From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BA43E158042 for ; Sat, 9 Nov 2024 16:48:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 10BCCE0837; Sat, 9 Nov 2024 16:48:32 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ED771E0837 for ; Sat, 9 Nov 2024 16:48:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 39739335D77 for ; Sat, 9 Nov 2024 16:48:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CC0BDAED for ; Sat, 9 Nov 2024 16:48:29 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1731170905.c713bb8a49787ff51043eb0956ed31ea5b11a665.mattst88@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mesa/files/, media-libs/mesa/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/mesa/files/24.2.6-dril-Fixup-order-of-pixel-formats-in-drilConfigs.patch media-libs/mesa/mesa-24.2.6-r1.ebuild media-libs/mesa/mesa-24.2.6-r2.ebuild X-VCS-Directories: media-libs/mesa/ media-libs/mesa/files/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: c713bb8a49787ff51043eb0956ed31ea5b11a665 X-VCS-Branch: master Date: Sat, 9 Nov 2024 16:48:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ec463946-ac97-4c13-867f-004196ffcb93 X-Archives-Hash: 8af916ddd7dacb37eb61ced723154a0f commit: c713bb8a49787ff51043eb0956ed31ea5b11a665 Author: Matt Turner gentoo org> AuthorDate: Sat Nov 9 16:03:39 2024 +0000 Commit: Matt Turner gentoo org> CommitDate: Sat Nov 9 16:48:25 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c713bb8a media-libs/mesa: Add patch to fix swapped colors Closes: https://bugs.gentoo.org/939429 Signed-off-by: Matt Turner gentoo.org> ...xup-order-of-pixel-formats-in-drilConfigs.patch | 85 ++++++++++++++++++++++ ...mesa-24.2.6-r1.ebuild => mesa-24.2.6-r2.ebuild} | 4 + 2 files changed, 89 insertions(+) diff --git a/media-libs/mesa/files/24.2.6-dril-Fixup-order-of-pixel-formats-in-drilConfigs.patch b/media-libs/mesa/files/24.2.6-dril-Fixup-order-of-pixel-formats-in-drilConfigs.patch new file mode 100644 index 000000000000..a0d3ef1af912 --- /dev/null +++ b/media-libs/mesa/files/24.2.6-dril-Fixup-order-of-pixel-formats-in-drilConfigs.patch @@ -0,0 +1,85 @@ +https://bugs.gentoo.org/939429 + +From e1098310da6b9fa7e66dc3fe382ae08d88fd1352 Mon Sep 17 00:00:00 2001 +From: Benjamin Herrenschmidt +Date: Mon, 4 Nov 2024 17:45:45 +1100 +Subject: [PATCH] dril: Fixup order of pixel formats in drilConfigs + +Having the RGB* formats before the BGR* formats in the table causes +problems where under some circumstances, some applications end up +with the wrong colors. + +The repro case for me is: Xvnc + mutter + chromium + +There was an existing comment in dri_fill_in_modes() which explained +the problem. This was lost when dril_target.c was created. + +Fixes: ec7afd2c24c ("dril: rework config creation") +Fixes: 3de62b2f9a6 ("gallium/dril: Compatibility stub for the legacy DRI loader interface") + +Signed-off-by: Benjamin Herrenschmidt +Part-of: +--- + src/gallium/targets/dril/dril_target.c | 36 +++++++++++++++++++------- + 1 file changed, 27 insertions(+), 9 deletions(-) + +diff --git ./src/gallium/targets/dril/dril_target.c ./src/gallium/targets/dril/dril_target.c +index 672d50a4182..583728e4093 100644 +--- ./src/gallium/targets/dril/dril_target.c ++++ ./src/gallium/targets/dril/dril_target.c +@@ -47,25 +47,43 @@ + CONFIG_ZS(color, PIPE_FORMAT_Z16_UNORM), \ + CONFIG_ZS(color, PIPE_FORMAT_NONE) \ + ++/* ++ * (copy of a comment in dri_screen.c:dri_fill_in_modes()) ++ * ++ * The 32-bit RGBA format must not precede the 32-bit BGRA format. ++ * Likewise for RGBX and BGRX. Otherwise, the GLX client and the GLX ++ * server may disagree on which format the GLXFBConfig represents, ++ * resulting in swapped color channels. ++ * ++ * The problem, as of 2017-05-30: ++ * When matching a GLXFBConfig to a __DRIconfig, GLX ignores the channel ++ * order and chooses the first __DRIconfig with the expected channel ++ * sizes. Specifically, GLX compares the GLXFBConfig's and __DRIconfig's ++ * __DRI_ATTRIB_{CHANNEL}_SIZE but ignores __DRI_ATTRIB_{CHANNEL}_MASK. ++ * ++ * EGL does not suffer from this problem. It correctly compares the ++ * channel masks when matching EGLConfig to __DRIconfig. ++ */ ++ + static const struct gl_config drilConfigs[] = { +- CONFIG(PIPE_FORMAT_R8G8B8A8_UNORM), +- CONFIG(PIPE_FORMAT_R8G8B8X8_UNORM), + CONFIG(PIPE_FORMAT_B8G8R8A8_UNORM), + CONFIG(PIPE_FORMAT_B8G8R8X8_UNORM), +- CONFIG(PIPE_FORMAT_R10G10B10A2_UNORM), +- CONFIG(PIPE_FORMAT_R10G10B10X2_UNORM), ++ CONFIG(PIPE_FORMAT_R8G8B8A8_UNORM), ++ CONFIG(PIPE_FORMAT_R8G8B8X8_UNORM), + CONFIG(PIPE_FORMAT_B10G10R10A2_UNORM), + CONFIG(PIPE_FORMAT_B10G10R10X2_UNORM), +- CONFIG(PIPE_FORMAT_R5G6B5_UNORM), +- CONFIG(PIPE_FORMAT_R5G5B5A1_UNORM), +- CONFIG(PIPE_FORMAT_R5G5B5X1_UNORM), +- CONFIG(PIPE_FORMAT_R4G4B4A4_UNORM), +- CONFIG(PIPE_FORMAT_R4G4B4X4_UNORM), ++ CONFIG(PIPE_FORMAT_R10G10B10A2_UNORM), ++ CONFIG(PIPE_FORMAT_R10G10B10X2_UNORM), + CONFIG(PIPE_FORMAT_B5G6R5_UNORM), + CONFIG(PIPE_FORMAT_B5G5R5A1_UNORM), + CONFIG(PIPE_FORMAT_B5G5R5X1_UNORM), + CONFIG(PIPE_FORMAT_B4G4R4A4_UNORM), + CONFIG(PIPE_FORMAT_B4G4R4X4_UNORM), ++ CONFIG(PIPE_FORMAT_R5G6B5_UNORM), ++ CONFIG(PIPE_FORMAT_R5G5B5A1_UNORM), ++ CONFIG(PIPE_FORMAT_R5G5B5X1_UNORM), ++ CONFIG(PIPE_FORMAT_R4G4B4A4_UNORM), ++ CONFIG(PIPE_FORMAT_R4G4B4X4_UNORM), + }; + + #define RGB UTIL_FORMAT_COLORSPACE_RGB +-- +2.45.2 + diff --git a/media-libs/mesa/mesa-24.2.6-r1.ebuild b/media-libs/mesa/mesa-24.2.6-r2.ebuild similarity index 99% rename from media-libs/mesa/mesa-24.2.6-r1.ebuild rename to media-libs/mesa/mesa-24.2.6-r2.ebuild index 3dd7cb3ad57b..a29746c0943b 100644 --- a/media-libs/mesa/mesa-24.2.6-r1.ebuild +++ b/media-libs/mesa/mesa-24.2.6-r2.ebuild @@ -187,6 +187,10 @@ BDEPEND=" wayland? ( dev-util/wayland-scanner ) " +PATCHES=( + "${FILESDIR}"/${PV}-dril-Fixup-order-of-pixel-formats-in-drilConfigs.patch +) + QA_WX_LOAD=" x86? ( usr/lib/libglapi.so.0.0.0