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>
This commit is contained in:
parent
032af35657
commit
4c92dea952
|
@ -469,7 +469,7 @@ present_vblank_create(WindowPtr window,
|
||||||
const uint32_t *capabilities,
|
const uint32_t *capabilities,
|
||||||
present_notify_ptr notifies,
|
present_notify_ptr notifies,
|
||||||
int num_notifies,
|
int num_notifies,
|
||||||
uint64_t *target_msc,
|
uint64_t target_msc,
|
||||||
uint64_t crtc_msc);
|
uint64_t crtc_msc);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -732,12 +732,15 @@ present_scmd_pixmap(WindowPtr window,
|
||||||
screen_priv->info ? &screen_priv->info->capabilities : NULL,
|
screen_priv->info ? &screen_priv->info->capabilities : NULL,
|
||||||
notifies,
|
notifies,
|
||||||
num_notifies,
|
num_notifies,
|
||||||
&target_msc,
|
target_msc,
|
||||||
crtc_msc);
|
crtc_msc);
|
||||||
|
|
||||||
if (!vblank)
|
if (!vblank)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
if (vblank->flip && vblank->sync_flip)
|
||||||
|
target_msc--;
|
||||||
|
|
||||||
xorg_list_append(&vblank->event_queue, &present_exec_queue);
|
xorg_list_append(&vblank->event_queue, &present_exec_queue);
|
||||||
vblank->queued = TRUE;
|
vblank->queued = TRUE;
|
||||||
if (msc_is_after(target_msc, crtc_msc)) {
|
if (msc_is_after(target_msc, crtc_msc)) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ present_vblank_create(WindowPtr window,
|
||||||
const uint32_t *capabilities,
|
const uint32_t *capabilities,
|
||||||
present_notify_ptr notifies,
|
present_notify_ptr notifies,
|
||||||
int num_notifies,
|
int num_notifies,
|
||||||
uint64_t *target_msc,
|
uint64_t target_msc,
|
||||||
uint64_t crtc_msc)
|
uint64_t crtc_msc)
|
||||||
{
|
{
|
||||||
ScreenPtr screen = window->drawable.pScreen;
|
ScreenPtr screen = window->drawable.pScreen;
|
||||||
|
@ -100,7 +100,7 @@ present_vblank_create(WindowPtr window,
|
||||||
|
|
||||||
vblank->x_off = x_off;
|
vblank->x_off = x_off;
|
||||||
vblank->y_off = y_off;
|
vblank->y_off = y_off;
|
||||||
vblank->target_msc = *target_msc;
|
vblank->target_msc = target_msc;
|
||||||
vblank->crtc = target_crtc;
|
vblank->crtc = target_crtc;
|
||||||
vblank->msc_offset = window_priv->msc_offset;
|
vblank->msc_offset = window_priv->msc_offset;
|
||||||
vblank->notifies = notifies;
|
vblank->notifies = notifies;
|
||||||
|
@ -111,12 +111,11 @@ present_vblank_create(WindowPtr window,
|
||||||
if (pixmap != NULL &&
|
if (pixmap != NULL &&
|
||||||
!(options & PresentOptionCopy) &&
|
!(options & PresentOptionCopy) &&
|
||||||
capabilities) {
|
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))
|
screen_priv->check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off, &reason))
|
||||||
{
|
{
|
||||||
vblank->flip = TRUE;
|
vblank->flip = TRUE;
|
||||||
vblank->sync_flip = TRUE;
|
vblank->sync_flip = TRUE;
|
||||||
*target_msc = *target_msc - 1;
|
|
||||||
} else if ((*capabilities & PresentCapabilityAsync) &&
|
} else if ((*capabilities & PresentCapabilityAsync) &&
|
||||||
screen_priv->check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off, &reason))
|
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)
|
if (pixmap)
|
||||||
DebugPresent(("q %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p) flip %d vsync %d serial %d\n",
|
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,
|
vblank->pixmap->drawable.id, vblank->window->drawable.id,
|
||||||
target_crtc, vblank->flip, vblank->sync_flip, vblank->serial));
|
target_crtc, vblank->flip, vblank->sync_flip, vblank->serial));
|
||||||
return vblank;
|
return vblank;
|
||||||
|
|
|
@ -645,11 +645,14 @@ present_wnmd_pixmap(WindowPtr window,
|
||||||
&screen_priv->wnmd_info->capabilities,
|
&screen_priv->wnmd_info->capabilities,
|
||||||
notifies,
|
notifies,
|
||||||
num_notifies,
|
num_notifies,
|
||||||
&target_msc,
|
target_msc,
|
||||||
crtc_msc);
|
crtc_msc);
|
||||||
if (!vblank)
|
if (!vblank)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
if (vblank->flip && vblank->sync_flip)
|
||||||
|
target_msc--;
|
||||||
|
|
||||||
xorg_list_append(&vblank->event_queue, &window_priv->exec_queue);
|
xorg_list_append(&vblank->event_queue, &window_priv->exec_queue);
|
||||||
vblank->queued = TRUE;
|
vblank->queued = TRUE;
|
||||||
if (crtc_msc < target_msc) {
|
if (crtc_msc < target_msc) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user