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

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



 COPYING            |   76 ++++++++++++++++--
 README             |   13 +--
 configure.ac       |    2 
 src/smi_driver.c   |  214 +++++++++++++++++++++--------------------------------
 src/smi_exa.c      |   40 ++-------
 src/smilynx_crtc.c |    2 
 6 files changed, 175 insertions(+), 172 deletions(-)

New commits:
commit d754e9a2954e56a26a94e58d87a450a825c250e6
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Jul 2 11:43:52 2009 -0400

    siliconmotion 1.7.2

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

commit cd9e9f25294abb739c1772e3a9a7a9c0a921ee82
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue Jun 23 13:11:02 2009 +0200

    Fix EXA rotation for SM502 at 32bpp (bug 22432).

diff --git a/src/smi_exa.c b/src/smi_exa.c
index 1b6d42f..5103924 100644
--- a/src/smi_exa.c
+++ b/src/smi_exa.c
@@ -78,9 +78,6 @@ static void
 SMI_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
               int dstX, int dstY, int width, int height);
 static void
-SMI501_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
-		 int dstX, int dstY, int width, int height);
-static void
 SMI730_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
               int dstX, int dstY, int width, int height);
 static void
@@ -169,12 +166,11 @@ SMI_EXAInit(ScreenPtr pScreen)
     pSmi->EXADriverPtr->CheckComposite = SMI_CheckComposite;
     pSmi->EXADriverPtr->PrepareComposite = SMI_PrepareComposite;
 
-    if (IS_MSOC(pSmi))
-	pSmi->EXADriverPtr->Composite = SMI501_Composite;
-    else if (pSmi->Chipset == SMI_COUGAR3DR)
+    if (IS_MSOC(pSmi) || pSmi->Chipset == SMI_COUGAR3DR)
 	pSmi->EXADriverPtr->Composite = SMI730_Composite;
     else
 	pSmi->EXADriverPtr->Composite = SMI_Composite;
+
     pSmi->EXADriverPtr->DoneComposite = SMI_DoneComposite;
 
     if(!exaDriverInit(pScreen, pSmi->EXADriverPtr)) {
@@ -711,38 +707,22 @@ SMI_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
     LEAVE();
 }
 
-#define MSOC_ROTBLTWIDTH		8
-static void
-SMI501_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
-		 int dstX, int dstY, int width, int height)
-{
-    ENTER();
-
-    /* SMI501 cannot rotate-blt more than 32 bytes.
-     * Based on smi's sample smi_shadow.c */
-    while (height > MSOC_ROTBLTWIDTH) {
-	SMI_Composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY,
-		      width, MSOC_ROTBLTWIDTH);
-	srcY	+= MSOC_ROTBLTWIDTH;
-	dstY	+= MSOC_ROTBLTWIDTH;
-	height	-= MSOC_ROTBLTWIDTH;
-    }
-    SMI_Composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY, width, height);
-
-    LEAVE();
-}
-
 static void
 SMI730_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
 		int dstX, int dstY, int width, int height)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+    SMIPtr pSmi = SMIPTR(pScrn);
     int maxPixels;
 
     ENTER();
 
-    /* SM731 cannot rotate-blt more than a certain number of pixels
-       (based on a calculation from the Windows driver source */
-    maxPixels = 1280 / pDst->drawable.bitsPerPixel;
+    /* Both SM501 and SM731 cannot rotate-blt more than a certain
+       number of pixels. */
+    if(IS_MSOC(pSmi))
+        maxPixels = 128 / pDst->drawable.bitsPerPixel;
+    else
+        maxPixels = 1280 / pDst->drawable.bitsPerPixel;
 
     while(height>0){
 	SMI_Composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY, width, min(height, maxPixels));

commit 97498c048c897e5753e61d3b4ab231025974d67c
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu May 28 15:17:58 2009 -0400

    Remove useless loader symbol lists.

diff --git a/src/smi_driver.c b/src/smi_driver.c
index 985563b..b47f774 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -190,104 +190,6 @@ static const OptionInfoRec SMIOptions[] =
     { -1,		     NULL,		  OPTV_NONE,	{0}, FALSE }
 };
 
