[RFC] Untested VRR logic - #18306
Open
AnataBakka wants to merge 1 commit into
Open
Conversation
The intention is for vrr mode to be a change to base behaviour, and thus be compatible with every selection of video-sync modes. However, currently it is only compatible for non-display sync ones. For display sync modes in the future, the expectation is to continue using this vrr structure, but just have vo immediatelly output frames one after the other like display sync does, and then use api functions like presentAt to present the frame based on the data from voframe. The expectation would be for display-sync vrr to exclude some of the estimations that display-sync uses, since they are not required and for cleaner design. One other expectation is for the driver to immediatelly drop frames when the swapchain is fully filled out, so that vo can then decide whether to move to a newer frame or recalculate the dropped frame position before trying to send it again, instead of the driver dropping older valid frames, or delaying the newer frame to later. Additional changes: #. merged the repeat functionality from display-sync modes into a new variable that can be used by vrr. it is not expected but it is possible for display-sync behaviour to have changed because of that. #. moved in->wakeup_pts set up inside render_frame instead of vo_queue_frame. This is because it doesn't appear to have a pre-render_frame purpose inside vo_queue_frame, and to allow decision based set up in render_frame. #. we now directly update frame-> information when pts and duration changes (i.e like when "now" has moved past our pts), to give the driver accurate data. #. after doing the initial duration < 0 check, we then clamp duration to 0, as non-valid negative duration input messes up the logic. #. display-sync now also uses a simple pts + duration for its in->wakeup_pts instead of an "= 0" special case. Since it already modifies pts to 0 and duration to -1 -> going to 0, end time is expected to also result in 0. Trying to re-use existing logic than making a lot of special cases. #. The "strict drop threshold" has been changed to include the case where end_time == now (as per duration <= 0), instead of just end_time < now. The vrr logic is cleaner when we drop frames at duration = 0, and i believe makes sense. #. Added a in->current_frame check for VO_CAP_NORETAIN, since stuff may randomly set current_frame to null (like vo_reconfig?), and just generally safer. #. Clarified the VO_CAP_FRAMEOWNER condition to be compatible with vrr, and also put up that the addition of the driver_dropped_frame condition (the logic of which is exactly the same as before this change) doesn't make much sense and should be removed, but i'll leave it to somebody else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Desire started here, based on my understanding of missing functionality. #6137 (comment)
The design is intended to be complete, covering all cases, but that's purely theoretical, as i haven't tested them at all. They may crash or even not compile, or unexpectedly have abysmal performance and security impact. This is my first contribution, so i've taken a number of assumptions that have a high chance of being wrong. However, i hope you see the reason behind everything, and you do not rush in deleting functionality.
At worst, i hope it will serve as a good starting point for the real thing.