summaryrefslogtreecommitdiff
path: root/src/smilynx_output.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2009-02-04 01:56:20 +0100
committerFrancisco Jerez <currojerez@riseup.net>2009-02-04 01:56:20 +0100
commit4d98e9c6a6e357ed736cd312a957c1e0a7b1d36b (patch)
treedf096d4c470c0e011058c549fd540a93e5a647ae /src/smilynx_output.c
parent1c57cfa814504c33fcad51115d77f2d166fb7903 (diff)
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.
Diffstat (limited to 'src/smilynx_output.c')
-rw-r--r--src/smilynx_output.c36
1 files changed, 18 insertions, 18 deletions
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;
}
}