[PATCH v2 weston] compositor-drm: update internal cursor plane location when disabling cursor

Derek Foreman derekf at osg.samsung.com
Fri Feb 5 21:53:30 UTC 2016


On 05/02/16 03:36 PM, Benoit Gschwind wrote:
> 
> 
> Le 05/02/2016 22:18, Pekka Paalanen a écrit :
>> On Fri,  5 Feb 2016 09:15:13 -0600
>> Derek Foreman <derekf at osg.samsung.com> wrote:
>>
>>> When the cursor plane is disabled the kernel can lose its location.
>>> If we don't update our internal idea of where the plane is at that time,
>>> the next time we set a cursor it can show up at 0,0.
>>>
>>> This can show up when an application is put in the cursor plane, removed
>>> from the plane, then put back at the same location.  It might show up at
>>> 0,0 when it's reinstated.
>>>
>>> We now use INT32_MIN as a location for disabled cursors so enabling the
>>> plane will always cause an update.
>>>
>>> Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
>>> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
>>> ---
>>> Change from v1:
>>> Use INT32_MIN instead of 0
>>> init cursor_plane values in create_output_for_connector
>>>
>>>
>>>   src/compositor-drm.c | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>>
>>> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
>>> index 8b9882e..4e4368c 100644
>>> --- a/src/compositor-drm.c
>>> +++ b/src/compositor-drm.c
>>> @@ -1174,6 +1174,8 @@ drm_output_set_cursor(struct drm_output *output)
>>>       output->cursor_view = NULL;
>>>       if (ev == NULL) {
>>>           drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
>>> +        output->cursor_plane.x = INT32_MIN;
>>> +        output->cursor_plane.y = INT32_MIN;
>>>           return;
>>>       }
>>>
>>> @@ -2312,6 +2314,9 @@ create_output_for_connector(struct drm_backend *b,
>>>       if (output == NULL)
>>>           return -1;
>>>
>>> +    output->cursor_plane.x = INT32_MIN;
>>> +    output->cursor_plane.y = INT32_MIN;
>>> +
>>>       output->base.subpixel =
>>> drm_subpixel_to_wayland(connector->subpixel);
>>>       output->base.name = make_connector_name(connector);
>>>       output->base.make = "unknown";
>>
>> Hi,
>>
>> this latter should be in the weston_plane_init() call arguments,
>> here it just gets overwritten with 0. It's almost at the end of the
>> function.

Ugh, yeah, you're right.  v3 coming....

>>
>> Thanks,
>> pq
>>
>>
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>>
> 
> Hi,
> 
> INT32_MIN may be confusing, is it -2147483648 ?

Yup.  What's wrong with that?  It should be a good value that will never
be a sensible real cursor plane position.

> maybe INT32_BASE ?

What's INT32_BASE?

> Best regards.



More information about the wayland-devel mailing list