[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-siliconmotion: Changes to 'upstream-unstable'



 README                |   78 +++++-----------------------------
 configure.ac          |    2 
 man/siliconmotion.man |    8 +--
 src/smi.h             |    2 
 src/smi_501.h         |    2 
 src/smi_driver.c      |   13 +++--
 src/smi_video.c       |   12 ++---
 src/smilynx_crtc.c    |  112 +++++++++++++++++++++++++++++++-------------------
 src/smilynx_hw.c      |   12 -----
 src/smilynx_output.c  |   42 +++++++++---------
 10 files changed, 128 insertions(+), 155 deletions(-)

New commits:
commit 00921b014fa0b5358c22a769cf2450cbd4bdc8a5
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Apr 28 22:24:03 2009 +0200

    Bump version to 1.7.1.

diff --git a/configure.ac b/configure.ac
index 5ec0679..da129c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-siliconmotion],
-        1.7.0,
+        1.7.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-siliconmotion)
 

commit abf1ba79f2bfe61f24cfa43deb0400d7c5f95bd5
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Apr 21 21:37:45 2009 +0200

    Increase the maximum clock value to 200MHz on SM712.
    
    The default MCLK setting was higher than the clock limit, and it
    failed.

diff --git a/src/smi_driver.c b/src/smi_driver.c
index ac1a952..7219612 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -918,8 +918,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
     pSmi->clockRange.next = NULL;
     pSmi->clockRange.minClock = 20000;
 
-    if (pSmi->Chipset == SMI_LYNX3DM ||
-	pSmi->Chipset == SMI_COUGAR3DR ||
+    if (SMI_LYNXM_SERIES(pSmi->Chipset) ||
 	IS_MSOC(pSmi))
 	pSmi->clockRange.maxClock = 200000;
     else

commit 41e5c49024d4e27a7be3da02017000a22b59016f
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Apr 21 21:36:10 2009 +0200

    Don't attempt monitor detection on SM712.
    
    The databook says nothing about it, and it doesn't work.

diff --git a/src/smilynx_output.c b/src/smilynx_output.c
index 6f34c3f..5ac0bbd 100644
--- a/src/smilynx_output.c
+++ b/src/smilynx_output.c
@@ -285,7 +285,9 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn)
 	    SMI_OutputFuncsInit_base(&outputFuncs);
 	    outputFuncs->dpms = SMILynx_OutputDPMS_crt;
 	    outputFuncs->get_modes = SMILynx_OutputGetModes_crt;
-	    outputFuncs->detect = SMILynx_OutputDetect_crt;
+
+	    if(pSmi->Chipset == SMI_LYNX3DM)
+		outputFuncs->detect = SMILynx_OutputDetect_crt;
 
 	    if(! (output = xf86OutputCreate(pScrn,outputFuncs,"VGA")))
 		LEAVE(FALSE);

commit 6691678b5f04d52a1e08f9eaa6d511df9b7eeb4d
Author: Jamie Lentin <jm@lentin.co.uk>
Date:   Thu Mar 19 21:54:12 2009 +0000

    Stop clearing of "VESA compliance power down mode" bit
    
    Clearing this bit causes an OQO 01+ w/SMI720 to power down the LCD,
    leave it alone.
    
    Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
    Signed-off-by: Francisco Jerez <currojerez@riseup.net>

diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c
index 158e20f..019261d 100644
--- a/src/smilynx_hw.c
+++ b/src/smilynx_hw.c
@@ -80,9 +80,6 @@ SMILynx_HWInit(ScrnInfoPtr pScrn)
 	/* Set DPMS state to Off */
 	mode->SR22 |= 0x30;
 
