http://bugs.freedesktop.org/show_bug.cgi?id=9379





--- Comment #12 from Andrew Péteri <[EMAIL PROTECTED]>  2008-01-22 03:53:55 PST 
---
Created an attachment (id=13855)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=13855)
patch to fix various span locking issues

Here goes my proposed patch for fixing some locking issues with the r128.

I think that most of the problems are caused by some primitives which ended up
in the software rasterizer without setting up the software part first. The
defined HW_LOCK() and HW_UNLOCK() macros mentioned in comment #11 caused
"double locking" ("*ERROR* 3 holds heavyweight lock"), if the correct fallback
path was taken, and r128SpanRenderStart was called before reading/writing
buffers. Removing these #defines as in the radeon source - leaving the job
solely to ...SpanRenderStart and ...SpanRenderFinish - in turn left the
software rasterizer without *any* locking for some primitives, which resulted
in early application termination (because now eg. r128WaitForIdleLocked could
be called without acquiring the locks -- hence the "*ERROR* r128_cce_idle
called without lock held").

I added two new fallback flags based on error logs - after removing the
#defines, blender crashed shortly after enabling GL_LINE_STIPPLE, and
armagetron had some problems with GL_POLYGON_SMOOTH. (armagetron also has
GL_LINE_SMOOTH, but it didn't crash when enabled, so I didn't add a separate
case for it.)

Another issue is caused by projective textures (seen in armagetron). In
r128RenderStart, when the routine determines from the vertex format (texture
coordinate size) that software rendering should be enabled, it is already "too
late" - some of the function pointer changes that _swsetup_Wakeup makes
(particularly tnl->Driver.Render.Start, which is changed to
_swsetup_RenderStart in _swsetup_Wakeup, which in turn would call
r128SpanRenderStart to acquire proper locking) will only take effect (if at
all) at the beginning of the next frame. So, once again, no locking would take
place for that iteration. I added a check to see if R128_FALLBACK_PROJTEX was
actually set in FALLBACK, and a call to run tnl->Driver.Render.Start if needed.
This part is commented out, because I'm not sure if this is the right way to
handle this; so, for now, projective textures are disabled by this patch.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to