[RFC wayland] protocol: Add wl_surface.buffer_damage
Jasper St. Pierre
jstpierre at mecheye.net
Sat Nov 7 09:49:21 PST 2015
OK. So the bug *wasn't* fixed two years ago like you were saying, and
under transformations, mesa is still wrong.
So we fix the bug by adding wl_surface.buffer_damage, since it's
impossible for Mesa to know about buffer transformations... and then
what?
The only way we can properly interpret the wl_surface.damage event is
it being correct under no buffer transformations. Which is fine to me.
And in any other case, we effectively have to treat it as a
full-surface damage, since the coordinates are junk.
And technically, it doesn't matter which of the two you pick -- it's
an optimization for the compositor to redraw less. At that point, I
think it makes more sense to say that we should just treat every
wl_surface.damage event as redrawing the full surface.
Given how surprising and unintuitive the rectangles behavior is (and
given how it only says it in passing in the spec), I personally don't
believe many 2D clients went through the trouble to make sure their
rectangles were correct in all cases. Given that the error case is
"app gets tearing and then when you click on it and switches away from
the backdrop theme, it works fine", I think many people probably just
blamed cairo and got on with it. Especially when it remained wrong in
Weston's own clients for a few years as well until somebody spotted
it.
Yes, this is what happens wheny ou introduce a broken protocol and let
it stay there in the name of stability -- you get nonsense results and
have to throw it out.
On Sat, Nov 7, 2015 at 9:41 AM, Daniel Stone <daniel at fooishbar.org> wrote:
> Hi,
>
> On 7 November 2015 at 16:59, Jasper St. Pierre <jstpierre at mecheye.net> wrote:
>> I don't see where. I see eglSwapBuffersWithDamage still looking like
>> it shoves the rects across the wire in buffer space, without any
>> modification.
>>
>> http://cgit.freedesktop.org/mesa/mesa/tree/src/egl/drivers/dri2/platform_wayland.c#n705
>
> A bug which should be fixed ...
>
>> I checked the Mali driver implementation I have, and it does something similar.
>
> Mali 6xx doesn't do that.
>
> Cheers,
> Daniel
>
>> On Sat, Nov 7, 2015 at 2:32 AM, Daniel Stone <daniel at fooishbar.org> wrote:
>>> On 6 November 2015 at 19:08, Jasper St. Pierre <jstpierre at mecheye.net> wrote:
>>>> To help clear things up, I think we should deprecate the
>>>> wl_surface.damage request and document that the coordinates are
>>>> effectively undefined -- for legacy reasons, if you see
>>>> wl_surface.damage, it should be considered a damage for the entire
>>>> surface.
>>>
>>> Why? Mesa fixed that bug two years ago, I don't know of a non-Mesa EGL
>>> implementation with that bug, and non-EGL clients are perfectly
>>> capable of implementing it correctly themselves. Whilst introducing
>>> buffer_damage, we could obliterate surface damage out of spite, but
>>> that seems like a giant middle finger to everyone who wrote conformant
>>> and performant apps, and now gets their entire buffer smashed through
>>> TexImage2D every time they want to blink a cursor.
>>>
>>> Cheers,
>>> Daniel
>>
>>
>>
>> --
>> Jasper
--
Jasper
More information about the wayland-devel
mailing list