-/*
- * Lists of symbols that may/may not be required by this driver.
- * This allows the loader to know which ones to issue warnings for.
- *
- * Note that vgahwSymbols and xaaSymbols are referenced outside the
- * XFree86LOADER define in later code, so are defined outside of that
- * define here also.
- */
-
-static const char *vgahwSymbols[] =
-{
-    "vgaHWCopyReg",
-    "vgaHWGetHWRec",
-    "vgaHWGetIOBase",
-    "vgaHWGetIndex",
-    "vgaHWInit",
-    "vgaHWLock",
-    "vgaHWMapMem",
-    "vgaHWProtect",
-    "vgaHWRestore",
-    "vgaHWSave",
-    "vgaHWSaveScreen",
-    "vgaHWSetMmioFuncs",
-    "vgaHWSetStdFuncs",
-    "vgaHWUnmapMem",
-    "vgaHWddc1SetSpeedWeak",
-    NULL
-};
-
-static const char *xaaSymbols[] =
-{
-    "XAAGetCopyROP",
-    "XAACreateInfoRec",
-    "XAADestroyInfoRec",
-    "XAAGetFallbackOps",
-    "XAAInit",
-    "XAAGetPatternROP",
-    NULL
-};
-
-static const char *exaSymbols[] =
-{
-    "exaDriverAlloc",
-    "exaDriverInit",
-    "exaDriverFini",
-    "exaOffscreenAlloc",
-    "exaOffscreenFree",
-    "exaGetPixmapPitch",
-    "exaGetPixmapOffset",
-    "exaGetPixmapSize",
-    NULL
-};
-
-static const char *ddcSymbols[] =
-{
-    "xf86PrintEDID",
-    "xf86DoEDID_DDC1",
-    "xf86DoEDID_DDC2",
-    "xf86SetDDCproperties",
-    NULL
-};
-
-static const char *i2cSymbols[] =
-{
-    "xf86CreateI2CBusRec",
-    "xf86CreateI2CDevRec",
-    "xf86DestroyI2CBusRec",
-    "xf86DestroyI2CDevRec",
-    "xf86I2CBusInit",
-    "xf86I2CDevInit",
-    "xf86I2CReadBytes",
-    "xf86I2CWriteByte",
-    NULL
-};
-
-static const char *int10Symbols[] =
-{
-    "xf86ExecX86int10",
-    "xf86FreeInt10",
-    "xf86InitInt10",
-    NULL
-};
-
-static const char *vbeSymbols[] =
-{
-    "VBEInit",
-    "vbeDoEDID",
-    "vbeFree",
-    NULL
-};
-
-static const char *fbSymbols[] =
-{
-    "fbPictureInit",
-    "fbScreenInit",
-    NULL
-};
-
 #ifdef XFree86LOADER
 
 static MODULESETUPPROTO(siliconmotionSetup);
@@ -330,19 +232,6 @@ siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin)
 	xf86AddDriver(&SILICONMOTION, module, 0);
 
 	/*
-	 * Modules that this driver always requires can be loaded here
-	 * by calling LoadSubModule().
-	 */
-
-	/*
-	 * Tell the loader about symbols from other modules that this module
-	 * might refer to.
-	 */
-	LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, exaSymbols,
-					  ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols,
-					  NULL);
-
-	/*
 	 * The return value must be non-NULL on success even though there
 	 * is no TearDownProc.
 	 */
@@ -537,8 +426,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 	if (!xf86LoadSubModule(pScrn, "vgahw"))
 	    LEAVE(FALSE);
 
-	xf86LoaderReqSymLists(vgahwSymbols, NULL);
-
 	/*
 	 * Allocate a vgaHWRec
 	 */
@@ -721,12 +608,10 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 
     if (pSmi->useBIOS) {
 	if (xf86LoadSubModule(pScrn,"int10")) {
-	    xf86LoaderReqSymLists(int10Symbols,NULL);
 	    pSmi->pInt10 = xf86InitInt10(pEnt->index);
 	}
 
 	if (pSmi->pInt10 && xf86LoadSubModule(pScrn, "vbe")) {
-	    xf86LoaderReqSymLists(vbeSymbols, NULL);
 	    pSmi->pVbe = VBEInit(pSmi->pInt10, pEnt->index);
 	}
 
@@ -890,12 +775,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 
     if(!IS_MSOC(pSmi)){
 	if (xf86LoadSubModule(pScrn, "i2c")) {
-	    xf86LoaderReqSymLists(i2cSymbols, NULL);
 	    SMI_I2CInit(pScrn);
 	}
-	if (xf86LoadSubModule(pScrn, "ddc")) {
-	    xf86LoaderReqSymLists(ddcSymbols, NULL);
-	}
+	xf86LoadSubModule(pScrn, "ddc");
     }
 
     /*
@@ -981,8 +863,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 	LEAVE(FALSE);
     }
 
-    xf86LoaderReqSymLists(fbSymbols, NULL);
-
     /* Load XAA or EXA if needed */
     if (!pSmi->NoAccel) {
 	if (!pSmi->useEXA) {
@@ -990,7 +870,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 		SMI_FreeRec(pScrn);
 		LEAVE(FALSE);
 	    }
-	    xf86LoaderReqSymLists(xaaSymbols, NULL);
 	} else {
 	    XF86ModReqInfo req;
 	    int errmaj, errmin;
@@ -1005,7 +884,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 		SMI_FreeRec(pScrn);
 		LEAVE(FALSE);
 	    }
-	    xf86LoaderReqSymLists(exaSymbols, NULL);
 	}
     }
 

