summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/smi501_crtc.c12
-rw-r--r--src/smi_output.c13
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)) ||