-	/* VESA compliance power down mode */
-	mode->SR24 &= ~0x01;
-
 	if (pSmi->Chipset != SMI_COUGAR3DR) {
 	    /* Select no displays */
 	    mode->SR31 &= ~0x07;
@@ -127,7 +124,6 @@ SMILynx_HWInit(ScrnInfoPtr pScrn)
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20, mode->SR20);
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, mode->SR21);
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22, mode->SR22);
-    VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x24, mode->SR24);
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, mode->SR31);
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32, mode->SR32);
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34, mode->SR34);

commit 05480382c508bd27c1755405518ce9c339f0f80e
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date:   Fri Mar 13 21:19:16 2009 +0100

    Fix direct access to IO space on chipsets with no IOBase mapping.
    
    Signed-off-by: Francisco Jerez <currojerez@riseup.net>

diff --git a/src/smilynx_output.c b/src/smilynx_output.c
index fefa8c5..6f34c3f 100644
--- a/src/smilynx_output.c
+++ b/src/smilynx_output.c
@@ -220,7 +220,7 @@ SMILynx_OutputDetect_crt(xf86OutputPtr output)
     while (!(hwp->readST01(hwp) & 0x8)) ;
     while (hwp->readST01(hwp) & 0x8) ;
 
-    status = MMIO_IN8(pSmi->IOBase, 0x3C2) & 0x10;
+    status = VGAIN8(pSmi, 0x3C2) & 0x10;
 
     /* Restore previous state */
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, mode->SR21);

commit e62807140ede74e262ed70c846017dc3506b511e
Author: Niels de Vos <niels.devos@wincor-nixdorf.com>
Date:   Wed Feb 11 10:10:13 2009 +0100

    siliconmotion: Fix disabling of debugging if SMI501_CLI_DEBUG is set to 0
    
    Due to checking if SMI501_CLI_DEBUG is defined, some debugging will
    be enabled if SMI501_CLI_DEBUG is set to 0. A single #if should be
    used instead. Some debugging code already does this.
    
    Signed-off-by: Niels de Vos <niels.devos@wincor-nixdorf.com>
    Signed-off-by: Francisco Jerez <currojerez@riseup.net>

diff --git a/src/smi.h b/src/smi.h
index ebd8a66..e682dfa 100644
--- a/src/smi.h
+++ b/src/smi.h
@@ -264,7 +264,7 @@ typedef struct
 					   structure */
     void (*BlockHandler)(int i, pointer blockData, pointer pTimeout,
 					 pointer pReadMask);
-#ifdef SMI501_CLI_DEBUG
+#if SMI501_CLI_DEBUG
     /* SMI 501/502 Command List Interpreter */
     Bool		 batch_active;
     int64_t		*batch_handle;	/* Virtual address */
diff --git a/src/smi_501.h b/src/smi_501.h
index c19721b..10bcf6c 100644
--- a/src/smi_501.h
+++ b/src/smi_501.h
@@ -1333,7 +1333,7 @@ typedef union smi_cli_entry {
 } smi_cli_entry_t;
 
 
-#ifdef SMI501_CLI_DEBUG
+#if SMI501_CLI_DEBUG
 
 /* ensure there are "count" command list "slots" 8 bytes wide free */
 #define BATCH_BEGIN(COUNT)						\
diff --git a/src/smi_driver.c b/src/smi_driver.c
index d417ff7..ac1a952 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1539,7 +1539,7 @@ SMI_MapMem(ScrnInfoPtr pScrn)
 	pSmi->FBReserved = pSmi->FBCursorOffset = pSmi->videoRAMBytes -
 	    (pSmi->Dualhead ? SMI501_CURSOR_SIZE << 1 : SMI501_CURSOR_SIZE);
 
