Mesa (master): r300: minor accelerated blit fixes

Maciej Cencora osiris at kemper.freedesktop.org
Sat Jan 9 18:55:00 UTC 2010


Module: Mesa
Branch: master
Commit: 0b7b76fb16adface352e2926c8ed476f4f9a9b82
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b7b76fb16adface352e2926c8ed476f4f9a9b82

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Sat Jan  9 19:46:09 2010 +0100

r300: minor accelerated blit fixes

---

 src/mesa/drivers/dri/r300/r300_blit.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c
index 9e3836a..2eec27e 100644
--- a/src/mesa/drivers/dri/r300/r300_blit.c
+++ b/src/mesa/drivers/dri/r300/r300_blit.c
@@ -543,6 +543,16 @@ GLboolean r300_blit(struct r300_context *r300,
     if (_mesa_get_format_bits(src_mesaformat, GL_DEPTH_BITS) > 0)
         return GL_FALSE;
 
+    /* Make sure that colorbuffer has even width - hw limitation */
+    if (dst_pitch % 2 > 0)
+        ++dst_pitch;
+
+    /* Rendering to small buffer doesn't work.
+     * Looks like a hw limitation.
+     */
+    if (dst_pitch < 32)
+        return GL_FALSE;
+
     /* Need to clamp the region size to make sure
      * we don't read outside of the source buffer
      * or write outside of the destination buffer.
@@ -564,7 +574,7 @@ GLboolean r300_blit(struct r300_context *r300,
         fprintf(stderr, "src: size [%d x %d], pitch %d, "
                 "offset [%d x %d], format %s, bo %p\n",
                 src_width, src_height, src_pitch,
-                src_offset, src_y_offset,
+                src_x_offset, src_y_offset,
                 _mesa_get_format_name(src_mesaformat),
                 src_bo);
         fprintf(stderr, "dst: pitch %d, offset[%d x %d], format %s, bo %p\n",
@@ -573,6 +583,9 @@ GLboolean r300_blit(struct r300_context *r300,
         fprintf(stderr, "region: %d x %d\n", reg_width, reg_height);
     }
 
+    /* Flush is needed to make sure that source buffer has correct data */
+    radeonFlush(r300->radeon.glCtx);
+
     if (!validate_buffers(r300, src_bo, dst_bo))
         return GL_FALSE;
 




More information about the mesa-commit mailing list