diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index bdcfa131a..fb1dd4f31 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -70,6 +70,14 @@ typedef enum _xf86OutputStatus { XF86OutputStatusUnknown } xf86OutputStatus; +typedef enum _xf86DriverTransforms { + XF86DriverTransformNone = 0, + XF86DriverTransformOutput = 1 << 0, + XF86DriverTransformCursorImage = 1 << 1, + XF86DriverTransformCursorPosition = 1 << 2, +} xf86DriverTransforms; + + struct xf86CrtcTileInfo { uint32_t group_id; uint32_t flags; @@ -237,7 +245,7 @@ typedef struct _xf86CrtcFuncs { } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; -#define XF86_CRTC_VERSION 6 +#define XF86_CRTC_VERSION 7 struct _xf86Crtc { /** @@ -377,17 +385,22 @@ struct _xf86Crtc { Bool shadowClear; /** - * Indicates that the driver is handling the transform, so the shadow - * surface should be disabled. The driver writes this field before calling - * xf86CrtcRotate to indicate that it is handling the transform (including - * rotation and reflection). + * Indicates that the driver is handling some or all transforms: * - * Setting this flag also causes the server to stop adjusting the cursor - * image and position. + * XF86DriverTransformOutput: The driver handles the output transform, so + * the shadow surface should be disabled. The driver writes this field + * before calling xf86CrtcRotate to indicate that it is handling the + * transform (including rotation and reflection). * - * Added in ABI version 4 + * XF86DriverTransformCursorImage: Setting this flag causes the server to + * pass the untransformed cursor image to the driver hook. + * + * XF86DriverTransformCursorPosition: Setting this flag causes the server + * to pass the untransformed cursor position to the driver hook. + * + * Added in ABI version 4, changed to xf86DriverTransforms in ABI version 7 */ - Bool driverIsPerformingTransform; + xf86DriverTransforms driverIsPerformingTransform; /* Added in ABI version 5 */ @@ -991,14 +1004,6 @@ extern _X_EXPORT void extern _X_EXPORT void xf86_cursors_fini(ScreenPtr screen); -/** - * Transform the cursor's coordinates based on the crtc transform. Normally - * this is done by the server, but if crtc->driverIsPerformingTransform is TRUE, - * then the server does not transform the cursor position automatically. - */ -extern _X_EXPORT void - xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y); - #ifdef XV /* * For overlay video, compute the relevant CRTC and diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index c1e9144f0..c71ac97a8 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -54,7 +54,7 @@ static Rotation xf86_crtc_cursor_rotation(xf86CrtcPtr crtc) { - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorImage) return RR_Rotate_0; return crtc->rotation; } @@ -357,8 +357,8 @@ xf86_show_cursors(ScrnInfoPtr scrn) } } -void -xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y) +static void +xf86_crtc_transform_cursor_position(xf86CrtcPtr crtc, int *x, int *y) { ScrnInfoPtr scrn = crtc->scrn; ScreenPtr screen = scrn->pScreen; @@ -401,7 +401,7 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) * Transform position of cursor on screen */ if (crtc->transform_in_use) - xf86CrtcTransformCursorPos(crtc, &crtc_x, &crtc_y); + xf86_crtc_transform_cursor_position(crtc, &crtc_x, &crtc_y); else { crtc_x -= crtc->x; crtc_y -= crtc->y; @@ -421,7 +421,7 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) crtc->cursor_in_range = in_range; if (in_range) { - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorPosition) crtc->funcs->set_cursor_position(crtc, x, y); else crtc->funcs->set_cursor_position(crtc, crtc_x, crtc_y); diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 4aa8f8d82..fbd3c3204 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -57,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) BoxPtr b = RegionRects(region); XID include_inferiors = IncludeInferiors; - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) return; src = CreatePicture(None, @@ -387,7 +387,7 @@ xf86CrtcRotate(xf86CrtcPtr crtc) new_height = 0; } else { - if (crtc->driverIsPerformingTransform) { + if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) { xf86RotateDestroy(crtc); } else {