-# ifdef SMI501_CLI_DEBUG
+# if SMI501_CLI_DEBUG
 	if (pSmi->useEXA) {
 	    pSmi->batch_active = FALSE;
 	    pSmi->batch_length = 4096;

commit 0b34c4a29fcf45ac24361b4691cca0fd99cc3a3f
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Wed Feb 4 03:49:08 2009 +0100

    Wait for vertical retrace before writing registers at SMILynx_CrtcDPMS_*

diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c
index 72e0db2..a8c0a03 100644
--- a/src/smilynx_crtc.c
+++ b/src/smilynx_crtc.c
@@ -866,12 +866,12 @@ SMILynx_CrtcDPMS_crt(xf86CrtcPtr crtc, int mode)
     else
 	reg->SR21 &= ~0x88; /* Enable DAC and color palette RAM */
 
-    VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, reg->SR21);
-
     /* Wait for vertical retrace */
     while (hwp->readST01(hwp) & 0x8) ;
     while (!(hwp->readST01(hwp) & 0x8)) ;
 
+    VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, reg->SR21);
+
     if(mode == DPMSModeOn){
 	/* Reload the LUT */
 	SMILynx_CrtcLoadLUT_crt(crtc);
@@ -895,12 +895,12 @@ SMILynx_CrtcDPMS_lcd(xf86CrtcPtr crtc, int mode)
     else
 	reg->SR31 |= 0x80; /* Enable Virtual Refresh */
 
-    VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, reg->SR31);
-
     /* Wait for vertical retrace */
     while (hwp->readST01(hwp) & 0x8) ;
     while (!(hwp->readST01(hwp) & 0x8)) ;
 
+    VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, reg->SR31);
+
     LEAVE();
 }
 

commit 1d46cca27b0d38d5355b5f93dd0ed0fe4f250d3f
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Feb 3 22:15:45 2009 +0100

    Drop the outdated configuration options documentation in README.

diff --git a/README b/README
index 28727d7..282d6a4 100644
--- a/README
+++ b/README
@@ -20,80 +20,3 @@ For more information on the git code manager, see:
         http://wiki.x.org/wiki/GitPage
 
 ----------------------------------------------------------------------------
-
-What works:
-- Supports 8bpp, 16bpp and 24bpp. Heavy testing on SM720.
-
-XCONFIG options:
-
-The driver supports quite a few different XConfig options, which can
-be used to tune the driver and improve performance. Without any options,
-the driver will use conservative settings which should work on most
-hardware. Large improvements in performance are possible by selecting
-the proper options, which will probably work on most systems.
-
-Cursor:
-
-- "hwcursor" "off" behaves exactly like "swcursor".  Default: "on"
-- "swcursor" will disable the HW Cursor.  HW Cursor is used by default and
-	no option is needed to enable it.
-
-Display:
-
-- "ShadowFB"  Use shadow framebuffer.  Default: off.
-- "Rotate" "cw" | "ccw"  Rotate the screen CW - clockwise or CCW - counter
-    clockwise.  Uses ShadowFB.  Default: no rotation.
-- "UseBIOS"  Use BIOS to set modes.  Default: on.
-- "ZoomOnLCD"  Allow changing resolution on panel.  Default: off.
-
-Overlays:
-
-- "VideoKey"  Set chroma key for video.  Default:  Off blue.
-- "ByteSwap"  Turn on YUV byte swapping.  Defaul: off.
-
-Video memory:
-
-- "set_mclk" sets the memory clock, format is:
-	Option "set_mclk" "50000"
-	in the XF86Config file.  Valid values are any
-	integer <= 100000, where 100000 == 100 MHz.
-
-Acceleration and graphic engine:
-
-- "NoAccel" turns off all acceleration
-- "fifo_aggressive", "fifo_moderate" and "fifo_conservative" alter the settings
-	for the threshold at which the pixel FIFO takes over the internal
-	memory bus to refill itself. The smaller this threshold, the better
-	the acceleration performance of the card. You may try the fastest
-	setting ("aggressive") and move down if you encounter pixel corruption.
-	The optimal setting will probably depend on dot-clock and on color
-	depth. Note that specifying any of these options will also alter other
-	memory settings which should increase performance, so you should at
-        least use "fifo_conservative" (this uses the chip defaults).
-- Common XAA acceleration options to disable primitives for test purposes:
-	"XaaNoScreenToScreenCopy"
-	"XaaNoSolidFillRect"
-	"XaaNoColor8x8PatternFillRect"
-	"XaaNoImageWriteRect"
-	"XaaNoPixmapCache"
-
-PCI bus:
-
-- "pci_burst" will enable PCI burst mode. This should work on all but a
-	few "broken" PCI chipsets, and will increase performance.  Option may
-	take a parameter "on", "off", "yes", etc...
-- "pci_retry" will allow the driver to rely on PCI Retry to program the
-	ViRGE registers. "pci_burst" must be enabled for this to work.
-	This will increase performance, especially for small fills/blits,
-        because the driver does not have to poll the ViRGE before sending it
-        commands to make sure it is ready. It should work on most
-        recent PCI chipsets.
-
-Debug:
-
-- "ShowCache"  Enable or disable viewing offscreen cache memory.  A
-    development debug option.  Default: off.
-
-Header:   //Mercury/Projects/archives/XFree86/4.0/README.-arc   1.2   14 Sep 2000 12:28:36   Frido  $
-
-$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.3 2001/02/15 18:20:33 dawes Exp $

