summaryrefslogtreecommitdiff
path: root/fb/fbcompose.c
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2006-07-10 18:58:09 -0700
committerAaron Plattner <aplattner@nvidia.com>2006-07-26 15:48:51 -0700
commita4005c15fbb48231cb958c32b2c791a2d23a135a (patch)
tree247ce0d86b1f62e69f188ff352cd424bd032284b /fb/fbcompose.c
parent319efac445cebda5a2ac1db67efebe54bc47ba9d (diff)
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.
Diffstat (limited to 'fb/fbcompose.c')
-rw-r--r--fb/fbcompose.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fb/fbcompose.c b/fb/fbcompose.c
index b1903e90b..c7a728066 100644
--- a/fb/fbcompose.c
+++ b/fb/fbcompose.c
@@ -2652,6 +2652,7 @@ static void fbFetchSolid(PicturePtr pict, int x, int y, int width, CARD32 *buffe
end = buffer + width;
while (buffer < end)
*buffer++ = color;
+ fbFinishAccess (pict->pDrawable);
}
static void fbFetch(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
@@ -2670,6 +2671,7 @@ static void fbFetch(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
bits += y*stride;
fetch(bits, x, width, buffer, indexed);
+ fbFinishAccess (pict->pDrawable);
}
#define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
@@ -2921,8 +2923,10 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
/* when using convolution filters one might get here without a transform */
if (pict->transform) {
- if (!PictureTransformPoint3d (pict->transform, &v))
+ if (!PictureTransformPoint3d (pict->transform, &v)) {
+ fbFinishAccess (pict->pDrawable);
return;
+ }
unit.vector[0] = pict->transform->matrix[0][0];
unit.vector[1] = pict->transform->matrix[1][0];
unit.vector[2] = pict->transform->matrix[2][0];
@@ -3352,6 +3356,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
v.vector[2] += unit.vector[2];
}
}
+
+ fbFinishAccess (pict->pDrawable);
}
@@ -3397,6 +3403,7 @@ static void fbStore(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
bits += y*stride;
store(bits, buffer, x, width, indexed);
+ fbFinishAccess (pict->pDrawable);
}
static void fbStoreExternalAlpha(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
@@ -3436,6 +3443,9 @@ static void fbStoreExternalAlpha(PicturePtr pict, int x, int y, int width, CARD3
store(bits, buffer, x, width, indexed);
astore(alpha_bits, buffer, ax - pict->alphaOrigin.x, width, aindexed);
+
+ fbFinishAccess (pict->alphaMap->pDrawable);
+ fbFinishAccess (pict->pDrawable);
}
typedef void (*scanStoreProc)(PicturePtr , int , int , int , CARD32 *);