From e54329233522591bbe8aad8a3fd6bcdc1e430f03 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 20 Dec 2007 16:49:25 +0800 Subject: i915: avoid dead lock in intel_meta_draw_poly. fix #13696 --- src/mesa/drivers/dri/i915/intel_tris.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/i915/intel_tris.c') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 4b45dc065c..474113cd63 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1074,8 +1074,10 @@ intel_meta_draw_poly(struct intel_context *intel, { union fi *vb; GLint i; + GLboolean was_locked = intel->locked; - LOCK_HARDWARE(intel); + if (!was_locked) + LOCK_HARDWARE(intel); /* All 3d primitives should be emitted with INTEL_BATCH_CLIPRECTS, * otherwise the drawing origin (DR4) might not be set correctly. @@ -1094,7 +1096,9 @@ intel_meta_draw_poly(struct intel_context *intel, } INTEL_FIREVERTICES(intel); - UNLOCK_HARDWARE(intel); + + if (!was_locked) + UNLOCK_HARDWARE(intel); } void -- cgit v1.2.3 From fcd1e9dad6949e02380593a166432dbac311c80e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 20 Dec 2007 08:19:42 -0800 Subject: [i915] Move meta_draw_quad into the vtbl with other meta operations. --- src/mesa/drivers/dri/i915/intel_tris.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/i915/intel_tris.c') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 474113cd63..61b0bb3fd3 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1066,7 +1066,7 @@ union fi /**********************************************************************/ /* Used only with the metaops callbacks. */ /**********************************************************************/ -void +static void intel_meta_draw_poly(struct intel_context *intel, GLuint n, GLfloat xy[][2], @@ -1101,7 +1101,7 @@ intel_meta_draw_poly(struct intel_context *intel, UNLOCK_HARDWARE(intel); } -void +static void intel_meta_draw_quad(struct intel_context *intel, GLfloat x0, GLfloat x1, GLfloat y0, GLfloat y1, @@ -1143,6 +1143,7 @@ intel_meta_draw_quad(struct intel_context *intel, void intelInitTriFuncs(GLcontext * ctx) { + struct intel_context *intel = intel_context(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); static int firsttime = 1; @@ -1159,4 +1160,6 @@ intelInitTriFuncs(GLcontext * ctx) tnl->Driver.Render.BuildVertices = _tnl_build_vertices; tnl->Driver.Render.CopyPV = _tnl_copy_pv; tnl->Driver.Render.Interp = _tnl_interp; + + intel->vtbl.meta_draw_quad = intel_meta_draw_quad; } -- cgit v1.2.3