From 1f6b4daeb4ec25676c3d9c4728fd5543b2a482a9 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Wed, 4 Sep 2024 18:09:25 +0100 Subject: [PATCH] v3d: v3d_resource Use LINEAR layout for importing with INVALID modifier --- mesa.spec | 1 + rhbz2270430.patch | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 rhbz2270430.patch diff --git a/mesa.spec b/mesa.spec index f19941e..ec07704 100644 --- a/mesa.spec +++ b/mesa.spec @@ -81,6 +81,7 @@ Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz Source1: Mesa-MLAA-License-Clarification-Email.txt Patch10: gnome-shell-glthread-disable.patch +Patch11: rhbz2270430.patch BuildRequires: meson >= 1.3.0 BuildRequires: gcc diff --git a/rhbz2270430.patch b/rhbz2270430.patch new file mode 100644 index 0000000..e8419a0 --- /dev/null +++ b/rhbz2270430.patch @@ -0,0 +1,50 @@ +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 +