[Mesa-dev] Help requested with drisw bug

Federico Mena Quintero federico.mena.lists at gmail.com
Fri Jan 24 19:06:33 PST 2014


Hi,

I've been looking for this bug for a couple of months now, and I don't
feel like I'm making much progress.

Attached is a piglit test that exposes the bug.  Run this with software
rendering:

  export LIBGL_ALWAYS_SOFTWARE=1

The bug is very obvious if you run Clutter programs with that, e.g.
gnome-shell.  The display is all messed up.

So far I have a patch for Mesa, also attached, that tries to fix this.
It makes the piglit test pass, but gnome-shell still displays
incorrectly.

As far as I can tell, the bug happens like this.  glBlitFramebuffer()
needs to create a "real" front buffer (whereas previously all buffer
swaps happened by just doing an XPutImage() from the back buffer to the
X window).  However, when glBlitFramebuffer() creates the real front
buffer, it does not initialize it with the previous contents of either
the "fake" front buffer, nor with the contents of the back buffer.  So,
the real front buffer starts up black, and subsequent blits to the
screen are incorrect.

My patch copies the back buffer to the real front buffer once the latter
gets created.  This makes the piglit test pass.  However, this does not
solve the problem for Clutter programs.

I've tried to read the code for e.g. the Intel driver, where it mentions
that intel_prepare_render() "should be called anywhere that curent
read/drawbuffer state is required".  I think something similar needs to
happen with drisw's implementation of blitting.

Basically, I don't know enough about the interplay between front/back
buffers or how programs with multiple drawables are supposed to
function.

Any help is appreciated.

Thanks!

  Federico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: piglit-mesa-blit.patch
Type: text/x-patch
Size: 6981 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140124/918fd865/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mesa-9.2.3-drisw-copy-back-left-to-front-left.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140124/918fd865/attachment-0003.bin>


More information about the mesa-dev mailing list