/* Fill a rectangular sub-region. Need better logic about when to
* push buffers into AGP - will currently do so whenever possible.
*/
-static ubyte *
-get_pointer(struct pipe_surface *dst, unsigned x, unsigned y)
+static void *
+get_pointer(struct pipe_surface *dst, void *dst_map, unsigned x, unsigned y)
{
- return dst->map + (y * dst->pitch + x) * dst->cpp;
+ return (char *)dst_map + (y * dst->pitch + x) * dst->cpp;
}
{
if (0) {
unsigned i, j;
-
- (void)pipe_surface_map(dst);
+ void *dst_map = pipe_surface_map(dst);
switch (dst->cpp) {
case 1: {
- ubyte *row = get_pointer(dst, dstx, dsty);
+ ubyte *row = get_pointer(dst, dst_map, dstx, dsty);
for (i = 0; i < height; i++) {
memset(row, value, width);
row += dst->pitch;
}
break;
case 2: {
- ushort *row = (ushort *) get_pointer(dst, dstx, dsty);
+ ushort *row = get_pointer(dst, dst_map, dstx, dsty);
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++)
row[j] = (ushort) value;
}
break;
case 4: {
- unsigned *row = (unsigned *) get_pointer(dst, dstx, dsty);
+ unsigned *row = get_pointer(dst, dst_map, dstx, dsty);
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++)
row[j] = value;
assert(0);
break;
}
+
+ pipe_surface_unmap( dst );
}
else {
i915_fill_blit( i915_context(pipe),