xserver-xorg-video-glide: Changes to 'upstream-unstable'
COPYING | 39 +++----
Makefile.am | 1
configure.ac | 52 +++++----
man/Makefile.am | 71 ++++---------
src/Makefile.am | 3
src/glide_driver.c | 277 +++++++++++++++++------------------------------------
6 files changed, 161 insertions(+), 282 deletions(-)
New commits:
commit 517e9252f3200f3e96bbfcfe84812b532c1b2933
Author: Guillem Jover <guillem@hadrons.org>
Date: Fri Dec 30 06:21:19 2011 +0100
Bump to 1.2.0
Signed-off-by: Guillem Jover <guillem@hadrons.org>
diff --git a/configure.ac b/configure.ac
index b6defb7..594d711 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
AC_PREREQ([2.60])
AC_INIT([xf86-video-glide],
- [1.1.0],
+ [1.2.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-glide])
commit 7fdaec9032cc069c8dabc719ada40c03aacda2de
Author: Guillem Jover <guillem@hadrons.org>
Date: Fri Dec 30 06:20:30 2011 +0100
Update copyright years
Signed-off-by: Guillem Jover <guillem@hadrons.org>
diff --git a/COPYING b/COPYING
index 096f76a..38e4872 100644
--- a/COPYING
+++ b/COPYING
@@ -21,7 +21,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Copyright © 2005 Adam Jackson.
-Copyright © 2007-2010 Guillem Jover.
+Copyright © 2007-2011 Guillem Jover.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
diff --git a/configure.ac b/configure.ac
index 41d5911..b6defb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# Copyright © 2005 Adam Jackson.
-# Copyright © 2007-2010 Guillem Jover.
+# Copyright © 2007-2011 Guillem Jover.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
commit e42689244fd5e1b23e641de46c4dc6d38a243a3b
Author: Guillem Jover <guillem@hadrons.org>
Date: Fri Dec 30 05:59:46 2011 +0100
Pass SST number through GLIDERec instead of casting it to driverPrivate
Allocate GLIDERec in GLIDEProbe() instead of in GLIDEPreInit() to pass
the SST number through the SST_Index member instead of casting it to
the driverPrivate pointer back and forth.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
diff --git a/src/glide_driver.c b/src/glide_driver.c
index e85ee2d..9217f0b 100644
--- a/src/glide_driver.c
+++ b/src/glide_driver.c
@@ -332,6 +332,8 @@ GLIDEProbe(DriverPtr drv, int flags)
/* Allocate a ScrnInfoRec and claim the slot */
if ((pScrn = xf86AllocateScreen(drv, 0))) {
+ GLIDEPtr pGlide;
+
xf86AddEntityToScreen(pScrn, entityIndex);
/* I'm not going to "claim" the glide device since no other driver than this can drive it */
@@ -348,7 +350,14 @@ GLIDEProbe(DriverPtr drv, int flags)
pScrn->EnterVT = GLIDEEnterVT;
pScrn->LeaveVT = GLIDELeaveVT;
pScrn->FreeScreen = GLIDEFreeScreen;
- pScrn->driverPrivate = (void*)sst;
+
+ /* Allocate the GLIDERec driverPrivate */
+ if (!GLIDEGetRec(pScrn))
+ break;
+
+ pGlide = GLIDEPTR(pScrn);
+ pGlide->SST_Index = sst;
+
/*
* XXX This is a hack because don't have the PCI info. Set it as
* an ISA entity with no resources.
@@ -376,7 +385,6 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
MessageType from;
int i;
ClockRangePtr clockRanges;
- int sst;
if (flags & PROBE_DETECT) return FALSE;
@@ -384,9 +392,6 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->numEntities != 1)
return FALSE;
- sst = (int)(pScrn->driverPrivate);
- pScrn->driverPrivate = NULL;
-
/* Set pScrn->monitor */
pScrn->monitor = pScrn->confScreen->monitor;
@@ -448,11 +453,6 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
/* We use a programmable clock */
pScrn->progClock = TRUE;
- /* Allocate the GLIDERec driverPrivate */
- if (!GLIDEGetRec(pScrn)) {
- return FALSE;
- }
-
pGlide = GLIDEPTR(pScrn);
/* Get the entity */
@@ -477,8 +477,6 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
"Voodoo card will be %s when exiting server.\n",
pGlide->OnAtExit ? "ON" : "OFF");
- pGlide->SST_Index = sst;
-
/*
* If the user has specified the amount of memory in the XF86Config
* file, we respect that setting.
commit 518b189f31ee7b85d28541bf32bbcf10b5337289
Author: Guillem Jover <guillem@hadrons.org>
Date: Tue Jul 19 15:32:56 2011 +0200
Stop using the deprecated LoaderSymbol() function
Instead of using dlsym() to replace LoaderSymbol() and keep loading
libglide at run-time, just switch to dyamically linking it.
This in effect makes the module stop using LoaderSymbol() function,
and as a bonus makes it start using proper linker dependencies.
Reported-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
diff --git a/configure.ac b/configure.ac
index 2c2012a..41d5911 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,11 @@ PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
# Checks for libraries.
+AC_CHECK_LIB([glide3x], [grGet], [GLIDE_LDFLAGS="-lglide3x"], [
+ AC_CHECK_LIB([glide2x], [grSstQueryBoards], [GLIDE_LDFLAGS="-lglide2x"], [
+ AC_MSG_ERROR([missing glide shared library])], [])], [])
+
+AC_SUBST([GLIDE_LDFLAGS])
# Checks for header files.
CPPFLAGS="$CPPFLAGS -I$glideincludedir"
diff --git a/src/Makefile.am b/src/Makefile.am
index 383a62d..b8015dc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,8 +23,9 @@
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
-AM_CFLAGS = @XORG_CFLAGS@ @GLIDE_CFLAGS@ -DMODULEDIR=\""@moduledir@\""
+AM_CFLAGS = @XORG_CFLAGS@ @GLIDE_CFLAGS@
glide_drv_la_LTLIBRARIES = glide_drv.la
+glide_drv_la_LIBADD = @GLIDE_LDFLAGS@
glide_drv_la_LDFLAGS = -module -avoid-version
glide_drv_ladir = @moduledir@/drivers
diff --git a/src/glide_driver.c b/src/glide_driver.c
index 4f16a06..e85ee2d 100644
--- a/src/glide_driver.c
+++ b/src/glide_driver.c
@@ -92,34 +92,6 @@ typedef u8 bool;
#define GLIDEPTR(p) ((GLIDEPtr)((p)->driverPrivate))
-
-#if defined(GLIDE3)
-typedef FxU32 (*pgrGet_t)(FxU32 pname, FxU32 plength, FxI32 *params);
-#else
-typedef FxBool (*pgrSstQueryBoards_t)(GrHwConfiguration*);
-#endif
-typedef void (*pgrGlideInit_t)(void);
-typedef void (*pgrSstSelect_t)(int which_sst);
-typedef FxBool (*pgrSstWinOpen_t)(FxU32, GrScreenResolution_t, GrScreenRefresh_t,
- GrColorFormat_t, GrOriginLocation_t, int, int);
-typedef void (*pgrRenderBuffer_t)(GrBuffer_t);
-typedef void (*pgrClipWindow_t)(FxU32, FxU32, FxU32, FxU32);
-typedef void (*pgrBufferClear_t)(GrColor_t, GrAlpha_t, FxU16);
-typedef FxBool (*pgrLfbLock_t)(GrLock_t, GrBuffer_t, GrLfbWriteMode_t, GrOriginLocation_t,
- FxBool, GrLfbInfo_t*);
-typedef FxBool (*pgrLfbUnlock_t)(GrLock_t, GrBuffer_t);
-typedef void (*pgrGlideShutdown_t)(void);
-
-
-#if defined(GLIDE3) && defined(GLIDE3_ALPHA)
-typedef FxBool (*pgrLfbWriteRegion_t)(GrBuffer_t, FxU32, FxU32, GrLfbSrcFmt_t,
- FxU32, FxU32, FxBool, FxI32, void*);
-#else
-typedef FxBool (*pgrLfbWriteRegion_t)(GrBuffer_t, FxU32, FxU32, GrLfbSrcFmt_t,
- FxU32, FxU32, FxI32, void*);
-#endif
-
-
typedef struct {
u8* ShadowPtr;
u32 ShadowPitch;
@@ -134,22 +106,6 @@ typedef struct {
OptionInfoPtr Options;
} GLIDERec, *GLIDEPtr;
-#if defined(GLIDE3)
-static pgrGet_t pgrGet;
-#else
-static pgrSstQueryBoards_t pgrSstQueryBoards;
-#endif
-static pgrGlideInit_t pgrGlideInit;
-static pgrSstSelect_t pgrSstSelect;
-static pgrSstWinOpen_t pgrSstWinOpen;
-static pgrRenderBuffer_t pgrRenderBuffer;
-static pgrClipWindow_t pgrClipWindow;
-static pgrBufferClear_t pgrBufferClear;
-static pgrLfbLock_t pgrLfbLock;
-static pgrLfbUnlock_t pgrLfbUnlock;
-static pgrGlideShutdown_t pgrGlideShutdown;
-static pgrLfbWriteRegion_t pgrLfbWriteRegion;
-
static const OptionInfoRec * GLIDEAvailableOptions(int chipid, int busid);
static void GLIDEIdentify(int flags);
static Bool GLIDEProbe(DriverPtr drv, int flags);
@@ -170,16 +126,9 @@ static void GLIDEDisplayPowerManagementSet(ScrnInfoPtr pScrn,
int flags);
-static int LoadGlide(void);
-
#define GLIDE_VERSION 4000
#define GLIDE_NAME "GLIDE"
#define GLIDE_DRIVER_NAME "glide"
-#ifdef GLIDE3
-#define GLIDE_MODULE_NAME "glide3x"
-#else
-#define GLIDE_MODULE_NAME "glide2x"
-#endif
#define GLIDE_MAJOR_VERSION PACKAGE_VERSION_MAJOR
#define GLIDE_MINOR_VERSION PACKAGE_VERSION_MINOR
#define GLIDE_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
@@ -243,50 +192,11 @@ _X_EXPORT XF86ModuleData glideModuleData = { &glideVersRec, glideSetup, NULL };
static pointer
glideSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
- const char module_name[] = GLIDE_MODULE_NAME;
static Bool setupDone = FALSE;
- pointer ret;
int errmaj2 = 0, errmin2 = 0;
if (!setupDone)
{
- /*
- * Modules that this driver always requires may be loaded here
- * by calling LoadSubModule().
- */
-
- ret = LoadSubModule(module, module_name, NULL, NULL, EXTERN_MODULE, NULL,
- &errmaj2, &errmin2);
- if (!ret)
- {
- xf86Msg(X_ERROR, "Glide driver:\n"
-"\n"
-"Could not load the shared library file for Glide: \"lib%s.so\"! \n"
-"\n"
-"You need to have Glide installed to run the glide driver for X.Org.\n"
-"Also, you need to tell X.Org where the lib%s.so file is placed\n"
-"by making a soft link in the " MODULEDIR " directory that points\n"
-"to the lib%s.so file. For example (if your lib%s.so file is in\n"
-"/usr/lib):\n"
-"\n"
-" # ln -s /usr/lib/lib%s.so " MODULEDIR "\n"
-"\n"
-"\n", module_name, module_name, module_name, module_name, module_name);
- if (errmaj)
- *errmaj = LDR_NOSUBENT;
- if (errmin)
- *errmin = errmaj2;
- return NULL;
- }
-
- if (!LoadGlide()) {
- if (errmaj)
- *errmaj = LDR_MODSPECIFIC;
- if (errmin)
- *errmin = 0;
- return NULL;
- }
-
setupDone = TRUE;
/* This module should be loaded only once */
*errmaj = LDR_ONCEONLY;
@@ -355,10 +265,10 @@ glide_get_num_boards(void)
FxI32 num_sst;
int r;
- r = pgrGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst);
+ r = grGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst);
if (!r)
{
- xf86Msg(X_ERROR, "GLIDEProbe(): Error calling pgrGet(GR_NUM_BOARDS)!\n");
+ xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grGet(GR_NUM_BOARDS)!\n");
return -1;
}
@@ -371,10 +281,10 @@ glide_get_num_boards(void)
GrHwConfiguration hw;
int r;
- r = pgrSstQueryBoards(&hw);
+ r = grSstQueryBoards(&hw);
if (!r)
{
- xf86Msg(X_ERROR, "GLIDEProbe(): Error calling pgrSstQueryBoards!\n");
+ xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grSstQueryBoards!\n");
return -1;
}
@@ -868,7 +778,7 @@ GLIDESaveScreen(ScreenPtr pScreen, int mode)
if (unblank)
GLIDERefreshAll(pScrn);
else
- pgrBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
+ grBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
return TRUE;
}
@@ -954,15 +864,15 @@ GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* Initialize the video card */
- pgrGlideInit();
- pgrSstSelect(pGlide->SST_Index);
-
- r = pgrSstWinOpen(0,
- pGlide->grResolution,
- pGlide->grRefreshRate,
- GR_COLORFORMAT_ARGB,
- GR_ORIGIN_UPPER_LEFT,
- 2, 0);
+ grGlideInit();
+ grSstSelect(pGlide->SST_Index);
+
+ r = grSstWinOpen(0,
+ pGlide->grResolution,
+ pGlide->grRefreshRate,
+ GR_COLORFORMAT_ARGB,
+ GR_ORIGIN_UPPER_LEFT,
+ 2, 0);
if (!r)
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "grSstWinOpen returned %d. "
@@ -970,9 +880,9 @@ GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
return FALSE;
}
- pgrRenderBuffer(GR_BUFFER_FRONTBUFFER);
- pgrClipWindow(0, 0, 1024, 768);
- pgrBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grClipWindow(0, 0, 1024, 768);
+ grBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
if (!r)
{
@@ -996,39 +906,9 @@ GLIDERestore(ScrnInfoPtr pScrn, Bool Closing)
return;
pGlide->GlideInitiated = FALSE;
pGlide->Blanked = TRUE;
- pgrBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
+ grBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
if (!Closing || !(pGlide->OnAtExit))
- pgrGlideShutdown();
-}
-
-
-#define GLIDE_FIND_FUNC(x) \
- p##x = (p##x##_t)LoaderSymbol(#x); \
- if (!p##x) \
- { \
- xf86Msg(X_ERROR, "Could not find " #x "() in lib%s.so.\n", GLIDE_MODULE_NAME); \
- return FALSE; \
- }
-
-static int
-LoadGlide(void)
-{
-#ifdef GLIDE3
- GLIDE_FIND_FUNC(grGet);
-#else
- GLIDE_FIND_FUNC(grSstQueryBoards);
-#endif
- GLIDE_FIND_FUNC(grGlideInit);
- GLIDE_FIND_FUNC(grSstSelect);
- GLIDE_FIND_FUNC(grSstWinOpen);
- GLIDE_FIND_FUNC(grRenderBuffer);
- GLIDE_FIND_FUNC(grClipWindow);
- GLIDE_FIND_FUNC(grBufferClear);
- GLIDE_FIND_FUNC(grLfbLock);
- GLIDE_FIND_FUNC(grLfbUnlock);
- GLIDE_FIND_FUNC(grGlideShutdown);
- GLIDE_FIND_FUNC(grLfbWriteRegion);
- return TRUE;
+ grGlideShutdown();
}
static void
@@ -1052,13 +932,13 @@ GLIDERefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
src = pGlide->ShadowPtr + (pbox->y1 * pGlide->ShadowPitch) +
(x1 * Bpp);
#if defined(GLIDE3) && defined(GLIDE3_ALPHA)
- pgrLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
- GR_LFB_SRC_FMT_565, x2-x1, pbox->y2-pbox->y1, FALSE,
- pGlide->ShadowPitch, src);
+ grLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
+ GR_LFB_SRC_FMT_565, x2-x1, pbox->y2-pbox->y1, FALSE,
+ pGlide->ShadowPitch, src);
#else
- pgrLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
- GR_LFB_SRC_FMT_565, x2-x1, pbox->y2-pbox->y1,
- pGlide->ShadowPitch, src);
+ grLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
+ GR_LFB_SRC_FMT_565, x2-x1, pbox->y2-pbox->y1,
+ pGlide->ShadowPitch, src);
#endif
pbox++;
}
@@ -1071,13 +951,13 @@ GLIDERefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
src = pGlide->ShadowPtr + (pbox->y1 * pGlide->ShadowPitch) +
(pbox->x1 * Bpp);
#if defined(GLIDE3) && defined(GLIDE3_ALPHA)
- pgrLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
- GR_LFB_SRC_FMT_888, x2-x1, pbox->y2-pbox->y1, FALSE,
- pGlide->ShadowPitch, src);
+ grLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
+ GR_LFB_SRC_FMT_888, x2-x1, pbox->y2-pbox->y1, FALSE,
+ pGlide->ShadowPitch, src);
#else
- pgrLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
- GR_LFB_SRC_FMT_888, x2-x1, pbox->y2-pbox->y1,
- pGlide->ShadowPitch, src);
+ grLfbWriteRegion(GR_BUFFER_FRONTBUFFER, x1, pbox->y1,
+ GR_LFB_SRC_FMT_888, x2-x1, pbox->y2-pbox->y1,
+ pGlide->ShadowPitch, src);
#endif
pbox++;
}
@@ -1116,7 +996,7 @@ GLIDEDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
case DPMSModeStandby:
case DPMSModeSuspend:
pGlide->Blanked = TRUE;
- pgrBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
+ grBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST);
break;
case DPMSModeOff:
GLIDERestore(pScrn, FALSE);
commit 8ffb28cda58be37d52ed8f7c3b9967574f0a4233
Author: Guillem Jover <guillem@hadrons.org>
Date: Tue Jul 19 17:56:32 2011 +0200
build: Define GLIDE3_ALPHA when using glide3
diff --git a/configure.ac b/configure.ac
index 3d1f278..2c2012a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,7 +76,10 @@ AC_HEADER_STDC
AC_CHECK_HEADER([glide.h], [],
[AC_MSG_ERROR([<glide.h> is required])])
-AC_CHECK_DECL([grGet], [AC_DEFINE(GLIDE3, 1, [glide3x available])], [],
+AC_CHECK_DECL([grGet],
+ [AC_DEFINE(GLIDE3, 1, [glide3x available])
+ AC_DEFINE(GLIDE3_ALPHA, 1, [glide3x alpha available])],
+ [],
[#include <glide.h>])
GLIDE_CFLAGS="-I$glideincludedir"
commit 76a838e31d3b702b0489792e9cc13018fa331749
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Nov 21 11:38:44 2010 -0800
Sun's copyrights belong to Oracle now
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/COPYING b/COPYING
index ab7e916..096f76a 100644
--- a/COPYING
+++ b/COPYING
@@ -42,7 +42,7 @@ 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 © 2005 Sun Microsystems, Inc. All rights reserved.
+Copyright (c) 2005, Oracle and/or its affiliates. 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"),
diff --git a/man/Makefile.am b/man/Makefile.am
index 52648f9..32aeba3 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright © 2005 Sun Microsystems, Inc. All rights reserved.
+# Copyright (c) 2005, Oracle and/or its affiliates. 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"),
commit d8045b0815167b2204c0a00a49ae84d1b673d8d3
Author: Guillem Jover <guillem@hadrons.org>
Date: Sat Nov 6 22:51:55 2010 +0100
Bump to 1.1.0
diff --git a/configure.ac b/configure.ac
index 2f8adcc..3d1f278 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
AC_PREREQ([2.60])
AC_INIT([xf86-video-glide],
- [1.0.3],
+ [1.1.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-glide])
commit be66973a0851b20a38911db3ef5413d60127b2af
Author: Guillem Jover <guillem@hadrons.org>
Date: Thu Oct 21 05:22:41 2010 +0200
Fix support for latest glide3x
This enables the driver to use libglide3x.so at run-time instead of
libglide2x.so, selectively depending on the headers specified at
configure time via --with-glide-include-dir.
glide3x is the newer interface and supports more hardware than glide2x.
diff --git a/configure.ac b/configure.ac
index 85ad072..2f8adcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,9 @@ AC_HEADER_STDC
AC_CHECK_HEADER([glide.h], [],
[AC_MSG_ERROR([<glide.h> is required])])
+AC_CHECK_DECL([grGet], [AC_DEFINE(GLIDE3, 1, [glide3x available])], [],
+ [#include <glide.h>])
+
GLIDE_CFLAGS="-I$glideincludedir"
AC_SUBST([GLIDE_CFLAGS])
AC_SUBST([XORG_CFLAGS])
diff --git a/src/glide_driver.c b/src/glide_driver.c
index 58b65c4..4f16a06 100644
--- a/src/glide_driver.c
+++ b/src/glide_driver.c
@@ -72,6 +72,11 @@
#include <glide.h>
+/* glide3x does not define this alias anymore, so let's do it ourselves. */
+#ifndef GR_ZDEPTHVALUE_FARTHEST
+#define GR_ZDEPTHVALUE_FARTHEST 0
+#endif
+
#define TRUE 1
#define FALSE 0
@@ -88,7 +93,11 @@ typedef u8 bool;
#define GLIDEPTR(p) ((GLIDEPtr)((p)->driverPrivate))
+#if defined(GLIDE3)
+typedef FxU32 (*pgrGet_t)(FxU32 pname, FxU32 plength, FxI32 *params);
+#else
typedef FxBool (*pgrSstQueryBoards_t)(GrHwConfiguration*);
+#endif
typedef void (*pgrGlideInit_t)(void);
typedef void (*pgrSstSelect_t)(int which_sst);
typedef FxBool (*pgrSstWinOpen_t)(FxU32, GrScreenResolution_t, GrScreenRefresh_t,
@@ -125,7 +134,11 @@ typedef struct {
OptionInfoPtr Options;
} GLIDERec, *GLIDEPtr;
+#if defined(GLIDE3)
+static pgrGet_t pgrGet;
+#else
static pgrSstQueryBoards_t pgrSstQueryBoards;
+#endif
static pgrGlideInit_t pgrGlideInit;
static pgrSstSelect_t pgrSstSelect;
static pgrSstWinOpen_t pgrSstWinOpen;
@@ -162,7 +175,11 @@ static int LoadGlide(void);
#define GLIDE_VERSION 4000
#define GLIDE_NAME "GLIDE"
#define GLIDE_DRIVER_NAME "glide"
+#ifdef GLIDE3
+#define GLIDE_MODULE_NAME "glide3x"
+#else
#define GLIDE_MODULE_NAME "glide2x"
+#endif
#define GLIDE_MAJOR_VERSION PACKAGE_VERSION_MAJOR
#define GLIDE_MINOR_VERSION PACKAGE_VERSION_MINOR
#define GLIDE_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
@@ -331,13 +348,45 @@ GLIDEIdentify(int flags)
xf86PrintChipsets(GLIDE_NAME, "driver for Glide devices (Voodoo cards)", GLIDEChipsets);
}
+#if defined(GLIDE3)
+static int
+glide_get_num_boards(void)
+{
+ FxI32 num_sst;
+ int r;
+
+ r = pgrGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst);
+ if (!r)
+ {
+ xf86Msg(X_ERROR, "GLIDEProbe(): Error calling pgrGet(GR_NUM_BOARDS)!\n");
+ return -1;
+ }
+
+ return num_sst;
+}
+#else
+static int
+glide_get_num_boards(void)
+{
+ GrHwConfiguration hw;
+ int r;
+
+ r = pgrSstQueryBoards(&hw);
+ if (!r)
+ {
+ xf86Msg(X_ERROR, "GLIDEProbe(): Error calling pgrSstQueryBoards!\n");
+ return -1;
+ }
+
+ return hw.num_sst;
+}
+#endif
/* Mandatory */
static Bool
GLIDEProbe(DriverPtr drv, int flags)
{
- GrHwConfiguration hw;
- int i, sst, r;
+ int i, num_sst, sst;
GDevPtr *devList;
GDevPtr dev = NULL;
int numdevList;
@@ -348,21 +397,17 @@ GLIDEProbe(DriverPtr drv, int flags)
if ((numdevList = xf86MatchDevice(GLIDE_DRIVER_NAME, &devList)) <= 0)
return FALSE;
- r = pgrSstQueryBoards(&hw);
- if (!r)
- {
- xf86Msg(X_ERROR, "GLIDEProbe(): Error calling pgrSstQueryBoards!\n");
+ num_sst = glide_get_num_boards();
+ if (num_sst < 0)
goto cleanup;
- }
-
-
- /* hw.num_sst : number of Glide boards available */
- if (hw.num_sst > 0 && (flags & PROBE_DETECT)) {
+
+ /* num_sst: number of Glide boards available */
+ if (num_sst > 0 && (flags & PROBE_DETECT)) {
/* XXX Need to call xf886AddDeviceToConfigure() here */
return TRUE;
}
- for (sst = 0; sst < hw.num_sst; sst++)
+ for (sst = 0; sst < num_sst; sst++)
{
for (i = 0; i < numdevList; i++)
{
@@ -968,7 +1013,11 @@ GLIDERestore(ScrnInfoPtr pScrn, Bool Closing)
static int
LoadGlide(void)
{
+#ifdef GLIDE3
+ GLIDE_FIND_FUNC(grGet);
+#else
GLIDE_FIND_FUNC(grSstQueryBoards);
+#endif
GLIDE_FIND_FUNC(grGlideInit);
GLIDE_FIND_FUNC(grSstSelect);
GLIDE_FIND_FUNC(grSstWinOpen);
commit ef45124f827e9b851c99bb8dbe29987e765cb85e
Author: Guillem Jover <guillem@hadrons.org>
Date: Thu Oct 21 05:12:37 2010 +0200
Abstract glide2x module name into a GLIDE_MODULE_NAME macro
diff --git a/src/glide_driver.c b/src/glide_driver.c
index 6357f2f..58b65c4 100644
--- a/src/glide_driver.c
+++ b/src/glide_driver.c
@@ -162,6 +162,7 @@ static int LoadGlide(void);
#define GLIDE_VERSION 4000
#define GLIDE_NAME "GLIDE"
#define GLIDE_DRIVER_NAME "glide"
+#define GLIDE_MODULE_NAME "glide2x"
#define GLIDE_MAJOR_VERSION PACKAGE_VERSION_MAJOR
#define GLIDE_MINOR_VERSION PACKAGE_VERSION_MINOR
#define GLIDE_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
@@ -225,6 +226,7 @@ _X_EXPORT XF86ModuleData glideModuleData = { &glideVersRec, glideSetup, NULL };
static pointer
glideSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
+ const char module_name[] = GLIDE_MODULE_NAME;
static Bool setupDone = FALSE;
pointer ret;
int errmaj2 = 0, errmin2 = 0;
@@ -236,23 +238,23 @@ glideSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* by calling LoadSubModule().
*/
- ret = LoadSubModule(module, "glide2x", NULL, NULL, EXTERN_MODULE, NULL,
+ ret = LoadSubModule(module, module_name, NULL, NULL, EXTERN_MODULE, NULL,
&errmaj2, &errmin2);
if (!ret)
{
xf86Msg(X_ERROR, "Glide driver:\n"
"\n"
-"Could not load the shared library file for Glide: \"libglide2x.so\"! \n"
+"Could not load the shared library file for Glide: \"lib%s.so\"! \n"
"\n"
"You need to have Glide installed to run the glide driver for X.Org.\n"
-"Also, you need to tell X.Org where the libglide2x.so file is placed\n"
+"Also, you need to tell X.Org where the lib%s.so file is placed\n"
"by making a soft link in the " MODULEDIR " directory that points\n"
-"to the libglide2x.so file. For example (if your libglide2x.so file is in\n"
+"to the lib%s.so file. For example (if your lib%s.so file is in\n"
"/usr/lib):\n"
"\n"
-" # ln -s /usr/lib/libglide2x.so " MODULEDIR "\n"
+" # ln -s /usr/lib/lib%s.so " MODULEDIR "\n"
"\n"
-"\n");
+"\n", module_name, module_name, module_name, module_name, module_name);
if (errmaj)
*errmaj = LDR_NOSUBENT;
if (errmin)
@@ -959,7 +961,7 @@ GLIDERestore(ScrnInfoPtr pScrn, Bool Closing)
p##x = (p##x##_t)LoaderSymbol(#x); \
if (!p##x) \
{ \
- xf86Msg(X_ERROR, "Could not find " #x "() in libglide2x.so.\n"); \
+ xf86Msg(X_ERROR, "Could not find " #x "() in lib%s.so.\n", GLIDE_MODULE_NAME); \
return FALSE; \
}
commit a30cc5587a71c0cbaedaa06b1d95274f890a1534
Author: Guillem Jover <guillem@hadrons.org>
Date: Thu Oct 21 07:07:00 2010 +0200
Use malloc and free instead of deprecated xalloc and xfree
diff --git a/src/glide_driver.c b/src/glide_driver.c
index bebbb8f..6357f2f 100644
--- a/src/glide_driver.c
+++ b/src/glide_driver.c
@@ -311,7 +311,7 @@ GLIDEFreeRec(ScrnInfoPtr pScrn)
{
if (pScrn->driverPrivate == NULL)
return;
- xfree(pScrn->driverPrivate);
+ free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -404,7 +404,7 @@ GLIDEProbe(DriverPtr drv, int flags)
}
cleanup:
- xfree(devList);
+ free(devList);
return foundScreen;
}
@@ -505,7 +505,8 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if (!(pGlide->Options = xalloc(sizeof(GLIDEOptions))))
+ pGlide->Options = malloc(sizeof(GLIDEOptions));
+ if (pGlide->Options == NULL)
return FALSE;
memcpy(pGlide->Options, GLIDEOptions, sizeof(GLIDEOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pGlide->Options);
@@ -777,7 +778,7 @@ GLIDECloseScreen(int scrnIndex, ScreenPtr pScreen)
if (pScrn->vtSema)
GLIDERestore(pScrn, TRUE);
- xfree(pGlide->ShadowPtr);
+ free(pGlide->ShadowPtr);
pScrn->vtSema = FALSE;
@@ -799,7 +800,7 @@ GLIDEFreeScreen(int scrnIndex, int flags)
* get called routinely at the end of a server generation.
*/
if (pGlide && pGlide->ShadowPtr)
- xfree(pGlide->ShadowPtr);
+ free(pGlide->ShadowPtr);
GLIDEFreeRec(xf86Screens[scrnIndex]);
}
commit 5e09be624bd6c064e425f2aeeb0693285a76cf9a
Author: Guillem Jover <guillem@hadrons.org>
Date: Thu Oct 21 03:27:34 2010 +0200
Drop useless symbol lists
The functions are not available anymore.
diff --git a/src/glide_driver.c b/src/glide_driver.c
index e88a1b5..bebbb8f 100644
--- a/src/glide_driver.c
+++ b/src/glide_driver.c
@@ -202,26 +202,6 @@ static SymTabRec GLIDEChipsets[] = {
};
-/*
- * List of symbols from other modules that this module references. This
- * list is used to tell the loader that it is OK for symbols here to be
- * unresolved providing that it hasn't been told that they haven't been
- * told that they are essential via a call to xf86LoaderReqSymbols() or
- * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about
- * unresolved symbols that are not required.
- */
-
-static const char *fbSymbols[] = {
- "fbScreenInit",
- "fbPictureInit",
- NULL
-};
-
-static const char *shadowSymbols[] = {
- "ShadowFBInit",
- NULL
-};
-
#ifdef XFree86LOADER
static MODULESETUPPROTO(glideSetup);
@@ -294,12 +274,6 @@ glideSetup(pointer module, pointer opts, int *errmaj, int *errmin)
xf86AddDriver(&GLIDE, module, 0);
/*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- LoaderRefSymLists(fbSymbols, shadowSymbols, NULL);
-
- /*
* The return value must be non-NULL on success even though there
* is no TearDownProc.
*/
@@ -633,14 +607,11 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
- xf86LoaderReqSymLists(fbSymbols, NULL);
-
/* Load the shadow framebuffer */
if (!xf86LoadSubModule(pScrn, "shadowfb")) {
GLIDEFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymLists(shadowSymbols, NULL);
return TRUE;
}
commit d58132f35de5140ff86cec0359f1ab9cb1709590
Author: Guillem Jover <guillem@hadrons.org>
Date: Thu Oct 21 05:28:37 2010 +0200
Update copyright statements
diff --git a/COPYING b/COPYING
index 009e00c..ab7e916 100644
--- a/COPYING
+++ b/COPYING
@@ -21,7 +21,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Copyright © 2005 Adam Jackson.
-Copyright © 2007 Guillem Jover.
+Copyright © 2007-2010 Guillem Jover.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
diff --git a/configure.ac b/configure.ac
index cb927b2..85ad072 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# Copyright © 2005 Adam Jackson.
-# Copyright © 2007 Guillem Jover.
+# Copyright © 2007-2010 Guillem Jover.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
commit eeb4cbe0596e08f56e1e29c77f6ec6790eea5340
Author: Guillem Jover <guillem@hadrons.org>
Date: Wed Oct 20 10:25:57 2010 +0200
build: Use LT_INIT instead of deprecated AC_PROG_LIBTOOL and AC_DISABLE_STATIC
diff --git a/configure.ac b/configure.ac
index 2e98bd0..cb927b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,8 +42,7 @@ XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Checks for programs.
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
+LT_INIT([disable-static])
AH_TOP([#include "xorg-server.h"])
commit 71a07200f7d1672bf6c7054cad856becf91eefd5
Author: Guillem Jover <guillem@hadrons.org>
Date: Wed Oct 20 10:24:49 2010 +0200
build: Use AC_CONFIG_FILES instead of deprecated AC_OUTPUT usage
diff --git a/configure.ac b/configure.ac
index de9f080..2e98bd0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,8 +85,9 @@ AC_SUBST([moduledir])
DRIVER_NAME=glide
AC_SUBST([DRIVER_NAME])
-AC_OUTPUT([
+AC_CONFIG_FILES([
Makefile
src/Makefile
man/Makefile
])
+AC_OUTPUT
commit cb3e75e3499f9ec9750a635b968f780143f2090f
Author: Guillem Jover <guillem@hadrons.org>
Date: Wed Oct 20 10:24:11 2010 +0200
build: Use AC_CHECK_HEADER instead of deprecated AC_HEADER_CHECK
diff --git a/configure.ac b/configure.ac
Reply to: