Mesa (master): intel: Fold intel_region_copy() into its one caller.

Eric Anholt anholt at kemper.freedesktop.org
Wed Mar 6 00:14:47 UTC 2013


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jan 28 11:32:49 2013 +1100

intel: Fold intel_region_copy() into its one caller.

This is similar code to intel_miptree_copy_slice, but the knobs
are all set differently.

v2: fix whitespace

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

---

 src/mesa/drivers/dri/intel/intel_pixel_copy.c |   22 +++++++++++----
 src/mesa/drivers/dri/intel/intel_regions.c    |   34 -------------------------
 src/mesa/drivers/dri/intel/intel_regions.h    |   13 ---------
 3 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index 8cbda07..5d80fed 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -39,6 +39,7 @@
 #include "intel_regions.h"
 #include "intel_pixel.h"
 #include "intel_fbo.h"
+#include "intel_blit.h"
 
 #define FILE_DEBUG_FLAG DEBUG_PIXEL
 
@@ -193,12 +194,21 @@ do_blit_copypixels(struct gl_context * ctx,
    dstx += draw_irb->draw_x;
    dsty += draw_irb->draw_y;
 
-   if (!intel_region_copy(intel,
-			  draw_irb->mt->region, 0, dstx, dsty,
-			  read_irb->mt->region, 0, srcx, srcy,
-			  width, height, flip,
-			  ctx->Color.ColorLogicOpEnabled ?
-			  ctx->Color.LogicOp : GL_COPY)) {
+   uint32_t src_pitch = read_irb->mt->region->pitch;
+   if (flip)
+      src_pitch = -src_pitch;
+
+   if (!intelEmitCopyBlit(intel,
+                          draw_irb->mt->cpp,
+                          src_pitch, read_irb->mt->region->bo,
+                          0, read_irb->mt->region->tiling,
+                          draw_irb->mt->region->pitch, draw_irb->mt->region->bo,
+                          0, draw_irb->mt->region->tiling,
+                          srcx, srcy,
+                          dstx, dsty,
+                          width, height,
+                          ctx->Color.ColorLogicOpEnabled ?
+                          ctx->Color.LogicOp : GL_COPY)) {
       DBG("%s: blit failure\n", __FUNCTION__);
       return false;
    }
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index eff306b..90b985d 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -244,40 +244,6 @@ intel_region_release(struct intel_region **region_handle)
    *region_handle = NULL;
 }
 
-/* Copy rectangular sub-regions. Need better logic about when to
- * push buffers into AGP - will currently do so whenever possible.
- */
-bool
-intel_region_copy(struct intel_context *intel,
-                  struct intel_region *dst,
-                  GLuint dst_offset,
-                  GLuint dstx, GLuint dsty,
-                  struct intel_region *src,
-                  GLuint src_offset,
-                  GLuint srcx, GLuint srcy, GLuint width, GLuint height,
-		  bool flip,
-		  GLenum logicop)
-{
-   uint32_t src_pitch = src->pitch;
-
-   _DBG("%s\n", __FUNCTION__);
-
-   if (intel == NULL)
-      return false;
-
-   assert(src->cpp == dst->cpp);
-
-   if (flip)
-      src_pitch = -src_pitch;
-
-   return intelEmitCopyBlit(intel,
-			    dst->cpp,
-			    src_pitch, src->bo, src_offset, src->tiling,
-			    dst->pitch, dst->bo, dst_offset, dst->tiling,
-			    srcx, srcy, dstx, dsty, width, height,
-			    logicop);
-}
-
 /**
  * This function computes masks that may be used to select the bits of the X
  * and Y coordinates that indicate the offset within a tile.  If the region is
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index 56f6ec5..06a4b98 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -97,19 +97,6 @@ void intel_region_release(struct intel_region **ib);
 
 void intel_recreate_static_regions(struct intel_context *intel);
 
-/* Copy rectangular sub-regions
- */
-bool
-intel_region_copy(struct intel_context *intel,
-		  struct intel_region *dest,
-		  GLuint dest_offset,
-		  GLuint destx, GLuint desty,
-		  struct intel_region *src,
-		  GLuint src_offset,
-		  GLuint srcx, GLuint srcy, GLuint width, GLuint height,
-		  bool flip,
-		  GLenum logicop);
-
 void
 intel_region_get_tile_masks(struct intel_region *region,
                             uint32_t *mask_x, uint32_t *mask_y,




More information about the mesa-commit mailing list