From 4d98e9c6a6e357ed736cd312a957c1e0a7b1d36b Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 4 Feb 2009 01:56:20 +0100 Subject: Dynamically switch virtual refresh mode. Probably this makes dualhead mode more useful because it makes possible displaying video on the LCD as long as the CRT output is disabled or cloned. --- src/smilynx_output.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/smilynx_output.c') diff --git a/src/smilynx_output.c b/src/smilynx_output.c index aba6db5..fefa8c5 100644 --- a/src/smilynx_output.c +++ b/src/smilynx_output.c @@ -82,17 +82,25 @@ SMILynx_OutputDPMS_lcd(xf86OutputPtr output, int mode) ScrnInfoPtr pScrn = output->scrn; SMIPtr pSmi = SMIPTR(pScrn); SMIRegPtr reg = pSmi->mode; + xf86CrtcConfigPtr crtcConf = XF86_CRTC_CONFIG_PTR(pScrn); ENTER(); switch (mode) { case DPMSModeOn: - if(pSmi->lcd == 2 /* LCD is DSTN */ - || pSmi->Dualhead /* Virtual Refresh is enabled */) + if(pSmi->Dualhead && + output->crtc == crtcConf->crtc[1]){ + /* Virtual Refresh is enabled */ + reg->SR21 &= ~0x10; /* Enable LCD framebuffer read operation and DSTN dithering engine */ - if(pSmi->lcd == 2 /* LCD is DSTN */ - && !pSmi->Dualhead /* Virtual Refresh is disabled */) - reg->SR21 &= ~0x20; /* Enable LCD framebuffer write operation */ + }else{ + if(pSmi->lcd == 2){ + /* LCD is DSTN */ + + reg->SR21 &= ~0x10; /* Enable LCD framebuffer read operation and DSTN dithering engine */ + reg->SR21 &= ~0x20; /* Enable LCD framebuffer write operation */ + } + } reg->SR31 |= 0x01; /* Enable LCD display*/ break; @@ -269,13 +277,10 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) output->interlaceAllowed = FALSE; output->doubleScanAllowed = FALSE; - output->possible_crtcs = 1 << 0; - if(pSmi->Dualhead) - output->possible_clones = 0; - else - output->possible_clones = 1 << 1; + output->possible_crtcs = (1 << 0) | (1 << 1); + output->possible_clones = 1 << 1; - if(!pSmi->useBIOS){ + if(pSmi->Dualhead){ /* Output 1 is CRT */ SMI_OutputFuncsInit_base(&outputFuncs); outputFuncs->dpms = SMILynx_OutputDPMS_crt; @@ -288,13 +293,8 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) output->interlaceAllowed = FALSE; output->doubleScanAllowed = FALSE; - if(pSmi->Dualhead){ - output->possible_crtcs = 1 << 1; - output->possible_clones = 0; - }else{ - output->possible_crtcs = 1 << 0; - output->possible_clones = 1 << 0; - } + output->possible_crtcs = 1 << 0; + output->possible_clones = 1 << 0; } } -- cgit v1.2.3