Page MenuHomeFreeBSD

graphics/libdrm: Convert to subpackages
AcceptedPublic

Authored by manu on Jan 29 2024, 8:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 1:36 AM
Unknown Object (File)
Wed, May 8, 1:36 AM
Unknown Object (File)
Wed, May 8, 12:19 AM
Unknown Object (File)
Wed, May 8, 12:11 AM
Unknown Object (File)
Wed, May 8, 12:11 AM
Unknown Object (File)
Wed, May 8, 12:11 AM
Unknown Object (File)
Wed, May 8, 12:10 AM
Unknown Object (File)
Tue, May 7, 11:30 PM
Subscribers

Details

Reviewers
pizzamig
jbeich
Group Reviewers
portmgr
x11
Summary

This split libdrm into multiple packages, one for each drm driver.
The (previously named) tests are also now always built and put into
the -tools packages as they aren't really tests but more test tools which
can always be useful to have.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55726
Build 52615: arc lint + arc unit

Event Timeline

manu requested review of this revision.Jan 29 2024, 8:09 AM
manu created this revision.

I will likely request an exp-run just in case some packages depends on libdrm.so but also needs the driver specific ones.
But for now just having some review would be good.

In D43643#995237, @manu wrote:

I will likely request an exp-run just in case some packages depends on libdrm.so but also needs the driver specific ones.

Before exp-run try pkg rquery '%B %o' | awk '/libdrm_intel/ { print $2 }' and similar.

Unpatched libdrm_intel consumers:

  • graphics/igt-gpu-tools
  • graphics/intel-backlight
  • graphics/piglit
  • multimedia/onevpl

Unpatched libdrm_amdgpu consumers:

  • graphics/igt-gpu-tools
  • sysutils/radeontop

Add more dependency on amdgpu and radeon

In D43643#995237, @manu wrote:

I will likely request an exp-run just in case some packages depends on libdrm.so but also needs the driver specific ones.

Before exp-run try pkg rquery '%B %o' | awk '/libdrm_intel/ { print $2 }' and similar.

Unpatched libdrm_intel consumers:

  • graphics/igt-gpu-tools
  • graphics/intel-backlight
  • graphics/piglit
  • multimedia/onevpl

Unpatched libdrm_amdgpu consumers:

  • graphics/igt-gpu-tools
  • sysutils/radeontop

Thanks, there is no need for an exp-run as I wanted one to fix the one above.

In D43643#995252, @manu wrote:

Thanks, there is no need for an exp-run as I wanted one to fix the one above.

libdrm_vmwgfx doesn't exist, so cannot be found via pkg rquery '%B %o'. mesa-gallium-xa and xf86-video-vmware bundle a copy of vmwgfx_drm.h, so may not need libdrm~vmwgfx subpackage but I didn't test build.

In D43643#995252, @manu wrote:

Thanks, there is no need for an exp-run as I wanted one to fix the one above.

libdrm_vmwgfx doesn't exist, so cannot be found via pkg rquery '%B %o'. mesa-gallium-xa and xf86-video-vmware bundle a copy of vmwgfx_drm.h, so may not need libdrm~vmwgfx subpackage but I didn't test build.

Both port doesn't seems to use libdrm/vmwgfx_drm.h but the bundled one.

Fix mesa-devel, intel is only for x86

graphics/mesa-devel/Makefile
27

Limit libdrm_amdgpu to radv_LIB_DEPENDS (under radv_BUILD_DEPENDS) and radeonsi_LIB_DEPENDS (under radeonsi_DESC).

$ readelf -d /usr/local/lib/libvulkan_radeon-devel.so  | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm_amdgpu.so.1]
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]
# From r600=OFF build
$ readelf -d /usr/local/lib/dri-devel/radeonsi_dri.so | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]
 0x0000000000000001 NEEDED               Shared library: [libdrm_radeon.so.1]
 0x0000000000000001 NEEDED               Shared library: [libdrm_amdgpu.so.1]
28

Limit libdrm_radeon to r600_LIB_DEPENDS (under r600_DESC) and radeonsi_LIB_DEPENDS (under radeonsi_DESC)

# From radv=OFF radeonsi=OFF build
$ readelf -d /usr/local/lib/dri-devel/r600_dri.so | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]
 0x0000000000000001 NEEDED               Shared library: [libdrm_radeon.so.1]
# From r600=OFF build
$ readelf -d /usr/local/lib/dri-devel/radeonsi_dri.so | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]
 0x0000000000000001 NEEDED               Shared library: [libdrm_radeon.so.1]
 0x0000000000000001 NEEDED               Shared library: [libdrm_amdgpu.so.1]
29

Drop libdrm_intel: only used by i915g which isn't built by mesa-devel ("no old drivers" unlike mesa-dri).

$ readelf -d /usr/local/lib/libvulkan_intel-devel.so | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]
# From r600=OFF radeonsi=OFF build
$ readelf -d /usr/local/lib/dri-devel/iris_dri.so | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]

Note, Gallium is a mega driver thus shares dependencies when multiple are built (default).

$ sha256 /usr/local/lib/dri-devel/*dri.so
SHA256 (/usr/local/lib/dri-devel/crocus_dri.so) = b551842540357b0befd833783bae4f2fd2998306614ee2d7af2d1384bb0a618b
SHA256 (/usr/local/lib/dri-devel/iris_dri.so) = b551842540357b0befd833783bae4f2fd2998306614ee2d7af2d1384bb0a618b
SHA256 (/usr/local/lib/dri-devel/r600_dri.so) = b551842540357b0befd833783bae4f2fd2998306614ee2d7af2d1384bb0a618b
SHA256 (/usr/local/lib/dri-devel/radeonsi_dri.so) = b551842540357b0befd833783bae4f2fd2998306614ee2d7af2d1384bb0a618b
$ readelf -d /usr/local/lib/dri-devel/iris_dri.so | fgrep libdrm
 0x0000000000000001 NEEDED               Shared library: [libdrm.so.2]
 0x0000000000000001 NEEDED               Shared library: [libdrm_radeon.so.1]
 0x0000000000000001 NEEDED               Shared library: [libdrm_amdgpu.so.1]
graphics/mesa-gallium-va/Makefile
15 ↗(On Diff #133561)

Duplicates mesa-dri/Makefile.common

$ make -V LIB_DEPENDS:M\*libdrm\* | sed 'y/ /\n/'
libdrm.so:graphics/libdrm
libdrm_amdgpu.so:graphics/libdrm~amdgpu
libdrm_radeon.so:graphics/libdrm~radeon
libdrm.so:graphics/libdrm
libdrm_amdgpu.so:graphics/libdrm~amdgpu
libdrm_radeon.so:graphics/libdrm~radeon
libdrm_intel.so:graphics/libdrm~intel
graphics/mesa-gallium-vdpau/Makefile
15 ↗(On Diff #133561)

Duplicates mesa-dri/Makefile.common

Address jbeich@ comments.

graphics/mesa-devel/Makefile
29

The helper is no longer used.

78

libdrm_amdgpu isn't used by r600, so move it to radv_LIB_DEPENDS (under radv_BUILD_DEPENDS).

Note, only radeonsi uses both libdrm_amdgpu and libdrm_radeon.

Address jbeich@ comments.

mat added a subscriber: mat.

As for portmgr approval, the conversion seems straightforward, if you have actually tested things still work after the conversion, go ahead.

This revision is now accepted and ready to land.Feb 2 2024, 10:25 AM