[PATCH v7 xserver 2/7] randr: Add RRHasScanoutPixmap helper function
Hans de Goede
hdegoede at redhat.com
Thu Sep 8 10:08:16 UTC 2016
This is a preparation patch for adding prime hw-cursor support.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
---
randr/randrstr.h | 6 ++++++
randr/rrcrtc.c | 19 +++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 1baa912..706e9a7 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -726,6 +726,12 @@ extern _X_EXPORT Bool
RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable);
/*
+ * Return if the screen has any scanout_pixmap's attached
+ */
+extern _X_EXPORT Bool
+ RRHasScanoutPixmap(ScreenPtr pScreen);
+
+/*
* Crtc dispatch
*/
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 8fb2bca..7636591 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1945,3 +1945,22 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable)
return ret;
}
+
+Bool
+RRHasScanoutPixmap(ScreenPtr pScreen)
+{
+ rrScrPriv(pScreen);
+ int i;
+
+ if (!pScreen->is_output_slave)
+ return FALSE;
+
+ for (i = 0; i < pScrPriv->numCrtcs; i++) {
+ RRCrtcPtr crtc = pScrPriv->crtcs[i];
+
+ if (crtc->scanout_pixmap)
+ return TRUE;
+ }
+
+ return FALSE;
+}
--
2.9.3
More information about the xorg-devel
mailing list