commit 536e5df957698251206326edc5a13e833f7c72b1
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Wed May 27 01:23:36 2009 +0200

    Program MCLK/MXCLK on startup for a secondary SM502.
    
    This should allow using a SM502 as secondary display
    device (bug 21810).

diff --git a/src/smi_driver.c b/src/smi_driver.c
index b788ed6..985563b 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1250,10 +1250,21 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn)
 	/* The SM712 can be safely clocked up to 157MHz, according to
 	   Silicon Motion engineers. */
 	pSmi->MCLK = 157000;
-    }else
-	pSmi->MCLK = 0;
 
-    pSmi->MXCLK = 0;
+    } else if (IS_MSOC(pSmi)) {
+       /* Set some sane defaults for the clock settings if we are on a
+          SM502 and it's likely to be uninitialized. */
+
+       if (!xf86IsPrimaryPci(pSmi->PciInfo) &&
+           (READ_SCR(pSmi, DEVICE_ID) & 0xFF) >= 0xC0) {
+          pSmi->MCLK = 112000;
+          pSmi->MXCLK = 144000;
+       }
+
+    } else {
+        pSmi->MCLK = 0;
+        pSmi->MXCLK = 0;
+    }
 
     /* MCLK from user settings */
     if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) {

commit 6a370fa2b6b8fcbd556dd6f9bf92872e9bea23e8
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Mon May 11 22:31:30 2009 -0700

    Fill in COPYING file, add SubmittingPatches URL to README

diff --git a/COPYING b/COPYING
index 7f33cbf..2101aa1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,72 @@
-This is a stub file.  This package has not yet had its complete licensing
-information compiled.  Please see the individual source files for details on
-your rights to use and modify this software.
+Copyright (C) 1994-2000 The XFree86 Project, Inc.  All Rights Reserved.
+Copyright (C) 2000,2008 Silicon Motion, Inc.  All Rights Reserved.
+Copyright (C) 2001 Corvin Zahn.  All Rights Reserved.
+Copyright (C) 2008 Francisco Jerez. All Rights Reserved.
+Copyright (C) 2008 Mandriva Linux.  All Rights Reserved.
 
-Please submit updated COPYING files to the Xorg bugzilla:
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
 
-https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
-All licensing questions regarding this software should be directed at the
-Xorg mailing list:
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-http://lists.freedesktop.org/mailman/listinfo/xorg
+Except as contained in this notice, the names of The XFree86 Project and
+Silicon Motion shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from The XFree86 Project or Silicon Motion.
+
+******************************************************************************
+
+Copyright 2007 George Sapountzis
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+******************************************************************************
+
+Copyright (C) 2006 Dennis De Winter  All Rights Reserved.
+Copyright (C) 2007 Alex Deucher  All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README b/README
index 282d6a4..b3b6674 100644
--- a/README
+++ b/README
@@ -1,22 +1,25 @@
 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
 
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=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 patch submission instructions, see:
+
+	http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
 For more information on the git code manager, see:
 
         http://wiki.x.org/wiki/GitPage
 
-----------------------------------------------------------------------------

commit 962e0c4f08180ac51994aef8d6d042108d5841c1
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Sun May 10 01:53:05 2009 +0200

    Widen the pixel clock readjust interval for SM712.
    
    Set it to 3MHz so that the pixel clock frequency is overridden
    when it's found to be 49MHz, which is reported to be unstable.

diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c
index a8c0a03..fb7183c 100644
--- a/src/smilynx_crtc.c
+++ b/src/smilynx_crtc.c
@@ -241,7 +241,7 @@ SMILynx_CrtcModeFixup(xf86CrtcPtr crtc,
 	/* Adjust the pixel clock in case it is near one of the known
 	   stable frequencies (KHz) */
 	int stable_clocks[] = {46534,};
-	int epsilon = 2000;
+	int epsilon = 3000;
 	int i;
 
 	for (i=0; i < sizeof(stable_clocks)/sizeof(int); i++) {

commit 3cc1b9d4bcf1b7a756ea4426c93392ff6d82e9a6
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue May 5 00:45:10 2009 +0200

    Fail gracefully when the specified virtual screen doesn't fit in RAM.

diff --git a/src/smi_driver.c b/src/smi_driver.c
index c0e72e4..b788ed6 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -578,6 +578,8 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 
     xf86PrintDepthBpp(pScrn);
 
+    pSmi->Bpp = pScrn->bitsPerPixel >> 3;
+
     /*
      * This must happen after pScrn->display has been set because
      * xf86SetWeight references it.
@@ -937,9 +939,27 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
     /* Only allow growing the screen dimensions if EXA is being used */
     if (!xf86InitialConfiguration (pScrn, !pSmi->NoAccel && pSmi->useEXA)){
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
+
+	SMI_EnableVideo(pScrn);
+	SMI_UnmapMem(pScrn);
 	LEAVE(FALSE);
     }
 
+    /* Ensure that the framebuffer size just set fits in video memory. */
+    {
+	int aligned_pitch = (pScrn->virtualX*pSmi->Bpp + 15) & ~15;
+
+	if(aligned_pitch * pScrn->virtualY > pSmi->FBReserved){
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Not enough video memory "
+		       "for the configured screen size (%dx%d) and color depth.\n",
+                       pScrn->virtualX, pScrn->virtualY);
+
+	    SMI_EnableVideo(pScrn);
+	    SMI_UnmapMem(pScrn);
+	    LEAVE(FALSE);
+	}
+    }
+
 
     SMI_EnableVideo(pScrn);
     SMI_UnmapMem(pScrn);
@@ -1724,7 +1744,6 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
     pScrn->vtSema = TRUE;
     pScrn->pScreen = pScreen;
 
-    pSmi->Bpp = pScrn->bitsPerPixel >> 3;
     pScrn->displayWidth = ((pScrn->virtualX * pSmi->Bpp + 15) & ~15) / pSmi->Bpp;
 
     pSmi->fbArea = NULL;

commit 32628d9884d577d7a672c172c12b7097be276700
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Tue May 5 00:44:17 2009 +0200

    Probe the amount of installed memory by trial and error on SM712.
    
    In some cases the BIOS hasn't filled in the "scratchpad registers"
    (SR71) with the right amount of memory installed (e.g. MIPS
    platform). There seems to be no other way to do it than to test it.
    
    This should fix bug 21528.

diff --git a/src/smi_driver.c b/src/smi_driver.c
index 7219612..c0e72e4 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1423,6 +1423,55 @@ SMI_MapMmio(ScrnInfoPtr pScrn)
     return (TRUE);
 }
 
+/* HACK - In some cases the BIOS hasn't filled in the "scratchpad
+   registers" (SR71) with the right amount of memory installed (e.g. MIPS
+   platform). Probe it manually. */
+static unsigned long
+SMI_ProbeMem(ScrnInfoPtr pScrn, unsigned long mem_skip, unsigned long mem_max)
+{
+    SMIPtr pSmi = SMIPTR(pScrn);
+    unsigned long mem_probe = 1024*1024;
+    unsigned long aperture_base;
+    void* mem;
+
+    ENTER();
+
+    aperture_base = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + mem_skip;
+    mem_max = min(mem_max , PCI_REGION_SIZE(pSmi->PciInfo, 0) - mem_skip);
+
+#ifndef XSERVER_LIBPCIACCESS
+    mem = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSmi->PciTag,
+			aperture_base, mem_max);
+
+    if(!mem)
+	LEAVE(0);
+#else
+    if(pci_device_map_range(pSmi->PciInfo, aperture_base, mem_max,
+			    PCI_DEV_MAP_FLAG_WRITABLE, &mem))
+	LEAVE(0);
+#endif
+
+    while(mem_probe <= mem_max){
+	MMIO_OUT32(mem, mem_probe-4, 0x55555555);
+	if(MMIO_IN32(mem, mem_probe-4) != 0x55555555)
+	    break;
+
+	MMIO_OUT32(mem, mem_probe-4, 0xAAAAAAAA);
+	if(MMIO_IN32(mem, mem_probe-4) != 0xAAAAAAAA)
+	    break;
+
+	mem_probe <<= 1;
+    }
+
+#ifndef XSERVER_LIBPCIACCESS
+    xf86UnMapVidMem(pScrn->scrnIndex, mem, mem_max);
+#else
+    pci_device_unmap_range(pSmi->PciInfo, mem, mem_max);
+#endif
+
+    LEAVE(mem_probe >> 1);
+}
+
 static Bool
 SMI_DetectMem(ScrnInfoPtr pScrn)
 {
@@ -1452,6 +1501,9 @@ SMI_DetectMem(ScrnInfoPtr pScrn)
 		    pSmi->videoRAMKBytes = lynx3d_table[config >> 6] * 1024 +
 			512;
 		    break;
+		case SMI_LYNXEMplus:
+		    pSmi->videoRAMKBytes = SMI_ProbeMem(pScrn, 0, 0x400000) / 1024;
+		    break;
 		case SMI_LYNX3DM:
 		    pSmi->videoRAMKBytes = lynx3dm_table[config >> 6] * 1024;
 		    break;


Reply to: