Commit a991b1ec authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer

xfree86/modes: Disambiguate driverIsPerformingTransform

The driver can now specify exactly which aspects of the transform it
wants to handle via XF86DriverTransform* flags.

Since the driver can now choose whether it wants to receive transformed
or untransformed cursor coordinates, xf86CrtcTransformCursorPos no
longer needs to be available to drivers, so make it static.
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent aad96f85
...@@ -70,6 +70,14 @@ typedef enum _xf86OutputStatus { ...@@ -70,6 +70,14 @@ typedef enum _xf86OutputStatus {
XF86OutputStatusUnknown XF86OutputStatusUnknown
} xf86OutputStatus; } xf86OutputStatus;
typedef enum _xf86DriverTransforms {
XF86DriverTransformNone = 0,
XF86DriverTransformOutput = 1 << 0,
XF86DriverTransformCursorImage = 1 << 1,
XF86DriverTransformCursorPosition = 1 << 2,
} xf86DriverTransforms;
struct xf86CrtcTileInfo { struct xf86CrtcTileInfo {
uint32_t group_id; uint32_t group_id;
uint32_t flags; uint32_t flags;
...@@ -237,7 +245,7 @@ typedef struct _xf86CrtcFuncs { ...@@ -237,7 +245,7 @@ typedef struct _xf86CrtcFuncs {
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
#define XF86_CRTC_VERSION 6 #define XF86_CRTC_VERSION 7
struct _xf86Crtc { struct _xf86Crtc {
/** /**
...@@ -377,17 +385,22 @@ struct _xf86Crtc { ...@@ -377,17 +385,22 @@ struct _xf86Crtc {
Bool shadowClear; Bool shadowClear;
/** /**
* Indicates that the driver is handling the transform, so the shadow * Indicates that the driver is handling some or all transforms:
* surface should be disabled. The driver writes this field before calling *
* xf86CrtcRotate to indicate that it is handling the transform (including * XF86DriverTransformOutput: The driver handles the output transform, so
* rotation and reflection). * 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).
*
* XF86DriverTransformCursorImage: Setting this flag causes the server to
* pass the untransformed cursor image to the driver hook.
* *
* Setting this flag also causes the server to stop adjusting the cursor * XF86DriverTransformCursorPosition: Setting this flag causes the server
* image and position. * to pass the untransformed cursor position to the driver hook.
* *
* Added in ABI version 4 * Added in ABI version 4, changed to xf86DriverTransforms in ABI version 7
*/ */
Bool driverIsPerformingTransform; xf86DriverTransforms driverIsPerformingTransform;
/* Added in ABI version 5 /* Added in ABI version 5
*/ */
...@@ -991,14 +1004,6 @@ extern _X_EXPORT void ...@@ -991,14 +1004,6 @@ extern _X_EXPORT void
extern _X_EXPORT void extern _X_EXPORT void
xf86_cursors_fini(ScreenPtr screen); 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 #ifdef XV
/* /*
* For overlay video, compute the relevant CRTC and * For overlay video, compute the relevant CRTC and
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
static Rotation static Rotation
xf86_crtc_cursor_rotation(xf86CrtcPtr crtc) xf86_crtc_cursor_rotation(xf86CrtcPtr crtc)
{ {
if (crtc->driverIsPerformingTransform) if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorImage)
return RR_Rotate_0; return RR_Rotate_0;
return crtc->rotation; return crtc->rotation;
} }
...@@ -357,8 +357,8 @@ xf86_show_cursors(ScrnInfoPtr scrn) ...@@ -357,8 +357,8 @@ xf86_show_cursors(ScrnInfoPtr scrn)
} }
} }
void static void
xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y) xf86_crtc_transform_cursor_position(xf86CrtcPtr crtc, int *x, int *y)
{ {
ScrnInfoPtr scrn = crtc->scrn; ScrnInfoPtr scrn = crtc->scrn;
ScreenPtr screen = scrn->pScreen; ScreenPtr screen = scrn->pScreen;
...@@ -401,7 +401,7 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) ...@@ -401,7 +401,7 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
* Transform position of cursor on screen * Transform position of cursor on screen
*/ */
if (crtc->transform_in_use) if (crtc->transform_in_use)
xf86CrtcTransformCursorPos(crtc, &crtc_x, &crtc_y); xf86_crtc_transform_cursor_position(crtc, &crtc_x, &crtc_y);
else { else {
crtc_x -= crtc->x; crtc_x -= crtc->x;
crtc_y -= crtc->y; crtc_y -= crtc->y;
...@@ -421,7 +421,7 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) ...@@ -421,7 +421,7 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
crtc->cursor_in_range = in_range; crtc->cursor_in_range = in_range;
if (in_range) { if (in_range) {
if (crtc->driverIsPerformingTransform) if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorPosition)
crtc->funcs->set_cursor_position(crtc, x, y); crtc->funcs->set_cursor_position(crtc, x, y);
else else
crtc->funcs->set_cursor_position(crtc, crtc_x, crtc_y); crtc->funcs->set_cursor_position(crtc, crtc_x, crtc_y);
......
...@@ -57,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) ...@@ -57,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region)
BoxPtr b = RegionRects(region); BoxPtr b = RegionRects(region);
XID include_inferiors = IncludeInferiors; XID include_inferiors = IncludeInferiors;
if (crtc->driverIsPerformingTransform) if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput)
return; return;
src = CreatePicture(None, src = CreatePicture(None,
...@@ -387,7 +387,7 @@ xf86CrtcRotate(xf86CrtcPtr crtc) ...@@ -387,7 +387,7 @@ xf86CrtcRotate(xf86CrtcPtr crtc)
new_height = 0; new_height = 0;
} }
else { else {
if (crtc->driverIsPerformingTransform) { if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) {
xf86RotateDestroy(crtc); xf86RotateDestroy(crtc);
} }
else { else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment