xf86-video-intel: Branch 'glucose-xf86-video-intel-2.1-branch' - 2 commits - src/common.h src/i810_driver.c src/i830_accel.c src/i830_display.c src/i830_dri.c src/i830_driver.c src/i830.h src/i830_memory.c src/i830_video.c src/Makefile.am
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Sat Oct 6 14:55:31 PDT 2007
src/Makefile.am | 2 -
src/common.h | 1
src/i810_driver.c | 4 +++
src/i830.h | 9 +++-----
src/i830_accel.c | 15 +++++++++-----
src/i830_display.c | 8 +++----
src/i830_dri.c | 2 -
src/i830_driver.c | 54 ++++++++++++++++++++++++++++++++++-------------------
src/i830_memory.c | 6 ++---
src/i830_video.c | 16 +++++++--------
10 files changed, 71 insertions(+), 46 deletions(-)
New commits:
diff-tree 329c98255a2d25f29df06a1f24026b64d05eb0a8 (from 23d0f327119b358fbb70979e13bae8dd98a4711c)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Tue Apr 17 16:22:12 2007 +0100
Fix build for glucose version of the driver.
diff --git a/src/common.h b/src/common.h
index fa96a5d..1184fa6 100644
--- a/src/common.h
+++ b/src/common.h
@@ -92,6 +92,7 @@ extern const char *I810driSymbols[];
extern const char *I810drmSymbols[];
#endif
extern const char *I810i2cSymbols[];
+extern const char *I810glucoseSymbols[];
extern void I830DPRINTF_stub(const char *filename, int line,
const char *function, const char *fmt, ...);
diff --git a/src/i830.h b/src/i830.h
index 41ed6a5..8806fd0 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -96,10 +96,9 @@ typedef struct _I830OutputRec I830Output
#include "extnsionst.h" /* required */
#include <X11/extensions/panoramiXproto.h> /* required */
-/*
- * The mode handling is based upon the VESA driver written by
- * Paulo César Pereira de Andrade <pcpa at conectiva.com.br>.
- */
+#define USE_XAA 0
+#define USE_EXA 1
+#define USE_GLUCOSE 2
#ifdef XF86DRI
#define I830_MM_MINPAGES 512
diff-tree 23d0f327119b358fbb70979e13bae8dd98a4711c (from b3ba121ed546e45d4840d57b4293f1d98f02509d)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Thu Apr 12 09:42:21 2007 +0100
Allow Intel driver to work with glucose.
diff --git a/src/Makefile.am b/src/Makefile.am
index 50e913e..ced8002 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,7 +31,7 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRI_CFLAGS@ @XMODES_CFLAGS@ \
- -DI830_XV -DI830_USE_XAA -DI830_USE_EXA
+ -DI830_XV -DI830_USE_XAA -DI830_USE_EXA -DI830_USE_GLUCOSE
intel_drv_la_LTLIBRARIES = intel_drv.la
intel_drv_la_LDFLAGS = -module -avoid-version
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 972b6d5..756583d 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -281,6 +281,10 @@ const char *I810int10Symbols[] = {
NULL
};
+const char *I810glucoseSymbols[] = {
+ "glucoseScreenInit",
+};
+
const char *I810xaaSymbols[] = {
"XAACreateInfoRec",
"XAADestroyInfoRec",
diff --git a/src/i830.h b/src/i830.h
index ad275da..41ed6a5 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -381,7 +381,7 @@ typedef struct _I830Rec {
unsigned int fence[FENCE_NEW_NR * 2];
unsigned int next_fence;
- Bool useEXA;
+ int AccelMethod;
Bool noAccel;
Bool SWCursor;
#ifdef I830_USE_XAA
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 5cbad44..59a56ad 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -68,7 +68,7 @@ intel_get_pixmap_offset(PixmapPtr pPix)
I830Ptr pI830 = I830PTR(pScrn);
#ifdef I830_USE_EXA
- if (pI830->useEXA)
+ if (pI830->AccelMethod == USE_EXA)
return exaGetPixmapOffset(pPix);
#endif
return (unsigned long)pPix->devPrivate.ptr - (unsigned long)pI830->FbBase;
@@ -82,7 +82,7 @@ intel_get_pixmap_pitch(PixmapPtr pPix)
I830Ptr pI830 = I830PTR(pScrn);
#ifdef I830_USE_EXA
- if (pI830->useEXA)
+ if (pI830->AccelMethod == USE_EXA)
return exaGetPixmapPitch(pPix);
#endif
#ifdef I830_USE_XAA
@@ -269,15 +269,20 @@ I830RefreshRing(ScrnInfoPtr pScrn)
Bool
I830AccelInit(ScreenPtr pScreen)
{
-#ifdef I830_USE_EXA
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
- if (pI830->useEXA)
+#ifdef I830_USE_EXA
+ if (pI830->AccelMethod == USE_EXA)
return I830EXAInit(pScreen);
#endif
#ifdef I830_USE_XAA
- return I830XAAInit(pScreen);
+ if (pI830->AccelMethod == USE_XAA)
+ return I830XAAInit(pScreen);
+#endif
+#ifdef I830_USE_GLUCOSE
+ if (pI830->AccelMethod == USE_GLUCOSE)
+ return glucoseScreenInit(pScreen, 0);
#endif
return FALSE;
}
diff --git a/src/i830_display.c b/src/i830_display.c
index 666c08a..f092413 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1149,7 +1149,7 @@ i830_crtc_shadow_allocate (xf86CrtcPtr c
* setter for offscreen area locking in EXA currently. So, we just
* allocate offscreen memory and fake up a pixmap header for it.
*/
- if (pI830->useEXA) {
+ if (pI830->AccelMethod == USE_EXA) {
assert(intel_crtc->rotate_mem_exa == NULL);
intel_crtc->rotate_mem_exa = exaOffscreenAlloc(pScreen, size, align,
@@ -1163,7 +1163,7 @@ i830_crtc_shadow_allocate (xf86CrtcPtr c
}
#endif /* I830_USE_EXA */
#ifdef I830_USE_XAA
- if (!pI830->useEXA) {
+ if (pI830->AccelMethod == USE_XAA) {
/* The XFree86 linear allocator operates in units of screen pixels,
* sadly.
*/
@@ -1231,13 +1231,13 @@ i830_crtc_shadow_destroy(xf86CrtcPtr crt
if (data)
{
#ifdef I830_USE_EXA
- if (pI830->useEXA && intel_crtc->rotate_mem_exa != NULL) {
+ if (pI830->AccelMethod == USE_EXA && intel_crtc->rotate_mem_exa != NULL) {
exaOffscreenFree(pScrn->pScreen, intel_crtc->rotate_mem_exa);
intel_crtc->rotate_mem_exa = NULL;
}
#endif /* I830_USE_EXA */
#ifdef I830_USE_XAA
- if (!pI830->useEXA) {
+ if (pI830->AccelMethod == USE_XAA) {
xf86FreeOffscreenLinear(intel_crtc->rotate_mem_xaa);
intel_crtc->rotate_mem_xaa = NULL;
}
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 0febb6c..1391512 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -602,7 +602,7 @@ I830DRIScreenInit(ScreenPtr pScreen)
#endif
#if DRIINFO_MAJOR_VERSION > 5 || \
(DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 3)
- if (pI830->useEXA)
+ if (pI830->AccelMethod == USE_EXA)
pDRIInfo->texOffsetStart = I830TexOffsetStart;
#endif
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 80d9645..5452df2 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -272,7 +272,7 @@ static PciChipsets I830PciChipsets[] = {
*/
typedef enum {
-#if defined(I830_USE_XAA) && defined(I830_USE_EXA)
+#if defined(I830_USE_XAA) || defined(I830_USE_EXA) || defined(I830_USE_GLUCOSE)
OPTION_ACCELMETHOD,
#endif
OPTION_NOACCEL,
@@ -293,7 +293,7 @@ typedef enum {
} I830Opts;
static OptionInfoRec I830Options[] = {
-#if defined(I830_USE_XAA) && defined(I830_USE_EXA)
+#if defined(I830_USE_XAA) || defined(I830_USE_EXA) || defined(I830_USE_GLUCOSE)
{OPTION_ACCELMETHOD, "AccelMethod", OPTV_ANYSTR, {0}, FALSE},
#endif
{OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE},
@@ -1276,26 +1276,31 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
*/
if (!pI830->noAccel) {
#if (defined(I830_USE_EXA) && defined(I830_USE_XAA)) || !defined(I830_USE_EXA)
- pI830->useEXA = FALSE;
+ pI830->AccelMethod = USE_XAA;
#else
- pI830->useEXA = TRUE;
+ pI830->AccelMethod = USE_EXA;
#endif
-#if defined(I830_USE_XAA) && defined(I830_USE_EXA)
+#if defined(I830_USE_XAA) || defined(I830_USE_EXA) || defined(I830_USE_GLUCOSE)
int from = X_DEFAULT;
if ((s = (char *)xf86GetOptValString(pI830->Options,
OPTION_ACCELMETHOD))) {
- if (!xf86NameCmp(s, "EXA")) {
+ if (!xf86NameCmp(s, "GLUCOSE")) {
from = X_CONFIG;
- pI830->useEXA = TRUE;
+ pI830->AccelMethod = USE_GLUCOSE;
+ }
+ else if (!xf86NameCmp(s, "EXA")) {
+ from = X_CONFIG;
+ pI830->AccelMethod = USE_EXA;
}
else if (!xf86NameCmp(s, "XAA")) {
from = X_CONFIG;
- pI830->useEXA = FALSE;
+ pI830->AccelMethod = USE_XAA;
}
}
#endif
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s for acceleration\n",
- pI830->useEXA ? "EXA" : "XAA");
+ (pI830->AccelMethod == USE_GLUCOSE) ? "GLUCOSE" :
+ (pI830->AccelMethod == USE_EXA) ? "EXA" : "XAA");
}
if (xf86ReturnOptValBool(pI830->Options, OPTION_SW_CURSOR, FALSE)) {
@@ -1520,7 +1525,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
xf86LoaderReqSymLists(I810fbSymbols, NULL);
#ifdef I830_USE_XAA
- if (!pI830->noAccel && !pI830->useEXA) {
+ if (!pI830->noAccel && pI830->AccelMethod == USE_XAA) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
PreInitCleanup(pScrn);
return FALSE;
@@ -1530,7 +1535,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
#endif
#ifdef I830_USE_EXA
- if (!pI830->noAccel && pI830->useEXA) {
+ if (!pI830->noAccel && pI830->AccelMethod == USE_EXA) {
XF86ModReqInfo req;
int errmaj, errmin;
@@ -1546,6 +1551,17 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
xf86LoaderReqSymLists(I830exaSymbols, NULL);
}
#endif
+
+#ifdef I830_USE_GLUCOSE
+ if (!pI830->noAccel && pI830->AccelMethod == USE_GLUCOSE) {
+ if (!xf86LoadSubModule(pScrn, "glucose")) {
+ PreInitCleanup(pScrn);
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(I810glucoseSymbols, NULL);
+ }
+#endif
+
if (!pI830->SWCursor) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
PreInitCleanup(pScrn);
@@ -1626,11 +1642,11 @@ ResetState(ScrnInfoPtr pScrn, Bool flush
} \
} while(0)
#ifdef I830_USE_XAA
- if (!pI830->useEXA && flush && pI830->AccelInfoRec)
+ if (pI830->AccelMethod == USE_XAA && flush && pI830->AccelInfoRec)
flush_ring();
#endif
#ifdef I830_USE_EXA
- if (pI830->useEXA && flush && pI830->EXADriverPtr)
+ if (pI830->AccelMethod == USE_EXA && flush && pI830->EXADriverPtr)
flush_ring();
#endif
@@ -2652,7 +2668,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr
DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n");
- if (!pI830->useEXA) {
+ if (pI830->AccelMethod == USE_XAA) {
if (I830IsPrimary(pScrn)) {
if (!I830InitFBManager(pScreen, &(pI830->FbMemBox))) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -3103,7 +3119,7 @@ I830CloseScreen(int scrnIndex, ScreenPtr
}
#endif
#ifdef I830_USE_EXA
- if (pI830->useEXA && pI830->EXADriverPtr) {
+ if (pI830->AccelMethod == USE_EXA && pI830->EXADriverPtr) {
exaDriverFini(pScreen);
xfree(pI830->EXADriverPtr);
pI830->EXADriverPtr = NULL;
@@ -3303,14 +3319,14 @@ i830WaitSync(ScrnInfoPtr pScrn)
I830Ptr pI830 = I830PTR(pScrn);
#ifdef I830_USE_XAA
- if (!pI830->noAccel && !pI830->useEXA && pI830->AccelInfoRec
+ if (!pI830->noAccel && pI830->AccelMethod == USE_XAA && pI830->AccelInfoRec
&& pI830->AccelInfoRec->NeedToSync) {
(*pI830->AccelInfoRec->Sync)(pScrn);
pI830->AccelInfoRec->NeedToSync = FALSE;
}
#endif
#ifdef I830_USE_EXA
- if (!pI830->noAccel && pI830->useEXA && pI830->EXADriverPtr) {
+ if (!pI830->noAccel && pI830->AccelMethod == USE_EXA && pI830->EXADriverPtr) {
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
exaWaitSync(pScreen);
}
@@ -3323,11 +3339,11 @@ i830MarkSync(ScrnInfoPtr pScrn)
I830Ptr pI830 = I830PTR(pScrn);
#ifdef I830_USE_XAA
- if (!pI830->useEXA && pI830->AccelInfoRec)
+ if (pI830->AccelMethod == USE_XAA && pI830->AccelInfoRec)
pI830->AccelInfoRec->NeedToSync = TRUE;
#endif
#ifdef I830_USE_EXA
- if (pI830->useEXA && pI830->EXADriverPtr) {
+ if (pI830->AccelMethod == USE_EXA && pI830->EXADriverPtr) {
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
exaMarkSync(pScreen);
}
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 2566627..85f1781 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -859,7 +859,7 @@ i830_allocate_framebuffer(ScrnInfoPtr pS
minspace = pitch * pScrn->virtualY;
avail = pScrn->videoRam * 1024;
- if (!pI830->useEXA) {
+ if (pI830->AccelMethod == USE_XAA) {
maxCacheLines = (avail - minspace) / pitch;
/* This shouldn't happen. */
if (maxCacheLines < 0) {
@@ -1104,7 +1104,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScr
return FALSE;
#ifdef I830_USE_EXA
- if (pI830->useEXA) {
+ if (pI830->AccelMethod == USE_EXA) {
if (pI830->exa_offscreen == NULL) {
/* Default EXA to having 3 screens worth of offscreen memory space
* (for pixmaps), plus a double-buffered, 1920x1088 video's worth.
@@ -1128,7 +1128,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScr
}
#endif /* I830_USE_EXA */
- if (!pI830->noAccel && !pI830->useEXA) {
+ if (!pI830->noAccel && pI830->AccelMethod == USE_XAA) {
pI830->xaa_scratch =
i830_allocate_memory(pScrn, "xaa scratch", MAX_SCRATCH_BUFFER_SIZE,
GTT_PAGE_SIZE, 0);
diff --git a/src/i830_video.c b/src/i830_video.c
index b4f9e74..87ab016 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2103,7 +2103,7 @@ I830AllocateMemory(ScrnInfoPtr pScrn, st
I830Ptr pI830 = I830PTR(pScrn);
#ifdef I830_USE_EXA
- if (pI830->useEXA) {
+ if (pI830->AccelMethod == USE_EXA) {
if (linear->exa != NULL) {
if (linear->exa->size >= size)
return;
@@ -2120,10 +2120,10 @@ I830AllocateMemory(ScrnInfoPtr pScrn, st
}
#endif /* I830_USE_EXA */
#ifdef I830_USE_XAA
- if (!pI830->useEXA) {
- /* Converts an offset from XAA's linear allocator to an offset from the
- * start of fb.
- */
+ if (pI830->AccelMethod == USE_XAA) {
+ /* Converts an offset from XAA's linear allocator to an offset from the
+ * start of fb.
+ */
#define XAA_OFFSET_TO_OFFSET(x) \
(pI830->front_buffer->offset + (x * pI830->cpp))
@@ -2163,7 +2163,7 @@ I830FreeMemory(ScrnInfoPtr pScrn, struct
I830Ptr pI830 = I830PTR(pScrn);
#ifdef I830_USE_EXA
- if (pI830->useEXA) {
+ if (pI830->AccelMethod == USE_EXA) {
if (linear->exa != NULL) {
exaOffscreenFree(pScrn->pScreen, linear->exa);
linear->exa = NULL;
@@ -2171,7 +2171,7 @@ I830FreeMemory(ScrnInfoPtr pScrn, struct
}
#endif /* I830_USE_EXA */
#ifdef I830_USE_XAA
- if (!pI830->useEXA) {
+ if (pI830->AccelMethod == USE_XAA) {
if (linear->xaa != NULL) {
xf86FreeOffscreenLinear(linear->xaa);
linear->xaa = NULL;
@@ -2480,7 +2480,7 @@ I830PutImage(ScrnInfoPtr pScrn,
}
#ifdef I830_USE_EXA
- if (pI830->useEXA) {
+ if (pI830->AccelMethod == USE_EXA) {
/* Force the pixmap into framebuffer so we can draw to it. */
exaMoveInPixmap(pPixmap);
}
More information about the xorg-commit
mailing list