commit 64f722c3121a8f28cfc5b532ddec0ac83095ac95
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Feb 3 22:17:33 2009 +0100

    Minor corrections at the man page.

diff --git a/man/siliconmotion.man b/man/siliconmotion.man
index e59d785..2c524f8 100644
--- a/man/siliconmotion.man
+++ b/man/siliconmotion.man
@@ -106,12 +106,12 @@ Turn on interlaced video capturing.  Default: off.
 .TP
 .BI "Option \*qUseBIOS\*q \*q" boolean \*q
 Use the BIOS to set the modes. This is used for custom panel timings.
-Default: on.
+Default: off for SM72x and SM5xx, otherwise on.
 .TP
 .BI "Option \*qDualhead\*q \*q" boolean \*q
 Enable dualhead mode.
-Currently not all chips are supported and on lynx chipsets hardware video
-overlay (XV) will only work on the secondary VGA output.
+Currently not all chips are supported and hardware video
+overlay (XV) support may have some limitations.
 Default: off.
 .TP
 .BI "Option \*qPanelSize\*q \*q" width x height \*q

commit 94d9c659b71c84db46fa279d9d8736e1589e155c
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Feb 3 22:18:14 2009 +0100

    Set dualhead to on by default on SM72x chipsets.

diff --git a/src/smi_driver.c b/src/smi_driver.c
index 28cecf3..d417ff7 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -792,9 +792,13 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 		   	  pSmi->PciInfo->func);
 #endif
 
-    pSmi->Dualhead = FALSE;
-
     from = X_DEFAULT;
+    if(pSmi->Chipset == SMI_LYNX3DM &&
+       pScrn->bitsPerPixel == 16)
+	pSmi->Dualhead = TRUE;
+    else
+	pSmi->Dualhead = FALSE;
+
     if (xf86GetOptValBool(pSmi->Options, OPTION_DUALHEAD, &pSmi->Dualhead))
 	from = X_CONFIG;
 

commit 4d98e9c6a6e357ed736cd312a957c1e0a7b1d36b
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Wed Feb 4 01:56:20 2009 +0100

    Dynamically switch virtual refresh mode.
    
    Probably this makes dualhead mode more useful because it makes
    possible displaying video on the LCD as long as the CRT output is
    disabled or cloned.

