summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/smi.h3
-rw-r--r--src/smi_accel.c44
-rw-r--r--src/smi_driver.c50
-rw-r--r--src/smi_video.c14
4 files changed, 59 insertions, 52 deletions
diff --git a/src/smi.h b/src/smi.h
index 07d73e8..d8fe50f 100644
--- a/src/smi.h
+++ b/src/smi.h
@@ -227,7 +227,8 @@ typedef struct
pixels */
CARD32 saveBufferSize; /* #670 - FB save buffer size */
void * pSaveBuffer; /* #670 - FB save buffer */
- CARD32 savedFBOffset; /* #670 - Saved FBOffset value */
+ CARD32 fbMapOffset; /* offset for fb mapping */
+ CARD32 savedFBOffset; /* #670 - Saved FBOffset value */
CARD32 savedFBReserved; /* #670 - Saved
FBReserved value */
CARD8 * paletteBuffer; /* #920 - Palette save buffer */
diff --git a/src/smi_accel.c b/src/smi_accel.c
index d55ad6e..0c70973 100644
--- a/src/smi_accel.c
+++ b/src/smi_accel.c
@@ -361,9 +361,9 @@ SMI_SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
DEBUG((VERBLEV, "xdir=%d ydir=%d rop=%02X trans=%08X\n", xdir, ydir,
rop, trans));
- pSmi->AccelCmd = XAACopyROP[rop]
- | SMI_BITBLT
- | SMI_START_ENGINE;
+ pSmi->AccelCmd = XAAGetCopyROP(rop)
+ | SMI_BITBLT
+ | SMI_START_ENGINE;
if ((xdir == -1) || (ydir == -1))
{
@@ -446,9 +446,9 @@ SMI_SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
ENTER_PROC("SMI_SetupForSolidFill");
DEBUG((VERBLEV, "color=%08X rop=%02X\n", color, rop));
- pSmi->AccelCmd = XAAPatternROP[rop]
- | SMI_BITBLT
- | SMI_START_ENGINE;
+ pSmi->AccelCmd = XAAGetPatternROP(rop)
+ | SMI_BITBLT
+ | SMI_START_ENGINE;
if (pSmi->ClipTurnedOn)
{
@@ -551,10 +551,10 @@ SMI_SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg,
ENTER_PROC("SMI_SetupForCPUToScreenColorExpandFill");
DEBUG((VERBLEV, "fg=%08X bg=%08X rop=%02X\n", fg, bg, rop));
- pSmi->AccelCmd = XAACopyROP[rop]
- | SMI_HOSTBLT_WRITE
- | SMI_SRC_MONOCHROME
- | SMI_START_ENGINE;
+ pSmi->AccelCmd = XAAGetCopyROP(rop)
+ | SMI_HOSTBLT_WRITE
+ | SMI_SRC_MONOCHROME
+ | SMI_START_ENGINE;
if (bg == -1)
{
@@ -638,9 +638,9 @@ SMI_SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int fg,
DEBUG((VERBLEV, "patx=%08X paty=%08X fg=%08X bg=%08X rop=%02X\n", patx,
paty, fg, bg, rop));
- pSmi->AccelCmd = XAAPatternROP[rop]
- | SMI_BITBLT
- | SMI_START_ENGINE;
+ pSmi->AccelCmd = XAAGetPatternROP(rop)
+ | SMI_BITBLT
+ | SMI_START_ENGINE;
if (pSmi->ClipTurnedOn)
{
@@ -711,10 +711,10 @@ SMI_SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int rop,
DEBUG((VERBLEV, "patx=%d paty=%d rop=%02X trans_color=%08X\n", patx, paty,
rop, trans_color));
- pSmi->AccelCmd = XAAPatternROP[rop]
- | SMI_BITBLT
- | SMI_COLOR_PATTERN
- | SMI_START_ENGINE;
+ pSmi->AccelCmd = XAAGetPatternROP(rop)
+ | SMI_BITBLT
+ | SMI_COLOR_PATTERN
+ | SMI_START_ENGINE;
if (pScrn->bitsPerPixel <= 16)
{
@@ -803,9 +803,9 @@ SMI_SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
DEBUG((VERBLEV, "rop=%02X trans_color=%08X bpp=%d depth=%d\n", rop,
trans_color, bpp, depth));
- pSmi->AccelCmd = XAACopyROP[rop]
- | SMI_HOSTBLT_WRITE
- | SMI_START_ENGINE;
+ pSmi->AccelCmd = XAAGetCopyROP(rop)
+ | SMI_HOSTBLT_WRITE
+ | SMI_START_ENGINE;
if (trans_color != -1)
{
@@ -1007,7 +1007,7 @@ SMI_ValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
ENTER_PROC("SMI_ValidatePolylines");
pSmi->ValidatePolylines(pGC, changes, pDraw);
- if (pGC->ops->Polylines == XAAFallbackOps.Polylines)
+ if (pGC->ops->Polylines == XAAGetFallbackOps()->Polylines)
{
/* Override the Polylines function with our own Polylines function. */
pGC->ops->Polylines = SMI_Polylines;
@@ -1027,7 +1027,7 @@ SMI_Polylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
ENTER_PROC("SMI_Polylines");
/* Call the original Polylines function. */
- pGC->ops->Polylines = XAAFallbackOps.Polylines;
+ pGC->ops->Polylines = XAAGetFallbackOps()->Polylines;
(*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
pGC->ops->Polylines = SMI_Polylines;
diff --git a/src/smi_driver.c b/src/smi_driver.c
index a75ea59..841290e 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -211,18 +211,18 @@ static const char *vgahwSymbols[] =
"vgaHWSetMmioFuncs",
"vgaHWSetStdFuncs",
"vgaHWUnmapMem",
- "vgaHWddc1SetSpeed",
+ "vgaHWddc1SetSpeedWeak",
NULL
};
static const char *xaaSymbols[] =
{
- "XAACopyROP",
+ "XAAGetCopyROP",
"XAACreateInfoRec",
"XAADestroyInfoRec",
- "XAAFallbackOps",
+ "XAAGetFallbackOps",
"XAAInit",
- "XAAPatternROP",
+ "XAAGetPatternROP",
NULL
};
@@ -304,7 +304,7 @@ static XF86ModuleVersionInfo SMIVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
SILICONMOTION_VERSION_MAJOR,
SILICONMOTION_VERSION_MINOR,
SILICONMOTION_PATCHLEVEL,
@@ -1860,20 +1860,21 @@ SMI_MapMem(ScrnInfoPtr pScrn)
"DataPort=%p - %p\n", pSmi->DataPortBase,
pSmi->DataPortBase + pSmi->DataPortSize - 1);
+ pScrn->memPhysBase = pSmi->PciInfo->memBase[0];
+
/* Map the frame buffer */
- if (pSmi->Chipset == SMI_LYNX3DM)
- {
- pScrn->memPhysBase = pSmi->PciInfo->memBase[0] + 0x200000;
- }
+ if (pSmi->Chipset == SMI_LYNX3DM)
+ pSmi->fbMapOffset = 0x200000;
else
- {
- pScrn->memPhysBase = pSmi->PciInfo->memBase[0];
- }
- if (pSmi->videoRAMBytes)
- {
- pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
- pSmi->PciTag, pScrn->memPhysBase, pSmi->videoRAMBytes);
-
+ pSmi->fbMapOffset = 0x0;
+
+ if (pSmi->videoRAMBytes) {
+ pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex,
+ VIDMEM_FRAMEBUFFER,
+ pSmi->PciTag,
+ pScrn->memPhysBase + pSmi->fbMapOffset,
+ pSmi->videoRAMBytes);
+
if (pSmi->FBBase == NULL)
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not "
@@ -1882,9 +1883,12 @@ SMI_MapMem(ScrnInfoPtr pScrn)
return(FALSE);
}
}
- pSmi->FBOffset = pScrn->fbOffset = 0;
+ pSmi->FBOffset = 0;
+ pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
+
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Physical frame buffer at 0x%08lX\n", pScrn->memPhysBase);
+ "Physical frame buffer at 0x%08lX offset: 0x%08lX\n",
+ pScrn->memPhysBase, pScrn->fbOffset);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
"Logical frame buffer at %p - %p\n", pSmi->FBBase,
pSmi->FBBase + pSmi->videoRAMBytes - 1);
@@ -2384,7 +2388,7 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen)
{
WRITE_FPR(pSmi, FPR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3);
}
-
+ pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Shadow: width=%d height=%d "
"offset=0x%08lX pitch=0x%08X\n",
@@ -2395,6 +2399,7 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen)
else
{
pSmi->FBOffset = 0;
+ pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
}
/*
@@ -3435,8 +3440,9 @@ SMI_ddc1(int scrnIndex)
tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72);
VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, tmp | 0x20);
- pMon = xf86PrintEDID(xf86DoEDID_DDC1(scrnIndex, vgaHWddc1SetSpeed,
- SMI_ddc1Read));
+ pMon = xf86PrintEDID(xf86DoEDID_DDC1(scrnIndex,
+ vgaHWddc1SetSpeedWeak(),
+ SMI_ddc1Read));
if (pMon != NULL)
{
success = TRUE;
diff --git a/src/smi_video.c b/src/smi_video.c
index 6254916..ed18d30 100644
--- a/src/smi_video.c
+++ b/src/smi_video.c
@@ -41,7 +41,7 @@ Author of changes: Corvin Zahn <zahn@zac.de>
Date: 2.11.2001
*/
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.1.4.2.4.2 2004/03/04 20:16:31 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.3 2004/07/31 01:21:51 anholt Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.13 2003/11/10 18:22:26 tsi Exp $ */
#include "smi.h"
@@ -179,7 +179,7 @@ static Atom xvInterlaced;
#define N_SVIDEO_CHANNELS 2
#define N_VIDEO_INPUTS 2
-typedef enum _VideoInput { COMPOSITE, SVIDEO } VideoInput;
+typedef enum _VideoInput { VID_COMPOSITE, VID_SVIDEO } VideoInput;
/**************************************************************************/
@@ -580,18 +580,18 @@ SMI_BuildEncodings(SMI_PortPtr p)
p->nenc = 0;
for (ch = 0; ch < N_COMPOSITE_CHANNELS; ch++) {
for (n = 0; n < N_VIDEO_NORMS; n++) {
- SMI_AddEncoding(p->enc, p->nenc, n, COMPOSITE, ch);
+ SMI_AddEncoding(p->enc, p->nenc, n, VID_COMPOSITE, ch);
p->norm[p->nenc] = n;
- p->input[p->nenc] = COMPOSITE;
+ p->input[p->nenc] = VID_COMPOSITE;
p->channel[p->nenc] = ch;
p->nenc++;
}
}
for (ch = 0; ch < N_SVIDEO_CHANNELS; ch++) {
for (n = 0; n < N_VIDEO_NORMS; n++) {
- SMI_AddEncoding(p->enc, p->nenc, n, SVIDEO, ch);
+ SMI_AddEncoding(p->enc, p->nenc, n, VID_SVIDEO, ch);
p->norm[p->nenc] = n;
- p->input[p->nenc] = SVIDEO;
+ p->input[p->nenc] = VID_SVIDEO;
p->channel[p->nenc] = ch;
p->nenc++;
}
@@ -767,7 +767,7 @@ SetAttrSAA7111(ScrnInfoPtr pScrn, int i, int value)
return XvBadAlloc;
}
/* set video input format and channel */
- if (input == COMPOSITE) {
+ if (input == VID_COMPOSITE) {
if (!xf86I2CWriteVec(&(pPort->I2CDev),
SAA7111CompositeChannelSelect[channel],
ENTRIES(SAA7111CompositeChannelSelect[channel]) / 2)) {