Mesa (lp-binning): llvmpipe: simplify the tiles_x, tiles_y code a bit

Brian Paul brianp at kemper.freedesktop.org
Thu Dec 10 13:56:53 PST 2009


Module: Mesa
Branch: lp-binning
Commit: ad3c16c127f167513a136759a1700e111a0ef7b8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad3c16c127f167513a136759a1700e111a0ef7b8

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Dec  9 16:30:05 2009 -0700

llvmpipe: simplify the tiles_x, tiles_y code a bit

---

 src/gallium/drivers/llvmpipe/lp_bin.c   |   10 ++++++----
 src/gallium/drivers/llvmpipe/lp_bin.h   |    5 ++---
 src/gallium/drivers/llvmpipe/lp_setup.c |   12 +++---------
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bin.c b/src/gallium/drivers/llvmpipe/lp_bin.c
index f2d3c2d..703cdd2 100644
--- a/src/gallium/drivers/llvmpipe/lp_bin.c
+++ b/src/gallium/drivers/llvmpipe/lp_bin.c
@@ -25,6 +25,7 @@
  *
  **************************************************************************/
 
+#include "util/u_math.h"
 #include "util/u_memory.h"
 #include "lp_bin.h"
 
@@ -137,13 +138,14 @@ lp_free_bin_data(struct lp_bins *bins)
 
 
 void
-lp_bin_set_num_bins( struct lp_bins *bins,
-                     unsigned tiles_x, unsigned tiles_y )
+lp_bin_set_framebuffer_size( struct lp_bins *bins,
+                             unsigned width, unsigned height )
 {
-   bins->tiles_x = tiles_x;
-   bins->tiles_y = tiles_y;
+   bins->tiles_x = align(width, TILE_SIZE) / TILE_SIZE;
+   bins->tiles_y = align(height, TILE_SIZE) / TILE_SIZE;
 }
 
+
 void
 lp_bin_new_cmd_block( struct cmd_block_list *list )
 {
diff --git a/src/gallium/drivers/llvmpipe/lp_bin.h b/src/gallium/drivers/llvmpipe/lp_bin.h
index c49b026..4394e7b 100644
--- a/src/gallium/drivers/llvmpipe/lp_bin.h
+++ b/src/gallium/drivers/llvmpipe/lp_bin.h
@@ -131,9 +131,8 @@ void lp_reset_bins(struct lp_bins *bins );
 
 void lp_free_bin_data(struct lp_bins *bins);
 
-void
-lp_bin_set_num_bins( struct lp_bins *bins,
-                     unsigned tiles_x, unsigned tiles_y );
+void lp_bin_set_framebuffer_size( struct lp_bins *bins,
+                                  unsigned width, unsigned height );
 
 void lp_bin_new_data_block( struct data_block_list *list );
 
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 889f92a..3ef9cda 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -34,7 +34,6 @@
 
 #include "pipe/p_defines.h"
 #include "pipe/p_inlines.h"
-#include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_pack_color.h"
 #include "lp_bin.h"
@@ -62,9 +61,8 @@ lp_setup_get_current_bins(struct setup_context *setup)
       if(0)lp_reset_bins( setup->bins ); /* XXX temporary? */
 
       if (setup->fb) {
-         unsigned tiles_x = align(setup->fb->width, TILE_SIZE) / TILE_SIZE;
-         unsigned tiles_y = align(setup->fb->height, TILE_SIZE) / TILE_SIZE;
-         lp_bin_set_num_bins(setup->bins, tiles_x, tiles_y);
+         lp_bin_set_framebuffer_size(setup->bins,
+                                     setup->fb->width, setup->fb->height);
       }
    }
    return setup->bins;
@@ -244,7 +242,6 @@ lp_setup_bind_framebuffer( struct setup_context *setup,
                            const struct pipe_framebuffer_state *fb )
 {
    struct lp_bins *bins = lp_setup_get_current_bins(setup);
-   unsigned tiles_x, tiles_y;
 
    LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
 
@@ -252,10 +249,7 @@ lp_setup_bind_framebuffer( struct setup_context *setup,
 
    setup->fb = fb;
 
-   tiles_x = align(setup->fb->width, TILE_SIZE) / TILE_SIZE;
-   tiles_y = align(setup->fb->height, TILE_SIZE) / TILE_SIZE;
-
-   lp_bin_set_num_bins(bins, tiles_x, tiles_y);
+   lp_bin_set_framebuffer_size(bins, setup->fb->width, setup->fb->height);
 }
 
 



More information about the mesa-commit mailing list