diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-10-24 17:55:02 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-10-24 17:55:02 -0200 |
commit | f2c83671cccc42345bfc9b506365936bbb6b9ef0 (patch) | |
tree | 07e6bf7e71c5aa909201ee75bee483451763439b /src/smi501_crtc.c | |
parent | 1efe36ed5cf5b0931daa915ca3ce231b78168d87 (diff) |
Make Dualhead option functional.
Slightly change clock selection code to start using 501 compatible values,
before checking 502 values, if it is a 502.
DPMS for the VGA/second output was being set with bits inverted, that is
dpms-on was programmed as dpms-off and vice versa. This was one of the
reasons of dual head not working.
Corrected wrong vsync programming for the crt. Cut&paste/typo caused
programming vsync with hsync values, and thus, never getting the crt
to accept the mode being programmed.
If adding:
Option "Dualhead" "True"
to xorg.conf, now you should be able to do things like:
$ DISPLAY=:0.0 xrandr --output VGA --right-of LVDS
$ DISPLAY=:0.0 xrandr --output VGA --below LVDS
and so on.
*Iff* there is some way to not have any limitations for video playback,
this option should be made default or automatically configured.
Diffstat (limited to 'src/smi501_crtc.c')
-rw-r--r-- | src/smi501_crtc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/smi501_crtc.c b/src/smi501_crtc.c index 07a96ed..589b088 100644 --- a/src/smi501_crtc.c +++ b/src/smi501_crtc.c @@ -59,7 +59,7 @@ SMI501_CrtcVideoInit_lcd(xf86CrtcPtr crtc) pitch = (((crtc->rotatedData? crtc->mode.HDisplay : pScrn->displayWidth) * pSmi->Bpp) + 15) & ~15; - width = crtc->mode.HDisplay * pSmi->Bpp; + width = ((crtc->mode.HDisplay * pSmi->Bpp) + 15) & ~ 15; /* >> 4 because of the "unused bits" that should be set to 0 */ mode->panel_fb_width.f.offset = pitch >> 4; @@ -91,7 +91,7 @@ SMI501_CrtcVideoInit_crt(xf86CrtcPtr crtc) pitch = (((crtc->rotatedData? crtc->mode.HDisplay : pScrn->displayWidth) * pSmi->Bpp) + 15) & ~15; - width = crtc->mode.HDisplay * pSmi->Bpp; + width = ((crtc->mode.HDisplay * pSmi->Bpp) + 15) & ~ 15; /* >> 4 because of the "unused bits" that should be set to 0 */ mode->crt_fb_width.f.offset = pitch >> 4; @@ -131,6 +131,7 @@ SMI501_CrtcAdjustFrame(xf86CrtcPtr crtc, int x, int y) mode->crt_display_ctl.f.pixel = ((x * pSmi->Bpp) & 15) / pSmi->Bpp; WRITE_SCR(pSmi, CRT_DISPLAY_CTL, mode->crt_display_ctl.value); mode->crt_fb_address.f.address = Base >> 4; + mode->crt_fb_address.f.mselect = 0; mode->crt_fb_address.f.pending = 1; WRITE_SCR(pSmi, CRT_FB_ADDRESS, mode->crt_fb_address.value); } @@ -225,7 +226,7 @@ SMI501_CrtcModeSet_lcd(xf86CrtcPtr crtc, mode->panel_htotal.f.total = xf86mode->HTotal - 1; mode->panel_htotal.f.end = xf86mode->HDisplay - 1; - mode->panel_hsync.f.start = xf86mode->HSyncStart; + mode->panel_hsync.f.start = xf86mode->HSyncStart - 1; mode->panel_hsync.f.width = xf86mode->HSyncEnd - xf86mode->HSyncStart; @@ -288,16 +289,16 @@ SMI501_CrtcModeSet_crt(xf86CrtcPtr crtc, mode->crt_htotal.f.total = xf86mode->HTotal - 1; mode->crt_htotal.f.end = xf86mode->HDisplay - 1; - mode->crt_hsync.f.start = xf86mode->HSyncStart; + mode->crt_hsync.f.start = xf86mode->HSyncStart - 1; mode->crt_hsync.f.width = xf86mode->HSyncEnd - xf86mode->HSyncStart; mode->crt_vtotal.f.total = xf86mode->VTotal - 1; mode->crt_vtotal.f.end = xf86mode->VDisplay - 1; - mode->crt_vsync.f.start = xf86mode->HSyncStart; - mode->crt_vsync.f.height = xf86mode->HSyncEnd - - xf86mode->HSyncStart; + mode->crt_vsync.f.start = xf86mode->VSyncStart; + mode->crt_vsync.f.height = xf86mode->VSyncEnd - + xf86mode->VSyncStart; SMI501_WriteMode_crt(pScrn,mode); SMI501_CrtcAdjustFrame(crtc, x, y); |