Mesa (master): intel: Call intel_prepare_render() before looking up regions .

2010-03-23 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 62d54f0387610ec4f71cc3d0fb2a5d49e370a0ef
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=62d54f0387610ec4f71cc3d0fb2a5d49e370a0ef

Author: Kristian Høgsberg 
Date:   Mon Mar 22 17:54:35 2010 -0400

intel: Call intel_prepare_render() before looking up regions.

Fixes #27213.

---

 src/mesa/drivers/dri/intel/intel_blit.c|2 --
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |2 ++
 src/mesa/drivers/dri/intel/intel_pixel_copy.c  |   11 +++
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_blit.c 
b/src/mesa/drivers/dri/intel/intel_blit.c
index f2769aa..4ad42a7 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -119,8 +119,6 @@ intelEmitCopyBlit(struct intel_context *intel,
break;
} while (pass < 2);
 
-   intel_prepare_render(intel);
-
if (pass >= 2) {
   drm_intel_gem_bo_map_gtt(dst_buffer);
   drm_intel_gem_bo_map_gtt(src_buffer);
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 4f14946..1b340af 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -520,6 +520,8 @@ intel_miptree_image_copy(struct intel_context *intel,
width = ALIGN(width, align_w);
}
 
+   intel_prepare_render(intel);
+
for (i = 0; i < depth; i++) {
   intel_miptree_get_image_offset(src, level, face, i, &src_x, &src_y);
   intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y);
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c 
b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index f4f3fd6..757f2f7 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -108,8 +108,8 @@ do_blit_copypixels(GLcontext * ctx,
GLint dstx, GLint dsty, GLenum type)
 {
struct intel_context *intel = intel_context(ctx);
-   struct intel_region *dst = intel_drawbuf_region(intel);
-   struct intel_region *src = copypix_src_region(intel, type);
+   struct intel_region *dst;
+   struct intel_region *src;
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_framebuffer *read_fb = ctx->ReadBuffer;
GLint orig_dstx;
@@ -133,13 +133,16 @@ do_blit_copypixels(GLcontext * ctx,
ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
   return GL_FALSE;
 
+   intel_prepare_render(intel);
+
+   dst = intel_drawbuf_region(intel);
+   src = copypix_src_region(intel, type);
+
if (!src || !dst)
   return GL_FALSE;
 
intelFlush(&intel->ctx);
 
-   intel_prepare_render(intel);
-
/* XXX: We fail to handle different inversion between read and draw 
framebuffer. */
 
/* Clip to destination buffer. */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): intel: Call intel_prepare_render() before looking up regions .

2010-03-22 Thread Kristian Høgsberg
Module: Mesa
Branch: master
Commit: 6422cf387baef75df9e5dbbed5cea4c0f495fe41
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6422cf387baef75df9e5dbbed5cea4c0f495fe41

Author: Kristian Høgsberg 
Date:   Mon Mar 22 17:54:35 2010 -0400

intel: Call intel_prepare_render() before looking up regions.

Fixes #27213.

---

 src/mesa/drivers/dri/intel/intel_blit.c|2 --
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |2 ++
 src/mesa/drivers/dri/intel/intel_pixel_copy.c  |   11 +++
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_blit.c 
b/src/mesa/drivers/dri/intel/intel_blit.c
index 4617370..167140d 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -119,8 +119,6 @@ intelEmitCopyBlit(struct intel_context *intel,
break;
} while (pass < 2);
 
-   intel_prepare_render(intel);
-
if (pass >= 2)
   return GL_FALSE;
 
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index e671355..ef1966e 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -448,6 +448,8 @@ intel_miptree_image_copy(struct intel_context *intel,
width = ALIGN(width, align_w);
}
 
+   intel_prepare_render(intel);
+
for (i = 0; i < depth; i++) {
   intel_miptree_get_image_offset(src, level, face, i, &src_x, &src_y);
   intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y);
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c 
b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index 8efb7a6..56faf07 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -108,8 +108,8 @@ do_blit_copypixels(GLcontext * ctx,
GLint dstx, GLint dsty, GLenum type)
 {
struct intel_context *intel = intel_context(ctx);
-   struct intel_region *dst = intel_drawbuf_region(intel);
-   struct intel_region *src = copypix_src_region(intel, type);
+   struct intel_region *dst;
+   struct intel_region *src;
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_framebuffer *read_fb = ctx->ReadBuffer;
GLint orig_dstx;
@@ -134,13 +134,16 @@ do_blit_copypixels(GLcontext * ctx,
ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
   return GL_FALSE;
 
+   intel_prepare_render(intel);
+
+   dst = intel_drawbuf_region(intel);
+   src = copypix_src_region(intel, type);
+
if (!src || !dst)
   return GL_FALSE;
 
intelFlush(&intel->ctx);
 
-   intel_prepare_render(intel);
-
/* Clip to destination buffer. */
orig_dstx = dstx;
orig_dsty = dsty;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit