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

Pekka Paalanen ppaalanen at gmail.com
Fri Feb 5 11:49:00 UTC 2016


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.

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.

With that change:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20160205/fca19257/attachment.sig>


More information about the wayland-devel mailing list