present: Fix Async swap logic
According to the spec, PresentOptionAsync should only trigger a different behaviour when the target msc has been reached. In this case if the driver is able to do async swaps, we use them to avoid a screen copy. When the target msc hasn't been reached yet, we want to use sync swaps. v2: Fix indentation and simplify checks for Async flips Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
3f35909acb
commit
2203735887
|
@ -836,19 +836,20 @@ present_pixmap(WindowPtr window,
|
||||||
vblank->notifies = notifies;
|
vblank->notifies = notifies;
|
||||||
vblank->num_notifies = num_notifies;
|
vblank->num_notifies = num_notifies;
|
||||||
|
|
||||||
if (!(options & PresentOptionAsync))
|
if (pixmap != NULL &&
|
||||||
vblank->sync_flip = TRUE;
|
!(options & PresentOptionCopy) &&
|
||||||
|
screen_priv->info) {
|
||||||
if (!(options & PresentOptionCopy) &&
|
if (target_msc > crtc_msc &&
|
||||||
!((options & PresentOptionAsync) &&
|
present_check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off))
|
||||||
(!screen_priv->info ||
|
|
||||||
!(screen_priv->info->capabilities & PresentCapabilityAsync))) &&
|
|
||||||
pixmap != NULL &&
|
|
||||||
present_check_flip (target_crtc, window, pixmap, vblank->sync_flip, valid, x_off, y_off))
|
|
||||||
{
|
{
|
||||||
vblank->flip = TRUE;
|
vblank->flip = TRUE;
|
||||||
if (vblank->sync_flip)
|
vblank->sync_flip = TRUE;
|
||||||
target_msc--;
|
target_msc--;
|
||||||
|
} else if ((screen_priv->info->capabilities & PresentCapabilityAsync) &&
|
||||||
|
present_check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off))
|
||||||
|
{
|
||||||
|
vblank->flip = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wait_fence) {
|
if (wait_fence) {
|
||||||
|
|
Loading…
Reference in New Issue