From: Jonathan Marek <jonathan@marek.ca> To: Christoph Hellwig <hch@infradead.org> Cc: freedreno@lists.freedesktop.org, Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <linux-arm-msm@vger.kernel.org>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <dri-devel@lists.freedesktop.org>, open list <linux-kernel@vger.kernel.org> Subject: Re: [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance Date: Fri, 2 Oct 2020 08:46:35 -0400 [thread overview] Message-ID: <b22fb797-67b0-a912-1d23-2b47c9a9e674@marek.ca> (raw) In-Reply-To: <20201002075321.GA7547@infradead.org> On 10/2/20 3:53 AM, Christoph Hellwig wrote: >> @@ -8,6 +8,7 @@ >> #include <linux/shmem_fs.h> >> #include <linux/dma-buf.h> >> #include <linux/pfn_t.h> >> +#include <linux/dma-noncoherent.h> > > NAK, dma-noncoherent.h is not for driver use. And will in fact go > away in 5.10. > Not actually used, so can be removed. >> >> #include <drm/drm_prime.h> >> >> @@ -808,6 +809,20 @@ int msm_gem_cpu_fini(struct drm_gem_object *obj) >> return 0; >> } >> >> +void msm_gem_sync_cache(struct drm_gem_object *obj, uint32_t flags, >> + size_t range_start, size_t range_end) >> +{ >> + struct msm_gem_object *msm_obj = to_msm_bo(obj); >> + >> + /* TODO: sync only the required range, and don't invalidate on clean */ >> + >> + if (flags & MSM_GEM_SYNC_CACHE_CLEAN) >> + sync_for_device(msm_obj); >> + >> + if (flags & MSM_GEM_SYNC_CACHE_INVALIDATE) >> + sync_for_cpu(msm_obj); > > And make to these ones as well. They are complete abuses of the DMA > API, and while we had to live with that for now to not cause regressions > they absoutely must not be exposed in a userspace ABI like this. > How do you propose that cached non-coherent memory be implemented? It is a useful feature for userspace.
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Marek <jonathan@marek.ca> To: Christoph Hellwig <hch@infradead.org> Cc: David Airlie <airlied@linux.ie>, freedreno@lists.freedesktop.org, open list <linux-kernel@vger.kernel.org>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <dri-devel@lists.freedesktop.org>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <linux-arm-msm@vger.kernel.org>, Sean Paul <sean@poorly.run> Subject: Re: [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance Date: Fri, 2 Oct 2020 08:46:35 -0400 [thread overview] Message-ID: <b22fb797-67b0-a912-1d23-2b47c9a9e674@marek.ca> (raw) In-Reply-To: <20201002075321.GA7547@infradead.org> On 10/2/20 3:53 AM, Christoph Hellwig wrote: >> @@ -8,6 +8,7 @@ >> #include <linux/shmem_fs.h> >> #include <linux/dma-buf.h> >> #include <linux/pfn_t.h> >> +#include <linux/dma-noncoherent.h> > > NAK, dma-noncoherent.h is not for driver use. And will in fact go > away in 5.10. > Not actually used, so can be removed. >> >> #include <drm/drm_prime.h> >> >> @@ -808,6 +809,20 @@ int msm_gem_cpu_fini(struct drm_gem_object *obj) >> return 0; >> } >> >> +void msm_gem_sync_cache(struct drm_gem_object *obj, uint32_t flags, >> + size_t range_start, size_t range_end) >> +{ >> + struct msm_gem_object *msm_obj = to_msm_bo(obj); >> + >> + /* TODO: sync only the required range, and don't invalidate on clean */ >> + >> + if (flags & MSM_GEM_SYNC_CACHE_CLEAN) >> + sync_for_device(msm_obj); >> + >> + if (flags & MSM_GEM_SYNC_CACHE_INVALIDATE) >> + sync_for_cpu(msm_obj); > > And make to these ones as well. They are complete abuses of the DMA > API, and while we had to live with that for now to not cause regressions > they absoutely must not be exposed in a userspace ABI like this. > How do you propose that cached non-coherent memory be implemented? It is a useful feature for userspace. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-10-02 12:48 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-01 0:27 [PATCH 0/3] drm/msm: support for host-cached BOs Jonathan Marek 2020-10-01 0:27 ` Jonathan Marek 2020-10-01 0:27 ` [PATCH 1/3] drm/msm: add MSM_BO_CACHED_COHERENT Jonathan Marek 2020-10-01 0:27 ` Jonathan Marek 2020-10-01 23:47 ` Jordan Crouse 2020-10-01 23:47 ` Jordan Crouse 2020-10-01 0:27 ` [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance Jonathan Marek 2020-10-01 0:27 ` Jonathan Marek 2020-10-01 23:29 ` [Freedreno] " Jordan Crouse 2020-10-01 23:29 ` Jordan Crouse 2020-10-02 7:53 ` Christoph Hellwig 2020-10-02 12:46 ` Jonathan Marek [this message] 2020-10-02 12:46 ` Jonathan Marek 2020-10-05 8:29 ` Christoph Hellwig 2020-10-05 14:35 ` Jonathan Marek 2020-10-05 14:35 ` Jonathan Marek 2020-10-06 7:23 ` Christoph Hellwig 2020-10-06 7:23 ` Christoph Hellwig 2020-10-06 13:19 ` Jonathan Marek 2020-10-06 13:19 ` Jonathan Marek 2020-10-06 13:19 ` Jonathan Marek 2020-10-07 6:25 ` Christoph Hellwig 2020-10-07 6:25 ` Christoph Hellwig 2020-10-13 13:42 ` Robin Murphy 2020-10-13 13:42 ` Robin Murphy 2020-10-13 13:42 ` Robin Murphy 2020-10-13 16:11 ` Rob Clark 2020-10-13 16:11 ` Rob Clark 2020-10-13 16:11 ` Rob Clark 2020-10-15 6:55 ` Christoph Hellwig 2020-10-15 6:55 ` Christoph Hellwig 2020-10-15 15:33 ` Daniel Vetter 2020-10-15 15:33 ` Daniel Vetter 2020-10-15 15:33 ` Daniel Vetter 2020-10-15 15:43 ` Christoph Hellwig 2020-10-15 15:43 ` Christoph Hellwig 2020-10-23 6:48 ` Christoph Hellwig 2020-10-23 6:48 ` Christoph Hellwig 2020-10-08 8:27 ` Joerg Roedel 2020-10-08 8:27 ` Joerg Roedel 2020-10-08 8:27 ` Joerg Roedel 2020-10-01 0:27 ` [PATCH 3/3] drm/msm: bump up the uapi version Jonathan Marek 2020-10-01 0:27 ` Jonathan Marek
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=b22fb797-67b0-a912-1d23-2b47c9a9e674@marek.ca \ --to=jonathan@marek.ca \ --cc=airlied@linux.ie \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=freedreno@lists.freedesktop.org \ --cc=hch@infradead.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=robdclark@gmail.com \ --cc=sean@poorly.run \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.