Hi,

While working with radeon i stumble on unbalanced mapping of
rendering buffer. Things is softpipe_map_surfaces get call
several time by softpipe_draw_elements but a comment in this
function stipulate that it wants to let surface mapped so
there is no call to softpipe_unmap_surfaces. So in the
end softpipe_map_surfaces get call several time and increase
map refcount of each pipe_surface and softpipe_unmap_surfaces
is call only once.

Attached is a proposed patch that change softpipe_map_surfaces
to only map once the pipe_surface this way surface stay mapped
accross several softpipe_draw_elements but the softpipe_unmap_surfaces
become sufficient to unmap surface before swap/displaying buffer
otherwise the renderbuffer is still maped while swap_buffer is
called and validation of the buffer timeout.

Is this a proper fix ? Or how the map should be balanced ?

Cheers,
Jerome Glisse <[EMAIL PROTECTED]>
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index b6995b8..339eb1c 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -80,16 +80,16 @@ softpipe_map_surfaces(struct softpipe_context *sp)
 
    for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
       ps = sp->framebuffer.cbufs[i];
-      if (ps->buffer)
+      if (ps->buffer && !ps->map)
          pipe_surface_map(ps);
    }
 
    ps = sp->framebuffer.zbuf;
-   if (ps && ps->buffer)
+   if (ps && ps->buffer && !ps->map)
       pipe_surface_map(ps);
 
    ps = sp->framebuffer.sbuf;
-   if (ps && ps->buffer)
+   if (ps && ps->buffer && !ps->map)
       pipe_surface_map(ps);
 }
 
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to