Skip to contentSkip to conversation

mesa: Add patches for red label issues on video for VC4 and Freedreno

PATCH Superseded Pablo Saavedra Rodi?o 4 participants 11 messages Sep 23, 2021 – Oct 18, 2021 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesa: Add patches for red label issues on video for VC4 and Freedreno

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

---
 ...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
meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +31 -0
new file mode 100644
index 0000000000..92f4b40997
@@ -0,0 +1,31 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00 2001
+From: Pablo Saavedra <[email protected]>
+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 <[email protected]>
+Co-authored-by: Jose Maria Casanova Crespo <[email protected]>
+Signed-off-by: Pablo Saavedra <[email protected]>
+---
+ 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
+
meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +32 -0
new file mode 100644
index 0000000000..c2e5462dd1
@@ -0,0 +1,32 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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;
+                 }
meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +31 -0
new file mode 100644
index 0000000000..dfbe994048
@@ -0,0 +1,31 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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);
+        }
+ }
+ 
meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +34 -0
new file mode 100644
index 0000000000..7d60a31f53
@@ -0,0 +1,34 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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;
meta/recipes-graphics/mesa/mesa.inc +4 -0
index a85f94c75e..8d8871aa5d 100644
@@ -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"
Signature · 1 line
2.30.2
#1 lore raw
Quoted 38 lines · Pablo Saavedra Rodi?o

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

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

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +1 -0
new file mode 100644
index 0000000000..92f4b40997
@@ -0,0 +1,31 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00 2001

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch line 11

Quoted 10 lines
meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +10 -0
+From: Pablo Saavedra <[email protected]>
+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 <[email protected]>
+Co-authored-by: Jose Maria Casanova Crespo <[email protected]>
+Signed-off-by: Pablo Saavedra <[email protected]>

All the patches are missing an Upstream-Status - if that is already merged upstream, as you mentioned, it should be Upstream-Status: Accepted (or Upstream-Status: Backport)

Adding it would certainly make it easier on the next update to identify the patches that can easily be dropped

Also I'm not seeing any info that this series has been applied to master (but I might be wrong here)

Quoted 155 lines
meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +20 -0
+---
+ 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
+
meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +32 -0
new file mode 100644
index 0000000000..c2e5462dd1
@@ -0,0 +1,32 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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;
+                 }
meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +31 -0
new file mode 100644
index 0000000000..dfbe994048
@@ -0,0 +1,31 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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);
+        }
+ }
+
meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +34 -0
new file mode 100644
index 0000000000..7d60a31f53
@@ -0,0 +1,34 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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;
meta/recipes-graphics/mesa/mesa.inc +4 -0
index a85f94c75e..8d8871aa5d 100644
@@ -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 lore raw
In reply to Pablo Saavedra Rodi?o

Hi Pablo,

All the patches misses the Upstream-Status:

https://wiki.yoctoproject.org/wiki/Best_Known_Methods_%28BKMs%29_for_Package_Updating#Patch_Upstreaming

Pablo Saavedra Rodi?o <[email protected]> escreveu no dia quinta, 23/09/2021 à(s) 10:06:

Quoted 205 lines

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

---
 ...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
meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +31 -0
new file mode 100644
index 0000000000..92f4b40997
@@ -0,0 +1,31 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00 2001
+From: Pablo Saavedra <[email protected]>
+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 <[email protected]>
+Co-authored-by: Jose Maria Casanova Crespo <[email protected]>
+Signed-off-by: Pablo Saavedra <[email protected]>
+---
+ 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
+
meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +32 -0
new file mode 100644
index 0000000000..c2e5462dd1
@@ -0,0 +1,32 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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;
+                 }
meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +31 -0
new file mode 100644
index 0000000000..dfbe994048
@@ -0,0 +1,31 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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);
+        }
+ }
+
meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +34 -0
new file mode 100644
index 0000000000..7d60a31f53
@@ -0,0 +1,34 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+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;
meta/recipes-graphics/mesa/mesa.inc +4 -1
index a85f94c75e..8d8871aa5d 100644
@@ -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

Signature · 3 lines
Best regards,

José Quaresma
#3 lore raw

PATCH v2 1/1 mesa: Add patches for red label issues on video for VC4 and Freedreno

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

