From: Boris Brezillon <boris.brezillon@collabora.com>
To: Steven Price <steven.price@arm.com>
Cc: dri-devel@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Faith Ekstrand <faith.ekstrand@collabora.com>,
kernel@collabora.com
Subject: Re: [PATCH v3 13/14] drm/panfrost: Add flag to map GEM object Write-Back Cacheable
Date: Wed, 15 Oct 2025 17:47:25 +0200 [thread overview]
Message-ID: <20251015174725.7721155d@fedora> (raw)
In-Reply-To: <306663b7-cc35-49f7-aca9-ef1282ada424@arm.com>
On Wed, 15 Oct 2025 16:32:54 +0100
Steven Price <steven.price@arm.com> wrote:
> On 15/10/2025 14:01, Boris Brezillon wrote:
> > From: Faith Ekstrand <faith.ekstrand@collabora.com>
> >
> > Will be used by the UMD to optimize CPU accesses to buffers
> > that are frequently read by the CPU, or on which the access
> > pattern makes non-cacheable mappings inefficient.
> >
> > Mapping buffers CPU-cached implies taking care of the CPU
> > cache maintenance in the UMD, unless the GPU is IO coherent.
> >
> > v2:
> > - Add more to the commit message
> >
> > v3:
> > - No changes
> >
> > Signed-off-by: Faith Ekstrand <faith.ekstrand@collabora.com>
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > ---
> > drivers/gpu/drm/panfrost/panfrost_drv.c | 10 ++++++++--
> > drivers/gpu/drm/panfrost/panfrost_gem.c | 3 +++
> > include/uapi/drm/panfrost_drm.h | 1 +
> > 3 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> > index 00c0881fa2f0..0f51b1dc1abc 100644
> > --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> > +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> > @@ -125,6 +125,10 @@ static int panfrost_ioctl_get_param(struct drm_device *ddev, void *data, struct
> > return 0;
> > }
> >
> > +#define PANFROST_BO_FLAGS (PANFROST_BO_NOEXEC | \
> > + PANFROST_BO_HEAP | \
> > + PANFROST_BO_WB_MMAP)
> > +
> > static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data,
> > struct drm_file *file)
> > {
> > @@ -134,8 +138,7 @@ static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data,
> > struct panfrost_gem_mapping *mapping;
> > int ret;
> >
> > - if (!args->size || args->pad ||
> > - (args->flags & ~(PANFROST_BO_NOEXEC | PANFROST_BO_HEAP)))
> > + if (!args->size || args->pad || (args->flags & ~PANFROST_BO_FLAGS))
> > return -EINVAL;
> >
> > /* Heaps should never be executable */
> > @@ -661,6 +664,9 @@ static int panfrost_ioctl_query_bo_info(struct drm_device *dev, void *data,
> >
> > if (bo->is_heap)
> > args->create_flags |= PANFROST_BO_HEAP;
> > +
> > + if (bo->base.map_wc)
> > + args->create_flags |= PANFROST_BO_WB_MMAP;
>
> This test is still reversed (or I'm confused?)
WTF?! I had that fixed. I must have stashed the changes before
amending the commit :face_palm:.
>
> Thanks,
> Steve
>
> > }
> >
> > drm_gem_object_put(gem_obj);
> > diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
> > index da0362202d94..0e8028ee9d1f 100644
> > --- a/drivers/gpu/drm/panfrost/panfrost_gem.c
> > +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
> > @@ -320,6 +320,9 @@ panfrost_gem_create(struct drm_device *dev, size_t size, u32 flags)
> > bo->noexec = !!(flags & PANFROST_BO_NOEXEC);
> > bo->is_heap = !!(flags & PANFROST_BO_HEAP);
> >
> > + if (flags & PANFROST_BO_WB_MMAP)
> > + bo->base.map_wc = false;
> > +
> > return bo;
> > }
> >
> > diff --git a/include/uapi/drm/panfrost_drm.h b/include/uapi/drm/panfrost_drm.h
> > index e7d01e744efd..244d2f96c2d7 100644
> > --- a/include/uapi/drm/panfrost_drm.h
> > +++ b/include/uapi/drm/panfrost_drm.h
> > @@ -104,6 +104,7 @@ struct drm_panfrost_wait_bo {
> > /* Valid flags to pass to drm_panfrost_create_bo */
> > #define PANFROST_BO_NOEXEC 1
> > #define PANFROST_BO_HEAP 2
> > +#define PANFROST_BO_WB_MMAP 4
> >
> > /**
> > * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
>
next prev parent reply other threads:[~2025-10-15 15:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 13:00 [PATCH v3 00/14] drm/panfrost, panthor: Cached maps and explicit flushing Boris Brezillon
2025-10-15 13:00 ` [PATCH v3 01/14] drm/panthor: Fix panthor_gpu_coherency_set() Boris Brezillon
2025-10-15 15:23 ` Steven Price
2025-10-15 13:00 ` [PATCH v3 02/14] drm/gem: Add a drm_gem_object_funcs::sync() and a drm_gem_sync() helper Boris Brezillon
2025-10-15 15:24 ` Steven Price
2025-10-15 13:00 ` [PATCH v3 03/14] drm/prime: Provide default ::{begin, end}_cpu_access() implementations Boris Brezillon
2025-10-15 15:25 ` [PATCH v3 03/14] drm/prime: Provide default ::{begin,end}_cpu_access() implementations Steven Price
2025-10-15 13:00 ` [PATCH v3 04/14] drm/shmem: Add a drm_gem_shmem_sync() helper Boris Brezillon
2025-10-15 15:28 ` Steven Price
2025-10-15 13:00 ` [PATCH v3 05/14] drm/panthor: Expose the selected coherency protocol to the UMD Boris Brezillon
2025-10-15 15:29 ` Steven Price
2025-10-15 13:00 ` [PATCH v3 06/14] drm/panthor: Add a PANTHOR_BO_SYNC ioctl Boris Brezillon
2025-10-15 13:00 ` [PATCH v3 07/14] drm/panthor: Add an ioctl to query BO flags Boris Brezillon
2025-10-15 13:00 ` [PATCH v3 08/14] drm/panthor: Add flag to map GEM object Write-Back Cacheable Boris Brezillon
2025-10-15 15:31 ` Steven Price
2025-10-15 13:00 ` [PATCH v3 09/14] drm/panthor: Bump the driver version to 1.6 Boris Brezillon
2025-10-15 13:00 ` [PATCH v3 10/14] drm/panfrost: Expose the selected coherency protocol to the UMD Boris Brezillon
2025-10-15 15:32 ` Steven Price
2025-10-15 13:01 ` [PATCH v3 11/14] drm/panfrost: Add a PANFROST_SYNC_BO ioctl Boris Brezillon
2025-10-15 13:01 ` [PATCH v3 12/14] drm/panfrost: Add an ioctl to query BO flags Boris Brezillon
2025-10-15 13:01 ` [PATCH v3 13/14] drm/panfrost: Add flag to map GEM object Write-Back Cacheable Boris Brezillon
2025-10-15 15:32 ` Steven Price
2025-10-15 15:47 ` Boris Brezillon [this message]
2025-10-15 13:01 ` [PATCH v3 14/14] drm/panfrost: Bump the driver version to 1.6 Boris Brezillon
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=20251015174725.7721155d@fedora \
--to=boris.brezillon@collabora.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith.ekstrand@collabora.com \
--cc=kernel@collabora.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/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: link
Be 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.