summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-29 19:17:54 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-29 19:17:54 -0200
commitc756ed67cbcf5bdd40c300627802d8bcd3d95123 (patch)
treef225b7de7bfff2ac5292a0adde9492de2b7dee22
parent2671776999a5add36e1aeaad4080bfccedc2b1a5 (diff)
SMI501/502 cursor fixes.
Use separate buffers for crt and panel hw cursors. Describe, and workaround a problem with Dualhead and hw cursor enabled. It still has the inconvenient of having a blinking X when exiting the server or switching to a VT; maybe should also save the image currently configured also (and restore on exit), or just disable hw cursor on dual head mode. Also revert change to not initialize video on dualhead. Better to have fully functional video only on panel, that can be resized, then non resizable video..
-rw-r--r--src/smi.h1
-rw-r--r--src/smi501_crtc.c6
-rw-r--r--src/smi_crtc.c25
-rw-r--r--src/smi_driver.c43
4 files changed, 39 insertions, 36 deletions
diff --git a/src/smi.h b/src/smi.h
index 882cb2d..ccc1eab 100644
--- a/src/smi.h
+++ b/src/smi.h
@@ -112,7 +112,6 @@ typedef struct
CloseScreenProcPtr CloseScreen; /* Pointer used to save wrapped
CloseScreen function */
- xf86CursorInfoPtr CursorInfoRec; /* HW Cursor info */
I2CBusPtr I2C; /* Pointer into I2C module */
xf86Int10InfoPtr pInt10; /* Pointer to INT10 module */
vbeInfoPtr pVbe; /* Pointer to VBE module */
diff --git a/src/smi501_crtc.c b/src/smi501_crtc.c
index 606a169..9cf6817 100644
--- a/src/smi501_crtc.c
+++ b/src/smi501_crtc.c
@@ -440,9 +440,11 @@ SMI501_CrtcLoadCursorImage(xf86CrtcPtr crtc, CARD8 *image)
ENTER();
port = crtc == crtcConf->crtc[0] ? 0x00f0 : 0x0230;
- value = pSmi->FBCursorOffset + (port == 0x00f0 ? 0 : 1024);
+ value = pSmi->FBCursorOffset + (port == 0x00f0 ? 0 : SMI501_MAX_CURSOR);
WRITE_DCR(pSmi, port, value);
- memcpy(pSmi->FBBase + value, image, 1024);
+ memcpy(pSmi->FBBase + value, image,
+ /* FIXME 1024, but then, should not be using 64x64 cursors */
+ (SMI501_MAX_CURSOR >> 2) * SMI501_MAX_CURSOR);
LEAVE();
}
diff --git a/src/smi_crtc.c b/src/smi_crtc.c
index 9c452c9..90728f4 100644
--- a/src/smi_crtc.c
+++ b/src/smi_crtc.c
@@ -42,9 +42,12 @@ SMI_CrtcDPMS(xf86CrtcPtr crtc,
static Bool
SMI_CrtcLock (xf86CrtcPtr crtc)
{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ SMIPtr pSmi = SMIPTR(pScrn);
+
ENTER();
- /* Nothing */
+ WaitIdle();
RETURN(FALSE);
}
@@ -79,8 +82,8 @@ SMI_CrtcPrepare(xf86CrtcPtr crtc)
ENTER();
- if (pSmi->HwCursor)
- xf86_hide_cursors(pScrn);
+ if (!pSmi->Dualhead && pSmi->HwCursor)
+ crtc->funcs->hide_cursor(crtc);
LEAVE();
}
@@ -93,7 +96,21 @@ SMI_CrtcCommit(xf86CrtcPtr crtc)
ENTER();
- if(pSmi->HwCursor)
+ /* Problem:
+ * When starting in Dualhead mode, both hw cursors will be shown,
+ * and at the same position, as both are at the same address.
+ * When reconfiguring with something like:
+ * $ xrandr --output VGA --right-of LVDS
+ * what will happen is basically:
+ * hide_cursor(panel)
+ * hide_cursor(crt)
+ * <set-crt-mode-and-modify-mapped-address>
+ * show_cursor(panel) <- besides a sw argb cursor is being used...
+ *
+ * It should not be a problem if argb cursors were supported,
+ * or only one output is available...
+ */
+ if (!pSmi->Dualhead && pSmi->HwCursor)
xf86_reload_cursors(pScrn->pScreen);
LEAVE();
diff --git a/src/smi_driver.c b/src/smi_driver.c
index f7484a6..9e80cd1 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -247,14 +247,6 @@ static const char *exaSymbols[] =
NULL
};
-static const char *ramdacSymbols[] =
-{
- "xf86CreateCursorInfoRec",
- "xf86DestroyCursorInfoRec",
- "xf86InitCursor",
- NULL
-};
-
static const char *ddcSymbols[] =
{
"xf86PrintEDID",
@@ -350,7 +342,7 @@ siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* Tell the loader about symbols from other modules that this module
* might refer to.
*/
- LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, exaSymbols, ramdacSymbols,
+ LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, exaSymbols,
ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols,
NULL);
@@ -996,7 +988,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
SMI_FreeRec(pScrn);
RETURN(FALSE);
}
- xf86LoaderReqSymLists(ramdacSymbols, NULL);
}
RETURN(TRUE);
@@ -1063,7 +1054,8 @@ SMI_LeaveVT(int scrnIndex, int flags)
unmapped. */
xf86RotateCloseScreen(pScrn->pScreen);
- memset(pSmi->FBBase, 0, 256 * 1024); /* #689 */
+ /* Clear frame buffer */
+ memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
if (!IS_MSOC(pSmi)) {
vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -1503,16 +1495,16 @@ SMI_MapMem(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Cursor Offset: %08lX\n", (unsigned long)pSmi->FBCursorOffset);
- /* set up the fifo reserved space */
- if (IS_MSOC(pSmi)) {
- pSmi->FBCursorOffset = pSmi->videoRAMBytes - 2048;
- pSmi->FBReserved = pSmi->videoRAMBytes - 4096;
- }
+ if (IS_MSOC(pSmi))
+ /* Reserve space for panel cursr, and crt if in dual head mode */
+ pSmi->FBReserved = pSmi->FBCursorOffset = pSmi->videoRAMBytes -
+ (pSmi->Dualhead ? SMI501_CURSOR_SIZE << 1 : SMI501_CURSOR_SIZE);
else {
- /* Set up offset to hwcursor memory area. It's a 1K chunk at the end of
+ /* Set up offset to hwcursor memory area, at the end of
* the frame buffer.
*/
- pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024;
+ pSmi->FBCursorOffset = pSmi->videoRAMBytes - SMILYNX_CURSOR_SIZE;
+ /* set up the fifo reserved space */
if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */ {
CARD32 fifoOffset = 0;
fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
@@ -1618,9 +1610,6 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Save the chip/graphics state */
pSmi->Save(pScrn);
- /* Zero the frame buffer, #258 */
- memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
-
/* Fill in some needed pScrn fields */
pScrn->vtSema = TRUE;
pScrn->pScreen = pScreen;
@@ -1632,6 +1621,9 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pSmi->FBOffset = 0;
pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
+ /* Clear frame buffer */
+ memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
+
/*
* The next step is to setup the screen's visuals, and initialise the
* framebuffer code. In cases where the framebuffer's default choises for
@@ -1781,11 +1773,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
!xf86DPMSInit(pScreen, SMILynx_DisplayPowerManagementSet, 0)))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed!\n");
- /* FIXME This could be an option.
- * When not scaling doesn't seem to make much of a difference
- * on MSOC, and this way, one can watch video on both screens... */
- if (!IS_MSOC(pSmi) || !pSmi->Dualhead)
- SMI_InitVideo(pScreen);
+ SMI_InitVideo(pScreen);
if(!xf86CrtcScreenInit(pScreen))
RETURN(FALSE);
@@ -1836,9 +1824,6 @@ SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen)
exaDriverFini(pScreen);
pSmi->EXADriverPtr = NULL;
}
- if (pSmi->CursorInfoRec != NULL) {
- xf86DestroyCursorInfoRec(pSmi->CursorInfoRec);
- }
if (pSmi->DGAModes != NULL) {
xfree(pSmi->DGAModes);
}