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.
This commit is contained in:
Eric Anholt
2006-03-09 06:04:07 +00:00
parent 65aa33f917
commit 2822cbc1fb
10 changed files with 319 additions and 285 deletions

View File

@@ -64,14 +64,13 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
dst = pExaPixmap->devPrivate.ptr;
if (pExaPixmap->dirty) {
if (pExaScr->info->accel.DownloadFromScreen &&
(*pExaScr->info->accel.DownloadFromScreen) (pPixmap,
pPixmap->drawable.x,
pPixmap->drawable.y,
pPixmap->drawable.width,
pPixmap->drawable.height,
dst,
dst_pitch)) {
if (pExaScr->info->DownloadFromScreen &&
(*pExaScr->info->DownloadFromScreen) (pPixmap,
pPixmap->drawable.x,
pPixmap->drawable.y,
pPixmap->drawable.width,
pPixmap->drawable.height,
dst, dst_pitch)) {
} else {
exaWaitSync (pPixmap->drawable.pScreen);
@@ -120,16 +119,16 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
CARD16 w = pPixmap->drawable.width;
int pitch;
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
w = 1 << (exaLog2(w - 1) + 1);
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
pitch = (w * bpp / 8) + (pExaScr->info->pixmapPitchAlign - 1);
pitch -= pitch % pExaScr->info->pixmapPitchAlign;
pExaPixmap->size = pitch * h;
pExaPixmap->devKind = pPixmap->devKind;
pExaPixmap->devPrivate = pPixmap->devPrivate;
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
pExaScr->info->card.pixmapOffsetAlign,
pExaScr->info->pixmapOffsetAlign,
FALSE,
exaPixmapSave, (pointer) pPixmap);
if (!pExaPixmap->area)
@@ -142,7 +141,8 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
pPixmap->drawable.height));
pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->memoryBase +
pExaPixmap->area->offset);
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
return TRUE;
}
@@ -186,12 +186,12 @@ exaMoveInPixmap (PixmapPtr pPixmap)
pExaPixmap->dirty = FALSE;
if (pExaScr->info->accel.UploadToScreen)
if (pExaScr->info->UploadToScreen)
{
if (pExaScr->info->accel.UploadToScreen(pPixmap, 0, 0,
pPixmap->drawable.width,
pPixmap->drawable.height,
src, src_pitch))
if (pExaScr->info->UploadToScreen(pPixmap, 0, 0,
pPixmap->drawable.width,
pPixmap->drawable.height,
src, src_pitch))
return;
}
@@ -205,7 +205,7 @@ exaMoveInPixmap (PixmapPtr pPixmap)
i = pPixmap->drawable.height;
DBG_PIXMAP(("dst = %p, src = %p,(%d, %d) height = %d, mem_base = %p, offset = %d\n",
dst, src, dst_pitch, src_pitch,
i, pExaScr->info->card.memoryBase, ExaGetPixmapPriv(pPixmap)->area->offset));
i, pExaScr->info->memoryBase, pExaPixmap->area->offset));
while (i--) {
memcpy (dst, src, bytes);