summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-03-09 06:04:07 +0000
committerEric Anholt <anholt@freebsd.org>2006-03-09 06:04:07 +0000
commit2822cbc1fb2271844e7ae10c3629aaa940ae4042 (patch)
tree5ea4d9af188cf9a79e64ce3354574cdd717cea69 /hw
parent65aa33f9173b1554924437685698f7c5f645a3c4 (diff)
Rearrange EXA driver structures so that there's a hope of maintaining ABI
when extending the driver interface. The card and accel structures are merged into the ExaDriverRec, which is to be allocated using exaDriverAlloc(). The driver structure also grows exa_major and exa_minor, which drivers fill in and have checked by EXA (double-checking that the driver really did check that the EXA version was correct). Removes exaInitCard(), which is replaced by the driver filling in the rec by hand, and the exaGetVersion() and related EXA_*VERSION which are replaced by always using the XFree86 loadable module versioning.
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ephyr/ephyr.h2
-rw-r--r--hw/kdrive/ephyr/ephyr_draw.c64
-rw-r--r--hw/xfree86/exa/examodule.c2
3 files changed, 40 insertions, 28 deletions
diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h
index d1ee50090..3d468afd9 100644
--- a/hw/kdrive/ephyr/ephyr.h
+++ b/hw/kdrive/ephyr/ephyr.h
@@ -47,7 +47,7 @@ typedef struct _ephyrPriv {
} EphyrPriv;
typedef struct _ephyrFakexaPriv {
- ExaDriverRec exa;
+ ExaDriverPtr exa;
Bool is_synced;
/* The following are arguments and other information from Prepare* calls
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c
index 10a8cd78c..03c2b2f36 100644
--- a/hw/kdrive/ephyr/ephyr_draw.c
+++ b/hw/kdrive/ephyr/ephyr_draw.c
@@ -281,6 +281,11 @@ ephyrDrawInit(ScreenPtr pScreen)
if (fakexa == NULL)
return FALSE;
+ fakexa->exa = exaDriverAlloc();
+ if (fakexa->exa == NULL) {
+ xfree(fakexa);
+ return FALSE;
+ }
#if 0
/* Currently, EXA isn't ready for what we want to do here. We want one
* pointer to the framebuffer (which is set in exaMapFramebuffer) to be
@@ -289,53 +294,60 @@ ephyrDrawInit(ScreenPtr pScreen)
* to extend the XImage data area set up in hostx.c from exaMapFramebuffer,
* but that may be complicated.
*/
- fakexa->exa.card.memoryBase = xalloc(EPHYR_OFFSCREEN_SIZE);
- if (fakexa->exa.card.memoryBase == NULL) {
+ fakexa->exa->memoryBase = xalloc(EPHYR_OFFSCREEN_SIZE);
+ if (fakexa->exa->memoryBase == NULL) {
+ xfree(fakexa->exa);
xfree(fakexa);
return FALSE;
}
- fakexa->exa.card.memorySize = EPHYR_OFFSCREEN_SIZE;
- fakexa->exa.card.offScreenBase = EPHYR_OFFSCREEN_BASE;
+ fakexa->exa->memorySize = EPHYR_OFFSCREEN_SIZE;
+ fakexa->exa->offScreenBase = EPHYR_OFFSCREEN_BASE;
#else
/* Tell EXA that there's a single framebuffer area, which happens to cover
* exactly what the front buffer is.
*/
- fakexa->exa.card.memoryBase = screen->memory_base;
- fakexa->exa.card.memorySize = screen->off_screen_base;
- fakexa->exa.card.offScreenBase = screen->off_screen_base;
+ fakexa->exa->memoryBase = screen->memory_base;
+ fakexa->exa->memorySize = screen->off_screen_base;
+ fakexa->exa->offScreenBase = screen->off_screen_base;
#endif
- fakexa->exa.accel.PrepareSolid = ephyrPrepareSolid;
- fakexa->exa.accel.Solid = ephyrSolid;
- fakexa->exa.accel.DoneSolid = ephyrDoneSolid;
+ /* Since we statically link against EXA, we shouldn't have to be smart about
+ * versioning.
+ */
+ fakexa->exa->exa_major = 2;
+ fakexa->exa->exa_minor = 0;
+
+ fakexa->exa->PrepareSolid = ephyrPrepareSolid;
+ fakexa->exa->Solid = ephyrSolid;
+ fakexa->exa->DoneSolid = ephyrDoneSolid;
- fakexa->exa.accel.PrepareCopy = ephyrPrepareCopy;
- fakexa->exa.accel.Copy = ephyrCopy;
- fakexa->exa.accel.DoneCopy = ephyrDoneCopy;
+ fakexa->exa->PrepareCopy = ephyrPrepareCopy;
+ fakexa->exa->Copy = ephyrCopy;
+ fakexa->exa->DoneCopy = ephyrDoneCopy;
- fakexa->exa.accel.CheckComposite = ephyrCheckComposite;
- fakexa->exa.accel.PrepareComposite = ephyrPrepareComposite;
- fakexa->exa.accel.Composite = ephyrComposite;
- fakexa->exa.accel.DoneComposite = ephyrDoneComposite;
+ fakexa->exa->CheckComposite = ephyrCheckComposite;
+ fakexa->exa->PrepareComposite = ephyrPrepareComposite;
+ fakexa->exa->Composite = ephyrComposite;
+ fakexa->exa->DoneComposite = ephyrDoneComposite;
- fakexa->exa.accel.MarkSync = ephyrMarkSync;
- fakexa->exa.accel.WaitMarker = ephyrWaitMarker;
+ fakexa->exa->MarkSync = ephyrMarkSync;
+ fakexa->exa->WaitMarker = ephyrWaitMarker;
- fakexa->exa.card.pixmapOffsetAlign = EPHYR_OFFSET_ALIGN;
- fakexa->exa.card.pixmapPitchAlign = EPHYR_PITCH_ALIGN;
+ fakexa->exa->pixmapOffsetAlign = EPHYR_OFFSET_ALIGN;
+ fakexa->exa->pixmapPitchAlign = EPHYR_PITCH_ALIGN;
- fakexa->exa.card.maxX = 1023;
- fakexa->exa.card.maxY = 1023;
+ fakexa->exa->maxX = 1023;
+ fakexa->exa->maxY = 1023;
- fakexa->exa.card.flags = EXA_OFFSCREEN_PIXMAPS;
+ fakexa->exa->flags = EXA_OFFSCREEN_PIXMAPS;
- success = exaDriverInit(pScreen, &fakexa->exa);
+ success = exaDriverInit(pScreen, fakexa->exa);
if (success) {
ErrorF("Initialized fake EXA acceleration\n");
scrpriv->fakexa = fakexa;
} else {
ErrorF("Failed to initialize EXA\n");
- xfree(fakexa->exa.card.memoryBase);
+ xfree(fakexa->exa);
xfree(fakexa);
}
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index 09b63d06f..8b48444f1 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -126,7 +126,7 @@ static XF86ModuleVersionInfo exaVersRec =
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
- 1, 2, 0,
+ EXA_VERSION_MAJOR, EXA_VERSION_MINOR, EXA_VERSION_RELEASE,
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
ABI_VIDEODRV_VERSION,
MOD_CLASS_NONE,