From 2eefb53f58854ef9d34859583207ec37d3c3047a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 6 Sep 2016 13:15:36 +0200 Subject: [PATCH] randr: Add RRHasScanoutPixmap helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a preparation patch for adding prime hw-cursor support. Signed-off-by: Hans de Goede Reviewed-by: Michel Dänzer --- randr/randrstr.h | 6 ++++++ randr/rrcrtc.c | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/randr/randrstr.h b/randr/randrstr.h index 1baa91226e..706e9a7b03 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -725,6 +725,12 @@ extern _X_EXPORT void 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 8fb2bca8aa..76365919ad 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; +}