[PATCH weston 1/2] compositor-drm: update internal cursor plane location when disabling cursor

Derek Foreman derekf at osg.samsung.com
Fri Feb 5 15:05:01 UTC 2016


On 05/02/16 05:49 AM, Pekka Paalanen wrote:
> On Thu,  3 Dec 2015 14:07:11 -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 will show up at
>> 0,0 when it's reinstated.
>>
>> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
>> ---
>>  src/compositor-drm.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
>> index ea6f3cd..a6db933 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 = 0;
>> +		output->cursor_plane.y = 0;
>>  		return;
>>  	}
>>  
> 
> Hi,
> 
> what if the next time the cursor plane actually should show up at 0,0
> but the kernel remembers the old position somewhere else? Unlikely,
> yes, but possible, isn't it.

Good catch.  Thanks.

> I'd propose to use INT32_MIN instead of 0 for the coordinate. That will
> never be a proper position.
> 
> If you want, you could also make the same change to
> create_output_for_connector() initializing the cursor plane, so that we
> always have INT32_MIN for a disabled cursor plane.

Yup.

> With that change:
> Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> 
> Thanks,
> pq
> 
> 
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 



More information about the wayland-devel mailing list