[PATCH xserver 2/5] xfree86/modes: Check for CRTC transforms in xf86_use_hw_cursor(_argb)

Michel Dänzer michel at daenzer.net
Thu Dec 24 23:12:33 PST 2015


On 24.12.2015 16:57, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
> 
> We currently don't handle transforms for the HW cursor image, so return
> FALSE to signal a software cursor must be used if a transform is in use
> on any CRTC.
> 
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  hw/xfree86/modes/xf86Cursors.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
> index f487890..14bd5f6 100644
> --- a/hw/xfree86/modes/xf86Cursors.c
> +++ b/hw/xfree86/modes/xf86Cursors.c
> @@ -515,11 +515,22 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
>      ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
>      xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
>      xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
> +    int c;
>  
>      if (cursor->bits->width > cursor_info->MaxWidth ||
>          cursor->bits->height > cursor_info->MaxHeight)
>          return FALSE;
>  
> +    for (c = 0; c < xf86_config->num_crtc; c++) {
> +        xf86CrtcPtr crtc = xf86_config->crtc[c];
> +
> +        if (!crtc->enabled)
> +            continue;
> +
> +        if (crtc->transform_in_use)
> +            return FALSE;
> +    }

Turns out crtc->transform_in_use is also TRUE for rotation, which works
correctly with a HW cursor. crtc->transformPresent needs to be checked
again instead.


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


More information about the xorg-devel mailing list