[PATCH weston] compositor-drm: Use view transform in cursor plane setup

Daniel Stone daniel at fooishbar.org
Tue Nov 24 04:35:52 PST 2015


Hi,

On 23 November 2015 at 22:33, Derek Foreman <derekf at osg.samsung.com> wrote:
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index a84d869..d872dd0 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -1095,6 +1095,8 @@ drm_output_prepare_cursor_view(struct drm_output *output,
>                 (struct drm_backend *)output->base.compositor->backend;
>         struct weston_buffer_viewport *viewport = &ev->surface->buffer_viewport;
>
> +       if (!drm_view_transform_supported(ev))
> +               return NULL;
>         if (b->gbm == NULL)
>                 return NULL;
>         if (output->base.transform != WL_OUTPUT_TRANSFORM_NORMAL)

AFAICT, cursor planes don't support scaling, so you might want to punt
if the transform includes that.

> @@ -1192,8 +1194,7 @@ drm_output_set_cursor(struct drm_output *output)
>                 }
>         }
>
> -       x = (ev->geometry.x - output->base.x) * output->base.current_scale;
> -       y = (ev->geometry.y - output->base.y) * output->base.current_scale;
> +       weston_view_to_global_float(ev, 0, 0, &x, &y);
>         if (output->cursor_plane.x != x || output->cursor_plane.y != y) {
>                 if (drmModeMoveCursor(b->drm.fd, output->crtc_id, x, y)) {
>                         weston_log("failed to move cursor: %m\n");

This looks good though.

Cheers,
Daniel


More information about the wayland-devel mailing list