i965/vec4: Simplify opt_reduce_swizzle() using the swizzle utils.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_pixel_bitmap.c
index 34edc246cc3a4add49e2ad818012ff31814aa014..1b3f952f4fbb9a196a8d909f3635835644c55a04 100644 (file)
@@ -47,7 +47,7 @@
 #include "intel_batchbuffer.h"
 #include "intel_blit.h"
 #include "intel_fbo.h"
-#include "intel_regions.h"
+#include "intel_image.h"
 #include "intel_buffers.h"
 #include "intel_pixel.h"
 #include "intel_reg.h"
@@ -79,7 +79,8 @@ static const GLubyte *map_pbo( struct gl_context *ctx,
 
    buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
                                                GL_MAP_READ_BIT,
-                                               unpack->BufferObj);
+                                               unpack->BufferObj,
+                                                MAP_INTERNAL);
    if (!buf) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)");
       return NULL;
@@ -233,7 +234,7 @@ do_blit_bitmap( struct gl_context *ctx,
    case MESA_FORMAT_B8G8R8X8_UNORM:
       color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
       break;
-   case MESA_FORMAT_RGB565:
+   case MESA_FORMAT_B5G6R5_UNORM:
       color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]);
       break;
    default:
@@ -295,10 +296,10 @@ do_blit_bitmap( struct gl_context *ctx,
                                                (GLubyte *)stipple,
                                                sz,
                                                color,
-                                               irb->mt->region->pitch,
-                                               irb->mt->region->bo,
+                                               irb->mt->pitch,
+                                               irb->mt->bo,
                                                0,
-                                               irb->mt->region->tiling,
+                                               irb->mt->tiling,
                                                dstx + px,
                                                dsty + py,
                                                w, h,
@@ -317,11 +318,9 @@ out:
 
    if (_mesa_is_bufferobj(unpack->BufferObj)) {
       /* done with PBO so unmap it now */
-      ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
+      ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj, MAP_INTERNAL);
    }
 
-   intel_check_front_buffer_rendering(brw);
-
    return true;
 }