Mesa (master): r300g: set correct pitch in libdrm

Marek Olšák mareko at kemper.freedesktop.org
Mon May 31 02:16:57 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon May 31 04:01:56 2010 +0200

r300g: set correct pitch in libdrm

to match what DDX sets. This prevents some flushes from occuring.

---

 src/gallium/drivers/r300/r300_state.c   |   12 ++++++------
 src/gallium/drivers/r300/r300_texture.c |   12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index d68f403..cfec8ac 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -540,18 +540,18 @@ static void r300_fb_set_tiling_flags(struct r300_context *r300,
         level = new_state->cbufs[i]->level;
 
         r300->rws->buffer_set_tiling(r300->rws, tex->buffer,
-                                        tex->pitch[0],
-                                        tex->microtile,
-                                        tex->mip_macrotile[level]);
+                tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
+                tex->microtile,
+                tex->mip_macrotile[level]);
     }
     if (new_state->zsbuf) {
         tex = r300_texture(new_state->zsbuf->texture);
         level = new_state->zsbuf->level;
 
         r300->rws->buffer_set_tiling(r300->rws, tex->buffer,
-                                        tex->pitch[0],
-                                        tex->microtile,
-                                        tex->mip_macrotile[level]);
+                tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
+                tex->microtile,
+                tex->mip_macrotile[level]);
     }
 }
 
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 4a5c932..a4b5d34 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -963,9 +963,9 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
                                      base->bind,
 				     tex->size);
     rws->buffer_set_tiling(rws, tex->buffer,
-			   tex->pitch[0],
-			   tex->microtile,
-			   tex->macrotile);
+            tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
+            tex->microtile,
+            tex->macrotile);
 
     if (!tex->buffer) {
         FREE(tex);
@@ -1093,9 +1093,9 @@ r300_texture_from_handle(struct pipe_screen* screen,
 
     if (override_zb_flags) {
         rws->buffer_set_tiling(rws, tex->buffer,
-                               tex->pitch[0],
-                               tex->microtile,
-                               tex->macrotile);
+                tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
+                tex->microtile,
+                tex->macrotile);
     }
     return (struct pipe_resource*)tex;
 }




More information about the mesa-commit mailing list