---
 ...rmats-are-supported-as-external-only.patch | 34 +++++++++++++++++
 ...at-is_dmabuf_modifier_supported-are-.patch | 35 ++++++++++++++++++
 ...at-query_dmabuf_modifiers-are-extern.patch | 34 +++++++++++++++++
 ...OD_BROADCOM_SAND128-only-available-f.patch | 37 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  4 ++
 5 files changed, 144 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
meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +34 -0
new file mode 100644
index 0000000000..9688ac1619
@@ -0,0 +1,34 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00 2001
+From: Pablo Saavedra <[email protected]>
+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 <[email protected]>
+Co-authored-by: Jose Maria Casanova Crespo <[email protected]>
+Signed-off-by: Pablo Saavedra <[email protected]>
+
+Upstream-Status: Pending [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991]
+Signed-off-by: Pablo Saavedra <[email protected]>
+---
+ 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
+
meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +35 -0
new file mode 100644
index 0000000000..9e90a07c8e
@@ -0,0 +1,35 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
+
+Upstream-status: backport [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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;
+                 }
meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +34 -0
new file mode 100644
index 0000000000..d1658f9a87
@@ -0,0 +1,34 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
+
+Upstream-status: backport [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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);
+        }
+ }
+ 
meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +37 -0
new file mode 100644
index 0000000000..17a612ea7e
@@ -0,0 +1,37 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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 <[email protected]>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
+
+Upstream-status: backport [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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;
meta/recipes-graphics/mesa/mesa.inc +4 -0
index a85f94c75e..8d8871aa5d 100644
@@ -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"
Signature · 1 line
2.30.2
#4 lore raw

I would strongly suggest that you get everything merged upstream first before adding the patches to oe-core.

Even then, this should go to master first, as we do not want the situation when honister has these fixes, but master does not.

Backport must be capitalized.

Alex

Quoted 263 lines · Pablo Saavedra Rodi?o

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

---
 ...rmats-are-supported-as-external-only.patch | 34 +++++++++++++++++
 ...at-is_dmabuf_modifier_supported-are-.patch | 35 ++++++++++++++++++
 ...at-query_dmabuf_modifiers-are-extern.patch | 34 +++++++++++++++++
 ...OD_BROADCOM_SAND128-only-available-f.patch | 37 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  4 ++
 5 files changed, 144 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..9688ac1619
--- /dev/null
+++
b/meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +4 -0
@@ -0,0 +1,34 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00 2001
+From: Pablo Saavedra <[email protected]>
+Date: Thu, 23 Sep 2021 10:23:56 +0200
+Subject: [PATCH] freedreno: YUV formats are supported as external-only

dmabuf
+ modifiers

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +8 -0
+
+Based on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524
+
+Co-authored-by: Alberto Garcia <[email protected]>
+Co-authored-by: Jose Maria Casanova Crespo <[email protected]>
+Signed-off-by: Pablo Saavedra <[email protected]>
+
+Upstream-Status: Pending [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991]

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +6 -0
+Signed-off-by: Pablo Saavedra <[email protected]>
+---
+ 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,

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats-are-supported-as-external-only.patch new file +11 -0
+                       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..9e90a07c8e
--- /dev/null
+++
b/meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +13 -0
@@ -0,0 +1,35 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+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"

(quoted diff) +2 -0
+Reviewed-by: Alejandro Piñeiro <[email protected]>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524
Quoted 1 line
(quoted diff) +2 -0
+
+Upstream-status: backport [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +6 -0
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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,

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +5 -0
+         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);

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +3 -0
+
+                         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..d1658f9a87
--- /dev/null
+++
b/meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +4 -0
@@ -0,0 +1,34 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+Date: Thu, 29 Apr 2021 18:37:25 +0200
+Subject: [PATCH] v3d: YUV formats at query_dmabuf_modifiers are

external_only

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +10 -0
+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 <[email protected]>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524
Quoted 1 line
(quoted diff) +2 -0
+
+Upstream-status: backport [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at-is_dmabuf_modifier_supported-are-.patch new file +6 -0
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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,

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at-query_dmabuf_modifiers-are-extern.patch new file +8 -0
+         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..17a612ea7e
--- /dev/null
+++
b/meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch

meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +4 -0
@@ -0,0 +1,37 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00 2001
+From: Jose Maria Casanova Crespo <[email protected]>
+Date: Thu, 29 Apr 2021 18:47:53 +0200
+Subject: [PATCH] v3d: DRM_FORMAT_MOD_BROADCOM_SAND128 only available for

NV12
+ format.

meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +10 -0
+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 <[email protected]>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524
Quoted 1 line
(quoted diff) +2 -0
+
+Upstream-status: backport [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]

meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +6 -0
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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,

meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +4 -0
+         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--;
++

meta/recipes-graphics/mesa/files/0003-v3d-DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch new file +3 -0
+         if (!modifiers) {
+                 *count = num_modifiers;
+                 return;
meta/recipes-graphics/mesa/mesa.inc +4 -0
index a85f94c75e..8d8871aa5d 100644
@@ -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

#5 lore raw
Quoted 3 lines · Alexander Kanavin

I would strongly suggest that you get everything merged upstream first before adding the patches to oe-core.

I kindly accept your recommendation but could I make also a question?:
Couldn't it be enough just setting the 0001-freedreno-YUV-formats-are- supported-as-external-only.patch with "Upstream-status: Submitted" [1].

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991

Quoted 3 lines

Even then, this should go to master first, as we do not want the situation when honister has these fixes, but master does not.

I assume this point affects only to the 0001-freedreno-YUV-formats-are- supported-as-external-only.patch patch since the other commits are already in Mesa 20.2 (version available in Honister) and they are not required for Honister and next Am I right?

Quoted 289 lines

Backport must be capitalized.

Alex

Quoted 282 lines · Pablo Saavedra Rodi?o

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

---
 ...rmats-are-supported-as-external-only.patch | 34
+++++++++++++++++
 ...at-is_dmabuf_modifier_supported-are-.patch | 35
++++++++++++++++++
 ...at-query_dmabuf_modifiers-are-extern.patch | 34
+++++++++++++++++
 ...OD_BROADCOM_SAND128-only-available-f.patch | 37
+++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  4 ++

 5 files changed, 144 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

(quoted diff) +0 -0

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..9688ac1619

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +0 -0

are-supported-as-external-only.patch

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +1 -0
@@ -0,0 +1,34 @@
+From e5b33a4b744a3114ff054ae577ac7802d9221490 Mon Sep 17 00:00:00

2001

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +3 -0
+From: Pablo Saavedra <[email protected]>
+Date: Thu, 23 Sep 2021 10:23:56 +0200
+Subject: [PATCH] freedreno: YUV formats are supported as external-

only dmabuf
+ modifiers

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +2 -0
+
+Based on

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +6 -0
+
+Co-authored-by: Alberto Garcia <[email protected]>
+Co-authored-by: Jose Maria Casanova Crespo <[email protected]>
+Signed-off-by: Pablo Saavedra <[email protected]>
+
+Upstream-Status: Pending

[https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991]

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +6 -0
+Signed-off-by: Pablo Saavedra <[email protected]>
+---
+ 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-

Quoted 1 line

supported_modifiers[i];

+
+               if (external_only)
+-                      external_only[num] = 0;
++                      external_only[num] =
util_format_is_yuv(format);
+
+               num++;
+       }
+--
+2.30.2

meta/recipes-graphics/mesa/files/0001-freedreno-YUV-formats- new file +1 -0
+
(quoted diff) +0 -0

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..9e90a07c8e

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +0 -0

is_dmabuf_modifier_supported-are-.patch

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +1 -0
@@ -0,0 +1,35 @@
+From 389bffa0981bba60f9d081063c150fb17e497c4a Mon Sep 17 00:00:00

2001

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +3 -0
+From: Jose Maria Casanova Crespo <[email protected]>
+Date: Thu, 29 Apr 2021 18:15:27 +0200
+Subject: [PATCH] v3d: YUV formats at is_dmabuf_modifier_supported

are
+ external_only

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +6 -0
+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"

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +2 -0
+
+Fixes: 6ee10ab3de86 "gallium: Add

pipe_screen::is_dmabuf_modifier_supported"

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +2 -0
+Reviewed-by: Alejandro Piñeiro <[email protected]>
+Part-of:

<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +2 -0
+
+Upstream-status: backport

[https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]

meta/recipes-graphics/mesa/files/0001-v3d-YUV-formats-at- new file +6 -0
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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;
+                 }

(quoted diff) +0 -0

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..d1658f9a87

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +0 -0

query_dmabuf_modifiers-are-extern.patch

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +1 -0
@@ -0,0 +1,34 @@
+From a5f74e140cce671dd9a04d3b3541cd3faf91916b Mon Sep 17 00:00:00

2001

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +3 -0
+From: Jose Maria Casanova Crespo <[email protected]>
+Date: Thu, 29 Apr 2021 18:37:25 +0200
+Subject: [PATCH] v3d: YUV formats at query_dmabuf_modifiers are

external_only

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +6 -0
+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"

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +2 -0
+
+Fixes: 95c4f0f91098 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128

support"

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +2 -0
+Reviewed-by: Alejandro Piñeiro <[email protected]>
+Part-of:

<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +2 -0
+
+Upstream-status: backport

[https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]

meta/recipes-graphics/mesa/files/0002-v3d-YUV-formats-at- new file +6 -0
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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);
+        }
+ }
+

