diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-13 19:44:14 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-13 19:44:14 -0200 |
commit | 6b6da04d566ec5b9d723c9f28791c604f76526dd (patch) | |
tree | 132ae0934bf8474eba4dab40934f7ab559af258b | |
parent | d2709b1af22a06b24606ec8c01f39f1ca27ca8d3 (diff) |
Changed to use panel plane tl and tr to center modes smaller then panel size.
The code is under "<hash>ifdef USE_PANEL_CENTER", as it is buggy, and
regardless of value set to right and bottom, it will crop from 0 to
mode-width/mode-height, and then display a lot of screen artifacts, due
to improper programming. Either way, the CRT in clone mode will display
correctly.
-rw-r--r-- | src/smi501_crtc.c | 12 | ||||
-rw-r--r-- | src/smi_output.c | 13 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/smi501_crtc.c b/src/smi501_crtc.c index b827eed..54152fc 100644 --- a/src/smi501_crtc.c +++ b/src/smi501_crtc.c @@ -218,11 +218,21 @@ SMI501_CrtcModeSet_lcd(xf86CrtcPtr crtc, mode->panel_wheight.f.y = 0; mode->panel_wheight.f.height = xf86mode->VDisplay; - mode->panel_plane_tl.f.top = 0; +#ifdef USE_PANEL_CENTER + mode->panel_plane_tl.f.left = (pSmi->lcdWidth - xf86mode->HDisplay) >> 1; + mode->panel_plane_tl.f.top = (pSmi->lcdHeight - xf86mode->VDisplay) >> 1; + + mode->panel_plane_br.f.right = mode->panel_plane_tl.f.left + + xf86mode->HDisplay - 1; + mode->panel_plane_br.f.bottom = mode->panel_plane_tl.f.top + + xf86mode->VDisplay - 1; +#else mode->panel_plane_tl.f.left = 0; + mode->panel_plane_tl.f.top = 0; mode->panel_plane_br.f.right = xf86mode->HDisplay - 1; mode->panel_plane_br.f.bottom = xf86mode->VDisplay - 1; +#endif /* 0 means pulse high */ mode->panel_display_ctl.f.hsync = !(xf86mode->Flags & V_PHSYNC); diff --git a/src/smi_output.c b/src/smi_output.c index b26530c..f07f64e 100644 --- a/src/smi_output.c +++ b/src/smi_output.c @@ -51,11 +51,16 @@ SMI_OutputModeValid(xf86OutputPtr output, DisplayModePtr mode) ENTER(); - /* FIXME LVDS currently have fixed height. But allow external crtc to - * have a smaller or larger size, even if only one monitor section - * exists in xorg.conf. */ + /* FIXME May also need to test for IS_MSOC(pSmi) here. + * Only accept modes matching the panel size because the panel cannot + * be centered neither shrinked/expanded due to hardware bugs. + * Note that as long as plane tr/br and plane window x/y are set to 0 + * and the mode height matches the panel height, it will work and + * set the mode, but at offset 0, and properly program the crt. + * But use panel dimensions so that "full screen" programs will do + * their own centering. */ if (output->name && strcmp(output->name, "LVDS") == 0 && - (mode->HDisplay > pSmi->lcdWidth || mode->VDisplay != pSmi->lcdHeight)) + (mode->HDisplay != pSmi->lcdWidth || mode->VDisplay != pSmi->lcdHeight)) RETURN(MODE_PANEL); if (!(((mode->HDisplay == 1280) && (mode->VDisplay == 1024)) || |