xorg-x11-server/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch
Troy Dawson 6c2dd5fc20 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/xorg-x11-server#eaf442296937a83e622ce4995c5f33122bcd6f02
2020-10-15 14:12:16 -07:00

122 lines
4.8 KiB
Diff

From dae234efdb7bba75744aa1697386df3c0db5348a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Fri, 11 Sep 2020 17:00:18 +0200
Subject: [PATCH xserver 13/16] present: Move flip target_msc adjustment out of
present_vblank_create
Preparation for different handling between SCMD & WNMD. No functional
change intended.
Reviewed-by: Roman Gilg <subdiff@gmail.com>
Tested-by: Roman Gilg <subdiff@gmail.com>
(cherry picked from commit 4c92dea952f7fed19857904f0f552900257ef4b9)
---
present/present_priv.h | 2 +-
present/present_scmd.c | 5 ++++-
present/present_vblank.c | 9 ++++-----
present/present_wnmd.c | 5 ++++-
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/present/present_priv.h b/present/present_priv.h
index 5849b9e0b..90c3f4e79 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -469,7 +469,7 @@ present_vblank_create(WindowPtr window,
const uint32_t *capabilities,
present_notify_ptr notifies,
int num_notifies,
- uint64_t *target_msc,
+ uint64_t target_msc,
uint64_t crtc_msc);
void
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 6a580cb7a..a4d046ca8 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -745,12 +745,15 @@ present_scmd_pixmap(WindowPtr window,
screen_priv->info ? &screen_priv->info->capabilities : NULL,
notifies,
num_notifies,
- &target_msc,
+ target_msc,
crtc_msc);
if (!vblank)
return BadAlloc;
+ if (vblank->flip && vblank->sync_flip)
+ target_msc--;
+
xorg_list_append(&vblank->event_queue, &present_exec_queue);
vblank->queued = TRUE;
if (msc_is_after(target_msc, crtc_msc)) {
diff --git a/present/present_vblank.c b/present/present_vblank.c
index 2c124f4bb..a4b70c0d9 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -57,7 +57,7 @@ present_vblank_create(WindowPtr window,
const uint32_t *capabilities,
present_notify_ptr notifies,
int num_notifies,
- uint64_t *target_msc,
+ uint64_t target_msc,
uint64_t crtc_msc)
{
ScreenPtr screen = window->drawable.pScreen;
@@ -100,7 +100,7 @@ present_vblank_create(WindowPtr window,
vblank->x_off = x_off;
vblank->y_off = y_off;
- vblank->target_msc = *target_msc;
+ vblank->target_msc = target_msc;
vblank->crtc = target_crtc;
vblank->msc_offset = window_priv->msc_offset;
vblank->notifies = notifies;
@@ -111,12 +111,11 @@ present_vblank_create(WindowPtr window,
if (pixmap != NULL &&
!(options & PresentOptionCopy) &&
capabilities) {
- if (msc_is_after(*target_msc, crtc_msc) &&
+ if (msc_is_after(target_msc, crtc_msc) &&
screen_priv->check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off, &reason))
{
vblank->flip = TRUE;
vblank->sync_flip = TRUE;
- *target_msc = *target_msc - 1;
} else if ((*capabilities & PresentCapabilityAsync) &&
screen_priv->check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off, &reason))
{
@@ -139,7 +138,7 @@ present_vblank_create(WindowPtr window,
if (pixmap)
DebugPresent(("q %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p) flip %d vsync %d serial %d\n",
- vblank->event_id, vblank, *target_msc,
+ vblank->event_id, vblank, target_msc,
vblank->pixmap->drawable.id, vblank->window->drawable.id,
target_crtc, vblank->flip, vblank->sync_flip, vblank->serial));
return vblank;
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 35ea12968..31e83d6ee 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -626,11 +626,14 @@ present_wnmd_pixmap(WindowPtr window,
&screen_priv->wnmd_info->capabilities,
notifies,
num_notifies,
- &target_msc,
+ target_msc,
crtc_msc);
if (!vblank)
return BadAlloc;
+ if (vblank->flip && vblank->sync_flip)
+ target_msc--;
+
xorg_list_append(&vblank->event_queue, &window_priv->exec_queue);
vblank->queued = TRUE;
if (crtc_msc < target_msc) {
--
2.28.0