present: fix msc offset calculation in screen mode
Instead of getting the current msc value from the window crtc,
which not exist take the last saved msc value saved in
the window_priv struct
Signed-off-by: Łukasz Spintzyk <lukasz.spintzyk@synaptics.com>
(cherry picked from commit d2dce22b67
)
This commit is contained in:
parent
31544e68e6
commit
c7a2da7b99
|
@ -2236,7 +2236,7 @@ if test "x$DMX" = xyes; then
|
|||
fi
|
||||
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
|
||||
XDMX_CFLAGS="$DMXMODULES_CFLAGS"
|
||||
XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
|
||||
XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $RENDER_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
|
||||
XDMX_SYS_LIBS="$DMXMODULES_LIBS"
|
||||
AC_SUBST([XDMX_CFLAGS])
|
||||
AC_SUBST([XDMX_LIBS])
|
||||
|
|
|
@ -68,9 +68,6 @@
|
|||
* _any_ header files. */
|
||||
extern FontPtr defaultFont;
|
||||
|
||||
/* Hack to get Present to build (present requires RandR) */
|
||||
RESTYPE RRCrtcType;
|
||||
|
||||
/** This routine provides information to the DMX protocol extension
|
||||
* about a particular screen. */
|
||||
Bool
|
||||
|
|
|
@ -109,8 +109,6 @@ Bool dmxGLXSyncSwap = FALSE;
|
|||
Bool dmxGLXFinishSwap = FALSE;
|
||||
#endif
|
||||
|
||||
RESTYPE RRProviderType = 0;
|
||||
|
||||
Bool dmxIgnoreBadFontPaths = FALSE;
|
||||
|
||||
Bool dmxAddRemoveScreens = FALSE;
|
||||
|
|
|
@ -239,11 +239,12 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc
|
|||
if (window_priv->crtc == PresentCrtcNeverSet) {
|
||||
window_priv->msc_offset = 0;
|
||||
} else {
|
||||
/* The old CRTC may have been turned off, in which case
|
||||
/* The old CRTC may have been turned off or be destroyed, in which case
|
||||
* we'll just use whatever previous MSC we'd seen from this CRTC
|
||||
*/
|
||||
|
||||
if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success)
|
||||
if (!RRCrtcExists(window->drawable.pScreen, window_priv->crtc) ||
|
||||
present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success)
|
||||
old_msc = window_priv->msc;
|
||||
|
||||
window_priv->msc_offset += new_msc - old_msc;
|
||||
|
|
|
@ -642,6 +642,11 @@ extern _X_EXPORT void
|
|||
*/
|
||||
extern _X_EXPORT RRCrtcPtr RRCrtcCreate(ScreenPtr pScreen, void *devPrivate);
|
||||
|
||||
/*
|
||||
* Tests if findCrtc belongs to pScreen or slave screens
|
||||
*/
|
||||
extern _X_EXPORT Bool RRCrtcExists(ScreenPtr pScreen, RRCrtcPtr findCrtc);
|
||||
|
||||
/*
|
||||
* Set the allowed rotations on a CRTC
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
RESTYPE RRCrtcType;
|
||||
RESTYPE RRCrtcType = 0;
|
||||
|
||||
/*
|
||||
* Notify the CRTC of some change
|
||||
|
@ -960,6 +960,47 @@ RRCrtcGammaGet(RRCrtcPtr crtc)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static Bool RRCrtcInScreen(ScreenPtr pScreen, RRCrtcPtr findCrtc)
|
||||
{
|
||||
rrScrPrivPtr pScrPriv;
|
||||
int c;
|
||||
|
||||
if (pScreen == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (findCrtc == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!dixPrivateKeyRegistered(rrPrivKey))
|
||||
return FALSE;
|
||||
|
||||
pScrPriv = rrGetScrPriv(pScreen);
|
||||
for (c = 0; c < pScrPriv->numCrtcs; c++) {
|
||||
if (pScrPriv->crtcs[c] == findCrtc)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Bool RRCrtcExists(ScreenPtr pScreen, RRCrtcPtr findCrtc)
|
||||
{
|
||||
ScreenPtr slave= NULL;
|
||||
|
||||
if (RRCrtcInScreen(pScreen, findCrtc))
|
||||
return TRUE;
|
||||
|
||||
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) {
|
||||
if (!slave->is_output_slave)
|
||||
continue;
|
||||
if (RRCrtcInScreen(slave, findCrtc))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Notify the extension that the Crtc gamma has been changed
|
||||
* The driver calls this whenever it has changed the gamma values
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
RESTYPE RRProviderType;
|
||||
RESTYPE RRProviderType = 0;
|
||||
|
||||
/*
|
||||
* Initialize provider type error value
|
||||
|
|
Loading…
Reference in New Issue