[PATCH v5 xserver 6/7] xf86Cursor: Deal with rotation on GPU screens using a hw-cursor

Michel Dänzer michel at daenzer.net
Wed Sep 7 01:34:56 UTC 2016


On 06/09/16 08:31 PM, Hans De Goede wrote:
> When a slave-output is rotated the transformation is done on the blit
> from master to slave GPU, so crtc->transform_in_use is not set, but we
> still need to adjust the mouse position for things to work.

[...]

> +static void
> +xf86_crtc_transform_gpu_cursor_position(xf86CrtcPtr crtc, int *x, int *y)
> +{
> +    ScrnInfoPtr scrn = crtc->scrn;
> +    ScreenPtr screen = scrn->pScreen;
> +    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
> +    xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
> +    xf86CursorScreenPtr ScreenPriv =
> +        (xf86CursorScreenPtr) dixLookupPrivate(&screen->devPrivates,
> +                                               xf86CursorScreenKey);
> +    int dx, dy;
> +
> +    *x = *x - crtc->x + ScreenPriv->HotX;
> +    *y = *y - crtc->y + ScreenPriv->HotY;
> +
> +    xf86_crtc_rotate_coord_back(crtc->rotation, crtc->mode.HDisplay,
> +                                crtc->mode.VDisplay, *x, *y, x, y);

As discussed in the review of patch 5, I'm afraid you may not be able to
use xf86_crtc_rotate_coord_back here, though actually I'm not sure why
it wouldn't work as is? What's the problem?


Patches 1, 2, 4 & 7 are

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list