Add framebuffer access wrapper infrastructure.

Create fbPrepareAccess macros to call into the driver to set up the
wfbReadMemory and wfbWriteWemory pointers.  Call these from fbGetDrawable and
fbGetStipDrawable.

Add the READ and WRITE macros, which expand to simple memory accesses for fb,
and calls through the function pointers for wfb.

Add fbFinishAccess macro to give the driver an opportunity to clean up.  Add
calls to this in the appropriate places.
This commit is contained in:
Aaron Plattner
2006-07-10 18:58:09 -07:00
parent 319efac445
commit a4005c15fb
24 changed files with 266 additions and 9 deletions

View File

@@ -160,6 +160,8 @@ fbPixmapToRegion(PixmapPtr pPix)
FirstRect = REGION_BOXPTR(pReg);
rects = FirstRect;
fbPrepareAccess(pPix);
pwLine = (FbBits *) pPix->devPrivate.ptr;
nWidth = pPix->devKind >> (FB_SHIFT-3);
@@ -311,6 +313,8 @@ fbPixmapToRegion(PixmapPtr pPix)
pReg->data = (RegDataPtr)NULL;
}
}
fbFinishAccess(&pPix->drawable);
#ifdef DEBUG
if (!miValidRegion(pReg))
FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
@@ -362,6 +366,7 @@ fbValidateDrawable (DrawablePtr pDrawable)
if (!fbValidateBits (first, stride, FB_HEAD_BITS) ||
!fbValidateBits (last, stride, FB_TAIL_BITS))
fbInitializeDrawable(pDrawable);
fbFinishAccess (pDrawable);
}
void
@@ -383,5 +388,6 @@ fbInitializeDrawable (DrawablePtr pDrawable)
last = bits + stride * pDrawable->height;
fbSetBits (first, stride, FB_HEAD_BITS);
fbSetBits (last, stride, FB_TAIL_BITS);
fbFinishAccess (pDrawable);
}
#endif /* FB_DEBUG */