summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorŁukasz Spintzyk <lukasz.spintzyk@synaptics.com>2020-09-18 14:31:34 +0200
committerPovilas Kanapickas <povilas@radix.lt>2021-04-16 10:53:43 +0000
commitd2dce22b6775c772282ac2c0e224ef9685ab34fa (patch)
tree5bc4868e4ac0a8977a2727c234e7c8ec0e18d016 /randr
parent908deb0895f9fe345d70be933d251ea10511d30a (diff)
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>
Diffstat (limited to 'randr')
-rw-r--r--randr/randrstr.h5
-rw-r--r--randr/rrcrtc.c43
-rw-r--r--randr/rrprovider.c2
3 files changed, 48 insertions, 2 deletions
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 44076f496..8f427a48e 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -643,6 +643,11 @@ extern _X_EXPORT void
extern _X_EXPORT RRCrtcPtr RRCrtcCreate(ScreenPtr pScreen, void *devPrivate);
/*
+ * Tests if findCrtc belongs to pScreen or secondary screens
+ */
+extern _X_EXPORT Bool RRCrtcExists(ScreenPtr pScreen, RRCrtcPtr findCrtc);
+
+/*
* Set the allowed rotations on a CRTC
*/
extern _X_EXPORT void
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index c8626b982..3a9b620ab 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -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 secondary= NULL;
+
+ if (RRCrtcInScreen(pScreen, findCrtc))
+ return TRUE;
+
+ xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
+ if (!secondary->is_output_secondary)
+ continue;
+ if (RRCrtcInScreen(secondary, 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
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index 617185cf7..d628a20d4 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -28,7 +28,7 @@
#include <X11/Xatom.h>
-RESTYPE RRProviderType;
+RESTYPE RRProviderType = 0;
/*
* Initialize provider type error value