From 4820caf46e050761d9b347b8a440381e1b1f4727 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 21 Sep 2006 01:47:27 -0700 Subject: Make planeEnabled track pipes controlled by randr. Also add code to deal with disabling pipes. --- src/i830_randr.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/i830_randr.c') diff --git a/src/i830_randr.c b/src/i830_randr.c index 4132eb2e..7c67aea2 100644 --- a/src/i830_randr.c +++ b/src/i830_randr.c @@ -548,7 +548,7 @@ I830RandRCrtcSet (ScreenPtr pScreen, ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; I830Ptr pI830 = I830PTR(pScrn); int pipe = (int) (crtc->devPrivate); - DisplayModePtr display_mode = mode->devPrivate; + DisplayModePtr display_mode = mode ? mode->devPrivate : NULL; /* Sync the engine before adjust mode */ if (pI830->AccelInfoRec && pI830->AccelInfoRec->NeedToSync) { @@ -558,8 +558,24 @@ I830RandRCrtcSet (ScreenPtr pScreen, if (display_mode != randrp->modes[pipe]) { - if (!i830PipeSetMode (pScrn, display_mode, pipe)) - return FALSE; + pI830->planeEnabled[pipe] = mode != NULL; + if (display_mode) + { + if (!i830PipeSetMode (pScrn, display_mode, pipe)) + return FALSE; + /* XXX need I830SDVOPostSetMode here */ + } + else + { + CARD32 operatingDevices = pI830->operatingDevices; + + if (pipe == 0) + pI830->operatingDevices &= ~0xff; + else + pI830->operatingDevices &= ~0xff00; + i830DisableUnusedFunctions (pScrn); + pI830->operatingDevices = operatingDevices; + } randrp->modes[pipe] = display_mode; } i830PipeSetBase(pScrn, pipe, x, y); -- cgit v1.2.3