diff --git a/91-drm-modeset.rules b/91-drm-modeset.rules new file mode 100644 index 0000000000000000000000000000000000000000..f1bb5ecec6a5cc6e239bcee0f9877a5435667b10 --- /dev/null +++ b/91-drm-modeset.rules @@ -0,0 +1 @@ +KERNEL=="controlD[0-9]*", SUBSYSTEM=="drm", MODE="0600" diff --git a/README.rst b/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..e47cb241b119d09b642d87b4a5a6d6cac9f50141 --- /dev/null +++ b/README.rst @@ -0,0 +1,61 @@ +libdrm - userspace library for drm +---------------------------------- + +This is libdrm, a userspace library for accessing the DRM, direct rendering +manager, on Linux, BSD and other operating systems that support the ioctl +interface. +The library provides wrapper functions for the ioctls to avoid exposing the +kernel interface directly, and for chipsets with drm memory manager, support +for tracking relocations and buffers. +New functionality in the kernel DRM drivers typically requires a new libdrm, +but a new libdrm will always work with an older kernel. + +libdrm is a low-level library, typically used by graphics drivers such as +the Mesa drivers, the X drivers, libva and similar projects. + + +Compiling +--------- + +libdrm has two build systems, a legacy autotools build system, and a newer +meson build system. The meson build system is much faster, and offers a +slightly different interface, but otherwise provides an equivalent feature set. + +To use it: + + meson builddir/ + +By default this will install into /usr/local, you can change your prefix +with --prefix=/usr (or `meson configure builddir/ -Dprefix=/usr` after +the initial meson setup). + +Then use ninja to build and install: + + ninja -C builddir/ install + +If you are installing into a system location you will need to run install +separately, and as root. + + +Alternatively you can invoke autotools configure: + + ./configure + +By default, libdrm will install into the /usr/local/ prefix. If you +want to install this DRM to replace your system copy, pass +--prefix=/usr and --exec-prefix=/ to configure. If you are building +libdrm from a git checkout, you first need to run the autogen.sh +script. You can pass any options to autogen.sh that you would other +wise pass to configure, or you can just re-run configure with the +options you need once autogen.sh finishes. + +Next step is to build libdrm: + + make + +and once make finishes successfully, install the package using + + make install + +If you are installing into a system location, you will need to be root +to perform the install step. diff --git a/libdrm-2.4.110.tar.xz b/libdrm-2.4.110.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..c33e6bfba7bee75a854c756e68ad8fcdbdfd0a92 Binary files /dev/null and b/libdrm-2.4.110.tar.xz differ diff --git a/libdrm.spec b/libdrm.spec new file mode 100644 index 0000000000000000000000000000000000000000..b650077d329a381abe397e15bf95fc839ddf58b1 --- /dev/null +++ b/libdrm.spec @@ -0,0 +1,275 @@ +%define anolis_release 1 +%define bcond_meson() %{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} + +%bcond_without libkms +%bcond_without intel +%bcond_without radeon +%bcond_without amdgpu +%bcond_without nouveau +%bcond_without vmwgfx +%bcond_without omap +%bcond_without exynos +%bcond_without freedreno +%bcond_without tegra +%bcond_without vc4 +%bcond_without etnaviv +%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 +Summary: Direct Rendering Manager runtime library +Version: 2.4.110 +Release: %{anolis_release}%{?dist} +License: MIT + +URL: https://dri.freedesktop.org +Source0: %{url}/libdrm/%{name}-%{version}.tar.xz +Source1: README.rst +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 +%endif +#BuildRequires: pkgconfig(cunit) >= 2.1 +%if %{with cairo_tests} +BuildRequires: pkgconfig(cairo) +%endif +%if %{with man_pages} +BuildRequires: python3-docutils +%endif +%if %{with valgrind} +BuildRequires: valgrind-devel +%endif +%if %{with udev} +BuildRequires: pkgconfig(udev) +%endif +BuildRequires: chrpath + + +%description +Direct Rendering Manager runtime library + +%package devel +Summary: Direct Rendering Manager development package +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: kernel-headers + +%description devel +Direct Rendering Manager development package. + +%if %{with install_test_programs} +%package -n drm-utils +Summary: Direct Rendering Manager utilities +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n drm-utils +Utility programs for the kernel DRM interface. Will void your warranty. +%endif + +%prep +%autosetup -p1 + +%build +%meson \ + %{bcond_meson libkms} \ + %{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} \ + %{bcond_meson valgrind} \ + %{bcond_meson freedreno_kgsl} \ + %{bcond_meson install_test_programs} \ + %{bcond_meson udev} \ + %{nil} +%meson_build + +%install +%meson_install +%if %{with install_test_programs} +chrpath -d %{_vpath_builddir}/tests/drmdevice +install -Dpm0755 -t %{buildroot}%{_bindir} %{_vpath_builddir}/tests/drmdevice +%endif +%if %{with udev} +install -Dpm0644 -t %{buildroot}%{_udevrulesdir} %{S:2} +%endif +mkdir -p %{buildroot}%{_docdir}/libdrm + +%ldconfig_scriptlets + +%files +%doc README.rst +%{_libdir}/libdrm.so.2 +%{_libdir}/libdrm.so.2.4.0 +%dir %{_datadir}/libdrm +%if %{with libkms} +%{_libdir}/libkms.so.1 +%{_libdir}/libkms.so.1.0.0 +%endif +%if %{with intel} +%{_libdir}/libdrm_intel.so.1 +%{_libdir}/libdrm_intel.so.1.0.0 +%endif +%if %{with radeon} +%{_libdir}/libdrm_radeon.so.1 +%{_libdir}/libdrm_radeon.so.1.0.1 +%endif +%if %{with amdgpu} +%{_libdir}/libdrm_amdgpu.so.1 +%{_libdir}/libdrm_amdgpu.so.1.0.0 +%{_datadir}/libdrm/amdgpu.ids +%endif +%if %{with nouveau} +%{_libdir}/libdrm_nouveau.so.2 +%{_libdir}/libdrm_nouveau.so.2.0.0 +%endif +%if %{with omap} +%{_libdir}/libdrm_omap.so.1 +%{_libdir}/libdrm_omap.so.1.0.0 +%endif +%if %{with exynos} +%{_libdir}/libdrm_exynos.so.1 +%{_libdir}/libdrm_exynos.so.1.0.0 +%endif +%if %{with freedreno} +%{_libdir}/libdrm_freedreno.so.1 +%{_libdir}/libdrm_freedreno.so.1.0.0 +%endif +%if %{with tegra} +%{_libdir}/libdrm_tegra.so.0 +%{_libdir}/libdrm_tegra.so.0.0.0 +%endif +%if %{with etnaviv} +%{_libdir}/libdrm_etnaviv.so.1 +%{_libdir}/libdrm_etnaviv.so.1.0.0 +%endif +%if %{with udev} +%{_udevrulesdir}/91-drm-modeset.rules +%endif + +%files devel +%dir %{_includedir}/libdrm +%{_includedir}/libdrm/drm.h +%{_includedir}/libdrm/drm_fourcc.h +%{_includedir}/libdrm/drm_mode.h +%{_includedir}/libdrm/drm_sarea.h +%{_includedir}/libdrm/*_drm.h +%{_libdir}/libdrm.so +%{_libdir}/pkgconfig/libdrm.pc +%if %{with libkms} +%{_includedir}/libkms/ +%{_libdir}/libkms.so +%{_libdir}/pkgconfig/libkms.pc +%endif +%if %{with intel} +%{_includedir}/libdrm/intel_*.h +%{_libdir}/libdrm_intel.so +%{_libdir}/pkgconfig/libdrm_intel.pc +%endif +%if %{with radeon} +%{_includedir}/libdrm/radeon_{bo,cs,surface}*.h +%{_includedir}/libdrm/r600_pci_ids.h +%{_libdir}/libdrm_radeon.so +%{_libdir}/pkgconfig/libdrm_radeon.pc +%endif +%if %{with amdgpu} +%{_includedir}/libdrm/amdgpu.h +%{_libdir}/libdrm_amdgpu.so +%{_libdir}/pkgconfig/libdrm_amdgpu.pc +%endif +%if %{with nouveau} +%{_includedir}/libdrm/nouveau/ +%{_libdir}/libdrm_nouveau.so +%{_libdir}/pkgconfig/libdrm_nouveau.pc +%endif +%if %{with omap} +%{_includedir}/libdrm/omap_*.h +%{_includedir}/omap/ +%{_libdir}/libdrm_omap.so +%{_libdir}/pkgconfig/libdrm_omap.pc +%endif +%if %{with exynos} +%{_includedir}/libdrm/exynos_*.h +%{_includedir}/exynos/ +%{_libdir}/libdrm_exynos.so +%{_libdir}/pkgconfig/libdrm_exynos.pc +%endif +%if %{with freedreno} +%{_includedir}/freedreno/ +%{_libdir}/libdrm_freedreno.so +%{_libdir}/pkgconfig/libdrm_freedreno.pc +%endif +%if %{with tegra} +%{_includedir}/libdrm/tegra.h +%{_libdir}/libdrm_tegra.so +%{_libdir}/pkgconfig/libdrm_tegra.pc +%endif +%if %{with vc4} +%{_includedir}/libdrm/vc4_*.h +%{_libdir}/pkgconfig/libdrm_vc4.pc +%endif +%if %{with etnaviv} +%{_includedir}/libdrm/etnaviv_*.h +%{_libdir}/libdrm_etnaviv.so +%{_libdir}/pkgconfig/libdrm_etnaviv.pc +%endif +%{_includedir}/libsync.h +%{_includedir}/xf86drm.h +%{_includedir}/xf86drmMode.h +%if %{with man_pages} +%{_mandir}/man3/drm*.3* +%{_mandir}/man7/drm*.7* +%endif + +%if %{with install_test_programs} +%files -n drm-utils +%if %{with amdgpu} +%{_bindir}/amdgpu_stress +%endif +%{_bindir}/drmdevice +%if %{with etnaviv} +%exclude %{_bindir}/etnaviv_* +%endif +%if %{with exynos} +%exclude %{_bindir}/exynos_* +%endif +%{_bindir}/kms-steal-crtc +%{_bindir}/kms-universal-planes +%if %{with libkms} +%{_bindir}/kmstest +%endif +%{_bindir}/modeprint +%{_bindir}/modetest +%{_bindir}/proptest +%{_bindir}/vbltest +%endif + +%changelog +* Wed Apr 06 2022 mgb01105731 - 2.4.110-1 +- Init from upstream version 2.4.110