i915: reference __DRI_ATTRIB_SWAP_COPY token over the GLX one
[mesa.git] / src / mesa / drivers / dri / i915 / intel_tex_copy.c
index d018cece1cb5137294b35ed930790fcb9d5774b5..4b087b6162979724ecd6f98abebb9064b569195b 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2003 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +18,7 @@
  * 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.
@@ -41,9 +41,6 @@
 #include "intel_fbo.h"
 #include "intel_tex.h"
 #include "intel_blit.h"
-#ifndef I915
-#include "brw_context.h"
-#endif
 
 #define FILE_DEBUG_FLAG DEBUG_TEXTURE
 
@@ -59,21 +56,10 @@ intel_copy_texsubimage(struct intel_context *intel,
 
    intel_prepare_render(intel);
 
-   /* glCopyTexSubImage() can be called on a multisampled renderbuffer (if
-    * that renderbuffer is associated with the window system framebuffer),
-    * however the hardware blitter can't handle this case, so fall back to
-    * meta (which can, since it uses ReadPixels).
-    */
-   if (irb->Base.Base.NumSamples != 0)
-      return false;
-
-   /* glCopyTexSubImage() can't be called on a multisampled texture. */
-   assert(intelImage->base.Base.NumSamples == 0);
-
    if (!intelImage->mt || !irb || !irb->mt) {
       if (unlikely(INTEL_DEBUG & DEBUG_PERF))
         fprintf(stderr, "%s fail %p %p (0x%08x)\n",
-                __FUNCTION__, intelImage->mt, irb, internalFormat);
+                __func__, intelImage->mt, irb, internalFormat);
       return false;
    }
 
@@ -84,7 +70,7 @@ intel_copy_texsubimage(struct intel_context *intel,
                            intelImage->mt, intelImage->base.Base.Level,
                            intelImage->base.Base.Face + slice,
                            dstx, dsty, false,
-                           width, height, GL_COPY)) {
+                           width, height, COLOR_LOGICOP_COPY)) {
       return false;
    }
 
@@ -102,14 +88,7 @@ intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
 {
    struct intel_context *intel = intel_context(ctx);
 
-#ifndef I915
-   /* Try BLORP first.  It can handle almost everything. */
-   if (brw_blorp_copytexsubimage(intel, rb, texImage, slice, x, y,
-                                 xoffset, yoffset, width, height))
-      return;
-#endif
-
-   /* Next, try the BLT engine. */
+   /* Try the BLT engine. */
    if (intel_copy_texsubimage(intel,
                               intel_texture_image(texImage),
                               xoffset, yoffset, slice,
@@ -117,8 +96,8 @@ intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
       return;
    }
 
-   /* Finally, fall back to meta.  This will likely be slow. */
-   perf_debug("%s - fallback to swrast\n", __FUNCTION__);
+   /* Otherwise, fall back to meta.  This will likely be slow. */
+   perf_debug("%s - fallback to swrast\n", __func__);
    _mesa_meta_CopyTexSubImage(ctx, dims, texImage,
                               xoffset, yoffset, slice,
                               rb, x, y, width, height);