i965: Refactor SIMD16-to-2xSIMD8 checks.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_pixel_draw.c
index 477586e1f057ab72f4722988dc420c40ea83e78b..e0904de2ba37d727fde7a17fc0ac442c0217b73b 100644 (file)
@@ -1,8 +1,8 @@
 /**************************************************************************
- * 
- * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ *
+ * Copyright 2006 VMware, Inc.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portionsalloc
  * of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
  **************************************************************************/
 
 #include "main/glheader.h"
@@ -44,7 +44,6 @@
 #include "intel_buffers.h"
 #include "intel_fbo.h"
 #include "intel_mipmap_tree.h"
-#include "intel_regions.h"
 #include "intel_pixel.h"
 #include "intel_buffer_objects.h"
 
@@ -72,6 +71,8 @@ do_blit_drawpixels(struct gl_context * ctx,
       return false;
    }
 
+   intel_prepare_render(brw);
+
    struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);
 
@@ -101,19 +102,16 @@ do_blit_drawpixels(struct gl_context * ctx,
    src_offset += _mesa_image_offset(2, unpack, width, height,
                                    format, type, 0, 0, 0);
 
-   intel_prepare_render(brw);
-
-   src_buffer = intel_bufferobj_buffer(brw, src,
-                                      src_offset, width * height *
-                                       irb->mt->cpp);
+   src_buffer = intel_bufferobj_buffer(brw, src, src_offset,
+                                       height * src_stride);
 
    struct intel_mipmap_tree *pbo_mt =
       intel_miptree_create_for_bo(brw,
                                   src_buffer,
                                   irb->mt->format,
                                   src_offset,
-                                  width, height,
-                                  src_stride, I915_TILING_NONE);
+                                  width, height, 1,
+                                  src_stride);
    if (!pbo_mt)
       return false;
 
@@ -133,8 +131,6 @@ do_blit_drawpixels(struct gl_context * ctx,
    if (ctx->Query.CurrentOcclusionObject)
       ctx->Query.CurrentOcclusionObject->Result += width * height;
 
-   intel_check_front_buffer_rendering(brw);
-
    DBG("%s: success\n", __FUNCTION__);
    return true;
 }