diff --git a/src/smi_video.c b/src/smi_video.c
index 3ae30f4..9bf0e1b 100644
--- a/src/smi_video.c
+++ b/src/smi_video.c
@@ -1057,10 +1057,10 @@ SMI_PutVideo(
     dstBox.x2 = drw_x + drw_w;
     dstBox.y2 = drw_y + drw_h;
 
-    if(!xf86_crtc_clip_video_helper(pScrn, &crtc, NULL, &dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height))
+    if(!xf86_crtc_clip_video_helper(pScrn, &crtc, crtcConf->crtc[0], &dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height))
 	LEAVE(Success);
 
-    if(pSmi->Dualhead && crtc == crtcConf->crtc[0])
+    if(pSmi->Dualhead && crtc == crtcConf->crtc[1])
 	LEAVE(Success);
 
     /* Transform dstBox to the CRTC coordinates */
@@ -1516,7 +1516,7 @@ SMI_PutImage(
 	    LEAVE(Success);
     }
     else {
-	if (!xf86_crtc_clip_video_helper(pScrn, &crtc, NULL, &dstBox,
+	if (!xf86_crtc_clip_video_helper(pScrn, &crtc, crtcConf->crtc[0], &dstBox,
 					 &x1, &x2, &y1, &y2, clipBoxes,
 					 width, height))
 	    LEAVE(Success);
@@ -1629,7 +1629,7 @@ SMI_PutImage(
 				 drw_w, drw_h);
     }
     else{
-	if(!pSmi->Dualhead || crtc == crtcConf->crtc[1])
+	if(crtc == crtcConf->crtc[0])
 	    SMI_DisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2,
 			     &dstBox, src_w, src_h, drw_w, drw_h);
     }
@@ -2461,7 +2461,7 @@ SMI_DisplaySurface(
     dstBox.y1 = drw_y;
     dstBox.y2 = drw_y + drw_h;
 
-    if(!xf86_crtc_clip_video_helper(surface->pScrn, &crtc, NULL, &dstBox,
+    if(!xf86_crtc_clip_video_helper(surface->pScrn, &crtc, crtcConf->crtc[0], &dstBox,
 				    &x1, &x2, &y1, &y2, clipBoxes, surface->width, surface->height))
 	LEAVE(Success);
 
@@ -2485,7 +2485,7 @@ SMI_DisplaySurface(
 			     surface->height, surface->pitches[0], x1, y1,
 			     x2, y2, &dstBox, vid_w, vid_h, drw_w, drw_h);
     else{
-	if(!pSmi->Dualhead || crtc == crtcConf->crtc[1])
+	if(crtc == crtcConf->crtc[0])
 	    SMI_DisplayVideo(surface->pScrn, surface->id, surface->offsets[0],
 			     surface->width, surface->height, surface->pitches[0], x1, y1, x2,
 			     y2, &dstBox, vid_w, vid_h, drw_w, drw_h);
diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c
index e5963ff..72e0db2 100644
--- a/src/smilynx_crtc.c
+++ b/src/smilynx_crtc.c
@@ -194,7 +194,7 @@ SMILynx_CrtcAdjustFrame(xf86CrtcPtr crtc, int x, int y)
 	WRITE_VPR(pSmi, 0x0C, Base);
 	WRITE_FPR(pSmi, FPR0C, Base);
     }else{
-	if(pSmi->Dualhead && crtc == crtcConf->crtc[0]){
+	if(pSmi->Dualhead && crtc == crtcConf->crtc[1]){
 	    /* LCD */
 
 	    /* FIFO1 read start address */
@@ -857,6 +857,7 @@ SMILynx_CrtcDPMS_crt(xf86CrtcPtr crtc, int mode)
     ScrnInfoPtr pScrn = crtc->scrn;
     SMIPtr pSmi = SMIPTR(pScrn);
     SMIRegPtr reg = pSmi->mode;
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
 
     ENTER();
 
@@ -867,6 +868,39 @@ SMILynx_CrtcDPMS_crt(xf86CrtcPtr crtc, int mode)
 
     VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, reg->SR21);
 
+    /* Wait for vertical retrace */
+    while (hwp->readST01(hwp) & 0x8) ;
+    while (!(hwp->readST01(hwp) & 0x8)) ;
+
+    if(mode == DPMSModeOn){
+	/* Reload the LUT */
+	SMILynx_CrtcLoadLUT_crt(crtc);
+    }
+
+    LEAVE();
+}
+
+static void
+SMILynx_CrtcDPMS_lcd(xf86CrtcPtr crtc, int mode)
+{
+    ScrnInfoPtr pScrn = crtc->scrn;
+    SMIPtr pSmi = SMIPTR(pScrn);
+    SMIRegPtr reg = pSmi->mode;
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+    ENTER();
+
+    if(mode == DPMSModeOff)
+	reg->SR31 &= ~0x80; /* Disable Virtual Refresh */
+    else
+	reg->SR31 |= 0x80; /* Enable Virtual Refresh */
+
+    VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, reg->SR31);
+
+    /* Wait for vertical retrace */
+    while (hwp->readST01(hwp) & 0x8) ;
+    while (!(hwp->readST01(hwp) & 0x8)) ;
+
     LEAVE();
 }
 
@@ -912,56 +946,52 @@ SMILynx_CrtcPreInit(ScrnInfoPtr pScrn)
 	    LEAVE(FALSE);
 	crtc->driver_private = crtcPriv;
     }else{
-	if(pSmi->Dualhead){
-	    /* CRTC is LCD*/
-	    SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
-	    crtcFuncs->mode_set = SMILynx_CrtcModeSet_lcd;
-	    crtcFuncs->mode_fixup = SMILynx_CrtcModeFixup;
-	    crtcPriv->adjust_frame = SMILynx_CrtcAdjustFrame;
-	    crtcPriv->video_init = SMILynx_CrtcVideoInit_lcd;
-	    crtcPriv->load_lut = SMILynx_CrtcLoadLUT_lcd;
-
-	    if(! (crtc = xf86CrtcCreate(pScrn,crtcFuncs)))
-		LEAVE(FALSE);
-	    crtc->driver_private = crtcPriv;
+	/* CRTC0 can drive both outputs when virtual refresh is
+	   disabled, and only the VGA output with virtual refresh
+	   enabled. */
+	SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
 
-	    /* CRTC1 is CRT */
-	    SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
+	if(pSmi->useBIOS){
+	    crtcFuncs->mode_set = SMILynx_CrtcModeSet_bios;
+	}else{
 	    crtcFuncs->dpms = SMILynx_CrtcDPMS_crt;
-	    crtcFuncs->mode_set = SMILynx_CrtcModeSet_crt;
-	    crtcFuncs->mode_fixup = SMILynx_CrtcModeFixup;
-	    crtcPriv->adjust_frame = SMILynx_CrtcAdjustFrame;
-	    crtcPriv->video_init = SMILynx_CrtcVideoInit_crt;
-	    crtcPriv->load_lut = SMILynx_CrtcLoadLUT_crt;
 
-	    if(! (crtc = xf86CrtcCreate(pScrn,crtcFuncs)))
-		LEAVE(FALSE);
-	    crtc->driver_private = crtcPriv;
+	    if(pSmi->Dualhead){
+		/* The standard VGA CRTC registers get locked in
+		   virtual refresh mode. */
+		crtcFuncs->mode_set = SMILynx_CrtcModeSet_crt;
 
-	}else{
-	    /* CRTC0 is LCD, but in standard refresh mode
-	       it is controlled through the primary VGA registers */
-	    SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
-
-	    if(pSmi->useBIOS){
-		crtcFuncs->mode_set = SMILynx_CrtcModeSet_bios;
 	    }else{
-		crtcFuncs->dpms = SMILynx_CrtcDPMS_crt;
 		crtcFuncs->mode_set = SMILynx_CrtcModeSet_vga;
 	    }
+	}
+
+	crtcFuncs->mode_fixup = SMILynx_CrtcModeFixup;
+	crtcPriv->adjust_frame = SMILynx_CrtcAdjustFrame;
+	crtcPriv->video_init = SMILynx_CrtcVideoInit_crt;
+	crtcPriv->load_lut = SMILynx_CrtcLoadLUT_crt;
+
+	if(pSmi->HwCursor){
+	    crtcFuncs->set_cursor_colors = SMILynx_CrtcSetCursorColors_crt;
+	    crtcFuncs->set_cursor_position = SMILynx_CrtcSetCursorPosition_crt;
+	    crtcFuncs->show_cursor = SMILynx_CrtcShowCursor_crt;
+	    crtcFuncs->hide_cursor = SMILynx_CrtcHideCursor_crt;
+	    crtcFuncs->load_cursor_image = SMILynx_CrtcLoadCursorImage_crt;
+	}
 
+	if(! (crtc = xf86CrtcCreate(pScrn,crtcFuncs)))
+	    LEAVE(FALSE);
+	crtc->driver_private = crtcPriv;
+
+	if(pSmi->Dualhead){
+	    /* CRTC1 drives LCD when enabled. */
+	    SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
+	    crtcFuncs->mode_set = SMILynx_CrtcModeSet_lcd;
 	    crtcFuncs->mode_fixup = SMILynx_CrtcModeFixup;
+	    crtcFuncs->dpms = SMILynx_CrtcDPMS_lcd;
 	    crtcPriv->adjust_frame = SMILynx_CrtcAdjustFrame;
-	    crtcPriv->video_init = SMILynx_CrtcVideoInit_crt;
-	    crtcPriv->load_lut = SMILynx_CrtcLoadLUT_crt;
-
-	    if(pSmi->HwCursor){
-		crtcFuncs->set_cursor_colors = SMILynx_CrtcSetCursorColors_crt;
-		crtcFuncs->set_cursor_position = SMILynx_CrtcSetCursorPosition_crt;
-		crtcFuncs->show_cursor = SMILynx_CrtcShowCursor_crt;
-		crtcFuncs->hide_cursor = SMILynx_CrtcHideCursor_crt;
-		crtcFuncs->load_cursor_image = SMILynx_CrtcLoadCursorImage_crt;
-	    }
+	    crtcPriv->video_init = SMILynx_CrtcVideoInit_lcd;
+	    crtcPriv->load_lut = SMILynx_CrtcLoadLUT_lcd;
 
 	    if(! (crtc = xf86CrtcCreate(pScrn,crtcFuncs)))
 		LEAVE(FALSE);
diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c
index 8d2c523..158e20f 100644
--- a/src/smilynx_hw.c
+++ b/src/smilynx_hw.c
@@ -87,12 +87,8 @@ SMILynx_HWInit(ScrnInfoPtr pScrn)
 	    /* Select no displays */
 	    mode->SR31 &= ~0x07;
 
-	    /* Enable virtual refresh */
-	    if(pSmi->Dualhead){
-		mode->SR31 |= 0x80;
-	    }else{
-		mode->SR31 &= ~0x80;
-	    }
+	    /* Disable virtual refresh */
+	    mode->SR31 &= ~0x80;
 
 	    /* Disable expansion */
 	    mode->SR32 &= ~0x03;
diff --git a/src/smilynx_output.c b/src/smilynx_output.c
index aba6db5..fefa8c5 100644
--- a/src/smilynx_output.c
+++ b/src/smilynx_output.c
@@ -82,17 +82,25 @@ SMILynx_OutputDPMS_lcd(xf86OutputPtr output, int mode)
     ScrnInfoPtr pScrn = output->scrn;
     SMIPtr pSmi = SMIPTR(pScrn);
     SMIRegPtr reg = pSmi->mode;
+    xf86CrtcConfigPtr crtcConf = XF86_CRTC_CONFIG_PTR(pScrn);
 
     ENTER();
 
     switch (mode) {
     case DPMSModeOn:
-	if(pSmi->lcd == 2 /* LCD is DSTN */
-	   || pSmi->Dualhead /* Virtual Refresh is enabled */)
+	if(pSmi->Dualhead &&
+	   output->crtc == crtcConf->crtc[1]){
+	    /* Virtual Refresh is enabled */
+
 	    reg->SR21 &= ~0x10; /* Enable LCD framebuffer read operation and DSTN dithering engine */
-	if(pSmi->lcd == 2 /* LCD is DSTN */
-	   && !pSmi->Dualhead /* Virtual Refresh is disabled */)
-	    reg->SR21 &= ~0x20; /* Enable LCD framebuffer write operation */
+	}else{
+	    if(pSmi->lcd == 2){
+		/* LCD is DSTN */
+
+		reg->SR21 &= ~0x10; /* Enable LCD framebuffer read operation and DSTN dithering engine */
+		reg->SR21 &= ~0x20; /* Enable LCD framebuffer write operation */
+	    }
+	}
 
 	reg->SR31 |= 0x01; /* Enable LCD display*/
 	break;
@@ -269,13 +277,10 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn)
 
 	output->interlaceAllowed = FALSE;
 	output->doubleScanAllowed = FALSE;
-	output->possible_crtcs = 1 << 0;
-	if(pSmi->Dualhead)
-	    output->possible_clones = 0;
-	else
-	    output->possible_clones = 1 << 1;
+	output->possible_crtcs = (1 << 0) | (1 << 1);
+	output->possible_clones = 1 << 1;
 
-	if(!pSmi->useBIOS){
+	if(pSmi->Dualhead){
 	    /* Output 1 is CRT */
 	    SMI_OutputFuncsInit_base(&outputFuncs);
 	    outputFuncs->dpms = SMILynx_OutputDPMS_crt;
@@ -288,13 +293,8 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn)
 	    output->interlaceAllowed = FALSE;
 	    output->doubleScanAllowed = FALSE;
 
-	    if(pSmi->Dualhead){
-		output->possible_crtcs = 1 << 1;
-		output->possible_clones = 0;
-	    }else{
-		output->possible_crtcs = 1 << 0;
-		output->possible_clones = 1 << 0;
-	    }
+	    output->possible_crtcs = 1 << 0;
+	    output->possible_clones = 1 << 0;
 	}
     }
 

commit 1c57cfa814504c33fcad51115d77f2d166fb7903
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Fri Jan 30 21:00:17 2009 -0800

    Add README with pointers to mailing list, bugzilla & git repos

diff --git a/README b/README
index d2f142d..28727d7 100644
--- a/README
+++ b/README
@@ -1,3 +1,26 @@
+xf86-video-siliconmotion - Silicon Motion video driver for the Xorg X server
+
+Please submit bugs & patches to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/driver/xf86-video-siliconmotion
+
+        http://cgit.freedesktop.org/xorg/driver/xf86-video-siliconmotion
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
+----------------------------------------------------------------------------
+
 What works:
 - Supports 8bpp, 16bpp and 24bpp. Heavy testing on SM720.
 

commit 2aee107d992cb58bfbb2f527cfa73ea9f6957998
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Fri Jan 9 16:33:43 2009 -0800

    Remove xorgconfig & xorgcfg from See Also list in man page

diff --git a/man/siliconmotion.man b/man/siliconmotion.man
index bc50756..e59d785 100644
--- a/man/siliconmotion.man
+++ b/man/siliconmotion.man
@@ -191,7 +191,7 @@ recent PCI chipsets.  Default: value of
 option.
 
 .SH SEE ALSO
-__xservername__(1), __xconfigfile__(__filemansuffix__), xorgconfig(1), Xserver(1), X(__miscmansuffix__)
+__xservername__(1), __xconfigfile__(__filemansuffix__), Xserver(1), X(__miscmansuffix__)
 
 .SH SUPPORT
 For assistance with this driver, or __xservername__ in general, check the web


Reply to: