diff options
author | marha <marha@users.sourceforge.net> | 2011-02-25 08:27:07 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-02-25 08:27:07 +0000 |
commit | 27b0ed125725f09242054563bb65ac20cfaa17ff (patch) | |
tree | 6fe92374761ae87d8541d117605db27f3486aee1 /xorg-server/hw/xfree86/modes | |
parent | e8d899178e9ebe174e6b4a53297d3dfced8003f0 (diff) | |
parent | 8268836508edd4ba2a3045c9ba937397df7bf2c5 (diff) | |
download | vcxsrv-27b0ed125725f09242054563bb65ac20cfaa17ff.tar.gz vcxsrv-27b0ed125725f09242054563bb65ac20cfaa17ff.tar.bz2 vcxsrv-27b0ed125725f09242054563bb65ac20cfaa17ff.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/modes')
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Crtc.c | 149 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Crtc.h | 119 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Cursors.c | 4 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86RandR12.c | 387 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Rotate.c | 44 |
5 files changed, 147 insertions, 556 deletions
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index d721b131f..1f2ce2acd 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -82,17 +82,6 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, config->maxHeight = maxHeight;
}
-void
-xf86CrtcSetScanoutFormats(ScrnInfoPtr scrn,
- int num_formats,
- xf86CrtcScanoutFormat *formats)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- config->num_scanout_formats = num_formats;
- config->scanout_formats = formats;
-}
-
/*
* Crtc functions
*/
@@ -117,17 +106,12 @@ xf86CrtcCreate (ScrnInfoPtr scrn, pixman_transform_init_identity (&crtc->crtc_to_framebuffer);
pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer);
pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc);
- pixman_f_transform_init_identity (&crtc->f_screen_to_crtc);
- pixman_f_transform_init_identity (&crtc->user_sprite_position_transform);
- pixman_f_transform_init_identity (&crtc->f_crtc_to_cursor);
- pixman_f_transform_init_identity (&crtc->user_sprite_image_transform);
crtc->filter = NULL;
crtc->params = NULL;
crtc->nparams = 0;
crtc->filter_width = 0;
crtc->filter_height = 0;
crtc->transform_in_use = FALSE;
- crtc->sprite_transform_in_use = FALSE;
crtc->transformPresent = FALSE;
crtc->desiredTransformPresent = FALSE;
memset (&crtc->bounds, '\0', sizeof (crtc->bounds));
@@ -263,20 +247,20 @@ xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) * Sets the given video mode on the given crtc
*/
Bool
-xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set)
+xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ RRTransformPtr transform, int x, int y)
{
ScrnInfoPtr scrn = crtc->scrn;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
int i;
Bool ret = FALSE;
Bool didLock = FALSE;
- DisplayModePtr adjusted_mode = NULL;
+ DisplayModePtr adjusted_mode;
DisplayModeRec saved_mode;
int saved_x, saved_y;
Rotation saved_rotation;
RRTransformRec saved_transform;
Bool saved_transform_present;
- PixmapPtr saved_scanout_pixmap;
crtc->enabled = xf86CrtcInUse (crtc);
@@ -288,15 +272,13 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) return TRUE;
}
- /* See if nothing has changed */
- if (!set->flags)
- return TRUE;
+ adjusted_mode = xf86DuplicateMode(mode);
+
saved_mode = crtc->mode;
saved_x = crtc->x;
saved_y = crtc->y;
saved_rotation = crtc->rotation;
- saved_scanout_pixmap = crtc->scanoutPixmap;
if (crtc->transformPresent) {
RRTransformInit (&saved_transform);
RRTransformCopy (&saved_transform, &crtc->transform);
@@ -306,46 +288,21 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) /* Update crtc values up front so the driver can rely on them for mode
* setting.
*/
- if (set->flags & XF86CrtcSetMode)
- crtc->mode = *set->mode;
- if (set->flags & XF86CrtcSetOrigin) {
- crtc->x = set->x;
- crtc->y = set->y;
- }
- if (set->flags & XF86CrtcSetRotation)
- crtc->rotation = set->rotation;
- if (set->flags & XF86CrtcSetScanoutPixmap)
- crtc->scanoutPixmap = set->scanout_pixmap;
-
- if (set->flags & XF86CrtcSetTransform) {
- if (set->transform) {
- RRTransformCopy (&crtc->transform, set->transform);
- crtc->transformPresent = TRUE;
- } else
- crtc->transformPresent = FALSE;
- }
-
- if (crtc->funcs->set) {
- ret = crtc->funcs->set(crtc, set->flags);
- goto done;
- }
-
- if (set->flags == XF86CrtcSetOrigin && crtc->funcs->set_origin) {
- ret = xf86CrtcRotate(crtc);
- if (ret)
- crtc->funcs->set_origin(crtc, crtc->x, crtc->y);
- goto done;
- }
+ crtc->mode = *mode;
+ crtc->x = x;
+ crtc->y = y;
+ crtc->rotation = rotation;
+ if (transform) {
+ RRTransformCopy (&crtc->transform, transform);
+ crtc->transformPresent = TRUE;
+ } else
+ crtc->transformPresent = FALSE;
if (crtc->funcs->set_mode_major) {
- ret = crtc->funcs->set_mode_major(crtc, &crtc->mode,
- crtc->rotation,
- crtc->x, crtc->y);
+ ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
goto done;
}
- adjusted_mode = xf86DuplicateMode(&crtc->mode);
-
didLock = crtc->funcs->lock (crtc);
/* Pass our mode to the outputs and the CRTC to give them a chance to
* adjust it according to limitations or output properties, and also
@@ -357,12 +314,12 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) if (output->crtc != crtc)
continue;
- if (!output->funcs->mode_fixup(output, &crtc->mode, adjusted_mode)) {
+ if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) {
goto done;
}
}
- if (!crtc->funcs->mode_fixup(crtc, &crtc->mode, adjusted_mode)) {
+ if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) {
goto done;
}
@@ -385,12 +342,12 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) /* Set up the DPLL and any output state that needs to adjust or depend
* on the DPLL.
*/
- crtc->funcs->mode_set(crtc, &crtc->mode, adjusted_mode, crtc->x, crtc->y);
+ crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y);
for (i = 0; i < xf86_config->num_output; i++)
{
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc)
- output->funcs->mode_set(output, &crtc->mode, adjusted_mode);
+ output->funcs->mode_set(output, mode, adjusted_mode);
}
/* Only upload when needed, to avoid unneeded delays. */
@@ -424,13 +381,10 @@ done: if (saved_transform_present)
RRTransformCopy (&crtc->transform, &saved_transform);
crtc->transformPresent = saved_transform_present;
- crtc->scanoutPixmap = saved_scanout_pixmap;
}
- if (adjusted_mode) {
- free(adjusted_mode->name);
- free(adjusted_mode);
- }
+ free(adjusted_mode->name);
+ free(adjusted_mode);
if (didLock)
crtc->funcs->unlock (crtc);
@@ -439,19 +393,35 @@ done: }
/**
+ * Sets the given video mode on the given crtc, but without providing
+ * a transform
+ */
+Bool
+xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y)
+{
+ return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y);
+}
+
+/**
* Pans the screen, does not change the mode
*/
void
xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
{
- xf86CrtcSetRec set;
+ ScrnInfoPtr scrn = crtc->scrn;
- if (x != crtc->x || y != crtc->y) {
- set.x = x;
- set.y = y;
- set.flags = XF86CrtcSetOrigin;
- (void) xf86CrtcSet(crtc, &set);
+ crtc->x = x;
+ crtc->y = y;
+ if (crtc->funcs->set_origin) {
+ if (!xf86CrtcRotate (crtc))
+ return;
+ crtc->funcs->set_origin (crtc, x, y);
+ if (scrn->ModeSet)
+ scrn->ModeSet(scrn);
}
+ else
+ xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
}
/*
@@ -1595,7 +1565,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) int min_clock = 0;
int max_clock = 0;
double clock;
- Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE);
+ Bool add_default_modes;
Bool debug_modes = config->debug_modes ||
xf86Initialising;
enum det_monrec_source sync_source = sync_default;
@@ -1641,6 +1611,14 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) }
output_modes = (*output->funcs->get_modes) (output);
+
+ /*
+ * If the user has a preference, respect it.
+ * Otherwise, don't second-guess the driver.
+ */
+ if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES,
+ &add_default_modes))
+ add_default_modes = (output_modes == NULL);
edid_monitor = output->MonInfo;
@@ -2642,7 +2620,6 @@ xf86SetDesiredModes (ScrnInfoPtr scrn) for (c = 0; c < config->num_crtc; c++)
{
xf86OutputPtr output = NULL;
- xf86CrtcSetRec set;
int o;
RRTransformPtr transform;
@@ -2686,15 +2663,8 @@ xf86SetDesiredModes (ScrnInfoPtr scrn) transform = &crtc->desiredTransform;
else
transform = NULL;
- set.mode = &crtc->desiredMode;
- set.rotation = crtc->desiredRotation;
- set.transform = transform;
- set.x = crtc->desiredX;
- set.y = crtc->desiredY;
- set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput |
- XF86CrtcSetOrigin | XF86CrtcSetTransform |
- XF86CrtcSetRotation);
- if (!xf86CrtcSet(crtc, &set))
+ if (!xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation,
+ transform, crtc->desiredX, crtc->desiredY))
return FALSE;
}
@@ -2798,7 +2768,6 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) xf86CrtcPtr crtc = config->crtc[c];
DisplayModePtr crtc_mode = NULL;
int o;
- xf86CrtcSetRec set;
if (!crtc->enabled)
continue;
@@ -2826,15 +2795,7 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) crtc->enabled = FALSE;
continue;
}
- set.mode = crtc_mode;
- set.rotation = rotation;
- set.transform = NULL;
- set.x = 0;
- set.y = 0;
- set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput |
- XF86CrtcSetOrigin | XF86CrtcSetTransform |
- XF86CrtcSetRotation);
- if (!xf86CrtcSet (crtc, &set))
+ if (!xf86CrtcSetModeTransform (crtc, crtc_mode, rotation, NULL, 0, 0))
ok = FALSE;
else
{
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.h b/xorg-server/hw/xfree86/modes/xf86Crtc.h index e4037142f..5dfcec280 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.h +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.h @@ -72,25 +72,6 @@ typedef enum _xf86OutputStatus { XF86OutputStatusUnknown
} xf86OutputStatus;
-typedef enum _xf86CrtcSetFlags {
- XF86CrtcSetMode = 1, /* mode */
- XF86CrtcSetOutput = 2, /* outputs */
- XF86CrtcSetOrigin = 4, /* x/y */
- XF86CrtcSetTransform = 8, /* transform */
- XF86CrtcSetRotation = 16, /* rotation */
- XF86CrtcSetProperty = 32, /* output property */
- XF86CrtcSetScanoutPixmap = 64, /* scanout pixmap */
-} xf86CrtcSetFlags;
-
-typedef struct _xf86CrtcSet {
- xf86CrtcSetFlags flags;
- DisplayModePtr mode;
- Rotation rotation;
- RRTransformPtr transform;
- int x, y;
- PixmapPtr scanout_pixmap;
-} xf86CrtcSetRec;
-
typedef struct _xf86CrtcFuncs {
/**
* Turns the crtc on/off, or sets intermediate power levels if available.
@@ -240,12 +221,6 @@ typedef struct _xf86CrtcFuncs { void
(*set_origin)(xf86CrtcPtr crtc, int x, int y);
- /**
- * General mode setting entry point that does everything
- */
- Bool
- (*set)(xf86CrtcPtr crtc, xf86CrtcSetFlags flags);
-
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
#define XF86_CRTC_VERSION 3
@@ -279,7 +254,6 @@ struct _xf86Crtc { Rotation rotation;
PixmapPtr rotatedPixmap;
void *rotatedData;
- PixmapPtr scanoutPixmap;
/**
* Position on screen
@@ -348,7 +322,6 @@ struct _xf86Crtc { int filter_width; /* ABI 2 */
int filter_height; /* ABI 2 */
Bool transform_in_use;
- Bool sprite_transform_in_use;
RRTransformRec transform; /* ABI 2 */
Bool transformPresent; /* ABI 2 */
RRTransformRec desiredTransform; /* ABI 2 */
@@ -388,22 +361,6 @@ struct _xf86Crtc { * Clear the shadow
*/
Bool shadowClear;
-
- /**
- * Sprite position transforms
- */
-
- /* Transform a screen coordinate to a crtc coordinate */
- struct pixman_f_transform f_screen_to_crtc;
-
- /* The user-specified portion of the screen to crtc conversion */
- struct pixman_f_transform user_sprite_position_transform;
-
- /* Transform a hardware cursor coordinate to a cursor coordinate */
- struct pixman_f_transform f_crtc_to_cursor;
-
- /* The user-specified portion of the cursor to hardware transform */
- struct pixman_f_transform user_sprite_image_transform;
};
typedef struct _xf86OutputFuncs {
@@ -650,37 +607,6 @@ struct _xf86Output { INT16 initialBorder[4];
};
-typedef enum _xf86SetConfigResponse {
- xf86SetConfigFailed, /* set_config failed */
- xf86SetConfigChecked, /* set_config validated the configuration */
- xf86SetConfigDone, /* set_config finished the work */
-} xf86SetConfigResponse;
-
-typedef struct _xf86CrtcSetConfig {
- xf86CrtcPtr crtc;
- int x, y;
- DisplayModeRec mode;
- Rotation rotation;
- int numOutputs;
- xf86OutputPtr *outputs;
- struct pict_f_transform sprite_position_transform;
- struct pict_f_transform sprite_image_transform;
-
- /* Probably want some internal structure for the pixmap so that
- * this can be set before the server is running
- */
- PixmapPtr pixmap;
- int pixmap_x, pixmap_y;
-} xf86CrtcSetConfigRec, *xf86CrtcSetConfigPtr;
-
-typedef struct _xf86CrtcScanoutFormat {
- int depth;
- int bitsPerPixel;
- int maxWidth, maxHeight;
- Rotation rotations;
- PictFormatShort format;
-} xf86CrtcScanoutFormat;
-
typedef struct _xf86CrtcConfigFuncs {
/**
* Requests that the driver resize the screen.
@@ -698,23 +624,6 @@ typedef struct _xf86CrtcConfigFuncs { (*resize)(ScrnInfoPtr scrn,
int width,
int height);
-
- xf86SetConfigResponse
- (*set_config) (ScrnInfoPtr scrn,
- RRScreenConfigPtr screen_config,
- xf86CrtcSetConfigPtr crtc_configs,
- int num_configs);
-
- /**
- * Create a scanout pixmap
- */
- PixmapPtr
- (*create_scanout_pixmap)(ScrnInfoPtr scrn,
- int width,
- int height,
- Rotation rotations,
- xf86CrtcScanoutFormat *format);
-
} xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr;
typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen);
@@ -774,11 +683,6 @@ typedef struct _xf86CrtcConfig { /* callback when crtc configuration changes */
xf86_crtc_notify_proc_ptr xf86_crtc_notify;
- /*
- * Supported scanout pixmap formats
- */
- int num_scanout_formats;
- xf86CrtcScanoutFormat *scanout_formats;
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
@@ -824,11 +728,6 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, int minWidth, int minHeight,
int maxWidth, int maxHeight);
-extern _X_EXPORT void
-xf86CrtcSetScanoutFormats (ScrnInfoPtr scrn,
- int num_formats,
- xf86CrtcScanoutFormat *formats);
-
/*
* Crtc functions
*/
@@ -839,12 +738,18 @@ xf86CrtcCreate (ScrnInfoPtr scrn, extern _X_EXPORT void
xf86CrtcDestroy (xf86CrtcPtr crtc);
+
/**
- * Change a crtc configuration (modes, outputs, etc)
+ * Sets the given video mode on the given crtc
*/
extern _X_EXPORT Bool
-xf86CrtcSet (xf86CrtcPtr crtc, xf86CrtcSetRec *set);
+xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ RRTransformPtr transform, int x, int y);
+
+extern _X_EXPORT Bool
+xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y);
extern _X_EXPORT void
xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y);
@@ -855,14 +760,6 @@ xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y); extern _X_EXPORT Bool
xf86CrtcRotate (xf86CrtcPtr crtc);
-
-/*
- * Update cursor transform matrices after user changes
- * This is just the cursor subset of xf86CrtcRotate
- */
-extern _X_EXPORT void
-xf86CrtcRotateCursor (xf86CrtcPtr crtc);
-
/*
* Clean up any rotation data, used when a crtc is turned off
* as well as when rotation is disabled.
diff --git a/xorg-server/hw/xfree86/modes/xf86Cursors.c b/xorg-server/hw/xfree86/modes/xf86Cursors.c index 3c2958743..5562f29cc 100644 --- a/xorg-server/hw/xfree86/modes/xf86Cursors.c +++ b/xorg-server/hw/xfree86/modes/xf86Cursors.c @@ -338,7 +338,7 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) /*
* Transform position of cursor on screen
*/
- if (crtc->sprite_transform_in_use)
+ if (crtc->transform_in_use)
{
ScreenPtr screen = scrn->pScreen;
xf86CursorScreenPtr ScreenPriv =
@@ -349,7 +349,7 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) v.v[0] = (x + ScreenPriv->HotX) + 0.5;
v.v[1] = (y + ScreenPriv->HotY) + 0.5;
v.v[2] = 1;
- pixman_f_transform_point (&crtc->f_screen_to_crtc, &v);
+ pixman_f_transform_point (&crtc->f_framebuffer_to_crtc, &v);
/* cursor will have 0.5 added to it already so floor is sufficent */
x = floor (v.v[0]);
y = floor (v.v[1]);
diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c index 7bfb6fa47..2b19d82ad 100644 --- a/xorg-server/hw/xfree86/modes/xf86RandR12.c +++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c @@ -180,14 +180,14 @@ xf86RandR13VerifyPanningArea (xf86CrtcPtr crtc, int screenWidth, int screenHeigh */
static void
-xf86ComputeCrtcPan (Bool sprite_transform_in_use,
+xf86ComputeCrtcPan (Bool transform_in_use,
struct pixman_f_transform *m,
double screen_x, double screen_y,
double crtc_x, double crtc_y,
int old_pan_x, int old_pan_y,
int *new_pan_x, int *new_pan_y)
{
- if (sprite_transform_in_use) {
+ if (transform_in_use) {
/*
* Given the current transform, M, the current position
* on the Screen, S, and the desired position on the CRTC,
@@ -374,8 +374,8 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y) c.v[0] = x;
c.v[1] = y;
c.v[2] = 1.0;
- if (crtc->sprite_transform_in_use) {
- pixman_f_transform_point(&crtc->f_screen_to_crtc, &c);
+ if (crtc->transform_in_use) {
+ pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &c);
} else {
c.v[0] -= crtc->x;
c.v[1] -= crtc->y;
@@ -402,8 +402,8 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y) }
}
if (panned)
- xf86ComputeCrtcPan (crtc->sprite_transform_in_use,
- &crtc->f_screen_to_crtc,
+ xf86ComputeCrtcPan (crtc->transform_in_use,
+ &crtc->f_framebuffer_to_crtc,
x, y, c.v[0], c.v[1],
newX, newY, &newX, &newY);
}
@@ -414,7 +414,7 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y) * XXX This computation only works when we do not have a transform
* in use.
*/
- if (!crtc->sprite_transform_in_use)
+ if (!crtc->transform_in_use)
{
/* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
@@ -659,12 +659,10 @@ xf86RandR12SetConfig (ScreenPtr pScreen, static Bool
xf86RandR12ScreenSetSize (ScreenPtr pScreen,
- CARD16 width,
- CARD16 height,
- CARD16 pixWidth,
- CARD16 pixHeight,
- CARD32 mmWidth,
- CARD32 mmHeight)
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth,
+ CARD32 mmHeight)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
@@ -672,8 +670,6 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, WindowPtr pRoot = pScreen->root;
PixmapPtr pScrnPix;
Bool ret = FALSE;
- Bool pixSizeChanged = FALSE;
- Bool winSizeChanged = FALSE;
int c;
if (xf86RandR12Key) {
@@ -681,85 +677,46 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, {
randrp->virtualX = pScrn->virtualX;
randrp->virtualY = pScrn->virtualY;
- pixSizeChanged = TRUE;
}
}
+ if (pRoot && pScrn->vtSema)
+ (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
- pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
- if (pixWidth != pScrnPix->drawable.width ||
- pixHeight != pScrnPix->drawable.height)
- pixSizeChanged = TRUE;
-
- if (width != pScreen->width || height != pScreen->height)
- winSizeChanged = TRUE;
-
- if (pixSizeChanged)
- {
- if (pRoot && pScrn->vtSema)
- (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
-
- /* Let the driver update virtualX and virtualY */
- if (!(*config->funcs->resize)(pScrn, pixWidth, pixHeight))
- goto finish;
- }
+ /* Let the driver update virtualX and virtualY */
+ if (!(*config->funcs->resize)(pScrn, width, height))
+ goto finish;
ret = TRUE;
-
- if (winSizeChanged)
- {
- /* Update panning information */
- for (c = 0; c < config->num_crtc; c++) {
- xf86CrtcPtr crtc = config->crtc[c];
- if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
- crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
- if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
- crtc->panningTotalArea.x2 += width - pScreen->width;
- if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
- crtc->panningTotalArea.y2 += height - pScreen->height;
- if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1)
- crtc->panningTrackingArea.x2 += width - pScreen->width;
- if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1)
- crtc->panningTrackingArea.y2 += height - pScreen->height;
- xf86RandR13VerifyPanningArea (crtc, width, height);
- xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
- }
+ /* Update panning information */
+ for (c = 0; c < config->num_crtc; c++) {
+ xf86CrtcPtr crtc = config->crtc[c];
+ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
+ crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+ if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
+ crtc->panningTotalArea.x2 += width - pScreen->width;
+ if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
+ crtc->panningTotalArea.y2 += height - pScreen->height;
+ if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1)
+ crtc->panningTrackingArea.x2 += width - pScreen->width;
+ if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1)
+ crtc->panningTrackingArea.y2 += height - pScreen->height;
+ xf86RandR13VerifyPanningArea (crtc, width, height);
+ xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
}
}
pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
- pScreen->width = width;
- pScreen->height = height;
- if (pRoot)
- {
- BoxRec box;
-
- pRoot->drawable.width = width;
- pRoot->drawable.height = height;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = width;
- box.y2 = height;
- RegionInit(&pRoot->winSize, &box, 1);
- RegionInit(&pRoot->borderSize, &box, 1);
- }
- pScrnPix->drawable.width = pixWidth;
- pScrnPix->drawable.height = pixHeight;
+ pScreen->width = pScrnPix->drawable.width = width;
+ pScreen->height = pScrnPix->drawable.height = height;
randrp->mmWidth = pScreen->mmWidth = mmWidth;
randrp->mmHeight = pScreen->mmHeight = mmHeight;
- if (winSizeChanged)
- {
- xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1);
- xf86SetViewport (pScreen, 0, 0);
- }
+ xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1);
+ xf86SetViewport (pScreen, 0, 0);
finish:
- if (pixSizeChanged)
- {
- if (pRoot && pScrn->vtSema)
- (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
- }
-
+ if (pRoot && pScrn->vtSema)
+ (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
#if RANDR_12_INTERFACE
if (xf86RandR12Key && pScreen->root && ret)
RRScreenSizeNotify (pScreen);
@@ -801,7 +758,7 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86CrtcPtr crtc = config->crtc[c];
int crtc_width = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation);
int crtc_height = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation);
-
+
if (crtc->enabled) {
if (crtc_width > width)
width = crtc_width;
@@ -813,13 +770,13 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) height = crtc->panningTotalArea.y2;
}
}
-
+
if (width && height)
{
/*
* Compute physical size of screen
*/
- if (monitorResolution)
+ if (monitorResolution)
{
mmWidth = width * 25.4 / monitorResolution;
mmHeight = height * 25.4 / monitorResolution;
@@ -861,8 +818,6 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86RandR12ScreenSetSize (pScreen,
width,
height,
- width,
- height,
mmWidth,
mmHeight);
}
@@ -1052,7 +1007,7 @@ xf86RandRModeMatches (RRModePtr randr_mode, if (memcmp (randr_mode->name, mode->name, len) != 0) return FALSE;
}
#endif
-
+
/* check for same timings */
if (randr_mode->mode.dotClock / 1000 != mode->Clock) return FALSE;
if (randr_mode->mode.width != mode->HDisplay) return FALSE;
@@ -1064,11 +1019,11 @@ xf86RandRModeMatches (RRModePtr randr_mode, if (randr_mode->mode.vSyncStart != mode->VSyncStart) return FALSE;
if (randr_mode->mode.vSyncEnd != mode->VSyncEnd) return FALSE;
if (randr_mode->mode.vTotal != mode->VTotal) return FALSE;
-
+
/* check for same flags (using only the XF86 valid flag bits) */
if ((randr_mode->mode.modeFlags & FLAG_BITS) != (mode->Flags & FLAG_BITS))
return FALSE;
-
+
/* everything matches */
return TRUE;
}
@@ -1108,7 +1063,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) randr_output = output->randr_output;
randr_outputs[numOutputs++] = randr_output;
/*
- * We make copies of modes, so pointer equality
+ * We make copies of modes, so pointer equality
* isn't sufficient
*/
for (j = 0; j < randr_output->numModes + randr_output->numUserModes; j++)
@@ -1116,7 +1071,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) RRModePtr m = (j < randr_output->numModes ?
randr_output->modes[j] :
randr_output->userModes[j-randr_output->numModes]);
-
+
if (xf86RandRModeMatches (m, mode))
{
randr_mode = m;
@@ -1126,9 +1081,9 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) }
}
ret = RRCrtcNotify (randr_crtc, randr_mode, x, y,
- rotation,
+ rotation,
crtc->transformPresent ? &crtc->transform : NULL,
- numOutputs, randr_outputs, crtc->scanoutPixmap);
+ numOutputs, randr_outputs);
free(randr_outputs);
return ret;
}
@@ -1145,13 +1100,13 @@ xf86RandRModeConvert (ScrnInfoPtr scrn, mode->status = MODE_OK;
mode->Clock = randr_mode->mode.dotClock / 1000;
-
+
mode->HDisplay = randr_mode->mode.width;
mode->HSyncStart = randr_mode->mode.hSyncStart;
mode->HSyncEnd = randr_mode->mode.hSyncEnd;
mode->HTotal = randr_mode->mode.hTotal;
mode->HSkew = randr_mode->mode.hSkew;
-
+
mode->VDisplay = randr_mode->mode.height;
mode->VSyncStart = randr_mode->mode.vSyncStart;
mode->VSyncEnd = randr_mode->mode.vSyncEnd;
@@ -1171,15 +1126,14 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, int y,
Rotation rotation,
int num_randr_outputs,
- RROutputPtr *randr_outputs,
- PixmapPtr scanout_pixmap)
+ RROutputPtr *randr_outputs)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc = randr_crtc->devPrivate;
RRTransformPtr transform;
- xf86CrtcSetFlags flags = 0;
+ Bool changed = FALSE;
int o, ro;
xf86CrtcPtr *save_crtcs;
Bool save_enabled = crtc->enabled;
@@ -1189,37 +1143,34 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, save_crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr));
if ((randr_mode != NULL) != crtc->enabled)
- flags |= XF86CrtcSetMode;
+ changed = TRUE;
else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode))
- flags |= XF86CrtcSetMode;
-
+ changed = TRUE;
+
if (rotation != crtc->rotation)
- flags |= XF86CrtcSetRotation;
+ changed = TRUE;
transform = RRCrtcGetTransform (randr_crtc);
if ((transform != NULL) != crtc->transformPresent)
- flags |= XF86CrtcSetTransform;
+ changed = TRUE;
else if (transform && memcmp (&transform->transform, &crtc->transform.transform,
sizeof (transform->transform)) != 0)
- flags |= XF86CrtcSetTransform;
-
- if (scanout_pixmap != crtc->scanoutPixmap)
- flags |= XF86CrtcSetScanoutPixmap;
+ changed = TRUE;
if (x != crtc->x || y != crtc->y)
- flags |= XF86CrtcSetOrigin;
- for (o = 0; o < config->num_output; o++)
+ changed = TRUE;
+ for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
xf86CrtcPtr new_crtc;
save_crtcs[o] = output->crtc;
-
+
if (output->crtc == crtc)
new_crtc = NULL;
else
new_crtc = output->crtc;
- for (ro = 0; ro < num_randr_outputs; ro++)
+ for (ro = 0; ro < num_randr_outputs; ro++)
if (output->randr_output == randr_outputs[ro])
{
new_crtc = crtc;
@@ -1227,16 +1178,16 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, }
if (new_crtc != output->crtc)
{
- flags |= XF86CrtcSetOutput;
+ changed = TRUE;
output->crtc = new_crtc;
}
}
- for (ro = 0; ro < num_randr_outputs; ro++)
+ for (ro = 0; ro < num_randr_outputs; ro++)
if (randr_outputs[ro]->pendingProperties)
- flags |= XF86CrtcSetProperty;
+ changed = TRUE;
/* XXX need device-independent mode setting code through an API */
- if (flags)
+ if (changed)
{
crtc->enabled = randr_mode != NULL;
@@ -1244,17 +1195,9 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, {
DisplayModeRec mode;
RRTransformPtr transform = RRCrtcGetTransform (randr_crtc);
- xf86CrtcSetRec set;
xf86RandRModeConvert (pScrn, randr_mode, &mode);
- set.mode = &mode;
- set.rotation = rotation;
- set.transform = transform;
- set.x = x;
- set.y = y;
- set.scanout_pixmap = scanout_pixmap;
- set.flags = flags;
- if (!xf86CrtcSet(crtc, &set))
+ if (!xf86CrtcSetModeTransform (crtc, &mode, rotation, transform, x, y))
{
crtc->enabled = save_enabled;
for (o = 0; o < config->num_output; o++)
@@ -1435,7 +1378,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) if (nmode) {
rrmodes = malloc(nmode * sizeof (RRModePtr));
-
+
if (!rrmodes)
return FALSE;
nmode = 0;
@@ -1445,7 +1388,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) if ((pref != 0) == ((mode->type & M_T_PREFERRED) != 0)) {
xRRModeInfo modeInfo;
RRModePtr rrmode;
-
+
modeInfo.nameLength = strlen (mode->name);
modeInfo.width = mode->HDisplay;
modeInfo.dotClock = mode->Clock * 1000;
@@ -1469,7 +1412,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) }
}
}
-
+
ret = RROutputSetModes (randr_output, rrmodes, nmode, npreferred);
free(rrmodes);
return ret;
@@ -1489,13 +1432,13 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) int o, c, l;
RRCrtcPtr randr_crtc;
int nclone;
-
+
clones = malloc(config->num_output * sizeof (RROutputPtr));
crtcs = malloc(config->num_crtc * sizeof (RRCrtcPtr));
for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
-
+
ncrtc = 0;
for (c = 0; c < config->num_crtc; c++)
if (output->possible_crtcs & (1 << c))
@@ -1513,7 +1456,7 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) return FALSE;
}
- RROutputSetPhysicalSize(output->randr_output,
+ RROutputSetPhysicalSize(output->randr_output,
output->mm_width,
output->mm_height);
xf86RROutputSetModes (output->randr_output, output->probed_modes);
@@ -1539,7 +1482,7 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) for (l = 0; l < config->num_output; l++)
{
xf86OutputPtr clone = config->output[l];
-
+
if (l != o && (output->possible_clones & (1 << l)))
clones[nclone++] = clone->randr_output;
}
@@ -1580,7 +1523,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int c;
int o;
-
+
if (!RRInit ())
return FALSE;
@@ -1590,7 +1533,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen) for (c = 0; c < config->num_crtc; c++)
{
xf86CrtcPtr crtc = config->crtc[c];
-
+
crtc->randr_crtc = RRCrtcCreate (pScreen, crtc);
RRCrtcGammaSetSize (crtc->randr_crtc, 256);
}
@@ -1601,7 +1544,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen) {
xf86OutputPtr output = config->output[o];
- output->randr_output = RROutputCreate (pScreen, output->name,
+ output->randr_output = RROutputCreate (pScreen, output->name,
strlen (output->name),
output);
@@ -1624,7 +1567,7 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen) for (c = 0; c < config->num_crtc; c++)
xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
-
+
RRScreenSetSizeRange (pScreen, config->minWidth, config->minHeight,
config->maxWidth, config->maxHeight);
return TRUE;
@@ -1782,174 +1725,6 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) return Success;
}
-static RRScanoutPixmapInfo *
-xf86RRQueryScanoutPixmaps(ScreenPtr screen, int *n_info)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- RRScanoutPixmapInfo *info;
- int f;
-
- info = calloc(config->num_scanout_formats, sizeof (RRScanoutPixmapInfo));
- if (config->num_scanout_formats && !info) {
- *n_info = 0;
- return NULL;
- }
- for (f = 0; f < config->num_scanout_formats; f++) {
- info[f].maxWidth = config->scanout_formats[f].maxWidth;
- info[f].maxHeight = config->scanout_formats[f].maxHeight;
- info[f].depth = config->scanout_formats[f].depth;
- info[f].rotations = config->scanout_formats[f].rotations;
- info[f].format = PictureMatchFormat (screen, info[f].depth,
- config->scanout_formats[f].format);
- }
- *n_info = config->num_scanout_formats;
- return info;
-}
-
-static PixmapPtr
-xf86RRCreateScanoutPixmap(ScreenPtr screen,
- int width, int height, int depth,
- Rotation rotations,
- PictFormatPtr format)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int f;
-
- if (!config->funcs->create_scanout_pixmap)
- return NullPixmap;
-
- for (f = 0; f < config->num_scanout_formats; f++)
- if (config->scanout_formats[f].depth == depth &&
- (config->scanout_formats[f].format & 0xffffff) == format->format) {
- return (*config->funcs->create_scanout_pixmap) (scrn, width, height,
- rotations,
- &config->scanout_formats[f]);
- }
- return NullPixmap;
-}
-
-static void
-xf86RandR14SetCrtcSpriteTransform(ScreenPtr pScreen,
- RRCrtcPtr randr_crtc,
- struct pixman_f_transform *f_position_transform,
- struct pixman_f_transform *f_image_transform)
-{
- xf86CrtcPtr crtc = randr_crtc->devPrivate;
-
- crtc->user_sprite_position_transform = *f_position_transform;
- crtc->user_sprite_image_transform = *f_image_transform;
- xf86CrtcRotateCursor(crtc);
- xf86_reload_cursors(pScreen);
-}
-
-static Bool
-xf86RRConvertCrtcConfig(xf86CrtcSetConfigPtr xf86_config,
- RRCrtcConfigPtr rr_config)
-{
- RRCrtcPtr rr_crtc = rr_config->crtc;
- xf86CrtcPtr crtc = rr_crtc->devPrivate;
- ScrnInfoPtr scrn = xf86Screens[rr_crtc->pScreen->myNum];
- int o;
-
- xf86_config->crtc = crtc;
- xf86_config->x = rr_config->x;
- xf86_config->y = rr_config->y;
- xf86RandRModeConvert(scrn, rr_config->mode, &xf86_config->mode);
- xf86_config->rotation = rr_config->rotation;
- xf86_config->numOutputs = rr_config->numOutputs;
- xf86_config->outputs = calloc(rr_config->numOutputs, sizeof (xf86OutputPtr));
- if (!xf86_config->outputs)
- return FALSE;
- for (o = 0; o < rr_config->numOutputs; o++)
- xf86_config->outputs[o] = rr_config->outputs[o]->devPrivate;
- xf86_config->sprite_position_transform = rr_config->sprite_position_f_transform;
- xf86_config->sprite_image_transform = rr_config->sprite_image_f_transform;
- xf86_config->pixmap = rr_config->pixmap;
- xf86_config->pixmap_x = rr_config->pixmap_x;
- xf86_config->pixmap_y = rr_config->pixmap_y;
- return TRUE;
-}
-
-static void
-xf86FreeCrtcSetConfigs(xf86CrtcSetConfigPtr xf86_crtc_configs, int num_configs)
-{
- int i;
-
- for (i = 0; i < num_configs; i++)
- free(xf86_crtc_configs[i].outputs);
- free(xf86_crtc_configs);
-}
-
-static Bool
-xf86RRSetCrtcConfigs(ScreenPtr screen,
- RRScreenConfigPtr screen_config,
- RRCrtcConfigPtr crtc_configs,
- int num_configs)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- if (config->funcs->set_config) {
- xf86CrtcSetConfigPtr xf86_crtc_configs;
- int i;
- xf86SetConfigResponse response;
-
- /*
- * Convert RRCrtcConfigRecs to xf86CrtcSetConfigs
- */
- xf86_crtc_configs = calloc(num_configs, sizeof (xf86CrtcSetConfigRec));
- if (!xf86_crtc_configs)
- return FALSE;
- for (i = 0; i < num_configs; i++)
- if (!xf86RRConvertCrtcConfig(&xf86_crtc_configs[i], &crtc_configs[i])) {
- xf86FreeCrtcSetConfigs(xf86_crtc_configs, num_configs);
- return FALSE;
- }
-
- /*
- * Ask the driver to set the configuration
- */
- response = (*config->funcs->set_config)(scrn,
- screen_config,
- xf86_crtc_configs,
- num_configs);
- xf86FreeCrtcSetConfigs(xf86_crtc_configs, num_configs);
-
- /*
- * The driver is allowed to answer with one of three
- * responses:
- */
- switch (response) {
- case xf86SetConfigFailed:
-
- /* The configuration isn't usable, or some error
- * occurred while setting it. Everything has been
- * cleaned up and we're ready to return an error
- * back to the client
- */
- return FALSE;
- case xf86SetConfigDone:
-
- /* The configuration was acceptable, and the whole
- * mode setting experience is over. Nothing more to do
- * here.
- */
- return TRUE;
- case xf86SetConfigChecked:
-
- /* The configuration was acceptable, but the driver
- * didn't actually do anything. Go ask the DIX code
- * to do the mode setting operation using the simpler
- * interfaces
- */
- break;
- }
- }
- return miRRSetCrtcConfigs(screen, screen_config, crtc_configs, num_configs);
-}
-
static Bool
xf86RandR12EnterVT (int screen_index, int flags)
{
@@ -1958,7 +1733,6 @@ xf86RandR12EnterVT (int screen_index, int flags) XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
Bool ret;
- int i;
if (randrp->orig_EnterVT) {
pScrn->EnterVT = randrp->orig_EnterVT;
@@ -1970,6 +1744,7 @@ xf86RandR12EnterVT (int screen_index, int flags) }
/* reload gamma */
+ int i;
for (i = 0; i < rp->numCrtcs; i++)
xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]);
@@ -1991,17 +1766,15 @@ xf86RandR12Init12 (ScreenPtr pScreen) rp->rrCrtcGetGamma = xf86RandR12CrtcGetGamma;
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
+#if RANDR_13_INTERFACE
rp->rrOutputGetProperty = xf86RandR13OutputGetProperty;
rp->rrGetPanning = xf86RandR13GetPanning;
rp->rrSetPanning = xf86RandR13SetPanning;
+#endif
rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
pScrn->PointerMoved = xf86RandR12PointerMoved;
pScrn->ChangeGamma = xf86RandR12ChangeGamma;
- rp->rrSetCrtcSpriteTransform = xf86RandR14SetCrtcSpriteTransform;
- rp->rrSetCrtcConfigs = xf86RRSetCrtcConfigs;
- rp->rrQueryScanoutPixmaps = xf86RRQueryScanoutPixmaps;
- rp->rrCreateScanoutPixmap = xf86RRCreateScanoutPixmap;
randrp->orig_EnterVT = pScrn->EnterVT;
pScrn->EnterVT = xf86RandR12EnterVT;
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index 0181bc381..655857597 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -369,39 +369,6 @@ xf86CrtcFitsScreen (xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb) 0 <= b.y1 && b.y2 <= pScrn->virtualY);
}
-/*
- * A subset of xf86CrtcRotate that just deals with
- * cursor image/position transforms. Used when changing
- * the cursor transform
- */
-void
-xf86CrtcRotateCursor (xf86CrtcPtr crtc)
-{
- /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
- RRTransformPtr transform = NULL;
- PictTransform crtc_to_fb;
- struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc, f_screen_to_crtc, f_crtc_to_cursor;
-
- if (crtc->transformPresent)
- transform = &crtc->transform;
-
- (void) RRTransformCompute (crtc->x, crtc->y,
- crtc->mode.HDisplay, crtc->mode.VDisplay,
- crtc->rotation,
- transform,
- &crtc->user_sprite_position_transform,
- &crtc->user_sprite_image_transform,
-
- &crtc_to_fb,
- &f_crtc_to_fb,
- &f_fb_to_crtc,
- &f_screen_to_crtc,
- &f_crtc_to_cursor,
- &crtc->sprite_transform_in_use);
- crtc->f_screen_to_crtc = f_screen_to_crtc;
- crtc->f_crtc_to_cursor = f_crtc_to_cursor;
-}
-
Bool
xf86CrtcRotate (xf86CrtcPtr crtc)
{
@@ -410,7 +377,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
PictTransform crtc_to_fb;
- struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc, f_screen_to_crtc, f_crtc_to_cursor;
+ struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc;
xFixed *new_params = NULL;
int new_nparams = 0;
PictFilterPtr new_filter = NULL;
@@ -426,15 +393,10 @@ xf86CrtcRotate (xf86CrtcPtr crtc) crtc->mode.HDisplay, crtc->mode.VDisplay,
crtc->rotation,
transform,
- &crtc->user_sprite_position_transform,
- &crtc->user_sprite_image_transform,
&crtc_to_fb,
&f_crtc_to_fb,
- &f_fb_to_crtc,
- &f_screen_to_crtc,
- &f_crtc_to_cursor,
- &crtc->sprite_transform_in_use) &&
+ &f_fb_to_crtc) &&
xf86CrtcFitsScreen (crtc, &f_crtc_to_fb))
{
/*
@@ -543,8 +505,6 @@ xf86CrtcRotate (xf86CrtcPtr crtc) crtc->crtc_to_framebuffer = crtc_to_fb;
crtc->f_crtc_to_framebuffer = f_crtc_to_fb;
crtc->f_framebuffer_to_crtc = f_fb_to_crtc;
- crtc->f_screen_to_crtc = f_screen_to_crtc;
- crtc->f_crtc_to_cursor = f_crtc_to_cursor;
free(crtc->params);
crtc->params = new_params;
crtc->nparams = new_nparams;
|