(quoted diff) +0 -0

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..17a612ea7e

meta/recipes-graphics/mesa/files/0003-v3d- new file +0 -0

DRM_FORMAT_MOD_BROADCOM_SAND128-only-available-f.patch

meta/recipes-graphics/mesa/files/0003-v3d- new file +1 -0
@@ -0,0 +1,37 @@
+From cd2dce0257608fde2b9dd21429d1d7356e37abe1 Mon Sep 17 00:00:00

2001

meta/recipes-graphics/mesa/files/0003-v3d- new file +3 -0
+From: Jose Maria Casanova Crespo <[email protected]>
+Date: Thu, 29 Apr 2021 18:47:53 +0200
+Subject: [PATCH] v3d: DRM_FORMAT_MOD_BROADCOM_SAND128 only

available for NV12
+ format.

meta/recipes-graphics/mesa/files/0003-v3d- new file +8 -0
+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"

meta/recipes-graphics/mesa/files/0003-v3d- new file +2 -0
+Reviewed-by: Alejandro Piñeiro <[email protected]>
+Part-of:

<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>

meta/recipes-graphics/mesa/files/0003-v3d- new file +2 -0
+
+Upstream-status: backport

[https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524]

meta/recipes-graphics/mesa/files/0003-v3d- new file +6 -0
+Signed-off-by: pablo saavedra <[email protected]>
+---
+ 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;

