summaryrefslogtreecommitdiff
path: root/src/smi501_crtc.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-13 19:44:14 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-13 19:44:14 -0200
commit6b6da04d566ec5b9d723c9f28791c604f76526dd (patch)
tree132ae0934bf8474eba4dab40934f7ab559af258b /src/smi501_crtc.c
parentd2709b1af22a06b24606ec8c01f39f1ca27ca8d3 (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.
Diffstat (limited to 'src/smi501_crtc.c')
-rw-r--r--src/smi501_crtc.c12
1 files changed, 11 insertions, 1 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);