diff options
author | CoprDistGit <infra@openeuler.org> | 2024-12-12 02:36:25 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-12-12 02:36:25 +0000 |
commit | f051076cd2fb1be7c424f7e00479e436f0487022 (patch) | |
tree | 8d3e4f653fc70dbf1bcf9d8e8df9bda988e0d63f | |
parent | 3ecc28626c625d8f7bf36bbdeaf56f4cc7c07a62 (diff) |
automatic import of libdrmopeneuler24.09openeuler24.03_LTS
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 91-drm-modeset.rules | 1 | ||||
-rw-r--r-- | libdrm-2.4.0-no-bc.patch | 53 | ||||
-rw-r--r-- | libdrm-2.4.109-sw.patch | 78 | ||||
-rw-r--r-- | libdrm-make-dri-perms-okay.patch | 13 | ||||
-rw-r--r-- | libdrm.spec | 330 | ||||
-rw-r--r-- | sources | 1 |
7 files changed, 477 insertions, 0 deletions
@@ -0,0 +1 @@ +/libdrm-2.4.124.tar.xz diff --git a/91-drm-modeset.rules b/91-drm-modeset.rules new file mode 100644 index 0000000..f1bb5ec --- /dev/null +++ b/91-drm-modeset.rules @@ -0,0 +1 @@ +KERNEL=="controlD[0-9]*", SUBSYSTEM=="drm", MODE="0600" diff --git a/libdrm-2.4.0-no-bc.patch b/libdrm-2.4.0-no-bc.patch new file mode 100644 index 0000000..db9ff41 --- /dev/null +++ b/libdrm-2.4.0-no-bc.patch @@ -0,0 +1,53 @@ +diff -up libdrm-2.4.114/xf86drm.c.dma libdrm-2.4.114/xf86drm.c +--- libdrm-2.4.114/xf86drm.c.dma 2022-11-03 18:33:36.000000000 +1000 ++++ libdrm-2.4.114/xf86drm.c 2022-11-10 05:39:58.652477119 +1000 +@@ -930,11 +930,6 @@ drm_public int drmAvailable(void) + int fd; + + if ((fd = drmOpenMinor(0, 1, DRM_NODE_PRIMARY)) < 0) { +-#ifdef __linux__ +- /* Try proc for backward Linux compatibility */ +- if (!access("/proc/dri/0", R_OK)) +- return 1; +-#endif + return 0; + } + +@@ -1127,38 +1122,6 @@ static int drmOpenByName(const char *nam + } + } + +-#ifdef __linux__ +- /* Backward-compatibility /proc support */ +- for (i = 0; i < 8; i++) { +- char proc_name[64], buf[512]; +- char *driver, *pt, *devstring; +- int retcode; +- +- sprintf(proc_name, "/proc/dri/%d/name", i); +- if ((fd = open(proc_name, O_RDONLY)) >= 0) { +- retcode = read(fd, buf, sizeof(buf)-1); +- close(fd); +- if (retcode) { +- buf[retcode-1] = '\0'; +- for (driver = pt = buf; *pt && *pt != ' '; ++pt) +- ; +- if (*pt) { /* Device is next */ +- *pt = '\0'; +- if (!strcmp(driver, name)) { /* Match */ +- for (devstring = ++pt; *pt && *pt != ' '; ++pt) +- ; +- if (*pt) { /* Found busid */ +- return drmOpenByBusid(++pt, type); +- } else { /* No busid */ +- return drmOpenDevice(strtol(devstring, NULL, 0),i, type); +- } +- } +- } +- } +- } +- } +-#endif +- + return -1; + } diff --git a/libdrm-2.4.109-sw.patch b/libdrm-2.4.109-sw.patch new file mode 100644 index 0000000..b256394 --- /dev/null +++ b/libdrm-2.4.109-sw.patch @@ -0,0 +1,78 @@ +diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h +index 93025be..60b979a 100644 +--- a/include/drm/drm_sarea.h ++++ b/include/drm/drm_sarea.h +@@ -39,7 +39,9 @@ extern "C" { + #endif + + /* SAREA area needs to be at least a page */ +-#if defined(__alpha__) ++#if defined(__sw_64__) ++#define SAREA_MAX 0x2000U ++#elif defined(__alpha__) + #define SAREA_MAX 0x2000U + #elif defined(__mips__) + #define SAREA_MAX 0x4000U +diff --git a/xf86drm.c b/xf86drm.c +index 7a7a23f..6daaaf7 100644 +--- a/xf86drm.c ++++ b/xf86drm.c +@@ -1119,7 +1119,7 @@ static int drmOpenByBusid(const char *busid, int type) + sv.drm_dd_major = -1; /* Don't care */ + sv.drm_dd_minor = -1; /* Don't care */ + if (drmSetInterfaceVersion(fd, &sv)) { +-#ifndef __alpha__ ++#ifndef __sw_64__ + pci_domain_ok = 0; + #endif + sv.drm_di_major = 1; +diff --git a/xf86drm.h b/xf86drm.h +index 4c79a65..a8d3ad4 100644 +--- a/xf86drm.h ++++ b/xf86drm.h +@@ -382,6 +382,34 @@ typedef struct _drmSetVersion { + "r" (new)); \ + } while (0) + ++#elif defined(__sw_64__) ++#define DRM_CAS(lock, old, new, ret) \ ++ do{ \ ++ int tmp, old32; \ ++ int tmp1; \ ++ __asm__ __volatile__( \ ++ " addw $31, %6, %4\n" \ ++ " ldi %1, %3\n" \ ++ "1: lldw %0, 0(%1)\n" \ ++ " cmpeq %0, %4, %2\n" \ ++ " wr_f %2\n" \ ++ " mov %5, %0\n" \ ++ " lstw %0, 0(%1)\n" \ ++ " rd_f %0\n" \ ++ " beq %2, 2f\n" \ ++ " beq %0, 3f\n" \ ++ " memb\n" \ ++ "2: cmpeq %2, 0, %2\n" \ ++ ".subsection 2\n" \ ++ "3: br 1b\n" \ ++ ".previous" \ ++ : "=&r"(tmp),"=&r"(tmp1), "=&r"(ret), \ ++ "=m"(__drm_dummy_lock(lock)), \ ++ "=&r"(old32) \ ++ : "r"(new), "r"(old) \ ++ : "memory"); \ ++ } while (0) ++ + #elif defined(__alpha__) + + #define DRM_CAS(lock, old, new, ret) \ +@@ -511,7 +539,9 @@ do { register unsigned int __old __asm("o0"); \ + #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ + #endif + +-#if defined(__alpha__) ++#if defined(__sw_64__) ++#define DRM_CAS_RESULT(_result) long _result ++#elif defined(__alpha__) + #define DRM_CAS_RESULT(_result) long _result + #elif defined(__powerpc__) + #define DRM_CAS_RESULT(_result) int _result diff --git a/libdrm-make-dri-perms-okay.patch b/libdrm-make-dri-perms-okay.patch new file mode 100644 index 0000000..2bce3d6 --- /dev/null +++ b/libdrm-make-dri-perms-okay.patch @@ -0,0 +1,13 @@ +diff --git a/xf86drm.h b/xf86drm.h +index 4badaae..08cc287 100644 +--- a/xf86drm.h ++++ b/xf86drm.h +@@ -74,7 +74,7 @@ extern "C" { + /* Default /dev/dri directory permissions 0755 */ + #define DRM_DEV_DIRMODE \ + (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) +-#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) ++#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) + + #ifdef __OpenBSD__ + #define DRM_DIR_NAME "/dev" diff --git a/libdrm.spec b/libdrm.spec new file mode 100644 index 0000000..10a32cd --- /dev/null +++ b/libdrm.spec @@ -0,0 +1,330 @@ +%define bcond_meson() %{lua: do + local option = rpm.expand("%{1}") + local with = rpm.expand("%{?with_" .. option .. "}") + local value = (with ~= '') and "enabled" or "disabled" + option = option:gsub('_', '-') + print(string.format("-D%s=%s", option, value)) +end} +%define bcond_meson_tf() %{lua: do + local option = rpm.expand("%{1}") + local with = rpm.expand("%{?with_" .. option .. "}") + local value = (with ~= '') and "true" or "false" + option = option:gsub('_', '-') + print(string.format("-D%s=%s", option, value)) +end} + +%ifarch %{ix86} x86_64 +%bcond_without intel +%else +%bcond_with intel +%endif +%bcond_without radeon +%bcond_without amdgpu +%bcond_without nouveau +%bcond_without vmwgfx +%ifarch %{arm} +%bcond_without omap +%else +%bcond_with omap +%endif +%ifarch %{arm} aarch64 +%bcond_without exynos +%bcond_without freedreno +%bcond_without tegra +%bcond_without vc4 + +%bcond_without etnaviv +%else +%bcond_with exynos +%bcond_with freedreno +%bcond_with tegra +%bcond_with vc4 +%bcond_with etnaviv +%endif +%bcond_with cairo_tests +%bcond_without man_pages +%ifarch %{valgrind_arches} +%bcond_without valgrind +%else +%bcond_with valgrind +%endif +%bcond_with freedreno_kgsl +%bcond_without install_test_programs +%bcond_without udev + +Name: libdrm +Version: 2.4.124 +Release: 1 +License: MIT +Summary: library for direct rendering manager + +URL: https://dri.freedesktop.org +Source0: https://dri.freedesktop.org/libdrm/%{name}-%{version}.tar.xz +Source2: 91-drm-modeset.rules + +BuildRequires: meson >= 0.43 gcc kernel-headers +%if %{with intel} +BuildRequires: pkgconfig(pciaccess) >= 0.10 +%endif + +%if %{with cairo_tests} +BuildRequires: pkgconfig(cairo) +%endif +%if %{with man_pages} +BuildRequires: %{_bindir}/xsltproc +BuildRequires: %{_bindir}/sed +BuildRequires: python3-docutils chrpath +%endif +%if %{?openEuler:1}0 +%if %{with valgrind} +BuildRequires: valgrind-devel +%endif +%endif +%if %{with udev} +BuildRequires: pkgconfig(udev) +%endif + +Patch1001: %{name}-make-dri-perms-okay.patch +Patch1002: %{name}-2.4.0-no-bc.patch +Patch1003: libdrm-2.4.109-sw.patch + +%description +%{name} provides a user space library for accessing the DRM, direct rendering manager, +on operating systems that support the ioctl interface. libdrm is a low-level library, +typically used by graphics drivers such as the Mesa DRI drivers, the X drivers, libva +and similar projects. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} +Requires: kernel-headers + +%description devel +%{name}-devel contains the header files for developing +applications that want to make use of %{name}. + +%if %{with install_test_programs} +%package -n drm-utils +Summary: Utilities programs for %{name} +Requires: %{name} = %{version}-%{release} + +%description -n drm-utils +Utility programs for the kernel DRM interface. +%endif + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%meson \ + %{bcond_meson intel} %{bcond_meson radeon} %{bcond_meson amdgpu} \ + %{bcond_meson nouveau} %{bcond_meson vmwgfx} %{bcond_meson omap} %{bcond_meson exynos} \ + %{bcond_meson freedreno} %{bcond_meson tegra} %{bcond_meson vc4} %{bcond_meson etnaviv} \ + %{bcond_meson cairo_tests} %{bcond_meson man_pages} \ +%if %{?openEuler:1}0 + %{bcond_meson valgrind} \ +%endif + %{bcond_meson_tf freedreno_kgsl} %{bcond_meson_tf install_test_programs} %{bcond_meson_tf udev} \ + %{nil} +%meson_build + +%check +%meson_test + +%install +%meson_install +%if %{with install_test_programs} +install -Dpm0755 -t %{buildroot}%{_bindir} %{_vpath_builddir}/tests/drmdevice +%endif +%if %{with udev} +install -Dpm0644 -t %{buildroot}%{_udevrulesdir} %{S:2} +%endif + +chrpath --delete $RPM_BUILD_ROOT%{_bindir}/drmdevice + +%files +%{_libdir}/%{name}.so.* +%dir %{_datadir}/%{name}/ +%if %{with intel} +%{_libdir}/%{name}_intel.so.* +%endif +%if %{with radeon} +%{_libdir}/%{name}_radeon.so.* +%endif +%if %{with amdgpu} +%{_libdir}/%{name}_amdgpu.so.* +%{_datadir}/%{name}/amdgpu.ids +%endif +%if %{with nouveau} +%{_libdir}/%{name}_nouveau.so.* +%endif +%if %{with omap} +%{_libdir}/%{name}_omap.so.* +%endif +%if %{with exynos} +%{_libdir}/%{name}_exynos.so.* +%endif +%if %{with freedreno} +%{_libdir}/%{name}_freedreno.so.* +%endif +%if %{with tegra} +%{_libdir}/%{name}_tegra.so.* +%endif +%if %{with etnaviv} +%{_libdir}/%{name}_etnaviv.so.* +%endif +%if %{with udev} +%{_udevrulesdir}/91-drm-modeset.rules +%endif + +%files devel +%{_includedir}/%{name}/drm*.h +%{_includedir}/%{name}/*_drm.h +%{_libdir}/%{name}.so +%{_libdir}/pkgconfig/%{name}.pc +%if %{with intel} +%{_includedir}/%{name}/intel_*.h +%{_libdir}/%{name}_intel.so +%{_libdir}/pkgconfig/%{name}_intel.pc +%endif +%if %{with radeon} +%{_includedir}/%{name}/radeon_*.h +%{_includedir}/%{name}/r600_pci_ids.h +%{_libdir}/%{name}_radeon.so +%{_libdir}/pkgconfig/%{name}_radeon.pc +%endif +%if %{with amdgpu} +%{_includedir}/%{name}/amdgpu.h +%{_libdir}/%{name}_amdgpu.so +%{_libdir}/pkgconfig/%{name}_amdgpu.pc +%endif +%if %{with nouveau} +%{_includedir}/%{name}/nouveau/ +%{_libdir}/%{name}_nouveau.so +%{_libdir}/pkgconfig/%{name}_nouveau.pc +%endif +%if %{with omap} +%{_includedir}/%{name}/omap_*.h +%{_includedir}/omap/ +%{_libdir}/%{name}_omap.so +%{_libdir}/pkgconfig/%{name}_omap.pc +%endif +%if %{with exynos} +%{_includedir}/%{name}/exynos_*.h +%{_includedir}/exynos/ +%{_libdir}/%{name}_exynos.so +%{_libdir}/pkgconfig/%{name}_exynos.pc +%endif +%if %{with freedreno} +%{_includedir}/freedreno/ +%{_libdir}/%{name}_freedreno.so +%{_libdir}/pkgconfig/%{name}_freedreno.pc +%endif +%if %{with tegra} +%{_includedir}/%{name}/tegra.h +%{_libdir}/%{name}_tegra.so +%{_libdir}/pkgconfig/%{name}_tegra.pc +%endif +%if %{with vc4} +%{_includedir}/%{name}/vc4_*.h +%{_libdir}/pkgconfig/%{name}_vc4.pc +%endif +%if %{with etnaviv} +%{_includedir}/%{name}/etnaviv_*.h +%{_libdir}/%{name}_etnaviv.so +%{_libdir}/pkgconfig/%{name}_etnaviv.pc +%endif +%{_includedir}/*.h + +%if %{with install_test_programs} +%files -n drm-utils +%defattr(-,root,root) +%{_bindir}/amdgpu_stress +%{_bindir}/drmdevice +%if %{with etnaviv} +%exclude %{_bindir}/etnaviv_* +%endif +%if %{with exynos} +%exclude %{_bindir}/exynos_* +%endif +%if %{with tegra} +%exclude %{_bindir}/tegra-* +%endif +%{_bindir}/modeprint +%{_bindir}/modetest +%{_bindir}/proptest +%{_bindir}/vbltest +%endif + +%files help +%if %{with man_pages} +%{_mandir}/man3/drm*.3* +%{_mandir}/man7/drm*.7* +%endif + +%changelog +* Thu Dec 05 2024 Funda Wang <fundawang@yeah.net> - 2.4.124-1 +- update to version 2.4.124 + +* Fri Aug 30 2024 Funda Wang <fundawang@yeah.net> - 2.4.123-1 +- update to version 2.4.123 + +* Fri Aug 16 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.4.122-1 +- update to version 2.4.122 + +* Thu Jul 18 2024 yangchenguang <yangchenguang@kylinsec.com.cn> - 2.4.120-2 +- Modify sw_64 patch use all arch + +* Tue Mar 12 2024 liweigang <liweiganga@uniontech.com> - 2.4.120-1 +- update to version 2.4.120 + +* Thu Dec 28 2023 Paul Thomas <paulthomas100199@gmail.com> - 2.4.119-1 +- update to version 2.4.119 + +* Wed Nov 15 2023 lvgenggeng <lvgenggeng@uniontech.com> - 2.4.117-1 +- update to 2.4.117 + +* Tue Jul 11 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 2.4.115-1 +- update to 2.4.115 + +* Thu Dec 08 2022 zhouwenpei<zhouwenpei1@h-partners.com> - 2.4.109-7 +- remove rpath + +* Fri Nov 18 2022 zhouwenpei<zhouwenpei1@h-partners.com> - 2.4.109-6 +- Optimize the patch for add sw architecture + +* Fri Nov 18 2022 wuzx<wuzx1226@qq.com> - 2.4.109-5 +- Add sw64 architecture + +* Tue Oct 18 2022 Liu Zixian <liuzixian4@huawei.com> - 2.4.109-4 +- remove unused BuildRequires + +* Wed Mar 30 2022 liuyumeng <liuyumeng5@h-partners.com> - 2.4.109-3 +- enable tests + +* Tue Mar 1 2022 hanhui <hanhui15@h-partners.com> - 2.4.109-2 +* customized valgrind + +* Fri Dec 3 2021 xingxing <xingxing9@huawei.com> - 2.4.109-1 +- update to 2.4.109 + +* Fri Jan 29 2021 zhanzhimin <zhanzhimin@huawei.com> - 2.4.103-1 +- update to 2.4.103 + +* Mon Jul 27 2020 chengguipeng<chengguipeng1@huawei.com> - 2.4.102-1 +- Type:bugfix +- Id:NA +- SUG:NA +- update to 2.4.102 + + +* Wed Apr 15 2020 songnannan <songnannan2@huawei.com> - 2.4.100-1 +- Type:bugfix +- Id:NA +- SUG:NA +- update to 2.4.100 + +* Fri Sep 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.4.95-2 +- Package init @@ -0,0 +1 @@ +78f7f7ee6aff711696d4b34465b40728 libdrm-2.4.124.tar.xz |