From 5fed6bee19be40782a2e3bc76648d3177b4e02d9 Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Wed, 28 Aug 2024 21:58:09 +0200 Subject: [PATCH] v3d: v3d_resource Use LINEAR layout for importing with INVALID modifier v3d_resource_from_handle when importing a DRM_FORMAT_MOD_INVALID considered that if we had a render-only device the resource layout was linear and if we didn't have render-only the resource layout was tiled. This change honors the resource creation with the SCANOUT flag independently of the availability of the render-only for the DRM_FORMAT_MOD_INVALID modifier. It also fixes most of the failing piglit text for: spec@ext_image_dma_buf_import@ext_image_dma_buf_import.* Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11594 Cc: mesa-stable Reviewed-by: Iago Toral Quiroga Part-of: --- src/gallium/drivers/v3d/v3d_resource.c | 3 ++- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c index 5f24c6740782c..d582164ad5360 100644 --- a/src/gallium/drivers/v3d/v3d_resource.c +++ b/src/gallium/drivers/v3d/v3d_resource.c @@ -842,6 +842,7 @@ v3d_resource_create_with_modifiers(struct pipe_screen *pscreen, v3d_setup_slices(rsc, 0, tmpl->bind & PIPE_BIND_SHARED); if (screen->ro && (tmpl->bind & PIPE_BIND_SCANOUT)) { + assert(!rsc->tiled); struct winsys_handle handle; struct pipe_resource scanout_tmpl = { .target = prsc->target, @@ -912,7 +913,7 @@ v3d_resource_from_handle(struct pipe_screen *pscreen, rsc->tiled = true; break; case DRM_FORMAT_MOD_INVALID: - rsc->tiled = screen->ro == NULL; + rsc->tiled = false; break; default: switch(fourcc_mod_broadcom_mod(whandle->modifier)) { -- GitLab