From d5de49cc3633ffd182da572adfd8b36510bf5b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Penttil=C3=A4?= Date: Sun, 16 Nov 2025 09:20:36 +0200 Subject: [PATCH] Update to 2.4.128 Resolves: https://issues.redhat.com/browse/RHEL-107478 --- .gitignore | 1 + amdgpu-apu.patch | 80 ------------------------------------------- amdgpu-fallback.patch | 51 --------------------------- amdgpu-slice.patch | 71 -------------------------------------- libdrm.spec | 11 +++--- sources | 2 +- 6 files changed, 7 insertions(+), 209 deletions(-) delete mode 100644 amdgpu-apu.patch delete mode 100644 amdgpu-fallback.patch delete mode 100644 amdgpu-slice.patch diff --git a/.gitignore b/.gitignore index 09e9ecc..175ef5a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /libdrm-2.4.121.tar.xz /libdrm-2.4.123.tar.xz /libdrm-2.4.127.tar.xz +/libdrm-2.4.128.tar.xz diff --git a/amdgpu-apu.patch b/amdgpu-apu.patch deleted file mode 100644 index 3cc8fa4..0000000 --- a/amdgpu-apu.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 2c1d39eff8b9c8296b57212bffd031029ce74491 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Tue, 14 Oct 2025 11:54:41 -0500 -Subject: [PATCH] amdgpu: Read model name from /proc/cpuinfo for APUs - -The correct marketing name is encoded in the model name field -that is read from the hardware on an APU. Try to read from /proc/cpuinfo -when an APU is found to identify such hardware. - -Signed-off-by: Mario Limonciello ---- - amdgpu/amdgpu_asic_id.c | 45 +++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 45 insertions(+) - -diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c -index a5007ffc..7bdb2b67 100644 ---- a/amdgpu/amdgpu_asic_id.c -+++ b/amdgpu/amdgpu_asic_id.c -@@ -104,6 +104,45 @@ out: - return r; - } - -+static void amdgpu_parse_proc_cpuinfo(struct amdgpu_device *dev) -+{ -+ const char *search_key = "model name"; -+ char *line = NULL; -+ size_t len = 0; -+ FILE *fp; -+ -+ fp = fopen("/proc/cpuinfo", "r"); -+ if (fp == NULL) { -+ fprintf(stderr, "%s\n", strerror(errno)); -+ return; -+ } -+ -+ while (getline(&line, &len, fp) != -1) { -+ char *saveptr; -+ char *value; -+ -+ if (strncmp(line, search_key, strlen(search_key))) -+ continue; -+ -+ /* get content after colon and strip whitespace */ -+ value = strtok_r(line, ":", &saveptr); -+ value = strtok_r(NULL, ":", &saveptr); -+ if (value == NULL) -+ continue; -+ while (*value == ' ' || *value == '\t') -+ value++; -+ saveptr = strchr(value, '\n'); -+ if (saveptr) -+ *saveptr = '\0'; -+ -+ dev->marketing_name = strdup(value); -+ break; -+ } -+ -+ free(line); -+ fclose(fp); -+} -+ - void amdgpu_parse_asic_ids(struct amdgpu_device *dev) - { - FILE *fp; -@@ -113,6 +152,12 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev) - int line_num = 1; - int r = 0; - -+ if (dev->info.ids_flags & AMDGPU_IDS_FLAGS_FUSION) { -+ amdgpu_parse_proc_cpuinfo(dev); -+ if (dev->marketing_name != NULL) -+ return; -+ } -+ - fp = fopen(AMDGPU_ASIC_ID_TABLE, "r"); - if (!fp) { - fprintf(stderr, "%s: %s\n", AMDGPU_ASIC_ID_TABLE, --- -2.50.0 - diff --git a/amdgpu-fallback.patch b/amdgpu-fallback.patch deleted file mode 100644 index ea779a4..0000000 --- a/amdgpu-fallback.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 871e326ac799ae28ee4d98da9025028050c085cd Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 16 Oct 2025 10:53:01 -0500 -Subject: [PATCH] amdgpu: Only read /proc/cpuinfo as a fallback - -Some older Vega APUs don't provide a very useful string. If we have -a string in amdgpu.ids use that, but fallback to /proc/cpuinfo. - -Reviewed-by: Alex Deucher -Signed-off-by: Mario Limonciello ---- - amdgpu/amdgpu_asic_id.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c -index 2eeca0ec..2e52666c 100644 ---- a/amdgpu/amdgpu_asic_id.c -+++ b/amdgpu/amdgpu_asic_id.c -@@ -169,17 +169,11 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev) - int line_num = 1; - int r = 0; - -- if (dev->info.ids_flags & AMDGPU_IDS_FLAGS_FUSION) { -- amdgpu_parse_proc_cpuinfo(dev); -- if (dev->marketing_name != NULL) -- return; -- } -- - fp = fopen(AMDGPU_ASIC_ID_TABLE, "r"); - if (!fp) { - fprintf(stderr, "%s: %s\n", AMDGPU_ASIC_ID_TABLE, - strerror(errno)); -- return; -+ goto get_cpu; - } - - /* 1st valid line is file version */ -@@ -220,4 +214,10 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev) - - free(line); - fclose(fp); -+ -+get_cpu: -+ if (dev->info.ids_flags & AMDGPU_IDS_FLAGS_FUSION && -+ dev->marketing_name == NULL) { -+ amdgpu_parse_proc_cpuinfo(dev); -+ } - } --- -2.50.0 - diff --git a/amdgpu-slice.patch b/amdgpu-slice.patch deleted file mode 100644 index 9864ef6..0000000 --- a/amdgpu-slice.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 90656fc8e4150fc175ddadb788912674b2c4a705 Mon Sep 17 00:00:00 2001 -From: "Mario Limonciello (AMD)" -Date: Thu, 16 Oct 2025 10:01:42 -0500 -Subject: [PATCH] amdgpu: Slice and dice the string for APUs - -The string will generally have a CPU and GPU component, so if both -are found split it up. Make sure that it starts with AMD to be -consistent. - -Reviewed-by: Alex Deucher -Signed-off-by: Mario Limonciello (AMD) ---- - amdgpu/amdgpu_asic_id.c | 29 +++++++++++++++++++++++------ - 1 file changed, 23 insertions(+), 6 deletions(-) - -diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c -index 7bdb2b67..2eeca0ec 100644 ---- a/amdgpu/amdgpu_asic_id.c -+++ b/amdgpu/amdgpu_asic_id.c -@@ -107,6 +107,7 @@ out: - static void amdgpu_parse_proc_cpuinfo(struct amdgpu_device *dev) - { - const char *search_key = "model name"; -+ const char *radeon_key = "Radeon"; - char *line = NULL; - size_t len = 0; - FILE *fp; -@@ -124,18 +125,34 @@ static void amdgpu_parse_proc_cpuinfo(struct amdgpu_device *dev) - if (strncmp(line, search_key, strlen(search_key))) - continue; - -- /* get content after colon and strip whitespace */ -- value = strtok_r(line, ":", &saveptr); -- value = strtok_r(NULL, ":", &saveptr); -- if (value == NULL) -- continue; -+ /* check for parts that have both CPU and GPU information */ -+ value = strstr(line, radeon_key); -+ -+ /* get content after the first colon */ -+ if (value == NULL) { -+ value = strstr(line, ":"); -+ if (value == NULL) -+ continue; -+ value++; -+ } -+ -+ /* strip whitespace */ - while (*value == ' ' || *value == '\t') - value++; - saveptr = strchr(value, '\n'); - if (saveptr) - *saveptr = '\0'; - -- dev->marketing_name = strdup(value); -+ /* Add AMD to the new string if it's missing from slicing/dicing */ -+ if (strncmp(value, "AMD", 3) != 0) { -+ char *tmp = malloc(strlen(value) + 5); -+ -+ if (!tmp) -+ break; -+ sprintf(tmp, "AMD %s", value); -+ dev->marketing_name = tmp; -+ } else -+ dev->marketing_name = strdup(value); - break; - } - --- -2.50.0 - diff --git a/libdrm.spec b/libdrm.spec index 49e9039..c742483 100644 --- a/libdrm.spec +++ b/libdrm.spec @@ -48,12 +48,12 @@ end} %bcond_without install_test_programs %bcond_without udev -%global lib_version 127 +%global lib_version 128 Name: libdrm Summary: Direct Rendering Manager runtime library Version: 2.4.%{lib_version} -Release: 2%{?dist} +Release: 1%{?dist} License: MIT URL: https://dri.freedesktop.org @@ -86,10 +86,6 @@ BuildRequires: chrpath Patch1001: libdrm-make-dri-perms-okay.patch # remove backwards compat not needed on Fedora Patch1002: libdrm-2.4.0-no-bc.patch -# use /proc/cpuinfo to identify AMD APU -Patch1003: amdgpu-apu.patch -Patch1004: amdgpu-slice.patch -Patch1005: amdgpu-fallback.patch %description Direct Rendering Manager runtime library @@ -287,6 +283,9 @@ cp %{SOURCE1} %{buildroot}%{_docdir}/libdrm %endif %changelog +* Mon Nov 17 2025 Mika Penttilä - 2.4.128-1 +- Update to 2.4.128-1 + * Wed Oct 22 2025 Mika Penttilä - 2.4.127-2 - Added amdgpu-slice.patch and amdgpu-fallback.patch diff --git a/sources b/sources index 15c864f..a77359e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libdrm-2.4.127.tar.xz) = 2b1e9bdc864d1d8b890763a5154708bd44ee0cab5cb9156a7ec473d1d83b9fae7f4f66f660a68a3d1839ecca010163439c9991d9360f9be03be7ed8823a73ec6 +SHA512 (libdrm-2.4.128.tar.xz) = b80e6be1c9d0427e1c3ffd018213d7230333f037498cf98819a8a6c50d923ad3472002044e010ca9dc646ef79dbca241bd47eaa992014cb7063b31cdb84037c7