summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-14 19:05:31 -0300
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-14 19:05:31 -0300
commitf686d1b4fdd11d3d969ff4db21128d7867c9044d (patch)
tree94552564576f7a7435f03adb5406a7b19c29bb36 /src
parentfc722212d297a5141245beb7c8ae396606a8f221 (diff)
Extra MSOC tweaks for the RandR1.2 changes.
The "prototype" computer no longer locks, and only "missing feature" from before the patch is that video and Xaa don't work (only with Exa). For the moment, just force crt as not connected, and set the proper registers to make the secondary output clone the panel.
Diffstat (limited to 'src')
-rw-r--r--src/smi501_crtc.c18
-rw-r--r--src/smi501_output.c10
-rw-r--r--src/smi_501.c5
3 files changed, 29 insertions, 4 deletions
diff --git a/src/smi501_crtc.c b/src/smi501_crtc.c
index 88406c6..87aaec0 100644
--- a/src/smi501_crtc.c
+++ b/src/smi501_crtc.c
@@ -35,6 +35,10 @@ authorization from The XFree86 Project or Silicon Motion.
#include "smi_crtc.h"
#include "smi_501.h"
+/* Want to see register dumps for now */
+#undef VERBLEV
+#define VERBLEV 1
+
static void
SMI501_CrtcVideoInit_lcd(xf86CrtcPtr crtc)
{
@@ -55,9 +59,10 @@ SMI501_CrtcVideoInit_lcd(xf86CrtcPtr crtc)
int pitch = (crtc->rotatedData? crtc->mode.HDisplay : pScrn->displayWidth) * pSmi->Bpp;
pitch = (pitch + 15) & ~15;
+ /* >> 4 because of the "unused bits" that should be set to 0 */
+ /* FIXME this should be used for virtual size? */
mode->panel_fb_width.f.offset = pitch >> 4;
- mode->panel_fb_width.f.width = crtc->mode.HDisplay * pSmi->Bpp >> 4;
-
+ mode->panel_fb_width.f.width = pitch >> 4;
WRITE_SCR(pSmi, PANEL_DISPLAY_CTL, mode->panel_display_ctl.value);
WRITE_SCR(pSmi, PANEL_FB_WIDTH, mode->panel_fb_width.value);
@@ -85,8 +90,10 @@ SMI501_CrtcVideoInit_crt(xf86CrtcPtr crtc)
int pitch = (crtc->rotatedData? crtc->mode.HDisplay : pScrn->displayWidth) * pSmi->Bpp;
pitch = (pitch + 15) & ~15;
+ /* >> 4 because of the "unused bits" that should be set to 0 */
+ /* FIXME this should be used for virtual size? */
mode->crt_fb_width.f.offset = pitch >> 4;
- mode->crt_fb_width.f.width = crtc->mode.HDisplay * pSmi->Bpp >> 4;
+ mode->crt_fb_width.f.width = pitch >> 4;
WRITE_SCR(pSmi, CRT_DISPLAY_CTL, mode->crt_display_ctl.value);
@@ -138,6 +145,11 @@ SMI501_CrtcModeSet_lcd(xf86CrtcPtr crtc,
ENTER();
+ if (pSmi->UseFBDev) {
+ LEAVE();
+ return;
+ }
+
/* Initialize the display controller */
SMI501_CrtcVideoInit_lcd(crtc);
diff --git a/src/smi501_output.c b/src/smi501_output.c
index 8037fd4..a0fd6db 100644
--- a/src/smi501_output.c
+++ b/src/smi501_output.c
@@ -79,6 +79,14 @@ SMI501_OutputDPMS_crt(xf86OutputPtr output, int dpms)
LEAVE();
}
+static xf86OutputStatus
+SMI501_OutputDetect_crt(xf86OutputPtr output)
+{
+ ENTER();
+
+ RETURN(XF86OutputStatusDisconnected);
+}
+
static xf86OutputFuncsRec SMI501_Output0Funcs;
static xf86OutputFuncsRec SMI501_Output1Funcs;
@@ -94,6 +102,7 @@ SMI501_OutputPreInit(ScrnInfoPtr pScrn)
SMI_OutputFuncsInit_base(&SMI501_Output0Funcs);
SMI501_Output0Funcs.dpms=SMI501_OutputDPMS_lcd;
SMI501_Output0Funcs.get_modes=SMI_OutputGetModes_native;
+ SMI501_Output0Funcs.detect = SMI_OutputDetect_lcd;
output0=xf86OutputCreate(pScrn,&SMI501_Output0Funcs,"LVDS");
if(!output0)
@@ -108,6 +117,7 @@ SMI501_OutputPreInit(ScrnInfoPtr pScrn)
SMI_OutputFuncsInit_base(&SMI501_Output1Funcs);
SMI501_Output1Funcs.dpms=SMI501_OutputDPMS_crt;
SMI501_Output1Funcs.get_modes=SMI_OutputGetModes_native;
+ SMI501_Output1Funcs.detect = SMI501_OutputDetect_crt;
output1=xf86OutputCreate(pScrn,&SMI501_Output1Funcs,"VGA");
if(!output1)
diff --git a/src/smi_501.c b/src/smi_501.c
index 8ce6383..7f2bbc5 100644
--- a/src/smi_501.c
+++ b/src/smi_501.c
@@ -210,7 +210,7 @@ SMI501_HWInit(ScrnInfoPtr pScrn)
/* FIXME: No dual head setup, and in this case, crt may
* just be another panel */
/* crt clones panel */
- mode->crt_display_ctl.f.enable = 1;
+ mode->crt_display_ctl.f.enable = 1;
/* 0: select panel - 1: select crt */
mode->crt_display_ctl.f.select = 0;
@@ -311,6 +311,9 @@ SMI501_WriteMode_lcd(ScrnInfoPtr pScrn, MSOCRegPtr mode)
mode->panel_display_ctl.f.fp = 1;
WRITE_SCR(pSmi, PANEL_DISPLAY_CTL, mode->panel_display_ctl.value);
SMI501_WaitVSync(pSmi, 4);
+
+ /* Turn CRT on */
+ SMI501_DisplayPowerManagementSet(pScrn, DPMSModeOn, 0);
}
void