Re: [PATCH v2 1/7] drm/panfrost: Check another bo field for cache option query
From: Steven Price
Date: Fri Jun 05 2026 - 06:35:41 EST
On 04/06/2026 18:35, Adrián Larumbe wrote:
> When querying the properties of a BO, whether it was created in
> Writeback caching mode for userspace mappings, is recorded in a Panfrost
> BO's wb_mmap field.
>
> Reported-by: Claude <noreply@xxxxxxxxxxxxx>
> Closes: https://gitlab.freedesktop.org/panfrost/linux/-/work_items/88
> Signed-off-by: Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx>
> Fixes: 62eedf1ccba5 ("drm/panfrost: Add flag to map GEM object Write-Back Cacheable")
This is a subtle change in uABI because bo->base.map_wc reflects the
actual properties of the buffer. So on a coherent device this will
change. But it does match the intention/documentation of the ioctl
(returning the creation flags), and I don't think user space could have
been usefully relying on the current behaviour.
Reviewed-by: Steven Price <steven.price@xxxxxxx>
> ---
> drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index 3d0bdba2a474..cb8e5015847f 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -659,7 +659,7 @@ 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)
> + if (bo->wb_mmap)
> args->create_flags |= PANFROST_BO_WB_MMAP;
> }
>
>