Mesa (7.9): mesa/r300classic: Fix dri2Invalidate/ radeon_prepare_render for page flipping.

Alex Deucher agd5f at kemper.freedesktop.org
Mon Nov 8 18:54:28 UTC 2010


Module: Mesa
Branch: 7.9
Commit: 2fe82c281d48f72fd86a63378397d9770c4b4761
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fe82c281d48f72fd86a63378397d9770c4b4761

Author: Mario Kleiner <mario.kleiner at tuebingen.mpg.de>
Date:   Mon Nov  8 04:09:33 2010 +0100

mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.

A call to radeon_prepare_render() at the beginning of draw
operations was placed too deep in the call chain,
inside r300RunRenderPrimitive(), instead of
r300DrawPrims() where it belongs. This leads to
emission of stale target color renderbuffer into the cs if
bufferswaps via page-flipping are used, and thereby causes
massive rendering corruption due to unsynchronized
rendering into the active frontbuffer.

This patch fixes such problems for use with the
upcoming radeon page-flipping patches.

Signed-off-by: Mario Kleiner <mario.kleiner at tuebingen.mpg.de>

---

 src/mesa/drivers/dri/r300/r300_draw.c   |    4 ++++
 src/mesa/drivers/dri/r300/r300_render.c |    2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c
index 5ae9f49..767778b 100644
--- a/src/mesa/drivers/dri/r300/r300_draw.c
+++ b/src/mesa/drivers/dri/r300/r300_draw.c
@@ -717,6 +717,10 @@ static void r300DrawPrims(GLcontext *ctx,
 			 GLuint max_index)
 {
 	GLboolean retval;
+	struct r300_context *r300 = R300_CONTEXT(ctx);
+	radeonContextPtr radeon = &r300->radeon;
+
+	radeon_prepare_render(radeon);
 
 	/* This check should get folded into just the places that
 	 * min/max index are really needed.
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index cf89ab7..bb8f914 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -327,8 +327,6 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim)
 	BATCH_LOCALS(&rmesa->radeon);
 	int type, num_verts;
 
-	radeon_prepare_render(&rmesa->radeon);
-
 	type = r300PrimitiveType(rmesa, prim);
 	num_verts = r300NumVerts(rmesa, end - start, prim);
 




More information about the mesa-commit mailing list