diff options
Diffstat (limited to 'randr/rrcrtc.c')
-rw-r--r-- | randr/rrcrtc.c | 43 |
1 files changed, 42 insertions, 1 deletions
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 |