summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple/i915_surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_surface.c')
-rw-r--r--src/mesa/pipe/i915simple/i915_surface.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c
index 79e74e1143..4e1b0929ee 100644
--- a/src/mesa/pipe/i915simple/i915_surface.c
+++ b/src/mesa/pipe/i915simple/i915_surface.c
@@ -171,10 +171,10 @@ i915_surface_copy(struct pipe_context *pipe,
/* 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;
}
@@ -186,12 +186,11 @@ i915_surface_fill(struct pipe_context *pipe,
{
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;
@@ -199,7 +198,7 @@ i915_surface_fill(struct pipe_context *pipe,
}
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;
@@ -208,7 +207,7 @@ i915_surface_fill(struct pipe_context *pipe,
}
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;
@@ -220,6 +219,8 @@ i915_surface_fill(struct pipe_context *pipe,
assert(0);
break;
}
+
+ pipe_surface_unmap( dst );
}
else {
i915_fill_blit( i915_context(pipe),