[PATCH xf86-video-amdgpu] Adapt to XF86_CRTC_VERSION 7
Alex Deucher
alexdeucher at gmail.com
Wed Jun 1 13:14:00 UTC 2016
On Wed, Jun 1, 2016 at 5:21 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Now the HW cursor can be used with TearFree rotation.
>
> This also allows always using the separate scanout pixmap mechanism for
> rotation, so that should be much smoother even without TearFree enabled.
>
> (Ported from radeon commit <hash>)
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>
> I'll fill in the radeon commit hash before I push this.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
>
> src/drmmode_display.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 7b326bb..c5e0a52 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -581,7 +581,7 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
> if (crtc->transformPresent)
> return FALSE;
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> /* Xorg doesn't correctly handle cursor position transform in the
> * rotation case
> */
> @@ -604,11 +604,19 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
> static Bool
> drmmode_handle_transform(xf86CrtcPtr crtc)
> {
> - AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
> Bool ret;
>
> +#if XF86_CRTC_VERSION >= 7
> + if (!crtc->transformPresent && crtc->rotation != RR_Rotate_0)
> + crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
> + else
> + crtc->driverIsPerformingTransform = XF86DriverTransformNone;
> +#else
> + AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
> +
> crtc->driverIsPerformingTransform = info->tear_free &&
> !crtc->transformPresent && crtc->rotation != RR_Rotate_0;
> +#endif
>
> ret = xf86CrtcRotate(crtc);
>
> @@ -849,7 +857,7 @@ static void drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(crtc->scrn);
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> x += crtc->x;
> y += crtc->y;
> @@ -860,7 +868,7 @@ static void drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
> drmModeMoveCursor(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, x, y);
> }
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
>
> static int
> drmmode_cursor_src_offset(Rotation rotation, int width, int height,
> @@ -900,7 +908,7 @@ static void drmmode_do_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image, uint32_
> ScrnInfoPtr pScrn = crtc->scrn;
> AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> uint32_t cursor_w = info->cursor_w, cursor_h = info->cursor_h;
> int dstx, dsty;
> --
> 2.8.1
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
More information about the xorg-driver-ati
mailing list