combining Render's Composite + SHM's PutImage

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 9 01:39:30 PDT 2015


On Thu, Apr 09, 2015 at 11:01:47AM +1000, Nigel Tao wrote:
> I'm possibly Doing It Wrong, but...
> 
> I'm playing around with an X client, I have some shared memory full of
> pixels, and I want to paint them on a window, with alpha-blending. I
> also want to know when the paint is complete, so I can re-use that
> shared memory buffer for different pixels.
> 
> IIUC, Render gives me the alpha-blending, but not the SHM completion
> event. SHM gives me the opposite.
> 
> Is there a good way that I can have my cake and eat it too?
> 
> I suppose that I could call SHM's GetImage to a temporary shared
> buffer, do the alpha-blending on the client, and call SHM's PutImage.
> Or, I could call SHM's PutImage to a temporary server-side buffer, and
> call Render's Composite. But neither approach seems ideal, as it
> involves creating and cleaning up a temporary buffer.

You can either read cairo for an example of how to mix SHM and Render,
or http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/tools/virtual.c#n1819
The synopsis is that you want to insert your own SHMCompletionEvents
which are then guarranteed to be sent after the rendering by X's very
strict protocol ordering.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the xorg mailing list