i965/gen9: Optimize slice and subslice load balancing behavior.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_pixel_bitmap.c
index 54a741395eb611847909f2cf25463df4c4a0779e..249a077cf994bb1fcdbf4506475211fb01da8eb2 100644 (file)
@@ -47,7 +47,6 @@
 #include "intel_image.h"
 #include "intel_buffers.h"
 #include "intel_pixel.h"
-#include "intel_reg.h"
 
 
 #define FILE_DEBUG_FLAG DEBUG_PIXEL
@@ -159,10 +158,10 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
 static inline int
 y_flip(struct gl_framebuffer *fb, int y, int height)
 {
-   if (_mesa_is_user_fbo(fb))
-      return y;
-   else
+   if (fb->FlipY)
       return fb->Height - y - height;
+   else
+      return y;
 }
 
 /*
@@ -257,7 +256,7 @@ do_blit_bitmap( struct gl_context *ctx,
    /* The blitter has no idea about fast color clears, so we need to resolve
     * the miptree before we do anything.
     */
-   intel_miptree_resolve_color(brw, irb->mt, 0);
+   intel_miptree_access_raw(brw, irb->mt, irb->mt_level, irb->mt_layer, true);
 
    /* Chop it all into chunks that can be digested by hardware: */
    for (py = 0; py < height; py += DY) {
@@ -265,8 +264,8 @@ do_blit_bitmap( struct gl_context *ctx,
         int h = MIN2(DY, height - py);
         int w = MIN2(DX, width - px);
         GLuint sz = ALIGN(ALIGN(w,8) * h, 64)/8;
-        GLenum logic_op = ctx->Color.ColorLogicOpEnabled ?
-           ctx->Color.LogicOp : GL_COPY;
+        const enum gl_logicop_mode logic_op = ctx->Color.ColorLogicOpEnabled ?
+           ctx->Color._LogicOp : COLOR_LOGICOP_COPY;
 
         assert(sz <= sizeof(stipple));
         memset(stipple, 0, sz);
@@ -284,7 +283,7 @@ do_blit_bitmap( struct gl_context *ctx,
                                      w, h,
                                      (GLubyte *)stipple,
                                      8,
-                                     _mesa_is_winsys_fbo(fb));
+                                     fb->FlipY);
          if (count == 0)
            continue;
 
@@ -293,10 +292,10 @@ do_blit_bitmap( struct gl_context *ctx,
                                                (GLubyte *)stipple,
                                                sz,
                                                color,
-                                               irb->mt->pitch,
+                                               irb->mt->surf.row_pitch_B,
                                                irb->mt->bo,
-                                               0,
-                                               irb->mt->tiling,
+                                               irb->mt->offset,
+                                               irb->mt->surf.tiling,
                                                dstx + px,
                                                dsty + py,
                                                w, h,
@@ -349,11 +348,13 @@ intelBitmap(struct gl_context * ctx,
            const struct gl_pixelstore_attrib *unpack,
            const GLubyte * pixels)
 {
+   struct brw_context *brw = brw_context(ctx);
+
    if (!_mesa_check_conditional_render(ctx))
       return;
 
-   if (do_blit_bitmap(ctx, x, y, width, height,
-                          unpack, pixels))
+   if (brw->screen->devinfo.gen < 6 &&
+       do_blit_bitmap(ctx, x, y, width, height, unpack, pixels))
       return;
 
    _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels);