All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pablo Saavedra Rodi?o" <psaavedra@igalia.com>
To: openembedded-core@lists.openembedded.org
Cc: Pablo Saavedra <psaavedra@igalia.com>
Subject: [hardknott][PATCH] mesa: Add patches for red label issues on video for VC4 and Freedreno
Date: Thu, 23 Sep 2021 11:05:47 +0200	[thread overview]
Message-ID: <20210923090547.3260456-1-psaavedra@igalia.com> (raw)

freedreno,v3d: YUV formats are supported as external-only dmabuf
modifiers.

This patch fix red label issues on video for Raspberry 4-64 Mesa VC4
driver and for iMX53 Adreno A200 GPU using the Mesa Freedreno driver

Issue was originally reported in meta-webkit [1] and later contributed
in Mesa [2]  where it was already merged in master.

* Commits for VC4 [3] had been nominated for stable 21.1 and already in
  21.2 (available in honister).
* Commit for Freedreno [4] also reported (not merged yet).

[1] https://github.com/Igalia/meta-webkit/issues/185
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10534
[4] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991

Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
---
 ...rmats-are-supported-as-external-only.patch | 31 +++++++++++++++++
 ...at-is_dmabuf_modifier_supported-are-.patch | 32 +++++++++++++++++
 ...at-query_dmabuf_modifiers-are-extern.patch | 31 +++++++++++++++++
 ...OD_BROADCOM_SAND128-only-available-f.patch | 34 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  4 +++
 5 files changed, 132 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch
 create mode 100644 meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch
 create mode 100644 meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch
 create mode 100644 meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch

diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch
new file mode 100644
index 0000000000..92f4b40997
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch
@@ -0,0 +1,31 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00 2001
+From: Pablo Saavedra <psaavedra@igalia.com>
+Date: Thu, 23 Sep 2021 10:23:56 +0200
+Subject: [PATCH] freedreno: YUV formats are supported as external-only dmabuf
+ modifiers
+
+Based on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524
+
+Co-authored-by: Alberto Garcia <berto@igalia.com>
+Co-authored-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
+Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
+---
+ src/gallium/drivers/freedreno/freedreno_screen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
+index a9cd0e2..dc2b79d 100644
+--- a/src/gallium/drivers/freedreno/freedreno_screen.c
++++ b/src/gallium/drivers/freedreno/freedreno_screen.c
+@@ -804,7 +804,7 @@ fd_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
+ 			modifiers[num] = screen->supported_modifiers[i];
+ 
+ 		if (external_only)
+-			external_only[num] = 0;
++			external_only[num] = util_format_is_yuv(format);
+ 
+ 		num++;
+ 	}
+-- 
+2.30.2
+
diff --git a/meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch b/meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch
new file mode 100644
index 0000000000..c2e5462dd1
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch
@@ -0,0 +1,32 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
+Date: Thu, 29 Apr 2021 18:15:27 +0200
+Subject: [PATCH] v3d: YUV formats at is_dmabuf_modifier_supported are
+ external_only
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes Issue https://github.com/Igalia/meta-webkit/issues/185
+"Issue Raspberry 4-64 + Mesa VC4 driver + Gstreamer = red Label on video"
+
+Fixes: 6ee10ab3de86 "gallium: Add pipe_screen::is_dmabuf_modifier_supported"
+Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
+---
+ src/gallium/drivers/v3d/v3d_screen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
+index 4f69c20..a5c94db 100644
+--- a/src/gallium/drivers/v3d/v3d_screen.c
++++ b/src/gallium/drivers/v3d/v3d_screen.c
+@@ -670,7 +670,7 @@ v3d_screen_is_dmabuf_modifier_supported(struct pipe_screen *pscreen,
+         for (i = 0; i < ARRAY_SIZE(v3d_available_modifiers); i++) {
+                 if (v3d_available_modifiers[i] == modifier) {
+                         if (external_only)
+-                                *external_only = false;
++                                *external_only = util_format_is_yuv(format);
+ 
+                         return true;
+                 }
diff --git a/meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch b/meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch
new file mode 100644
index 0000000000..dfbe994048
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch
@@ -0,0 +1,31 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
+Date: Thu, 29 Apr 2021 18:37:25 +0200
+Subject: [PATCH] v3d: YUV formats at query_dmabuf_modifiers are external_only
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes Issue https://github.com/Igalia/meta-webkit/issues/185
+"Issue Raspberry 4-64 + Mesa VC4 driver + Gstreamer = red Label on video"
+
+Fixes: 95c4f0f91098 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
+Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
+---
+ src/gallium/drivers/v3d/v3d_screen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
+index a5c94db..edde17d 100644
+--- a/src/gallium/drivers/v3d/v3d_screen.c
++++ b/src/gallium/drivers/v3d/v3d_screen.c
+@@ -655,7 +655,7 @@ v3d_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
+         for (i = 0; i < *count; i++) {
+                 modifiers[i] = v3d_available_modifiers[i];
+                 if (external_only)
+-                        external_only[i] = false;
++                        external_only[i] = util_format_is_yuv(format);
+        }
+ }
+ 
diff --git a/meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch b/meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch
new file mode 100644
index 0000000000..7d60a31f53
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch
@@ -0,0 +1,34 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
+Date: Thu, 29 Apr 2021 18:47:53 +0200
+Subject: [PATCH] v3d: DRM_FORMAT_MOD_BROADCOM_SAND128 only available for NV12
+ format.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We were exposing as available DRM_FORMAT_MOD_BROADCOM_SAND128 for
+any format.
+
+Fixes: 95c4f0f91098 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
+Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
+---
+ src/gallium/drivers/v3d/v3d_screen.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
+index edde17d..684f912 100644
+--- a/src/gallium/drivers/v3d/v3d_screen.c
++++ b/src/gallium/drivers/v3d/v3d_screen.c
+@@ -646,6 +646,10 @@ v3d_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
+         int i;
+         int num_modifiers = ARRAY_SIZE(v3d_available_modifiers);
+ 
++        /* Expose DRM_FORMAT_MOD_BROADCOM_SAND128 only for PIPE_FORMAT_NV12 */
++        if (format != PIPE_FORMAT_NV12)
++                num_modifiers--;
++
+         if (!modifiers) {
+                 *count = num_modifiers;
+                 return;
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index a85f94c75e..8d8871aa5d 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -19,6 +19,10 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0002-meson.build-make-TLS-ELF-optional.patch \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
            file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
+           file://0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch \
+           file://0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch \
+           file://0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch \
+           file://0001-freedreno-YUV-formats-are-supported-as-external-only.patch \
            "
 
 SRC_URI[sha256sum] = "565c6f4bd2d5747b919454fc1d439963024fc78ca56fd05158c3b2cde2f6912b"
-- 
2.30.2


             reply	other threads:[~2021-09-23  9:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  9:05 Pablo Saavedra Rodi?o [this message]
2021-09-23  9:23 ` [OE-core] [hardknott][PATCH] mesa: Add patches for red label issues on video for VC4 and Freedreno Konrad Weihmann
2021-09-23  9:26 ` Jose Quaresma
2021-09-23 15:17   ` [hardknott][PATCH v2 ] " Pablo Saavedra Rodi?o
2021-09-23 16:01     ` [OE-core] " Alexander Kanavin
2021-09-23 18:44       ` Pablo Saavedra Rodi?o
2021-09-23 19:00         ` Alexander Kanavin
2021-09-23 20:14           ` Pablo Saavedra Rodi?o
     [not found]           ` <16A78CB146CA0532.15719@lists.openembedded.org>
2021-09-27  9:26             ` Pablo Saavedra Rodi?o
2021-10-18 16:12           ` [OE-core][hardknott][PATCH v3] mesa: gallium/dri Make YUV formats we're going to emulate external-only Pablo Saavedra
2021-10-18 16:19             ` Pablo Saavedra Rodi?o

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=20210923090547.3260456-1-psaavedra@igalia.com \
    --to=psaavedra@igalia.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.