i965: Enabled the OES_copy_image extension on Gen 7 GPUs
[mesa.git] / src / mesa / drivers / dri / i965 / intel_pixel_draw.c
index 1afa6c269163503893fdb7f36af8e7bc6ee686ad..9b7d436599fcd589b1f765b908bb08b05d3a0431 100644 (file)
@@ -6,7 +6,7 @@
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
+ * distribute, sublicense, 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 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.
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  * 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"
 #include "main/enums.h"
 #include "main/image.h"
 #include "main/glformats.h"
@@ -58,7 +57,7 @@ do_blit_drawpixels(struct gl_context * ctx,
    struct brw_context *brw = brw_context(ctx);
    struct intel_buffer_object *src = intel_buffer_object(unpack->BufferObj);
    GLuint src_offset;
-   drm_intel_bo *src_buffer;
+   struct brw_bo *src_buffer;
 
    DBG("%s\n", __func__);
 
@@ -110,7 +109,7 @@ do_blit_drawpixels(struct gl_context * ctx,
                                    format, type, 0, 0, 0);
 
    src_buffer = intel_bufferobj_buffer(brw, src, src_offset,
-                                       height * src_stride);
+                                       height * src_stride, false);
 
    struct intel_mipmap_tree *pbo_mt =
       intel_miptree_create_for_bo(brw,
@@ -119,7 +118,8 @@ do_blit_drawpixels(struct gl_context * ctx,
                                   src_offset,
                                   width, height, 1,
                                   src_stride,
-                                  0);
+                                  ISL_TILING_LINEAR,
+                                  MIPTREE_CREATE_DEFAULT);
    if (!pbo_mt)
       return false;
 
@@ -127,8 +127,8 @@ do_blit_drawpixels(struct gl_context * ctx,
                            pbo_mt, 0, 0,
                            0, 0, src_flip,
                            irb->mt, irb->mt_level, irb->mt_layer,
-                           x, y, _mesa_is_winsys_fbo(ctx->DrawBuffer),
-                           width, height, GL_COPY)) {
+                           x, y, ctx->DrawBuffer->FlipY,
+                           width, height, COLOR_LOGICOP_COPY)) {
       DBG("%s: blit failed\n", __func__);
       intel_miptree_release(&pbo_mt);
       return false;
@@ -163,7 +163,8 @@ intelDrawPixels(struct gl_context * ctx,
       return;
    }
 
-   if (_mesa_is_bufferobj(unpack->BufferObj)) {
+   if (brw->screen->devinfo.gen < 6 &&
+       _mesa_is_bufferobj(unpack->BufferObj)) {
       if (do_blit_drawpixels(ctx, x, y, width, height, format, type, unpack,
                             pixels)) {
         return;