Make PixmapDirtyUpdateRec::src a DrawablePtr

This allows making the master screen's pixmap_dirty_list entries
explicitly reflect that we're now tracking the root window instead of
the screen pixmap, in order to allow Present page flipping on master
outputs while there are active slave outputs.

Define HAS_DIRTYTRACKING_DRAWABLE_SRC for drivers to check, but leave
HAS_DIRTYTRACKING_ROTATION defined as well to make things slightly
easier for drivers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Michel Dänzer 2017-04-14 19:08:41 +09:00 • committed by Michel Dänzer
commit 8e3b26ceaa
9 changed files with 38 additions and 39 deletions

View file

@ -279,7 +279,7 @@ typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap);
typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, PixmapPtr,
typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, DrawablePtr,
PixmapPtr, PixmapPtr,
int x, int y,
int dst_x, int dst_y,

View file

@ -388,12 +388,12 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
if (crtc->scanout_pixmap) {
ScreenPtr master = crtc->pScreen->current_master;
PixmapPtr mscreenpix = master->GetScreenPixmap(master);
DrawablePtr mrootdraw = &master->root->drawable;
if (crtc->scanout_pixmap_back) {
pScrPriv->rrDisableSharedPixmapFlipping(crtc);
master->StopFlippingPixmapTracking(mscreenpix,
master->StopFlippingPixmapTracking(mrootdraw,
crtc->scanout_pixmap,
crtc->scanout_pixmap_back);
@ -402,7 +402,8 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
}
else {
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
master->StopPixmapTracking(mrootdraw,
crtc->scanout_pixmap);
}
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap);
@ -491,9 +492,8 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height,
ScreenPtr master = crtc->pScreen->current_master;
rrScrPrivPtr pMasterScrPriv = rrGetScrPriv(master);
rrScrPrivPtr pSlaveScrPriv = rrGetScrPriv(crtc->pScreen);
int depth;
PixmapPtr mscreenpix;
DrawablePtr mrootdraw = &master->root->drawable;
int depth = mrootdraw->depth;
PixmapPtr spix_front;
/* Create a pixmap on the master screen, then get a shared handle for it.
@ -515,9 +515,6 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height,
defer to the slave.
*/
mscreenpix = master->GetScreenPixmap(master);
depth = mscreenpix->drawable.depth;
if (crtc->scanout_pixmap)
RRCrtcDetachScanoutPixmap(crtc);
@ -553,7 +550,8 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height,
crtc->scanout_pixmap = spix_front;
crtc->scanout_pixmap_back = spix_back;
if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc, mscreenpix,
if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc,
mrootdraw,
spix_front,
spix_back,
x, y, 0, 0,
@ -588,7 +586,7 @@ fail: /* If flipping funcs fail, just fall back to unsynchronized */
}
crtc->scanout_pixmap = spix_front;
master->StartPixmapTracking(mscreenpix, spix_front, x, y, 0, 0, rotation);
master->StartPixmapTracking(mrootdraw, spix_front, x, y, 0, 0, rotation);
return TRUE;
}