v3d: v3d_resource Use LINEAR layout for importing with INVALID modifier

This commit is contained in:
Peter Robinson 2024-09-04 18:09:25 +01:00
parent 102923ec2b
commit 1f6b4daeb4
2 changed files with 51 additions and 0 deletions

View file

@ -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

50
rhbz2270430.patch Normal file
View file

@ -0,0 +1,50 @@
From 5fed6bee19be40782a2e3bc76648d3177b4e02d9 Mon Sep 17 00:00:00 2001
From: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
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 <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30946>
---
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