Update to 2.4.127
amdgpu-apu.patch: Read model name from /proc/cpuinfo for APUs
This commit is contained in:
parent
700fc678a5
commit
5f64c2c746
80
amdgpu-apu.patch
Normal file
80
amdgpu-apu.patch
Normal file
@ -0,0 +1,80 @@
|
||||
From 2c1d39eff8b9c8296b57212bffd031029ce74491 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
---
|
||||
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
|
||||
|
||||
27
libdrm.spec
27
libdrm.spec
@ -44,9 +44,11 @@ end}
|
||||
%bcond_without install_test_programs
|
||||
%bcond_without udev
|
||||
|
||||
%global lib_version 127
|
||||
|
||||
Name: libdrm
|
||||
Summary: Direct Rendering Manager runtime library
|
||||
Version: 2.4.123
|
||||
Version: 2.4.%{lib_version}
|
||||
Release: 1%{?dist}
|
||||
License: MIT
|
||||
|
||||
@ -57,7 +59,6 @@ Source2: 91-drm-modeset.rules
|
||||
|
||||
BuildRequires: meson >= 0.43
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libatomic_ops-devel
|
||||
BuildRequires: kernel-headers
|
||||
%if %{with intel}
|
||||
BuildRequires: pkgconfig(pciaccess) >= 0.10
|
||||
@ -81,6 +82,8 @@ 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
|
||||
|
||||
%description
|
||||
Direct Rendering Manager runtime library
|
||||
@ -144,24 +147,24 @@ cp %{SOURCE1} %{buildroot}%{_docdir}/libdrm
|
||||
%files
|
||||
%doc README.rst
|
||||
%{_libdir}/libdrm.so.2
|
||||
%{_libdir}/libdrm.so.2.123.0
|
||||
%{_libdir}/libdrm.so.2.%{lib_version}.0
|
||||
%dir %{_datadir}/libdrm
|
||||
%if %{with intel}
|
||||
%{_libdir}/libdrm_intel.so.1
|
||||
%{_libdir}/libdrm_intel.so.1.123.0
|
||||
%{_libdir}/libdrm_intel.so.1.%{lib_version}.0
|
||||
%endif
|
||||
%if %{with radeon}
|
||||
%{_libdir}/libdrm_radeon.so.1
|
||||
%{_libdir}/libdrm_radeon.so.1.123.0
|
||||
%{_libdir}/libdrm_radeon.so.1.%{lib_version}.0
|
||||
%endif
|
||||
%if %{with amdgpu}
|
||||
%{_libdir}/libdrm_amdgpu.so.1
|
||||
%{_libdir}/libdrm_amdgpu.so.1.123.0
|
||||
%{_libdir}/libdrm_amdgpu.so.1.%{lib_version}.0
|
||||
%{_datadir}/libdrm/amdgpu.ids
|
||||
%endif
|
||||
%if %{with nouveau}
|
||||
%{_libdir}/libdrm_nouveau.so.2
|
||||
%{_libdir}/libdrm_nouveau.so.2.123.0
|
||||
%{_libdir}/libdrm_nouveau.so.2.%{lib_version}.0
|
||||
%endif
|
||||
%if %{with omap}
|
||||
%{_libdir}/libdrm_omap.so.1
|
||||
@ -173,15 +176,15 @@ cp %{SOURCE1} %{buildroot}%{_docdir}/libdrm
|
||||
%endif
|
||||
%if %{with freedreno}
|
||||
%{_libdir}/libdrm_freedreno.so.1
|
||||
%{_libdir}/libdrm_freedreno.so.1.123.0
|
||||
%{_libdir}/libdrm_freedreno.so.1.%{lib_version}.0
|
||||
%endif
|
||||
%if %{with tegra}
|
||||
%{_libdir}/libdrm_tegra.so.0
|
||||
%{_libdir}/libdrm_tegra.so.0.123.0
|
||||
%{_libdir}/libdrm_tegra.so.0.%{lib_version}.0
|
||||
%endif
|
||||
%if %{with etnaviv}
|
||||
%{_libdir}/libdrm_etnaviv.so.1
|
||||
%{_libdir}/libdrm_etnaviv.so.1.123.0
|
||||
%{_libdir}/libdrm_etnaviv.so.1.%{lib_version}.0
|
||||
%endif
|
||||
%if %{with udev}
|
||||
%{_udevrulesdir}/91-drm-modeset.rules
|
||||
@ -278,6 +281,10 @@ cp %{SOURCE1} %{buildroot}%{_docdir}/libdrm
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Oct 20 2025 Mika Penttilä <mpenttil@redhat.com> - 2.4.127-1
|
||||
- Update to 2.4.127
|
||||
amdgpu-apu.patch: Read model name from /proc/cpuinfo for APUs
|
||||
|
||||
* Tue Nov 12 2024 José Expósito <jexposit@redhat.com> - 2.4.123-1
|
||||
- Update to 2.4.123
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-53895
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (libdrm-2.4.123.tar.xz) = d3e6ba26bbd609fd87ca131690547eeb6a903c0a8c28b7f5cd5d0947619da09f31daf7bf4b6c38bf5e5dc173e2ccba476338ef682d8cf06d6b71ba73fc9b948d
|
||||
SHA512 (libdrm-2.4.127.tar.xz) = 2b1e9bdc864d1d8b890763a5154708bd44ee0cab5cb9156a7ec473d1d83b9fae7f4f66f660a68a3d1839ecca010163439c9991d9360f9be03be7ed8823a73ec6
|
||||
|
||||
Loading…
Reference in New Issue
Block a user