Page MenuHomeFreeBSD

Update libdrm to 2.4.78 and remove the dependency on libdevq
ClosedPublic

Authored by rezny on Mar 29 2017, 1:20 PM.

Details

Summary

I have implemented the necessary functionality directly in libdrm alongside Linux's and OpenBSD's implementations with the intent to upstream that so we do not need significant local patches or an extra library for a few syscalls.

Test Plan

Poudriere 10.3/11.0 amd64/i386 OK, build on 11-stable ppc64, run verified on multiple 11amd64 systems with both intel and radeon

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rezny created this revision.Mar 29 2017, 1:20 PM
rezny updated this revision to Diff 26775.Mar 29 2017, 1:40 PM

Chase jrm's portrevision bump for libpthread-stubs with another bump

bapt added subscribers: dumbbell, bapt.

Adding @dumbbell as he wrote that part in libdevq :)

graphics/libdrm/files/patch-xf86drm.h
12 ↗(On Diff #26775)

Why modifying openbsd stuff?

rezny added inline comments.Mar 29 2017, 6:41 PM
graphics/libdrm/files/patch-xf86drm.h
12 ↗(On Diff #26775)

Consolidation while refactoring the mess. I moved a bunch of utility functions up the .c file so they can be used where needed and moved #defines to the .h file.
DRM_{PRIMARY,RENDER,CONTROL}_DEV_NAME were move from the .c to the .h, DRM_{,CONTROL,RENDER}_DEV_NAME were redefined in terms of the former set to remove duplication and chance of mismatch.
DRM_NODE_NAME_MAX was created to replace a function so the result can be used for array sizes instead of inconsistent values in various places.

rezny added inline comments.Mar 30 2017, 7:17 AM
graphics/libdrm/files/patch-xf86drm.h
12 ↗(On Diff #26775)

Correction: DRM_{PRIMARY,CONTROL,RENDER}_MINOR_NAME were moved from the .c to the .h and DRM_{,CONTROL,RENDER}_DEV_NAME were redefined in terms of those.
Is there really no way to edit previous comments in phabricator?

rezny updated this revision to Diff 26812.Mar 30 2017, 7:58 AM

libdrm 2.4.76 was released yesterday, so update the patch set after testing.

rezny retitled this revision from Remove the libdevq dependency in libdrm to Update libdrm to 2.4.76 and remove the dependency on libdevq.Mar 30 2017, 8:03 AM
rezny edited the summary of this revision. (Show Details)
rezny updated this revision to Diff 26838.Mar 30 2017, 5:39 PM

Remove the check of major number once again. I thought I had confirmation it is always 1 on drm-next, but it has now been reported it can be 2 or 3 as well, so assume it's random and never check; it has no purpose anyway.

rezny added a reviewer: x11.Mar 31 2017, 12:34 AM
bapt added a comment.Apr 1 2017, 10:29 AM

Note that I'm more than happy with this move, the libdevq idea was cool but we never made it real in the end :(

dumbbell accepted this revision.Apr 3 2017, 1:27 PM
This revision is now accepted and ready to land.Apr 3 2017, 1:27 PM
rezny updated this revision to Diff 26975.Apr 3 2017, 4:45 PM
rezny edited edge metadata.

After discussing with ftigeot to confirm major ID is dynanically assigned in DragonFly, remove the last difference from FreeBSD by setting MAJOR_ID 0 (n/a) there as well. Hopefully it will work for DragonFly (the version using libdevq did not), but if not, they will take care of patching for their needs.

This revision now requires review to proceed.Apr 3 2017, 4:45 PM
swills accepted this revision.Apr 7 2017, 9:06 PM

Looks good, approved

This revision is now accepted and ready to land.Apr 7 2017, 9:06 PM
rezny updated this revision to Diff 27219.Apr 8 2017, 4:27 AM
rezny edited edge metadata.
rezny marked 3 inline comments as done.

Wider testing revealed more variance than expected; busid does not always follow name and the busid oid is not always present, so try both to maximize chance of success. Assume all drm devices support KMS on DragonFly because they do but do not properly indicate so. Also, update to 2.4.78 because there were a couple more releases in the time that I was testing a system with multiple drm devices present.

This revision now requires review to proceed.Apr 8 2017, 4:27 AM
rezny retitled this revision from Update libdrm to 2.4.76 and remove the dependency on libdevq to Update libdrm to 2.4.78 and remove the dependency on libdevq.Apr 8 2017, 4:27 AM
swills accepted this revision.Apr 8 2017, 2:34 PM

Good update, approved

This revision is now accepted and ready to land.Apr 8 2017, 2:34 PM
This revision was automatically updated to reflect the committed changes.