meta/recipes- renamed from meta/recipes-graphics/mesa/mesa.inc +0 -0

graphics/mesa/mesa.inc
index a85f94c75e..8d8871aa5d 100644

meta/recipes-graphics/mesa/mesa.inc +0 -0
@@ -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"

#6 lore raw
Quoted 7 lines · Pablo Saavedra

I kindly accept your recommendation but could I make also a question?:
Couldn't it be enough just setting the 0001-freedreno-YUV-formats-are-supported-as-external-only.patch with "Upstream-status: Submitted" [1].

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991

In this case I would like to be cautious and accept the patch into oe-core only after it has been accepted by upstream. There have been situations where submitted patches were never actually merged upstream for various reasons, and so we ended up with unmaintainable custom patches.

Quoted 5 lines

I assume this point affects only to the 0001-freedreno-YUV-formats-are-supported-as-external-only.patch patch since the other commits are already in Mesa 20.2 (version available in Honister) and they are not required for Honister and next Am I right?

That's right.

Alex

Quoted 1 line
#7 lore raw

OK. Looks good to me. Let's wait for the acceptance of the patch first.

Quoted 28 lines · Alexander Kanavin
Quoted 7 lines · Pablo Saavedra

I kindly accept your recommendation but could I make also a question?: Couldn't it be enough just setting the 0001-freedreno- YUV-formats-are-supported-as-external-only.patch with "Upstream- status: Submitted" [1].

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991

In this case I would like to be cautious and accept the patch into oe-core only after it has been accepted by upstream. There have been situations where submitted patches were never actually merged upstream for various reasons, and so we ended up with unmaintainable custom patches.

