control: Add Device::crtc_get/queue_sequence()
IOCTLs and event
#200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.rs
orsrc/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 mutex
should 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
TODO
s 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_data
field onpage_flip()
just likewait_vblank()
, since thecrtc_id
field will always be set from kernel4.12
onwards?pub
? I.e.ResourceHandles
already haspub
fields and doesn't need trivial getters,WaitVblankReply
could use the same.PageFlipTarget
andWaitVblankTarget
?doc(alias)
to make it easier to relate low-level DRM code to the higher-level wrappers here.Capabilities
when they affect a specific function/struct/field/flag.Events
iterator (basically a buffered reader) consume events from thefd
indefinitely? Or at the very least document that it reads1024
bytes 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?