randr: Add RRHasScanoutPixmap helper function

This is a preparation patch for adding prime hw-cursor support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Hans de Goede 2016-09-06 13:15:36 +02:00
parent a52530a655
commit 2eefb53f58
2 changed files with 25 additions and 0 deletions

View File

@ -725,6 +725,12 @@ extern _X_EXPORT void
extern _X_EXPORT Bool extern _X_EXPORT Bool
RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable); 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 * Crtc dispatch
*/ */

View File

@ -1945,3 +1945,22 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable)
return ret; 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;
}