Quoted 5 lines

I assume this point affects only to the 0001-freedreno-YUV-formats- are-supported-as-external-only.patch patch since the other commits are already in Mesa 20.2 (version available in Honister) and they are not required for Honister and next Am I right?

That's right.

Alex

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

I got answer from Mesa with a new proposed fix in gallium for this problem:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038

I just tested it over Mesa 21.0.3 (hardknott - without
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524/commits
) in RPI4 and apparently this fix the issue for VC4 . Probably for Freedreno too.

If this last commit is finally landed in Mesa and fix the problem for both drivers I will update this pull request with this single patch.

Quoted 39 lines · Pablo Saavedra Rodi?o

OK. Looks good to me. Let's wait for the acceptance of the patch first.

Quoted 31 lines · Alexander Kanavin
Quoted 6 lines · Pablo Saavedra

I kindly accept your recommendation but could I make also a question?: Couldn't it be enough just setting the 0001-freedreno- YUV-formats-are-supported-as-external-only.patch with "Upstream- status: Submitted" [1].

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12991

Quoted 1 line

In this case I would like to be cautious and accept the patch into oe-core only after it has been accepted by upstream. There have been situations where submitted patches were never actually merged upstream for various reasons, and so we ended up with unmaintainable custom patches.

Quoted 7 lines

I assume this point affects only to the 0001-freedreno-YUV- formats-are-supported-as-external-only.patch patch since the other commits are already in Mesa 20.2 (version available in Honister) and they are not required for Honister and next Am I right?

That's right.

Alex

#10 lore raw

PATCH v3 1/1 mesa: gallium/dri Make YUV formats we're going to emulate external-only

In reply to Alexander Kanavin

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.

[1] https://github.com/Igalia/meta-webkit/issues/185
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038

---
 ...-YUV-formats-we-re-going-to-emulate-.patch | 52 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch
meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch new file +52 -0
new file mode 100644
index 0000000000..7436480238
@@ -0,0 +1,52 @@
+commit 8bd63cd28939d79d6681943b840627eaa3614ee4
+Author: Pablo Saavedra <[email protected]>
+Date:   Mon Oct 18 15:48:42 2021 +0200
+
+    gallium/dri: Make YUV formats we're going to emulate external-only.
+    
+    If we're going to have to bind them as separate planes with colorspace
+    conversion for sampling on the frontend, then we need to report that
+    they're only for external-image samplers, otherwise the lowering won't be
+    applied.
+    
+    Fixes: 4e3a7dcf ("gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally")
+    Reviewed-by: Jose Maria Casanova Crespo <[email protected]>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038>
+
+Upstream-Status: Accepted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038]
+
+diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
+index b0c0d7e..ef8df5a 100644
+--- a/src/gallium/frontends/dri/dri2.c
++++ b/src/gallium/frontends/dri/dri2.c
+@@ -1445,16 +1445,24 @@ dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
+ 
+    format = map->pipe_format;
+ 
++   bool native_sampling = pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
++                                                       PIPE_BIND_SAMPLER_VIEW);
+    if (pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
+-                                     PIPE_BIND_RENDER_TARGET) ||
+-        pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
+-                                     PIPE_BIND_SAMPLER_VIEW) ||
+-        dri2_yuv_dma_buf_supported(screen, map)) {
+-      if (pscreen->query_dmabuf_modifiers != NULL)
++                                    PIPE_BIND_RENDER_TARGET) ||
++       native_sampling ||
++       dri2_yuv_dma_buf_supported(screen, map))  {
++      if (pscreen->query_dmabuf_modifiers != NULL) {
+          pscreen->query_dmabuf_modifiers(pscreen, format, max, modifiers,
+                                          external_only, count);
+-      else
++         if (!native_sampling && external_only) {
++            /* To support it using YUV lowering, we need it to be samplerExternalOES.
++             */
++            for (int i = 0; i < *count; i++)
++               external_only[i] = true;
++         }
++      } else {
+          *count = 0;
++      }
+       return true;
+    }
+    return false;
meta/recipes-graphics/mesa/mesa.inc +1 -0
index a85f94c75e..7cba03cfcf 100644
@@ -19,6 +19,7 @@ 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-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch \
            "
 
 SRC_URI[sha256sum] = "565c6f4bd2d5747b919454fc1d439963024fc78ca56fd05158c3b2cde2f6912b"
