control: Add Device::crtc_get/queue_sequence() IOCTLs and event#200
control: Add Device::crtc_get/queue_sequence() IOCTLs and event#200MarijnS95 wants to merge 1 commit intoSmithay:developfrom
Device::crtc_get/queue_sequence() IOCTLs and event#200Conversation
These two IOCTLs are for querying the most recent sequence number (and its "first pixel out" timestamp) as well as scheduling (queueing) an event when a future sequence number (absolute or relative) is hit, equally containing the "first pixel out" timestamp for that sequence. As with `wait_vblank()`, `crtc_queue_sequence()` also returns the absolute sequence number that the event ended up latching on. This is useful when specifying a relative index as well as when the driver `max()`es an absolute target to the most recently triggered sequence. This request will still result in an event even when that sequence number has already been hit, but doesn't allow you to queue older frames.
I think the differentiating factor between the two modules was supposed to be what you can do on any drm-node vs a control-node. That obviously never really materialized as control-nodes never took off in favor of just using the primary node. The closest match today would be to figure out, which ioctls needs DRM_MASTER/authentification (these would belong into
That is something @Slabity pulled from the kernel code at some point as far as I am aware.
We might want to start documenting a minimum supported kernel version at some point...
Sound like good ideas for general cleanup. |
These two IOCTLs are for querying the most recent sequence number (and its "first pixel out" timestamp) as well as scheduling (queueing) an event when a future sequence number (absolute or relative) is hit, equally containing the "first pixel out" timestamp for that sequence.
As with
wait_vblank(),crtc_queue_sequence()also returns the absolute sequence number that the event ended up latching on. This is useful when specifying a relative index as well as when the drivermax()es an absolute target to the most recently triggered sequence. This request will still result in an event even when that sequence number has already been hit, but doesn't allow you to queue older frames.To figure out
src/lib.rsorsrc/control/mod.rs)?wait_vblank()which is outside ofcontrol, shouldreceive_events()be moved to the (or is the optionalwait_vblank(EVENT, ...)flag a feature of a modesetting device)?Locks DRM mutexshould be true or false?"Unrelated" TODOs
Note that this PR is much bigger than just these two IOCTLs, as I started cleaning through and playing with the code. There are a bunch of
TODOs remaining in the code, mostly questions for the maintainers to decide how to proceed. And a lot of unrelated changes to be split out.user_datafield onpage_flip()just likewait_vblank(), since thecrtc_idfield will always be set from kernel4.12onwards?pub? I.e.ResourceHandlesalready haspubfields and doesn't need trivial getters,WaitVblankReplycould use the same.PageFlipTargetandWaitVblankTarget?doc(alias)to make it easier to relate low-level DRM code to the higher-level wrappers here.Capabilitieswhen they affect a specific function/struct/field/flag.Eventsiterator (basically a buffered reader) consume events from thefdindefinitely? Or at the very least document that it reads1024bytes of data (rounded down to a whole number of events that would fit), leaving them unaware of whether more events are available unless they keep callingread_events()in a loop till it returns an empty iterator?