[PATCH weston 2/7] pixman-renderer: Move shadow buffer into renderer

David Herrmann dh.herrmann at googlemail.com
Wed Jan 23 04:53:53 PST 2013


Hi Ander

On Wed, Jan 23, 2013 at 11:34 AM, Ander Conselvan de Oliveira
<ander.conselvan.de.oliveira at intel.com> wrote:
> On 01/23/2013 12:15 PM, Vasily Khoruzhick wrote:
>>
>> On Wed, Jan 23, 2013 at 12:02 PM, Ander Conselvan de Oliveira
>> <conselvan2 at gmail.com> wrote:
>>>
>>> On 01/23/2013 09:25 AM, Vasily Khoruzhick wrote:
>>>>
>>>>
>>>> On Tue, Jan 22, 2013 at 7:07 PM, Ander Conselvan de Oliveira
>>>> <ander.conselvan.de.oliveira at intel.com> wrote:
>>>>>
>>>>>
>>>>> The X11 backend uses a shadow buffer to be able to support transformed
>>>>> outputs. However, this belongs in the renderer, since otherwise this
>>>>> code would have to be copied into every backend that uses the pixman
>>>>> renderer and supports transformed outputs.
>>>>
>>>>
>>>>
>>>> It's not a good idea, because with that change you won't be able to
>>>> implement pageflips.
>>>
>>>
>>>
>>> Can you elaborate on that? On the drm backend, I implemented page flips
>>> by
>>> calling pixman_renderer_output_set_buffer() prior to rendering,
>>> alternating
>>> between two dumb buffers. See drm_output_render_pixman() in the last
>>> patch
>>> of this series.
>>
>>
>> When doing pageflip you definitely don't need shadow buffer, do you?
>> Why to do extra copy?
>
>
> Reading from the dumb buffer is slow so compositing straight to it turns out
> to be slower than using the shadow buffer. If I understand correctly, pixman
> doesn't consider the transform of the destination image when compositing, so
> we also need a shadow buffer to support transformed outputs.

This really depends on the video-driver. For instance for i915 on my
gen3 hardware it turns out direct alpha-compositing into the
dumb-buffer is 30% slower than using a shadow buffer and blitting it
onto the hardware buffer.

However, for the udl driver (which uses shmem for dumb-buffers) it's
the other way around. Direct compositing is 30% faster as the final
blit can be skipped.

However, as a rule of thumb we should never do compositing in hardware
buffers. We can, as a bonus, provide an option to avoid the shadow
buffer for slow shmem-bases drivers to speed them up. But that
shouldn't be the default.

So if we move the shadow buffer into the pixman-renderer, we have a
cleaner split between the renderer and the video-driver and we can
easily change the renderer to avoid the shadow buffer.

Regards
David


More information about the wayland-devel mailing list