intel: Assert that the linear blits succeed.
authorEric Anholt <eric@anholt.net>
Wed, 17 Mar 2010 16:26:37 +0000 (09:26 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 17 Mar 2010 18:12:36 +0000 (11:12 -0700)
We don't have any fallback code here, and we want to avoid this path
if failure would happen, so just assert.

src/mesa/drivers/dri/intel/intel_blit.c

index f2769aa3e8cc4ec7a6044a1091156b8d0a292115..f4f93b5a13489af6e9399be36d565f9698a7e601 100644 (file)
@@ -482,6 +482,7 @@ intel_emit_linear_blit(struct intel_context *intel,
                       unsigned int size)
 {
    GLuint pitch, height;
+   GLboolean ok;
 
    /* Blits are in a different ringbuffer so we don't use them. */
    assert(intel->gen < 6);
@@ -489,25 +490,27 @@ intel_emit_linear_blit(struct intel_context *intel,
    /* The pitch is a signed value. */
    pitch = MIN2(size, (1 << 15) - 1);
    height = size / pitch;
-   intelEmitCopyBlit(intel, 1,
-                    pitch, src_bo, src_offset, I915_TILING_NONE,
-                    pitch, dst_bo, dst_offset, I915_TILING_NONE,
-                    0, 0, /* src x/y */
-                    0, 0, /* dst x/y */
-                    pitch, height, /* w, h */
-                    GL_COPY);
+   ok = intelEmitCopyBlit(intel, 1,
+                         pitch, src_bo, src_offset, I915_TILING_NONE,
+                         pitch, dst_bo, dst_offset, I915_TILING_NONE,
+                         0, 0, /* src x/y */
+                         0, 0, /* dst x/y */
+                         pitch, height, /* w, h */
+                         GL_COPY);
+   assert(ok);
 
    src_offset += pitch * height;
    dst_offset += pitch * height;
    size -= pitch * height;
    assert (size < (1 << 15));
    if (size != 0) {
-      intelEmitCopyBlit(intel, 1,
-                       size, src_bo, src_offset, I915_TILING_NONE,
-                       size, dst_bo, dst_offset, I915_TILING_NONE,
-                       0, 0, /* src x/y */
-                       0, 0, /* dst x/y */
-                       size, 1, /* w, h */
-                       GL_COPY);
+      ok = intelEmitCopyBlit(intel, 1,
+                            size, src_bo, src_offset, I915_TILING_NONE,
+                            size, dst_bo, dst_offset, I915_TILING_NONE,
+                            0, 0, /* src x/y */
+                            0, 0, /* dst x/y */
+                            size, 1, /* w, h */
+                            GL_COPY);
+      assert(ok);
    }
 }