Mesa (master): intel: Reduce intel_renderbuffer_tile_offsets to a thin wrapper.

Eric Anholt anholt at kemper.freedesktop.org
Tue May 28 20:09:46 UTC 2013


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Feb  4 10:05:51 2013 -0800

intel: Reduce intel_renderbuffer_tile_offsets to a thin wrapper.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Paul Berry <stereotype441 at gmail.com>

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   26 --------------------------
 src/mesa/drivers/dri/intel/intel_fbo.h |    9 +++++++--
 2 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 69f8629..34f31fb 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -535,32 +535,6 @@ intel_renderbuffer_set_draw_offset(struct intel_renderbuffer *irb)
 }
 
 /**
- * Rendering to tiled buffers requires that the base address of the
- * buffer be aligned to a page boundary.  We generally render to
- * textures by pointing the surface at the mipmap image level, which
- * may not be aligned to a tile boundary.
- *
- * This function returns an appropriately-aligned base offset
- * according to the tiling restrictions, plus any required x/y offset
- * from there.
- */
-uint32_t
-intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
-				uint32_t *tile_x,
-				uint32_t *tile_y)
-{
-   struct intel_region *region = irb->mt->region;
-   uint32_t mask_x, mask_y;
-
-   intel_region_get_tile_masks(region, &mask_x, &mask_y, false);
-
-   *tile_x = irb->draw_x & mask_x;
-   *tile_y = irb->draw_y & mask_y;
-   return intel_region_get_aligned_offset(region, irb->draw_x & ~mask_x,
-                                          irb->draw_y & ~mask_y, false);
-}
-
-/**
  * Called by glFramebufferTexture[123]DEXT() (and other places) to
  * prepare for rendering into texture memory.  This might be called
  * many times to choose different texture levels, cube faces, etc
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index aa52b97..5d6dc7e 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -33,6 +33,7 @@
 #include "main/formats.h"
 #include "main/macros.h"
 #include "intel_context.h"
+#include "intel_mipmap_tree.h"
 #include "intel_screen.h"
 
 #ifdef __cplusplus
@@ -148,10 +149,14 @@ intel_flip_renderbuffers(struct gl_framebuffer *fb);
 void
 intel_renderbuffer_set_draw_offset(struct intel_renderbuffer *irb);
 
-uint32_t
+static inline uint32_t
 intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
 				uint32_t *tile_x,
-				uint32_t *tile_y);
+				uint32_t *tile_y)
+{
+   return intel_miptree_get_tile_offsets(irb->mt, irb->mt_level, irb->mt_layer,
+                                         tile_x, tile_y);
+}
 
 struct intel_region*
 intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex);




More information about the mesa-commit mailing list