Signature · 1 line
2.30.2
#11 lore raw

Re: [OE-core][hardknott][PATCH v3] mesa: gallium/dri Make YUV formats we're going to emulate external-only

This patch was not explicitly sent to master. Instead of this I also created this upgrade [1] patch for mesa from 21.2.1 -> 21.2.4.

[1] https://lists.openembedded.org/g/openembedded-core/message/157082

Quoted 113 lines · Pablo Saavedra

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.

[1] https://github.com/Igalia/meta-webkit/issues/185
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038

---
 ...-YUV-formats-we-re-going-to-emulate-.patch | 52 +++++++++++++++++++ meta/recipes-graphics/mesa/mesa.inc           |  1 +

 2 files changed, 53 insertions(+)

 create mode 100644 meta/recipes-graphics/mesa/files/0001-gallium-dri- Make-YUV-formats-we-re-going-to-emulate-.patch

(quoted diff) +0 -0

YUV-formats-we-re-going-to-emulate-.patch b/meta/recipes- graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to- emulate-.patch
new file mode 100644
index 0000000000..7436480238

meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV- new file +0 -0

formats-we-re-going-to-emulate-.patch

meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV- new file +5 -0
@@ -0,0 +1,52 @@
+commit 8bd63cd28939d79d6681943b840627eaa3614ee4
+Author: Pablo Saavedra <[email protected]>
+Date:   Mon Oct 18 15:48:42 2021 +0200
+
+    gallium/dri: Make YUV formats we're going to emulate external-

only.
+
+    If we're going to have to bind them as separate planes with colorspace
+    conversion for sampling on the frontend, then we need to report that
+    they're only for external-image samplers, otherwise the lowering won't be
+    applied.
+
+    Fixes: 4e3a7dcf ("gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally")
+    Reviewed-by: Jose Maria Casanova Crespo <[email protected]> +    Part-of:
<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038>

meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV- new file +2 -0
+
+Upstream-Status: Accepted

[https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038]

meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV- new file +2 -0
+
+diff --git a/src/gallium/frontends/dri/dri2.c

b/src/gallium/frontends/dri/dri2.c
+index b0c0d7e..ef8df5a 100644
+--- a/src/gallium/frontends/dri/dri2.c
++++ b/src/gallium/frontends/dri/dri2.c
+@@ -1445,16 +1445,24 @@ dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
+
+    format = map->pipe_format;
+
++   bool native_sampling = pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
++
PIPE_BIND_SAMPLER_VIEW);
+    if (pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,

+-                                     PIPE_BIND_RENDER_TARGET) ||
+-        pscreen->is_format_supported(pscreen, format, screen->target,
0, 0,
+-                                     PIPE_BIND_SAMPLER_VIEW) ||
+-        dri2_yuv_dma_buf_supported(screen, map)) {
+-      if (pscreen->query_dmabuf_modifiers != NULL)
++                                    PIPE_BIND_RENDER_TARGET) ||
++       native_sampling ||

++       dri2_yuv_dma_buf_supported(screen, map))  {
++      if (pscreen->query_dmabuf_modifiers != NULL) {
+          pscreen->query_dmabuf_modifiers(pscreen, format, max, modifiers,
+                                          external_only, count); +-      else
++         if (!native_sampling && external_only) {
++            /* To support it using YUV lowering, we need it to be samplerExternalOES.
++             */
++            for (int i = 0; i < *count; i++)
++               external_only[i] = true;
++         }
++      } else {
+          *count = 0;
++      }
+       return true;
+    }
+    return false;

meta/recipes- renamed from meta/recipes-graphics/mesa/mesa.inc +0 -0

graphics/mesa/mesa.inc
index a85f94c75e..7cba03cfcf 100644

meta/recipes-graphics/mesa/mesa.inc +0 -0
@@ -19,6 +19,7 @@ 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-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch \
            "

 SRC_URI[sha256sum] = "565c6f4bd2d5747b919454fc1d439963024fc78ca56fd05158c3b2cde2f6912b"