2007-02-16 05:36:20 +01:00
|
|
|
/*
|
2009-09-19 06:12:17 +02:00
|
|
|
* Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
|
2007-02-16 05:36:20 +01:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
* the above copyright notice appear in all copies and that both that copyright
|
|
|
|
* notice and this permission notice appear in supporting documentation, and
|
|
|
|
* that the name of the copyright holders not be used in advertising or
|
|
|
|
* publicity pertaining to distribution of the software without specific,
|
|
|
|
* written prior permission. The copyright holders make no representations
|
|
|
|
* about the suitability of this software for any purpose. It is provided "as
|
|
|
|
* is" without express or implied warranty.
|
|
|
|
*
|
|
|
|
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
|
|
* OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "xf86.h"
|
|
|
|
#include "os.h"
|
|
|
|
#include "globals.h"
|
2013-03-21 16:58:57 +01:00
|
|
|
#include "xf86Modes.h"
|
2007-02-16 05:36:20 +01:00
|
|
|
#include "xf86Priv.h"
|
|
|
|
#include "xf86DDC.h"
|
|
|
|
#include "mipointer.h"
|
|
|
|
#include "windowstr.h"
|
2007-03-05 03:07:17 +01:00
|
|
|
#include "inputstr.h"
|
2007-02-16 05:36:20 +01:00
|
|
|
#include <randrstr.h>
|
|
|
|
#include <X11/extensions/render.h>
|
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
#include "xf86cmap.h"
|
2007-02-16 05:36:20 +01:00
|
|
|
#include "xf86Crtc.h"
|
|
|
|
#include "xf86RandR12.h"
|
|
|
|
|
|
|
|
typedef struct _xf86RandR12Info {
|
2012-03-21 20:55:09 +01:00
|
|
|
int virtualX;
|
|
|
|
int virtualY;
|
|
|
|
int mmWidth;
|
|
|
|
int mmHeight;
|
|
|
|
int maxX;
|
|
|
|
int maxY;
|
|
|
|
int pointerX;
|
|
|
|
int pointerY;
|
|
|
|
Rotation rotation; /* current mode */
|
|
|
|
Rotation supported_rotations; /* driver supported */
|
2009-05-05 02:24:47 +02:00
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
/* Compatibility with colormaps and XF86VidMode's gamma */
|
|
|
|
int palette_red_size;
|
|
|
|
int palette_green_size;
|
|
|
|
int palette_blue_size;
|
|
|
|
int palette_size;
|
|
|
|
LOCO *palette;
|
|
|
|
|
2009-05-05 02:24:47 +02:00
|
|
|
/* Used to wrap EnterVT so we can re-probe the outputs when a laptop unsuspends
|
|
|
|
* (actually, any time that we switch back into our VT).
|
|
|
|
*
|
|
|
|
* See https://bugs.freedesktop.org/show_bug.cgi?id=21554
|
|
|
|
*/
|
|
|
|
xf86EnterVTProc *orig_EnterVT;
|
2012-07-30 20:32:12 +02:00
|
|
|
|
|
|
|
Bool panning;
|
|
|
|
ConstrainCursorHarderProcPtr orig_ConstrainCursorHarder;
|
2007-02-16 05:36:20 +01:00
|
|
|
} XF86RandRInfoRec, *XF86RandRInfoPtr;
|
|
|
|
|
|
|
|
#ifdef RANDR_12_INTERFACE
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool xf86RandR12Init12(ScreenPtr pScreen);
|
|
|
|
static Bool xf86RandR12CreateScreenResources12(ScreenPtr pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
#endif
|
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
static int xf86RandR12Generation;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
static DevPrivateKeyRec xf86RandR12KeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
|
2019-01-11 17:38:34 +01:00
|
|
|
dixLookupPrivate(&(p)->devPrivates, &xf86RandR12KeyRec))
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12ModeRefresh(DisplayModePtr mode)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
|
|
|
if (mode->VRefresh)
|
2012-03-21 20:55:09 +01:00
|
|
|
return (int) (mode->VRefresh + 0.5);
|
2007-02-16 05:36:20 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2008-12-04 16:55:14 +01:00
|
|
|
/* Adapt panning area; return TRUE if panning area was valid without adaption */
|
2008-11-28 17:49:31 +01:00
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR13VerifyPanningArea(xf86CrtcPtr crtc, int screenWidth,
|
|
|
|
int screenHeight)
|
2008-11-28 17:49:31 +01:00
|
|
|
{
|
2008-12-04 16:55:14 +01:00
|
|
|
int ret = TRUE;
|
|
|
|
|
2008-11-28 17:49:31 +01:00
|
|
|
if (crtc->version < 2)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2008-11-28 17:49:31 +01:00
|
|
|
|
2008-12-04 16:55:14 +01:00
|
|
|
if (crtc->panningTotalArea.x2 <= crtc->panningTotalArea.x1) {
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Panning in X is disabled */
|
|
|
|
if (crtc->panningTotalArea.x1 || crtc->panningTotalArea.x2)
|
|
|
|
/* Illegal configuration -> fail/disable */
|
|
|
|
ret = FALSE;
|
|
|
|
crtc->panningTotalArea.x1 = crtc->panningTotalArea.x2 = 0;
|
|
|
|
crtc->panningTrackingArea.x1 = crtc->panningTrackingArea.x2 = 0;
|
|
|
|
crtc->panningBorder[0] = crtc->panningBorder[2] = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Panning in X is enabled */
|
|
|
|
if (crtc->panningTotalArea.x1 < 0) {
|
|
|
|
/* Panning region outside screen -> move inside */
|
|
|
|
crtc->panningTotalArea.x2 -= crtc->panningTotalArea.x1;
|
|
|
|
crtc->panningTotalArea.x1 = 0;
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.x2 <
|
|
|
|
crtc->panningTotalArea.x1 + crtc->mode.HDisplay) {
|
|
|
|
/* Panning region smaller than displayed area -> crop to displayed area */
|
|
|
|
crtc->panningTotalArea.x2 =
|
|
|
|
crtc->panningTotalArea.x1 + crtc->mode.HDisplay;
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.x2 > screenWidth) {
|
|
|
|
/* Panning region larger than screen -> move inside, then crop to screen */
|
|
|
|
crtc->panningTotalArea.x1 -=
|
|
|
|
crtc->panningTotalArea.x2 - screenWidth;
|
|
|
|
crtc->panningTotalArea.x2 = screenWidth;
|
|
|
|
ret = FALSE;
|
|
|
|
if (crtc->panningTotalArea.x1 < 0)
|
|
|
|
crtc->panningTotalArea.x1 = 0;
|
|
|
|
}
|
|
|
|
if (crtc->panningBorder[0] + crtc->panningBorder[2] >
|
|
|
|
crtc->mode.HDisplay) {
|
|
|
|
/* Borders too large -> set to 0 */
|
|
|
|
crtc->panningBorder[0] = crtc->panningBorder[2] = 0;
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
|
|
|
|
2008-12-04 16:55:14 +01:00
|
|
|
if (crtc->panningTotalArea.y2 <= crtc->panningTotalArea.y1) {
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Panning in Y is disabled */
|
|
|
|
if (crtc->panningTotalArea.y1 || crtc->panningTotalArea.y2)
|
|
|
|
/* Illegal configuration -> fail/disable */
|
|
|
|
ret = FALSE;
|
|
|
|
crtc->panningTotalArea.y1 = crtc->panningTotalArea.y2 = 0;
|
|
|
|
crtc->panningTrackingArea.y1 = crtc->panningTrackingArea.y2 = 0;
|
|
|
|
crtc->panningBorder[1] = crtc->panningBorder[3] = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Panning in Y is enabled */
|
|
|
|
if (crtc->panningTotalArea.y1 < 0) {
|
|
|
|
/* Panning region outside screen -> move inside */
|
|
|
|
crtc->panningTotalArea.y2 -= crtc->panningTotalArea.y1;
|
|
|
|
crtc->panningTotalArea.y1 = 0;
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.y2 <
|
|
|
|
crtc->panningTotalArea.y1 + crtc->mode.VDisplay) {
|
|
|
|
/* Panning region smaller than displayed area -> crop to displayed area */
|
|
|
|
crtc->panningTotalArea.y2 =
|
|
|
|
crtc->panningTotalArea.y1 + crtc->mode.VDisplay;
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.y2 > screenHeight) {
|
|
|
|
/* Panning region larger than screen -> move inside, then crop to screen */
|
|
|
|
crtc->panningTotalArea.y1 -=
|
|
|
|
crtc->panningTotalArea.y2 - screenHeight;
|
|
|
|
crtc->panningTotalArea.y2 = screenHeight;
|
|
|
|
ret = FALSE;
|
|
|
|
if (crtc->panningTotalArea.y1 < 0)
|
|
|
|
crtc->panningTotalArea.y1 = 0;
|
|
|
|
}
|
|
|
|
if (crtc->panningBorder[1] + crtc->panningBorder[3] >
|
|
|
|
crtc->mode.VDisplay) {
|
|
|
|
/* Borders too large -> set to 0 */
|
|
|
|
crtc->panningBorder[1] = crtc->panningBorder[3] = 0;
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
2008-12-04 16:55:14 +01:00
|
|
|
|
|
|
|
return ret;
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
|
|
|
|
2009-02-25 19:14:36 +01:00
|
|
|
/*
|
|
|
|
* The heart of the panning operation:
|
|
|
|
*
|
|
|
|
* Given a frame buffer position (fb_x, fb_y),
|
|
|
|
* and a crtc position (crtc_x, crtc_y),
|
|
|
|
* and a transform matrix which maps frame buffer to crtc,
|
|
|
|
* compute a panning position (pan_x, pan_y) that
|
|
|
|
* makes the resulting transform line those two up
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
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)
|
2009-02-25 19:14:36 +01:00
|
|
|
{
|
2011-02-23 20:18:12 +01:00
|
|
|
if (transform_in_use) {
|
2012-03-21 20:55:09 +01:00
|
|
|
/*
|
|
|
|
* Given the current transform, M, the current position
|
|
|
|
* on the Screen, S, and the desired position on the CRTC,
|
|
|
|
* C, compute a translation, T, such that:
|
|
|
|
*
|
|
|
|
* M T S = C
|
|
|
|
*
|
|
|
|
* where T is of the form
|
|
|
|
*
|
|
|
|
* | 1 0 dx |
|
|
|
|
* | 0 1 dy |
|
|
|
|
* | 0 0 1 |
|
|
|
|
*
|
|
|
|
* M T S =
|
|
|
|
* | M00 Sx + M01 Sy + M00 dx + M01 dy + M02 | | Cx F |
|
|
|
|
* | M10 Sx + M11 Sy + M10 dx + M11 dy + M12 | = | Cy F |
|
|
|
|
* | M20 Sx + M21 Sy + M20 dx + M21 dy + M22 | | F |
|
|
|
|
*
|
|
|
|
* R = M S
|
|
|
|
*
|
|
|
|
* Cx F = M00 dx + M01 dy + R0
|
|
|
|
* Cy F = M10 dx + M11 dy + R1
|
|
|
|
* F = M20 dx + M21 dy + R2
|
|
|
|
*
|
|
|
|
* Zero out dx, then dy
|
|
|
|
*
|
|
|
|
* F (Cx M10 - Cy M00) =
|
|
|
|
* (M10 M01 - M00 M11) dy + M10 R0 - M00 R1
|
|
|
|
* F (M10 - Cy M20) =
|
|
|
|
* (M10 M21 - M20 M11) dy + M10 R2 - M20 R1
|
|
|
|
*
|
|
|
|
* F (Cx M11 - Cy M01) =
|
|
|
|
* (M11 M00 - M01 M10) dx + M11 R0 - M01 R1
|
|
|
|
* F (M11 - Cy M21) =
|
|
|
|
* (M11 M20 - M21 M10) dx + M11 R2 - M21 R1
|
|
|
|
*
|
|
|
|
* Make some temporaries
|
|
|
|
*
|
|
|
|
* T = | Cx M10 - Cy M00 |
|
|
|
|
* | Cx M11 - Cy M01 |
|
|
|
|
*
|
|
|
|
* U = | M10 M01 - M00 M11 |
|
|
|
|
* | M11 M00 - M01 M10 |
|
|
|
|
*
|
|
|
|
* Q = | M10 R0 - M00 R1 |
|
|
|
|
* | M11 R0 - M01 R1 |
|
|
|
|
*
|
|
|
|
* P = | M10 - Cy M20 |
|
|
|
|
* | M11 - Cy M21 |
|
|
|
|
*
|
|
|
|
* W = | M10 M21 - M20 M11 |
|
|
|
|
* | M11 M20 - M21 M10 |
|
|
|
|
*
|
|
|
|
* V = | M10 R2 - M20 R1 |
|
|
|
|
* | M11 R2 - M21 R1 |
|
|
|
|
*
|
|
|
|
* Rewrite:
|
|
|
|
*
|
|
|
|
* F T0 = U0 dy + Q0
|
|
|
|
* F P0 = W0 dy + V0
|
|
|
|
* F T1 = U1 dx + Q1
|
|
|
|
* F P1 = W1 dx + V1
|
|
|
|
*
|
|
|
|
* Solve for F (two ways)
|
|
|
|
*
|
|
|
|
* F (W0 T0 - U0 P0) = W0 Q0 - U0 V0
|
|
|
|
*
|
|
|
|
* W0 Q0 - U0 V0
|
|
|
|
* F = -------------
|
|
|
|
* W0 T0 - U0 P0
|
|
|
|
*
|
|
|
|
* F (W1 T1 - U1 P1) = W1 Q1 - U1 V1
|
|
|
|
*
|
|
|
|
* W1 Q1 - U1 V1
|
|
|
|
* F = -------------
|
|
|
|
* W1 T1 - U1 P1
|
|
|
|
*
|
|
|
|
* We'll use which ever solution works (denominator != 0)
|
|
|
|
*
|
|
|
|
* Finally, solve for dx and dy:
|
|
|
|
*
|
|
|
|
* dx = (F T1 - Q1) / U1
|
|
|
|
* dx = (F P1 - V1) / W1
|
|
|
|
*
|
|
|
|
* dy = (F T0 - Q0) / U0
|
|
|
|
* dy = (F P0 - V0) / W0
|
|
|
|
*/
|
|
|
|
double r[3];
|
|
|
|
double q[2], u[2], t[2], v[2], w[2], p[2];
|
|
|
|
double f;
|
|
|
|
struct pict_f_vector d;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Get the un-normalized crtc coordinates again */
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
r[i] = m->m[i][0] * screen_x + m->m[i][1] * screen_y + m->m[i][2];
|
|
|
|
|
|
|
|
/* Combine values into temporaries */
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
q[i] = m->m[1][i] * r[0] - m->m[0][i] * r[1];
|
|
|
|
u[i] = m->m[1][i] * m->m[0][1 - i] - m->m[0][i] * m->m[1][1 - i];
|
|
|
|
t[i] = m->m[1][i] * crtc_x - m->m[0][i] * crtc_y;
|
|
|
|
|
|
|
|
v[i] = m->m[1][i] * r[2] - m->m[2][i] * r[1];
|
|
|
|
w[i] = m->m[1][i] * m->m[2][1 - i] - m->m[2][i] * m->m[1][1 - i];
|
|
|
|
p[i] = m->m[1][i] - m->m[2][i] * crtc_y;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Find a way to compute f */
|
|
|
|
f = 0;
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
double a = w[i] * q[i] - u[i] * v[i];
|
|
|
|
double b = w[i] * t[i] - u[i] * p[i];
|
|
|
|
|
|
|
|
if (b != 0) {
|
|
|
|
f = a / b;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Solve for the resulting transform vector */
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
if (u[i])
|
|
|
|
d.v[1 - i] = (t[i] * f - q[i]) / u[i];
|
|
|
|
else if (w[1])
|
|
|
|
d.v[1 - i] = (p[i] * f - v[i]) / w[i];
|
|
|
|
else
|
|
|
|
d.v[1 - i] = 0;
|
|
|
|
}
|
|
|
|
*new_pan_x = old_pan_x - floor(d.v[0] + 0.5);
|
|
|
|
*new_pan_y = old_pan_y - floor(d.v[1] + 0.5);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*new_pan_x = screen_x - crtc_x;
|
|
|
|
*new_pan_y = screen_y - crtc_y;
|
2009-02-25 19:14:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-28 17:49:31 +01:00
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR13Pan(xf86CrtcPtr crtc, int x, int y)
|
2008-11-28 17:49:31 +01:00
|
|
|
{
|
|
|
|
int newX, newY;
|
|
|
|
int width, height;
|
2009-02-25 19:14:36 +01:00
|
|
|
Bool panned = FALSE;
|
2008-11-28 17:49:31 +01:00
|
|
|
|
|
|
|
if (crtc->version < 2)
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2008-11-28 17:49:31 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!crtc->enabled ||
|
|
|
|
(crtc->panningTotalArea.x2 <= crtc->panningTotalArea.x1 &&
|
|
|
|
crtc->panningTotalArea.y2 <= crtc->panningTotalArea.y1))
|
|
|
|
return;
|
2008-11-28 17:49:31 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
newX = crtc->x;
|
|
|
|
newY = crtc->y;
|
|
|
|
width = crtc->mode.HDisplay;
|
2008-11-28 17:49:31 +01:00
|
|
|
height = crtc->mode.VDisplay;
|
|
|
|
|
2008-12-04 18:13:40 +01:00
|
|
|
if ((crtc->panningTrackingArea.x2 <= crtc->panningTrackingArea.x1 ||
|
2012-03-21 20:55:09 +01:00
|
|
|
(x >= crtc->panningTrackingArea.x1 &&
|
|
|
|
x < crtc->panningTrackingArea.x2)) &&
|
|
|
|
(crtc->panningTrackingArea.y2 <= crtc->panningTrackingArea.y1 ||
|
|
|
|
(y >= crtc->panningTrackingArea.y1 &&
|
|
|
|
y < crtc->panningTrackingArea.y2))) {
|
|
|
|
struct pict_f_vector c;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pre-clip the mouse position to the panning area so that we don't
|
|
|
|
* push the crtc outside. This doesn't deal with changes to the
|
|
|
|
* panning values, only mouse position changes.
|
|
|
|
*/
|
|
|
|
if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
|
|
|
|
if (x < crtc->panningTotalArea.x1)
|
|
|
|
x = crtc->panningTotalArea.x1;
|
|
|
|
if (x >= crtc->panningTotalArea.x2)
|
|
|
|
x = crtc->panningTotalArea.x2 - 1;
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
|
|
|
|
if (y < crtc->panningTotalArea.y1)
|
|
|
|
y = crtc->panningTotalArea.y1;
|
|
|
|
if (y >= crtc->panningTotalArea.y2)
|
|
|
|
y = crtc->panningTotalArea.y2 - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
c.v[0] = x;
|
|
|
|
c.v[1] = y;
|
|
|
|
c.v[2] = 1.0;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
|
|
|
|
if (c.v[0] < crtc->panningBorder[0]) {
|
|
|
|
c.v[0] = crtc->panningBorder[0];
|
|
|
|
panned = TRUE;
|
|
|
|
}
|
|
|
|
if (c.v[0] >= width - crtc->panningBorder[2]) {
|
|
|
|
c.v[0] = width - crtc->panningBorder[2] - 1;
|
|
|
|
panned = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
|
|
|
|
if (c.v[1] < crtc->panningBorder[1]) {
|
|
|
|
c.v[1] = crtc->panningBorder[1];
|
|
|
|
panned = TRUE;
|
|
|
|
}
|
|
|
|
if (c.v[1] >= height - crtc->panningBorder[3]) {
|
|
|
|
c.v[1] = height - crtc->panningBorder[3] - 1;
|
|
|
|
panned = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (panned)
|
|
|
|
xf86ComputeCrtcPan(crtc->transform_in_use,
|
|
|
|
&crtc->f_framebuffer_to_crtc,
|
|
|
|
x, y, c.v[0], c.v[1], newX, newY, &newX, &newY);
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
2009-02-25 19:14:36 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ensure that the crtc is within the panning region.
|
|
|
|
*
|
|
|
|
* XXX This computation only works when we do not have a transform
|
|
|
|
* in use.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
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) {
|
|
|
|
if (newX > crtc->panningTotalArea.x2 - width)
|
|
|
|
newX = crtc->panningTotalArea.x2 - width;
|
|
|
|
if (newX < crtc->panningTotalArea.x1)
|
|
|
|
newX = crtc->panningTotalArea.x1;
|
|
|
|
}
|
|
|
|
if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
|
|
|
|
if (newY > crtc->panningTotalArea.y2 - height)
|
|
|
|
newY = crtc->panningTotalArea.y2 - height;
|
|
|
|
if (newY < crtc->panningTotalArea.y1)
|
|
|
|
newY = crtc->panningTotalArea.y1;
|
|
|
|
}
|
2008-12-04 18:13:40 +01:00
|
|
|
}
|
2008-11-28 17:49:31 +01:00
|
|
|
if (newX != crtc->x || newY != crtc->y)
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcSetOrigin(crtc, newX, newY);
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
RRScreenSizePtr pSize;
|
2012-04-11 11:02:25 +02:00
|
|
|
ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
DisplayModePtr mode;
|
|
|
|
int maxX = 0, maxY = 0;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
*rotations = randrp->supported_rotations;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randrp->virtualX == -1 || randrp->virtualY == -1) {
|
|
|
|
randrp->virtualX = scrp->virtualX;
|
|
|
|
randrp->virtualY = scrp->virtualY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Re-probe the outputs for new monitors or modes */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (scrp->vtSema) {
|
|
|
|
xf86ProbeOutputModes(scrp, 0, 0);
|
|
|
|
xf86SetScrnInfoModes(scrp);
|
2007-06-22 03:08:21 +02:00
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (mode = scrp->modes;; mode = mode->next) {
|
|
|
|
int refresh = xf86RandR12ModeRefresh(mode);
|
|
|
|
|
|
|
|
if (randrp->maxX == 0 || randrp->maxY == 0) {
|
|
|
|
if (maxX < mode->HDisplay)
|
|
|
|
maxX = mode->HDisplay;
|
|
|
|
if (maxY < mode->VDisplay)
|
|
|
|
maxY = mode->VDisplay;
|
|
|
|
}
|
|
|
|
pSize = RRRegisterSize(pScreen,
|
|
|
|
mode->HDisplay, mode->VDisplay,
|
|
|
|
randrp->mmWidth, randrp->mmHeight);
|
|
|
|
if (!pSize)
|
|
|
|
return FALSE;
|
|
|
|
RRRegisterRate(pScreen, pSize, refresh);
|
|
|
|
|
|
|
|
if (xf86ModesEqual(mode, scrp->currentMode)) {
|
|
|
|
RRSetCurrentConfig(pScreen, randrp->rotation, refresh, pSize);
|
|
|
|
}
|
|
|
|
if (mode->next == scrp->modes)
|
|
|
|
break;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randrp->maxX == 0 || randrp->maxY == 0) {
|
|
|
|
randrp->maxX = maxX;
|
|
|
|
randrp->maxY = maxY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12SetMode(ScreenPtr pScreen,
|
|
|
|
DisplayModePtr mode,
|
|
|
|
Bool useVirtual, int mmWidth, int mmHeight)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-11 11:02:25 +02:00
|
|
|
ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
int oldWidth = pScreen->width;
|
|
|
|
int oldHeight = pScreen->height;
|
|
|
|
int oldmmWidth = pScreen->mmWidth;
|
|
|
|
int oldmmHeight = pScreen->mmHeight;
|
|
|
|
WindowPtr pRoot = pScreen->root;
|
|
|
|
DisplayModePtr currentMode = NULL;
|
|
|
|
Bool ret = TRUE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
if (pRoot)
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
(*scrp->EnableDisableFBAccess) (scrp, FALSE);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (useVirtual) {
|
|
|
|
scrp->virtualX = randrp->virtualX;
|
|
|
|
scrp->virtualY = randrp->virtualY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
scrp->virtualX = mode->HDisplay;
|
|
|
|
scrp->virtualY = mode->VDisplay;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randrp->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
|
|
|
|
/* If the screen is rotated 90 or 270 degrees, swap the sizes. */
|
|
|
|
pScreen->width = scrp->virtualY;
|
|
|
|
pScreen->height = scrp->virtualX;
|
|
|
|
pScreen->mmWidth = mmHeight;
|
|
|
|
pScreen->mmHeight = mmWidth;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
pScreen->width = scrp->virtualX;
|
|
|
|
pScreen->height = scrp->virtualY;
|
|
|
|
pScreen->mmWidth = mmWidth;
|
|
|
|
pScreen->mmHeight = mmHeight;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
if (scrp->currentMode == mode) {
|
|
|
|
/* Save current mode */
|
|
|
|
currentMode = scrp->currentMode;
|
|
|
|
/* Reset, just so we ensure the drivers SwitchMode is called */
|
|
|
|
scrp->currentMode = NULL;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* We know that if the driver failed to SwitchMode to the rotated
|
2020-07-05 22:07:33 +02:00
|
|
|
* version, then it should revert back to its prior mode.
|
2007-02-16 05:36:20 +01:00
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!xf86SwitchMode(pScreen, mode)) {
|
2007-02-16 05:36:20 +01:00
|
|
|
ret = FALSE;
|
2012-03-21 20:55:09 +01:00
|
|
|
scrp->virtualX = pScreen->width = oldWidth;
|
|
|
|
scrp->virtualY = pScreen->height = oldHeight;
|
|
|
|
pScreen->mmWidth = oldmmWidth;
|
|
|
|
pScreen->mmHeight = oldmmHeight;
|
2007-02-16 05:36:20 +01:00
|
|
|
scrp->currentMode = currentMode;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Make sure the layout is correct
|
|
|
|
*/
|
|
|
|
xf86ReconfigureLayout();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Make sure the whole screen is visible
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86SetViewport(pScreen, pScreen->width, pScreen->height);
|
|
|
|
xf86SetViewport(pScreen, 0, 0);
|
2007-02-16 05:36:20 +01:00
|
|
|
if (pRoot)
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
(*scrp->EnableDisableFBAccess) (scrp, TRUE);
|
2007-02-16 05:36:20 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12SetConfig(ScreenPtr pScreen,
|
|
|
|
Rotation rotation, int rate, RRScreenSizePtr pSize)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-11 11:02:25 +02:00
|
|
|
ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
DisplayModePtr mode;
|
|
|
|
int pos[MAXDEVICES][2];
|
|
|
|
Bool useVirtual = FALSE;
|
|
|
|
int maxX = 0, maxY = 0;
|
|
|
|
Rotation oldRotation = randrp->rotation;
|
|
|
|
DeviceIntPtr dev;
|
|
|
|
Bool view_adjusted = FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
randrp->rotation = rotation;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randrp->virtualX == -1 || randrp->virtualY == -1) {
|
|
|
|
randrp->virtualX = scrp->virtualX;
|
|
|
|
randrp->virtualY = scrp->virtualY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
|
|
|
if (!IsMaster(dev) && !IsFloating(dev))
|
|
|
|
continue;
|
2011-02-11 02:11:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
|
2011-02-11 02:11:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (mode = scrp->modes;; mode = mode->next) {
|
|
|
|
if (randrp->maxX == 0 || randrp->maxY == 0) {
|
|
|
|
if (maxX < mode->HDisplay)
|
|
|
|
maxX = mode->HDisplay;
|
|
|
|
if (maxY < mode->VDisplay)
|
|
|
|
maxY = mode->VDisplay;
|
|
|
|
}
|
|
|
|
if (mode->HDisplay == pSize->width &&
|
|
|
|
mode->VDisplay == pSize->height &&
|
|
|
|
(rate == 0 || xf86RandR12ModeRefresh(mode) == rate))
|
|
|
|
break;
|
|
|
|
if (mode->next == scrp->modes) {
|
|
|
|
if (pSize->width == randrp->virtualX &&
|
|
|
|
pSize->height == randrp->virtualY) {
|
|
|
|
mode = scrp->modes;
|
|
|
|
useVirtual = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (randrp->maxX == 0 || randrp->maxY == 0) {
|
|
|
|
randrp->maxX = maxX;
|
|
|
|
randrp->maxY = maxY;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randrp->maxX == 0 || randrp->maxY == 0) {
|
|
|
|
randrp->maxX = maxX;
|
|
|
|
randrp->maxY = maxY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!xf86RandR12SetMode(pScreen, mode, useVirtual, pSize->mmWidth,
|
|
|
|
pSize->mmHeight)) {
|
2007-02-16 05:36:20 +01:00
|
|
|
randrp->rotation = oldRotation;
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Move the cursor back where it belongs; SwitchMode repositions it
|
2011-02-11 02:11:57 +01:00
|
|
|
* FIXME: duplicated code, see modes/xf86RandR12.c
|
2007-02-16 05:36:20 +01:00
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
|
|
|
if (!IsMaster(dev) && !IsFloating(dev))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (pScreen == miPointerGetScreen(dev)) {
|
|
|
|
int px = pos[dev->id][0];
|
|
|
|
int py = pos[dev->id][1];
|
|
|
|
|
|
|
|
px = (px >= pScreen->width ? (pScreen->width - 1) : px);
|
|
|
|
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
|
|
|
|
|
|
|
/* Setting the viewpoint makes only sense on one device */
|
|
|
|
if (!view_adjusted && IsMaster(dev)) {
|
|
|
|
xf86SetViewport(pScreen, px, py);
|
|
|
|
view_adjusted = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
(*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE);
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-07-30 20:32:12 +02:00
|
|
|
#define PANNING_ENABLED(crtc) \
|
|
|
|
((crtc)->panningTotalArea.x2 > (crtc)->panningTotalArea.x1 || \
|
|
|
|
(crtc)->panningTotalArea.y2 > (crtc)->panningTotalArea.y1)
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12ScreenSetSize(ScreenPtr pScreen,
|
|
|
|
CARD16 width,
|
|
|
|
CARD16 height, CARD32 mmWidth, CARD32 mmHeight)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
2012-04-11 11:02:25 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
WindowPtr pRoot = pScreen->root;
|
|
|
|
PixmapPtr pScrnPix;
|
|
|
|
Bool ret = FALSE;
|
|
|
|
int c;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2015-03-31 09:06:46 +02:00
|
|
|
if (randrp->virtualX == -1 || randrp->virtualY == -1) {
|
|
|
|
randrp->virtualX = pScrn->virtualX;
|
|
|
|
randrp->virtualY = pScrn->virtualY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2011-02-23 20:17:24 +01:00
|
|
|
if (pRoot && pScrn->vtSema)
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
(*pScrn->EnableDisableFBAccess) (pScrn, FALSE);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2011-02-23 20:17:24 +01:00
|
|
|
/* Let the driver update virtualX and virtualY */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(*config->funcs->resize) (pScrn, width, height))
|
|
|
|
goto finish;
|
2007-02-28 22:36:58 +01:00
|
|
|
|
|
|
|
ret = TRUE;
|
2011-02-23 20:17:24 +01:00
|
|
|
/* Update panning information */
|
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcPtr crtc = config->crtc[c];
|
|
|
|
|
2012-07-30 20:32:12 +02:00
|
|
|
if (PANNING_ENABLED (crtc)) {
|
2012-03-21 20:55:09 +01:00
|
|
|
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);
|
|
|
|
}
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
2007-02-28 22:36:58 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pScrnPix = (*pScreen->GetScreenPixmap) (pScreen);
|
2011-02-23 20:17:24 +01:00
|
|
|
pScreen->width = pScrnPix->drawable.width = width;
|
|
|
|
pScreen->height = pScrnPix->drawable.height = height;
|
2008-03-13 22:37:12 +01:00
|
|
|
randrp->mmWidth = pScreen->mmWidth = mmWidth;
|
|
|
|
randrp->mmHeight = pScreen->mmHeight = mmHeight;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86SetViewport(pScreen, pScreen->width - 1, pScreen->height - 1);
|
|
|
|
xf86SetViewport(pScreen, 0, 0);
|
2007-02-28 22:36:58 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
finish:
|
2011-09-07 06:04:10 +02:00
|
|
|
update_desktop_dimensions();
|
|
|
|
|
2011-02-23 20:17:24 +01:00
|
|
|
if (pRoot && pScrn->vtSema)
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
(*pScrn->EnableDisableFBAccess) (pScrn, TRUE);
|
2007-02-16 05:36:20 +01:00
|
|
|
#if RANDR_12_INTERFACE
|
2015-03-31 09:06:46 +02:00
|
|
|
if (pScreen->root && ret)
|
2012-03-21 20:55:09 +01:00
|
|
|
RRScreenSizeNotify(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
#endif
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Rotation
|
2007-02-16 05:36:20 +01:00
|
|
|
xf86RandR12GetRotation(ScreenPtr pScreen)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
return randrp->rotation;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CreateScreenResources(ScreenPtr pScreen)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config;
|
|
|
|
XF86RandRInfoPtr randrp;
|
|
|
|
int c;
|
|
|
|
int width, height;
|
|
|
|
int mmWidth, mmHeight;
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
/* XXX disable RandR when using Xinerama */
|
|
|
|
if (!noPanoramiXExtension)
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
2007-02-16 05:36:20 +01:00
|
|
|
#endif
|
|
|
|
|
2009-04-15 10:26:06 +02:00
|
|
|
config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
randrp = XF86RANDRINFO(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
/*
|
|
|
|
* Compute size of screen
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
width = 0;
|
|
|
|
height = 0;
|
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
|
|
|
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;
|
|
|
|
if (crtc_height > height)
|
|
|
|
height = crtc_height;
|
|
|
|
if (crtc->panningTotalArea.x2 > width)
|
|
|
|
width = crtc->panningTotalArea.x2;
|
|
|
|
if (crtc->panningTotalArea.y2 > height)
|
|
|
|
height = crtc->panningTotalArea.y2;
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
if (width && height) {
|
|
|
|
/*
|
|
|
|
* Compute physical size of screen
|
|
|
|
*/
|
|
|
|
if (monitorResolution) {
|
|
|
|
mmWidth = width * 25.4 / monitorResolution;
|
|
|
|
mmHeight = height * 25.4 / monitorResolution;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xf86OutputPtr output = xf86CompatOutput(pScrn);
|
|
|
|
|
|
|
|
if (output &&
|
|
|
|
output->conf_monitor &&
|
|
|
|
(output->conf_monitor->mon_width > 0 &&
|
|
|
|
output->conf_monitor->mon_height > 0)) {
|
|
|
|
/*
|
|
|
|
* Prefer user configured DisplaySize
|
|
|
|
*/
|
|
|
|
mmWidth = output->conf_monitor->mon_width;
|
|
|
|
mmHeight = output->conf_monitor->mon_height;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/*
|
|
|
|
* Otherwise, just set the screen to DEFAULT_DPI
|
|
|
|
*/
|
|
|
|
mmWidth = width * 25.4 / DEFAULT_DPI;
|
|
|
|
mmHeight = height * 25.4 / DEFAULT_DPI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
|
|
|
"Setting screen physical size to %d x %d\n",
|
|
|
|
mmWidth, mmHeight);
|
|
|
|
/*
|
|
|
|
* This is the initial setting of the screen size.
|
|
|
|
* We have to pre-set it here, otherwise panning would be adapted
|
|
|
|
* to the new screen size.
|
|
|
|
*/
|
|
|
|
pScreen->width = width;
|
|
|
|
pScreen->height = height;
|
|
|
|
xf86RandR12ScreenSetSize(pScreen, width, height, mmWidth, mmHeight);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randrp->virtualX == -1 || randrp->virtualY == -1) {
|
|
|
|
randrp->virtualX = pScrn->virtualX;
|
|
|
|
randrp->virtualY = pScrn->virtualY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcSetScreenSubpixelOrder(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
#if RANDR_12_INTERFACE
|
2012-03-21 20:55:09 +01:00
|
|
|
if (xf86RandR12CreateScreenResources12(pScreen))
|
|
|
|
return TRUE;
|
2007-02-16 05:36:20 +01:00
|
|
|
#endif
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12Init(ScreenPtr pScreen)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
rrScrPrivPtr rp;
|
|
|
|
XF86RandRInfoPtr randrp;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
/* XXX disable RandR when using Xinerama */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!noPanoramiXExtension) {
|
xfree86: belately init RandR12 if xinerama fails. (#24627)
On Fri, Dec 11, 2009 at 10:19:01AM -0800, Keith Packard wrote:
> On Wed, 9 Dec 2009 11:55:14 +1000, Peter Hutterer <peter.hutterer@who-t.net> wrote:
> > On Tue, Dec 08, 2009 at 05:24:06PM -0800, Aaron Plattner wrote:
> > > On Tue, Dec 08, 2009 at 03:52:27PM -0800, Peter Hutterer wrote:
> > > > Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
> > > > and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
> > > > only one screen is found, Xinerama is disabled again and RandR12 tries to
> > > > access data it never initialized.
>
> I'd sure like to have RandR get enabled when xinerama doesn't; is there
> an easy way of making that happen here? Perhaps having the RandR12 code
> disable Xinerama when only one screen is found? Or some other kludge?
you know the dependency better than I do so any hints are apreciated.
afaict, the screenInfo.numScreens (the check used by Xinerama) isn't
necessarily initialized at this point so we can't use the same check.
The following seems to work though:
From 670b3ebdb7312a6433a8f093d0820785db2aea20 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 14 Dec 2009 11:00:58 +1000
Subject: [PATCH] xfree86: if only one screen was found, disable Xinerama (#24627)
Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
only one screen is found, Xinerama is disabled again and RandR12 tries to
access data it never initialized.
Dependency chain is:
- ProcessCommandLine sets noPanoramiXExtension to FALSE
- xf86RandR12Init() is a noop
- PanoramiXExtensionInit sets noPanoramiXExtension to TRUE
- xf86RandR12CreateScreenResources tries to use the devPrivates key it never
initialized.
This hack checks if there's only one screen at the time RandR12 is
initialized. If so, we expect Xinerama to fail anyhow so we disable it
ourselves and proceed as planned.
X.Org Bug 24627 <http://bugs.freedesktop.org/show_bug.cgi?id=24627>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-14 02:05:20 +01:00
|
|
|
if (xf86NumScreens == 1)
|
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
#endif
|
2007-12-14 00:38:25 +01:00
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
if (xf86RandR12Generation != serverGeneration)
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12Generation = serverGeneration;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&xf86RandR12KeyRec, PRIVATE_SCREEN, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
randrp = malloc(sizeof(XF86RandRInfoRec));
|
2007-02-16 05:36:20 +01:00
|
|
|
if (!randrp)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!RRScreenInit(pScreen)) {
|
|
|
|
free(randrp);
|
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
rp = rrGetScrPriv(pScreen);
|
|
|
|
rp->rrGetInfo = xf86RandR12GetInfo;
|
|
|
|
rp->rrSetConfig = xf86RandR12SetConfig;
|
|
|
|
|
|
|
|
randrp->virtualX = -1;
|
|
|
|
randrp->virtualY = -1;
|
|
|
|
randrp->mmWidth = pScreen->mmWidth;
|
|
|
|
randrp->mmHeight = pScreen->mmHeight;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
randrp->rotation = RR_Rotate_0; /* initial rotated mode */
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
randrp->supported_rotations = RR_Rotate_0;
|
|
|
|
|
|
|
|
randrp->maxX = randrp->maxY = 0;
|
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
randrp->palette_size = 0;
|
|
|
|
randrp->palette = NULL;
|
|
|
|
|
2019-01-11 17:38:34 +01:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, &xf86RandR12KeyRec, randrp);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
#if RANDR_12_INTERFACE
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!xf86RandR12Init12(pScreen))
|
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
#endif
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2010-05-08 07:56:04 +02:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CloseScreen(ScreenPtr pScreen)
|
2010-05-08 07:56:04 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp;
|
2010-05-08 07:56:04 +02:00
|
|
|
|
2020-07-03 03:03:06 +02:00
|
|
|
if (!dixPrivateKeyRegistered(&xf86RandR12KeyRec))
|
|
|
|
return;
|
|
|
|
|
2010-05-08 07:56:04 +02:00
|
|
|
randrp = XF86RANDRINFO(pScreen);
|
|
|
|
#if RANDR_12_INTERFACE
|
2012-04-10 16:47:33 +02:00
|
|
|
xf86ScreenToScrn(pScreen)->EnterVT = randrp->orig_EnterVT;
|
2012-07-30 20:32:12 +02:00
|
|
|
pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;
|
2010-05-08 07:56:04 +02:00
|
|
|
#endif
|
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
free(randrp->palette);
|
2010-05-08 07:56:04 +02:00
|
|
|
free(randrp);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp;
|
|
|
|
|
2007-02-16 11:17:11 +01:00
|
|
|
#if RANDR_12_INTERFACE
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
int c;
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
2007-11-29 09:40:53 +01:00
|
|
|
#endif
|
2007-11-29 09:57:24 +01:00
|
|
|
|
2020-07-03 03:03:06 +02:00
|
|
|
if (!dixPrivateKeyRegistered(&xf86RandR12KeyRec))
|
|
|
|
return;
|
|
|
|
|
2007-11-29 09:57:24 +01:00
|
|
|
randrp = XF86RANDRINFO(pScreen);
|
2007-11-29 09:40:53 +01:00
|
|
|
#if RANDR_12_INTERFACE
|
2007-02-16 05:36:20 +01:00
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcPtr crtc = config->crtc[c];
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
RRCrtcSetRotations(crtc->randr_crtc, rotations);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
#endif
|
2007-02-16 11:17:11 +01:00
|
|
|
randrp->supported_rotations = rotations;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms)
|
2008-03-18 23:35:44 +01:00
|
|
|
{
|
|
|
|
#if RANDR_13_INTERFACE
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
int c;
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
2008-03-18 23:35:44 +01:00
|
|
|
|
2020-07-03 03:03:06 +02:00
|
|
|
if (!dixPrivateKeyRegistered(&xf86RandR12KeyRec))
|
|
|
|
return;
|
|
|
|
|
2008-03-18 23:35:44 +01:00
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcPtr crtc = config->crtc[c];
|
2008-03-18 23:35:44 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
RRCrtcSetTransformSupport(crtc->randr_crtc, transforms);
|
2008-03-18 23:35:44 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2007-02-16 05:36:20 +01:00
|
|
|
xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
|
|
|
|
{
|
2012-04-11 10:46:39 +02:00
|
|
|
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
if (xf86RandR12Generation != serverGeneration ||
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RANDRINFO(pScreen)->virtualX == -1) {
|
|
|
|
*x = pScrn->virtualX;
|
|
|
|
*y = pScrn->virtualY;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
|
|
|
|
*x = randrp->virtualX;
|
|
|
|
*y = randrp->virtualY;
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if RANDR_12_INTERFACE
|
2007-02-21 08:04:26 +01:00
|
|
|
|
|
|
|
#define FLAG_BITS (RR_HSyncPositive | \
|
|
|
|
RR_HSyncNegative | \
|
|
|
|
RR_VSyncPositive | \
|
|
|
|
RR_VSyncNegative | \
|
|
|
|
RR_Interlace | \
|
|
|
|
RR_DoubleScan | \
|
|
|
|
RR_CSync | \
|
|
|
|
RR_CSyncPositive | \
|
|
|
|
RR_CSyncNegative | \
|
|
|
|
RR_HSkewPresent | \
|
|
|
|
RR_BCast | \
|
|
|
|
RR_PixelMultiplex | \
|
|
|
|
RR_DoubleClock | \
|
|
|
|
RR_ClockDivideBy2)
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandRModeMatches(RRModePtr randr_mode, DisplayModePtr mode)
|
2007-02-21 08:04:26 +01:00
|
|
|
{
|
|
|
|
#if 0
|
2012-03-21 20:55:09 +01:00
|
|
|
if (match_name) {
|
|
|
|
/* check for same name */
|
|
|
|
int len = strlen(mode->name);
|
|
|
|
|
|
|
|
if (randr_mode->mode.nameLength != len)
|
|
|
|
return FALSE;
|
|
|
|
if (memcmp(randr_mode->name, mode->name, len) != 0)
|
|
|
|
return FALSE;
|
2007-02-21 08:04:26 +01:00
|
|
|
}
|
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2007-02-21 08:04:26 +01:00
|
|
|
/* check for same timings */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (randr_mode->mode.dotClock / 1000 != mode->Clock)
|
|
|
|
return FALSE;
|
|
|
|
if (randr_mode->mode.width != mode->HDisplay)
|
|
|
|
return FALSE;
|
|
|
|
if (randr_mode->mode.hSyncStart != mode->HSyncStart)
|
|
|
|
return FALSE;
|
|
|
|
if (randr_mode->mode.hSyncEnd != mode->HSyncEnd)
|
|
|
|
return FALSE;
|
|
|
|
if (randr_mode->mode.hTotal != mode->HTotal)
|
|
|
|
return FALSE;
|
|
|
|
if (randr_mode->mode.hSkew != mode->HSkew)
|
|
|
|
return FALSE;
|
|
|
|
if (randr_mode->mode.height != mode->VDisplay)
|
|
|
|
return FALSE;
|
|
|
|
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;
|
|
|
|
|
2007-02-21 08:04:26 +01:00
|
|
|
/* check for same flags (using only the XF86 valid flag bits) */
|
|
|
|
if ((randr_mode->mode.modeFlags & FLAG_BITS) != (mode->Flags & FLAG_BITS))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
|
|
|
|
2007-02-21 08:04:26 +01:00
|
|
|
/* everything matches */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CrtcNotify(RRCrtcPtr randr_crtc)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = randr_crtc->pScreen;
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
RRModePtr randr_mode = NULL;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
Rotation rotation;
|
|
|
|
int numOutputs;
|
|
|
|
RROutputPtr *randr_outputs;
|
|
|
|
RROutputPtr randr_output;
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
xf86OutputPtr output;
|
|
|
|
int i, j;
|
|
|
|
DisplayModePtr mode = &crtc->mode;
|
|
|
|
Bool ret;
|
|
|
|
|
2015-03-22 01:12:06 +01:00
|
|
|
randr_outputs = xallocarray(config->num_output, sizeof(RROutputPtr));
|
2007-02-16 05:36:20 +01:00
|
|
|
if (!randr_outputs)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
x = crtc->x;
|
|
|
|
y = crtc->y;
|
|
|
|
rotation = crtc->rotation;
|
|
|
|
numOutputs = 0;
|
|
|
|
randr_mode = NULL;
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < config->num_output; i++) {
|
|
|
|
output = config->output[i];
|
|
|
|
if (output->crtc == crtc) {
|
|
|
|
randr_output = output->randr_output;
|
|
|
|
randr_outputs[numOutputs++] = randr_output;
|
|
|
|
/*
|
2014-10-31 00:45:12 +01:00
|
|
|
* We make copies of modes, so pointer equality
|
2012-03-21 20:55:09 +01:00
|
|
|
* isn't sufficient
|
|
|
|
*/
|
|
|
|
for (j = 0; j < randr_output->numModes + randr_output->numUserModes;
|
|
|
|
j++) {
|
|
|
|
RRModePtr m =
|
|
|
|
(j <
|
|
|
|
randr_output->numModes ? randr_output->
|
|
|
|
modes[j] : randr_output->userModes[j -
|
|
|
|
randr_output->
|
|
|
|
numModes]);
|
|
|
|
|
|
|
|
if (xf86RandRModeMatches(m, mode)) {
|
|
|
|
randr_mode = m;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
ret = RRCrtcNotify(randr_crtc, randr_mode, x, y,
|
|
|
|
rotation,
|
|
|
|
crtc->transformPresent ? &crtc->transform : NULL,
|
|
|
|
numOutputs, randr_outputs);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(randr_outputs);
|
2007-02-16 05:36:20 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2007-02-21 08:04:26 +01:00
|
|
|
/*
|
|
|
|
* Convert a RandR mode to a DisplayMode
|
|
|
|
*/
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandRModeConvert(ScrnInfoPtr scrn,
|
|
|
|
RRModePtr randr_mode, DisplayModePtr mode)
|
2007-02-21 08:04:26 +01:00
|
|
|
{
|
2007-11-26 15:38:20 +01:00
|
|
|
memset(mode, 0, sizeof(DisplayModeRec));
|
2007-02-21 08:04:26 +01:00
|
|
|
mode->status = MODE_OK;
|
|
|
|
|
|
|
|
mode->Clock = randr_mode->mode.dotClock / 1000;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2007-02-21 08:04:26 +01:00
|
|
|
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;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2007-02-21 08:04:26 +01:00
|
|
|
mode->VDisplay = randr_mode->mode.height;
|
|
|
|
mode->VSyncStart = randr_mode->mode.vSyncStart;
|
|
|
|
mode->VSyncEnd = randr_mode->mode.vSyncEnd;
|
|
|
|
mode->VTotal = randr_mode->mode.vTotal;
|
|
|
|
mode->VScan = 0;
|
|
|
|
|
|
|
|
mode->Flags = randr_mode->mode.modeFlags & FLAG_BITS;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86SetModeCrtc(mode, scrn->adjustFlags);
|
2007-02-21 08:04:26 +01:00
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CrtcSet(ScreenPtr pScreen,
|
|
|
|
RRCrtcPtr randr_crtc,
|
|
|
|
RRModePtr randr_mode,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
Rotation rotation,
|
|
|
|
int num_randr_outputs, RROutputPtr * randr_outputs)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
RRTransformPtr transform;
|
|
|
|
Bool changed = FALSE;
|
|
|
|
int o, ro;
|
|
|
|
xf86CrtcPtr *save_crtcs;
|
|
|
|
Bool save_enabled = crtc->enabled;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2008-03-17 16:33:01 +01:00
|
|
|
if (!crtc->scrn->vtSema)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2008-03-17 16:33:01 +01:00
|
|
|
|
2015-03-22 01:12:06 +01:00
|
|
|
save_crtcs = xallocarray(config->num_output, sizeof(xf86CrtcPtr));
|
2007-02-21 08:04:26 +01:00
|
|
|
if ((randr_mode != NULL) != crtc->enabled)
|
2012-03-21 20:55:09 +01:00
|
|
|
changed = TRUE;
|
|
|
|
else if (randr_mode && !xf86RandRModeMatches(randr_mode, &crtc->mode))
|
|
|
|
changed = TRUE;
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
if (rotation != crtc->rotation)
|
2012-03-21 20:55:09 +01:00
|
|
|
changed = TRUE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2016-06-17 05:06:47 +02:00
|
|
|
if (crtc->current_scanout != randr_crtc->scanout_pixmap ||
|
|
|
|
crtc->current_scanout_back != randr_crtc->scanout_pixmap_back)
|
2012-06-26 10:53:54 +02:00
|
|
|
changed = TRUE;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
transform = RRCrtcGetTransform(randr_crtc);
|
2008-03-19 20:15:39 +01:00
|
|
|
if ((transform != NULL) != crtc->transformPresent)
|
2012-03-21 20:55:09 +01:00
|
|
|
changed = TRUE;
|
|
|
|
else if (transform &&
|
2017-06-16 04:30:03 +02:00
|
|
|
!RRTransformEqual(transform, &crtc->transform))
|
2012-03-21 20:55:09 +01:00
|
|
|
changed = TRUE;
|
2008-03-14 05:31:12 +01:00
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
if (x != crtc->x || y != crtc->y)
|
2012-03-21 20:55:09 +01:00
|
|
|
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++)
|
|
|
|
if (output->randr_output == randr_outputs[ro]) {
|
|
|
|
new_crtc = crtc;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (new_crtc != output->crtc) {
|
|
|
|
changed = TRUE;
|
|
|
|
output->crtc = new_crtc;
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
for (ro = 0; ro < num_randr_outputs; ro++)
|
2007-07-14 21:36:15 +02:00
|
|
|
if (randr_outputs[ro]->pendingProperties)
|
2012-03-21 20:55:09 +01:00
|
|
|
changed = TRUE;
|
2007-07-14 21:36:15 +02:00
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
/* XXX need device-independent mode setting code through an API */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (changed) {
|
|
|
|
crtc->enabled = randr_mode != NULL;
|
|
|
|
|
|
|
|
if (randr_mode) {
|
|
|
|
DisplayModeRec mode;
|
|
|
|
|
|
|
|
xf86RandRModeConvert(pScrn, randr_mode, &mode);
|
|
|
|
if (!xf86CrtcSetModeTransform
|
|
|
|
(crtc, &mode, rotation, transform, x, y)) {
|
|
|
|
crtc->enabled = save_enabled;
|
|
|
|
for (o = 0; o < config->num_output; o++) {
|
|
|
|
xf86OutputPtr output = config->output[o];
|
|
|
|
|
|
|
|
output->crtc = save_crtcs[o];
|
|
|
|
}
|
|
|
|
free(save_crtcs);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height);
|
|
|
|
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
2012-07-30 20:32:12 +02:00
|
|
|
randrp->panning = PANNING_ENABLED (crtc);
|
2012-03-21 20:55:09 +01:00
|
|
|
/*
|
|
|
|
* Save the last successful setting for EnterVT
|
|
|
|
*/
|
2012-07-11 16:27:46 +02:00
|
|
|
xf86SaveModeContents(&crtc->desiredMode, &mode);
|
2012-03-21 20:55:09 +01:00
|
|
|
crtc->desiredRotation = rotation;
|
2012-06-26 10:53:54 +02:00
|
|
|
crtc->current_scanout = randr_crtc->scanout_pixmap;
|
2016-06-17 05:06:47 +02:00
|
|
|
crtc->current_scanout_back = randr_crtc->scanout_pixmap_back;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (transform) {
|
|
|
|
crtc->desiredTransform = *transform;
|
|
|
|
crtc->desiredTransformPresent = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
crtc->desiredTransformPresent = FALSE;
|
|
|
|
|
|
|
|
crtc->desiredX = x;
|
|
|
|
crtc->desiredY = y;
|
|
|
|
}
|
|
|
|
xf86DisableUnusedFunctions(pScrn);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2010-05-05 20:44:06 +02:00
|
|
|
free(save_crtcs);
|
2012-03-21 20:55:09 +01:00
|
|
|
return xf86RandR12CrtcNotify(randr_crtc);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
static void
|
2017-04-12 10:58:05 +02:00
|
|
|
xf86RandR12CrtcComputeGamma(xf86CrtcPtr crtc, LOCO *palette,
|
|
|
|
int palette_red_size, int palette_green_size,
|
|
|
|
int palette_blue_size, CARD16 *gamma_red,
|
|
|
|
CARD16 *gamma_green, CARD16 *gamma_blue,
|
|
|
|
int gamma_size)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2015-11-28 08:50:47 +01:00
|
|
|
int gamma_slots;
|
2017-04-12 10:58:05 +02:00
|
|
|
unsigned shift;
|
|
|
|
CARD32 value;
|
2015-11-28 08:50:47 +01:00
|
|
|
int i, j;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2017-04-12 10:58:05 +02:00
|
|
|
for (shift = 0; (gamma_size << shift) < (1 << 16); shift++);
|
|
|
|
|
2018-02-27 03:05:30 +01:00
|
|
|
if (crtc->gamma_size >= palette_red_size) {
|
|
|
|
/* Upsampling of smaller palette to larger hw lut size */
|
|
|
|
gamma_slots = crtc->gamma_size / palette_red_size;
|
|
|
|
for (i = 0; i < palette_red_size; i++) {
|
|
|
|
value = palette[i].red;
|
|
|
|
if (gamma_red)
|
|
|
|
value = gamma_red[value];
|
|
|
|
else
|
|
|
|
value <<= shift;
|
|
|
|
|
|
|
|
for (j = 0; j < gamma_slots; j++)
|
|
|
|
crtc->gamma_red[i * gamma_slots + j] = value;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Downsampling of larger palette to smaller hw lut size */
|
|
|
|
for (i = 0; i < crtc->gamma_size; i++) {
|
|
|
|
value = palette[i * (palette_red_size - 1) / (crtc->gamma_size - 1)].red;
|
|
|
|
if (gamma_red)
|
|
|
|
value = gamma_red[value];
|
|
|
|
else
|
|
|
|
value <<= shift;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2018-02-27 03:05:30 +01:00
|
|
|
crtc->gamma_red[i] = value;
|
|
|
|
}
|
2015-11-28 08:50:47 +01:00
|
|
|
}
|
2007-06-22 03:08:21 +02:00
|
|
|
|
2018-02-27 03:05:30 +01:00
|
|
|
if (crtc->gamma_size >= palette_green_size) {
|
|
|
|
/* Upsampling of smaller palette to larger hw lut size */
|
|
|
|
gamma_slots = crtc->gamma_size / palette_green_size;
|
|
|
|
for (i = 0; i < palette_green_size; i++) {
|
|
|
|
value = palette[i].green;
|
|
|
|
if (gamma_green)
|
|
|
|
value = gamma_green[value];
|
|
|
|
else
|
|
|
|
value <<= shift;
|
|
|
|
|
|
|
|
for (j = 0; j < gamma_slots; j++)
|
|
|
|
crtc->gamma_green[i * gamma_slots + j] = value;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Downsampling of larger palette to smaller hw lut size */
|
|
|
|
for (i = 0; i < crtc->gamma_size; i++) {
|
|
|
|
value = palette[i * (palette_green_size - 1) / (crtc->gamma_size - 1)].green;
|
|
|
|
if (gamma_green)
|
|
|
|
value = gamma_green[value];
|
|
|
|
else
|
|
|
|
value <<= shift;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2018-02-27 03:05:30 +01:00
|
|
|
crtc->gamma_green[i] = value;
|
|
|
|
}
|
2008-12-17 16:56:26 +01:00
|
|
|
}
|
|
|
|
|
2018-02-27 03:05:30 +01:00
|
|
|
if (crtc->gamma_size >= palette_blue_size) {
|
|
|
|
/* Upsampling of smaller palette to larger hw lut size */
|
|
|
|
gamma_slots = crtc->gamma_size / palette_blue_size;
|
|
|
|
for (i = 0; i < palette_blue_size; i++) {
|
|
|
|
value = palette[i].blue;
|
|
|
|
if (gamma_blue)
|
|
|
|
value = gamma_blue[value];
|
|
|
|
else
|
|
|
|
value <<= shift;
|
2015-11-28 08:50:47 +01:00
|
|
|
|
2018-02-27 03:05:30 +01:00
|
|
|
for (j = 0; j < gamma_slots; j++)
|
|
|
|
crtc->gamma_blue[i * gamma_slots + j] = value;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Downsampling of larger palette to smaller hw lut size */
|
|
|
|
for (i = 0; i < crtc->gamma_size; i++) {
|
|
|
|
value = palette[i * (palette_blue_size - 1) / (crtc->gamma_size - 1)].blue;
|
|
|
|
if (gamma_blue)
|
|
|
|
value = gamma_blue[value];
|
|
|
|
else
|
|
|
|
value <<= shift;
|
|
|
|
|
|
|
|
crtc->gamma_blue[i] = value;
|
|
|
|
}
|
2015-11-28 08:50:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-04-12 10:58:05 +02:00
|
|
|
xf86RandR12CrtcReloadGamma(xf86CrtcPtr crtc)
|
2015-11-28 08:50:47 +01:00
|
|
|
{
|
|
|
|
if (!crtc->scrn->vtSema || !crtc->funcs->gamma_set)
|
|
|
|
return;
|
2008-12-17 16:56:26 +01:00
|
|
|
|
2008-12-17 23:42:30 +01:00
|
|
|
/* Only set it when the crtc is actually running.
|
|
|
|
* Otherwise it will be set when it's activated.
|
|
|
|
*/
|
|
|
|
if (crtc->active)
|
2012-03-21 20:55:09 +01:00
|
|
|
crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
|
|
|
|
crtc->gamma_blue, crtc->gamma_size);
|
2015-11-28 08:50:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc)
|
|
|
|
{
|
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
|
|
|
|
if (crtc->funcs->gamma_set == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (randrp->palette_size) {
|
2017-04-12 10:58:05 +02:00
|
|
|
xf86RandR12CrtcComputeGamma(crtc, randrp->palette,
|
|
|
|
randrp->palette_red_size,
|
|
|
|
randrp->palette_green_size,
|
|
|
|
randrp->palette_blue_size,
|
|
|
|
randr_crtc->gammaRed,
|
|
|
|
randr_crtc->gammaGreen,
|
|
|
|
randr_crtc->gammaBlue,
|
|
|
|
randr_crtc->gammaSize);
|
2016-07-29 10:38:21 +02:00
|
|
|
} else {
|
|
|
|
memcpy(crtc->gamma_red, randr_crtc->gammaRed,
|
|
|
|
crtc->gamma_size * sizeof(crtc->gamma_red[0]));
|
|
|
|
memcpy(crtc->gamma_green, randr_crtc->gammaGreen,
|
|
|
|
crtc->gamma_size * sizeof(crtc->gamma_green[0]));
|
|
|
|
memcpy(crtc->gamma_blue, randr_crtc->gammaBlue,
|
|
|
|
crtc->gamma_size * sizeof(crtc->gamma_blue[0]));
|
2015-11-28 08:50:47 +01:00
|
|
|
}
|
2008-12-17 16:56:26 +01:00
|
|
|
|
2017-04-12 10:58:05 +02:00
|
|
|
xf86RandR12CrtcReloadGamma(crtc);
|
2016-07-29 10:38:21 +02:00
|
|
|
|
2008-12-17 16:56:26 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-06-21 08:41:45 +02:00
|
|
|
static void
|
2016-09-17 11:42:09 +02:00
|
|
|
init_one_component(CARD16 *comp, unsigned size, float gamma)
|
2016-06-21 08:41:45 +02:00
|
|
|
{
|
|
|
|
int i;
|
2016-09-17 11:42:09 +02:00
|
|
|
unsigned shift;
|
|
|
|
|
|
|
|
for (shift = 0; (size << shift) < (1 << 16); shift++);
|
2016-06-21 08:41:45 +02:00
|
|
|
|
|
|
|
if (gamma == 1.0) {
|
|
|
|
for (i = 0; i < size; i++)
|
|
|
|
comp[i] = i << shift;
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < size; i++)
|
|
|
|
comp[i] = (CARD16) (pow((double) i / (double) (size - 1),
|
|
|
|
1. / (double) gamma) *
|
|
|
|
(double) (size - 1) * (1 << shift));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
xf86RandR12CrtcInitGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green,
|
|
|
|
float gamma_blue)
|
|
|
|
{
|
2016-09-17 11:42:09 +02:00
|
|
|
unsigned size = crtc->randr_crtc->gammaSize;
|
2016-06-21 08:41:45 +02:00
|
|
|
CARD16 *red, *green, *blue;
|
|
|
|
|
|
|
|
if (!crtc->funcs->gamma_set &&
|
|
|
|
(gamma_red != 1.0f || gamma_green != 1.0f || gamma_blue != 1.0f))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
red = xallocarray(size, 3 * sizeof(CARD16));
|
|
|
|
if (!red)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
green = red + size;
|
|
|
|
blue = green + size;
|
|
|
|
|
2016-09-17 11:42:09 +02:00
|
|
|
init_one_component(red, size, gamma_red);
|
|
|
|
init_one_component(green, size, gamma_green);
|
|
|
|
init_one_component(blue, size, gamma_blue);
|
2016-06-21 08:41:45 +02:00
|
|
|
|
|
|
|
RRCrtcGammaSet(crtc->randr_crtc, red, green, blue);
|
|
|
|
free(red);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
xf86RandR12OutputInitGamma(xf86OutputPtr output)
|
|
|
|
{
|
|
|
|
XF86ConfMonitorPtr mon = output->conf_monitor;
|
|
|
|
float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0;
|
|
|
|
|
|
|
|
if (!mon)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* Get configured values, where they exist. */
|
|
|
|
if (mon->mon_gamma_red >= GAMMA_MIN && mon->mon_gamma_red <= GAMMA_MAX)
|
|
|
|
gamma_red = mon->mon_gamma_red;
|
|
|
|
|
|
|
|
if (mon->mon_gamma_green >= GAMMA_MIN && mon->mon_gamma_green <= GAMMA_MAX)
|
|
|
|
gamma_green = mon->mon_gamma_green;
|
|
|
|
|
|
|
|
if (mon->mon_gamma_blue >= GAMMA_MIN && mon->mon_gamma_blue <= GAMMA_MAX)
|
|
|
|
gamma_blue = mon->mon_gamma_blue;
|
|
|
|
|
|
|
|
/* Don't set gamma 1.0 if another cloned output on this CRTC already set a
|
|
|
|
* different gamma
|
|
|
|
*/
|
|
|
|
if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) {
|
2017-04-12 10:58:05 +02:00
|
|
|
if (!output->crtc->randr_crtc) {
|
|
|
|
xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
|
|
|
|
"Gamma correction for output %s not possible because "
|
|
|
|
"RandR is disabled\n", output->name);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-06-21 08:41:45 +02:00
|
|
|
xf86DrvMsg(output->scrn->scrnIndex, X_INFO,
|
|
|
|
"Output %s wants gamma correction (%.1f, %.1f, %.1f)\n",
|
|
|
|
output->name, gamma_red, gamma_green, gamma_blue);
|
|
|
|
return xf86RandR12CrtcInitGamma(output->crtc, gamma_red, gamma_green,
|
|
|
|
gamma_blue);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
Bool
|
2016-06-21 08:41:45 +02:00
|
|
|
xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize) {
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
int o, c;
|
|
|
|
|
|
|
|
/* Set default gamma for all CRTCs
|
|
|
|
* This is done to avoid problems later on with cloned outputs
|
|
|
|
*/
|
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
|
|
|
xf86CrtcPtr crtc = config->crtc[c];
|
|
|
|
|
2017-04-12 10:58:05 +02:00
|
|
|
if (!crtc->randr_crtc)
|
|
|
|
continue;
|
|
|
|
|
2016-06-21 08:41:45 +02:00
|
|
|
if (!RRCrtcGammaSetSize(crtc->randr_crtc, gammaSize) ||
|
|
|
|
!xf86RandR12CrtcInitGamma(crtc, 1.0f, 1.0f, 1.0f))
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set initial gamma per monitor configuration
|
|
|
|
*/
|
|
|
|
for (o = 0; o < config->num_output; o++) {
|
|
|
|
xf86OutputPtr output = config->output[o];
|
|
|
|
|
|
|
|
if (output->crtc &&
|
|
|
|
!xf86RandR12OutputInitGamma(output))
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
|
|
|
"Initial gamma correction for output %s: failed.\n",
|
|
|
|
output->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12OutputSetProperty(ScreenPtr pScreen,
|
|
|
|
RROutputPtr randr_output,
|
|
|
|
Atom property, RRPropertyValuePtr value)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
|
|
|
xf86OutputPtr output = randr_output->devPrivate;
|
|
|
|
|
|
|
|
/* If we don't have any property handler, then we don't care what the
|
|
|
|
* user is setting properties to.
|
|
|
|
*/
|
|
|
|
if (output->funcs->set_property == NULL)
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2007-06-22 03:08:21 +02:00
|
|
|
/*
|
|
|
|
* This function gets called even when vtSema is FALSE, as
|
|
|
|
* drivers will need to remember the correct value to apply
|
|
|
|
* when the VT switch occurs
|
|
|
|
*/
|
2007-02-16 05:36:20 +01:00
|
|
|
return output->funcs->set_property(output, property, value);
|
|
|
|
}
|
|
|
|
|
2008-03-06 22:47:44 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR13OutputGetProperty(ScreenPtr pScreen,
|
|
|
|
RROutputPtr randr_output, Atom property)
|
2008-03-06 22:47:44 +01:00
|
|
|
{
|
|
|
|
xf86OutputPtr output = randr_output->devPrivate;
|
|
|
|
|
|
|
|
if (output->funcs->get_property == NULL)
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
2008-03-06 22:47:44 +01:00
|
|
|
|
|
|
|
/* Should be safe even w/o vtSema */
|
|
|
|
return output->funcs->get_property(output, property);
|
|
|
|
}
|
|
|
|
|
2007-02-19 08:49:38 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12OutputValidateMode(ScreenPtr pScreen,
|
|
|
|
RROutputPtr randr_output, RRModePtr randr_mode)
|
2007-02-19 08:49:38 +01:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86OutputPtr output = randr_output->devPrivate;
|
|
|
|
DisplayModeRec mode;
|
2007-02-19 08:49:38 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandRModeConvert(pScrn, randr_mode, &mode);
|
2007-06-22 03:08:21 +02:00
|
|
|
/*
|
|
|
|
* This function may be called when vtSema is FALSE, so
|
|
|
|
* the underlying function must either avoid touching the hardware
|
|
|
|
* or return FALSE when vtSema is FALSE
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
if (output->funcs->mode_valid(output, &mode) != MODE_OK)
|
|
|
|
return FALSE;
|
2007-02-19 08:49:38 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12ModeDestroy(ScreenPtr pScreen, RRModePtr randr_mode)
|
2007-02-19 08:49:38 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
/**
|
|
|
|
* Given a list of xf86 modes and a RandR Output object, construct
|
|
|
|
* RandR modes and assign them to the output
|
|
|
|
*/
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RROutputSetModes(RROutputPtr randr_output, DisplayModePtr modes)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
DisplayModePtr mode;
|
|
|
|
RRModePtr *rrmodes = NULL;
|
|
|
|
int nmode = 0;
|
|
|
|
int npreferred = 0;
|
|
|
|
Bool ret = TRUE;
|
|
|
|
int pref;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
for (mode = modes; mode; mode = mode->next)
|
2012-03-21 20:55:09 +01:00
|
|
|
nmode++;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
if (nmode) {
|
2015-03-22 01:12:06 +01:00
|
|
|
rrmodes = xallocarray(nmode, sizeof(RRModePtr));
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
if (!rrmodes)
|
|
|
|
return FALSE;
|
|
|
|
nmode = 0;
|
|
|
|
|
|
|
|
for (pref = 1; pref >= 0; pref--) {
|
|
|
|
for (mode = modes; mode; mode = mode->next) {
|
|
|
|
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;
|
|
|
|
modeInfo.hSyncStart = mode->HSyncStart;
|
|
|
|
modeInfo.hSyncEnd = mode->HSyncEnd;
|
|
|
|
modeInfo.hTotal = mode->HTotal;
|
|
|
|
modeInfo.hSkew = mode->HSkew;
|
|
|
|
|
|
|
|
modeInfo.height = mode->VDisplay;
|
|
|
|
modeInfo.vSyncStart = mode->VSyncStart;
|
|
|
|
modeInfo.vSyncEnd = mode->VSyncEnd;
|
|
|
|
modeInfo.vTotal = mode->VTotal;
|
|
|
|
modeInfo.modeFlags = mode->Flags;
|
|
|
|
|
|
|
|
rrmode = RRModeGet(&modeInfo, mode->name);
|
|
|
|
if (rrmode) {
|
|
|
|
rrmodes[nmode++] = rrmode;
|
|
|
|
npreferred += pref;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
ret = RROutputSetModes(randr_output, rrmodes, nmode, npreferred);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(rrmodes);
|
2007-02-16 05:36:20 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mirror the current mode configuration to RandR
|
|
|
|
*/
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12SetInfo12(ScreenPtr pScreen)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
RROutputPtr *clones;
|
|
|
|
RRCrtcPtr *crtcs;
|
|
|
|
int ncrtc;
|
|
|
|
int o, c, l;
|
|
|
|
int nclone;
|
|
|
|
|
2015-03-22 01:12:06 +01:00
|
|
|
clones = xallocarray(config->num_output, sizeof(RROutputPtr));
|
|
|
|
crtcs = xallocarray(config->num_crtc, sizeof(RRCrtcPtr));
|
2012-03-21 20:55:09 +01:00
|
|
|
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))
|
|
|
|
crtcs[ncrtc++] = config->crtc[c]->randr_crtc;
|
|
|
|
|
|
|
|
if (!RROutputSetCrtcs(output->randr_output, crtcs, ncrtc)) {
|
|
|
|
free(crtcs);
|
|
|
|
free(clones);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
RROutputSetPhysicalSize(output->randr_output,
|
|
|
|
output->mm_width, output->mm_height);
|
|
|
|
xf86RROutputSetModes(output->randr_output, output->probed_modes);
|
|
|
|
|
|
|
|
switch (output->status) {
|
|
|
|
case XF86OutputStatusConnected:
|
|
|
|
RROutputSetConnection(output->randr_output, RR_Connected);
|
|
|
|
break;
|
|
|
|
case XF86OutputStatusDisconnected:
|
2019-03-28 23:44:07 +01:00
|
|
|
if (xf86OutputForceEnabled(output))
|
|
|
|
RROutputSetConnection(output->randr_output, RR_Connected);
|
|
|
|
else
|
|
|
|
RROutputSetConnection(output->randr_output, RR_Disconnected);
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
|
|
|
case XF86OutputStatusUnknown:
|
|
|
|
RROutputSetConnection(output->randr_output, RR_UnknownConnection);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
RROutputSetSubpixelOrder(output->randr_output, output->subpixel_order);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Valid clones
|
|
|
|
*/
|
|
|
|
nclone = 0;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
if (!RROutputSetClones(output->randr_output, clones, nclone)) {
|
|
|
|
free(crtcs);
|
|
|
|
free(clones);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2010-05-05 20:44:06 +02:00
|
|
|
free(crtcs);
|
|
|
|
free(clones);
|
2007-02-16 05:36:20 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Query the hardware for the current state, then mirror
|
|
|
|
* that to RandR
|
|
|
|
*/
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12GetInfo12(ScreenPtr pScreen, Rotation * rotations)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2007-06-22 03:08:21 +02:00
|
|
|
if (!pScrn->vtSema)
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
|
|
|
xf86ProbeOutputModes(pScrn, 0, 0);
|
|
|
|
xf86SetScrnInfoModes(pScrn);
|
|
|
|
return xf86RandR12SetInfo12(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CreateObjects12(ScreenPtr pScreen)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
int c;
|
|
|
|
int o;
|
|
|
|
|
|
|
|
if (!RRInit())
|
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Configure crtcs
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
|
|
|
xf86CrtcPtr crtc = config->crtc[c];
|
|
|
|
|
|
|
|
crtc->randr_crtc = RRCrtcCreate(pScreen, crtc);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Configure outputs
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
for (o = 0; o < config->num_output; o++) {
|
|
|
|
xf86OutputPtr output = config->output[o];
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
output->randr_output = RROutputCreate(pScreen, output->name,
|
|
|
|
strlen(output->name), output);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (output->funcs->create_resources != NULL)
|
|
|
|
output->funcs->create_resources(output);
|
|
|
|
RRPostPendingProperties(output->randr_output);
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
2012-06-13 15:17:06 +02:00
|
|
|
|
|
|
|
if (config->name) {
|
|
|
|
config->randr_provider = RRProviderCreate(pScreen, config->name,
|
|
|
|
strlen(config->name));
|
|
|
|
|
|
|
|
RRProviderSetCapabilities(config->randr_provider, pScrn->capabilities);
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2015-04-01 04:13:51 +02:00
|
|
|
static void
|
|
|
|
xf86RandR12CreateMonitors(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
int o, ot;
|
|
|
|
int ht, vt;
|
|
|
|
int ret;
|
|
|
|
char buf[25];
|
|
|
|
|
|
|
|
for (o = 0; o < config->num_output; o++) {
|
|
|
|
xf86OutputPtr output = config->output[o];
|
|
|
|
struct xf86CrtcTileInfo *tile_info = &output->tile_info, *this_tile;
|
|
|
|
RRMonitorPtr monitor;
|
|
|
|
int output_num, num_outputs;
|
|
|
|
if (!tile_info->group_id)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (tile_info->tile_h_loc ||
|
|
|
|
tile_info->tile_v_loc)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
num_outputs = tile_info->num_h_tile * tile_info->num_v_tile;
|
|
|
|
|
|
|
|
monitor = RRMonitorAlloc(num_outputs);
|
|
|
|
if (!monitor)
|
|
|
|
return;
|
|
|
|
monitor->pScreen = pScreen;
|
|
|
|
snprintf(buf, 25, "Auto-Monitor-%d", tile_info->group_id);
|
|
|
|
monitor->name = MakeAtom(buf, strlen(buf), TRUE);
|
|
|
|
monitor->primary = 0;
|
|
|
|
monitor->automatic = TRUE;
|
|
|
|
memset(&monitor->geometry.box, 0, sizeof(monitor->geometry.box));
|
|
|
|
|
|
|
|
output_num = 0;
|
|
|
|
for (ht = 0; ht < tile_info->num_h_tile; ht++) {
|
|
|
|
for (vt = 0; vt < tile_info->num_v_tile; vt++) {
|
|
|
|
|
|
|
|
for (ot = 0; ot < config->num_output; ot++) {
|
|
|
|
this_tile = &config->output[ot]->tile_info;
|
|
|
|
|
|
|
|
if (this_tile->group_id != tile_info->group_id)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (this_tile->tile_h_loc != ht ||
|
|
|
|
this_tile->tile_v_loc != vt)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
monitor->outputs[output_num] = config->output[ot]->randr_output->id;
|
|
|
|
output_num++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = RRMonitorAdd(serverClient, pScreen, monitor);
|
|
|
|
if (ret) {
|
|
|
|
RRMonitorFree(monitor);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int c;
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2016-01-14 10:09:44 +01:00
|
|
|
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
for (c = 0; c < config->num_crtc; c++)
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CrtcNotify(config->crtc[c]->randr_crtc);
|
|
|
|
|
|
|
|
RRScreenSetSizeRange(pScreen, config->minWidth, config->minHeight,
|
|
|
|
config->maxWidth, config->maxHeight);
|
2015-04-01 04:13:51 +02:00
|
|
|
|
|
|
|
xf86RandR12CreateMonitors(pScreen);
|
2016-01-14 10:09:44 +01:00
|
|
|
|
|
|
|
if (!pScreen->isGPU) {
|
|
|
|
rp->primaryOutput = config->output[0]->randr_output;
|
|
|
|
RROutputChanged(rp->primaryOutput, FALSE);
|
|
|
|
rp->layoutChanged = TRUE;
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-04-09 23:12:27 +02:00
|
|
|
/*
|
|
|
|
* Something happened within the screen configuration due
|
|
|
|
* to DGA, VidMode or hot key. Tell RandR
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12TellChanged(ScreenPtr pScreen)
|
2007-04-09 23:12:27 +02:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
int c;
|
2007-04-09 23:12:27 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12SetInfo12(pScreen);
|
2007-04-09 23:12:27 +02:00
|
|
|
for (c = 0; c < config->num_crtc; c++)
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12CrtcNotify(config->crtc[c]->randr_crtc);
|
2007-04-09 23:12:27 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
RRTellChanged(pScreen);
|
2007-04-09 23:12:27 +02:00
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static void
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
xf86RandR12PointerMoved(ScrnInfoPtr pScrn, int x, int y)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
2008-11-28 17:49:31 +01:00
|
|
|
int c;
|
|
|
|
|
|
|
|
randrp->pointerX = x;
|
|
|
|
randrp->pointerY = y;
|
|
|
|
for (c = 0; c < config->num_crtc; c++)
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR13Pan(config->crtc[c], x, y);
|
2008-11-28 17:49:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR13GetPanning(ScreenPtr pScreen,
|
|
|
|
RRCrtcPtr randr_crtc,
|
|
|
|
BoxPtr totalArea, BoxPtr trackingArea, INT16 *border)
|
2008-11-28 17:49:31 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
2008-11-28 17:49:31 +01:00
|
|
|
|
|
|
|
if (crtc->version < 2)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2008-11-28 17:49:31 +01:00
|
|
|
if (totalArea)
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(totalArea, &crtc->panningTotalArea, sizeof(BoxRec));
|
2008-11-28 17:49:31 +01:00
|
|
|
if (trackingArea)
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(trackingArea, &crtc->panningTrackingArea, sizeof(BoxRec));
|
2008-11-28 17:49:31 +01:00
|
|
|
if (border)
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(border, crtc->panningBorder, 4 * sizeof(INT16));
|
2008-11-28 17:49:31 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR13SetPanning(ScreenPtr pScreen,
|
|
|
|
RRCrtcPtr randr_crtc,
|
|
|
|
BoxPtr totalArea, BoxPtr trackingArea, INT16 *border)
|
2008-11-28 17:49:31 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
BoxRec oldTotalArea;
|
|
|
|
BoxRec oldTrackingArea;
|
|
|
|
INT16 oldBorder[4];
|
2012-07-30 20:32:12 +02:00
|
|
|
Bool oldPanning = randrp->panning;
|
2008-11-28 17:49:31 +01:00
|
|
|
|
|
|
|
if (crtc->version < 2)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2008-12-04 16:28:40 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(&oldTotalArea, &crtc->panningTotalArea, sizeof(BoxRec));
|
|
|
|
memcpy(&oldTrackingArea, &crtc->panningTrackingArea, sizeof(BoxRec));
|
|
|
|
memcpy(oldBorder, crtc->panningBorder, 4 * sizeof(INT16));
|
2008-12-04 16:28:40 +01:00
|
|
|
|
2008-11-28 17:49:31 +01:00
|
|
|
if (totalArea)
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(&crtc->panningTotalArea, totalArea, sizeof(BoxRec));
|
2008-11-28 17:49:31 +01:00
|
|
|
if (trackingArea)
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(&crtc->panningTrackingArea, trackingArea, sizeof(BoxRec));
|
2008-11-28 17:49:31 +01:00
|
|
|
if (border)
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(crtc->panningBorder, border, 4 * sizeof(INT16));
|
|
|
|
|
|
|
|
if (xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height)) {
|
|
|
|
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
2012-07-30 20:32:12 +02:00
|
|
|
randrp->panning = PANNING_ENABLED (crtc);
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Restore old settings */
|
|
|
|
memcpy(&crtc->panningTotalArea, &oldTotalArea, sizeof(BoxRec));
|
|
|
|
memcpy(&crtc->panningTrackingArea, &oldTrackingArea, sizeof(BoxRec));
|
|
|
|
memcpy(crtc->panningBorder, oldBorder, 4 * sizeof(INT16));
|
2012-07-30 20:32:12 +02:00
|
|
|
randrp->panning = oldPanning;
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2008-12-04 16:28:40 +01:00
|
|
|
}
|
2007-02-16 05:36:20 +01:00
|
|
|
}
|
|
|
|
|
2009-04-17 23:46:58 +02:00
|
|
|
/*
|
2015-11-28 08:50:47 +01:00
|
|
|
* Compatibility with colormaps and XF86VidMode's gamma
|
2009-04-17 23:46:58 +02:00
|
|
|
*/
|
2015-11-28 08:50:47 +01:00
|
|
|
void
|
|
|
|
xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
|
|
|
|
LOCO *colors, VisualPtr pVisual)
|
2009-04-17 23:46:58 +02:00
|
|
|
{
|
2015-11-28 08:50:47 +01:00
|
|
|
ScreenPtr pScreen = pScrn->pScreen;
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
int reds, greens, blues, index, palette_size;
|
|
|
|
int c, i;
|
2009-04-17 23:46:58 +02:00
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
if (pVisual->class == TrueColor || pVisual->class == DirectColor) {
|
|
|
|
reds = (pVisual->redMask >> pVisual->offsetRed) + 1;
|
|
|
|
greens = (pVisual->greenMask >> pVisual->offsetGreen) + 1;
|
|
|
|
blues = (pVisual->blueMask >> pVisual->offsetBlue) + 1;
|
|
|
|
} else {
|
|
|
|
reds = greens = blues = pVisual->ColormapEntries;
|
2009-04-17 23:46:58 +02:00
|
|
|
}
|
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
palette_size = max(reds, max(greens, blues));
|
2009-04-17 23:46:58 +02:00
|
|
|
|
2017-04-12 10:58:05 +02:00
|
|
|
if (dixPrivateKeyRegistered(rrPrivKey)) {
|
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
2009-04-17 23:46:58 +02:00
|
|
|
|
2017-04-12 10:58:05 +02:00
|
|
|
if (randrp->palette_size != palette_size) {
|
|
|
|
randrp->palette = reallocarray(randrp->palette, palette_size,
|
|
|
|
sizeof(colors[0]));
|
|
|
|
if (!randrp->palette) {
|
|
|
|
randrp->palette_size = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
randrp->palette_size = palette_size;
|
|
|
|
}
|
|
|
|
randrp->palette_red_size = reds;
|
|
|
|
randrp->palette_green_size = greens;
|
|
|
|
randrp->palette_blue_size = blues;
|
|
|
|
|
|
|
|
for (i = 0; i < numColors; i++) {
|
|
|
|
index = indices[i];
|
|
|
|
|
|
|
|
if (index < reds)
|
|
|
|
randrp->palette[index].red = colors[index].red;
|
|
|
|
if (index < greens)
|
|
|
|
randrp->palette[index].green = colors[index].green;
|
|
|
|
if (index < blues)
|
|
|
|
randrp->palette[index].blue = colors[index].blue;
|
|
|
|
}
|
2015-11-28 08:50:47 +01:00
|
|
|
}
|
2009-04-17 23:46:58 +02:00
|
|
|
|
2015-11-28 08:50:47 +01:00
|
|
|
for (c = 0; c < config->num_crtc; c++) {
|
2017-04-12 10:58:05 +02:00
|
|
|
xf86CrtcPtr crtc = config->crtc[c];
|
|
|
|
RRCrtcPtr randr_crtc = crtc->randr_crtc;
|
|
|
|
|
|
|
|
if (randr_crtc) {
|
|
|
|
xf86RandR12CrtcComputeGamma(crtc, colors, reds, greens, blues,
|
|
|
|
randr_crtc->gammaRed,
|
|
|
|
randr_crtc->gammaGreen,
|
|
|
|
randr_crtc->gammaBlue,
|
|
|
|
randr_crtc->gammaSize);
|
|
|
|
} else {
|
|
|
|
xf86RandR12CrtcComputeGamma(crtc, colors, reds, greens, blues,
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
xf86GetGammaRampSize(pScreen));
|
|
|
|
}
|
|
|
|
xf86RandR12CrtcReloadGamma(crtc);
|
2015-11-28 08:50:47 +01:00
|
|
|
}
|
2009-04-17 23:46:58 +02:00
|
|
|
}
|
|
|
|
|
2016-09-17 11:33:13 +02:00
|
|
|
/*
|
|
|
|
* Compatibility pScrn->ChangeGamma provider for ddx drivers which do not call
|
|
|
|
* xf86HandleColormaps(). Note such drivers really should be fixed to call
|
|
|
|
* xf86HandleColormaps() as this clobbers the per-CRTC gamma ramp of the CRTC
|
|
|
|
* assigned to the RandR compatibility output.
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma)
|
|
|
|
{
|
|
|
|
RRCrtcPtr randr_crtc = xf86CompatRRCrtc(pScrn);
|
|
|
|
int size;
|
|
|
|
|
2018-12-05 18:31:27 +01:00
|
|
|
if (!randr_crtc || pScrn->LoadPalette == xf86RandR12LoadPalette)
|
2016-09-17 11:33:13 +02:00
|
|
|
return Success;
|
|
|
|
|
|
|
|
size = max(0, randr_crtc->gammaSize);
|
|
|
|
if (!size)
|
|
|
|
return Success;
|
|
|
|
|
|
|
|
init_one_component(randr_crtc->gammaRed, size, gamma.red);
|
|
|
|
init_one_component(randr_crtc->gammaGreen, size, gamma.green);
|
|
|
|
init_one_component(randr_crtc->gammaBlue, size, gamma.blue);
|
|
|
|
xf86RandR12CrtcSetGamma(xf86ScrnToScreen(pScrn), randr_crtc);
|
|
|
|
|
|
|
|
pScrn->gamma = gamma;
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2009-05-05 02:24:47 +02:00
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
xf86RandR12EnterVT(ScrnInfoPtr pScrn)
|
2009-05-05 02:24:47 +02:00
|
|
|
{
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
|
2012-03-21 20:55:09 +01:00
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
|
|
|
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
|
|
|
|
Bool ret;
|
|
|
|
int i;
|
2009-05-05 02:24:47 +02:00
|
|
|
|
|
|
|
if (randrp->orig_EnterVT) {
|
2012-03-21 20:55:09 +01:00
|
|
|
pScrn->EnterVT = randrp->orig_EnterVT;
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
ret = pScrn->EnterVT(pScrn);
|
2012-03-21 20:55:09 +01:00
|
|
|
randrp->orig_EnterVT = pScrn->EnterVT;
|
|
|
|
pScrn->EnterVT = xf86RandR12EnterVT;
|
|
|
|
if (!ret)
|
|
|
|
return FALSE;
|
2009-05-05 02:24:47 +02:00
|
|
|
}
|
|
|
|
|
2010-11-15 02:25:12 +01:00
|
|
|
/* reload gamma */
|
|
|
|
for (i = 0; i < rp->numCrtcs; i++)
|
2017-04-12 10:58:05 +02:00
|
|
|
xf86RandR12CrtcReloadGamma(rp->crtcs[i]->devPrivate);
|
2010-11-15 02:25:12 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return RRGetInfo(pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */
|
2009-05-05 02:24:47 +02:00
|
|
|
}
|
|
|
|
|
2013-04-30 23:14:23 +02:00
|
|
|
static void
|
|
|
|
xf86DetachOutputGPU(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* make sure there are no attached shared scanout pixmaps first */
|
|
|
|
for (i = 0; i < rp->numCrtcs; i++)
|
|
|
|
RRCrtcDetachScanoutPixmap(rp->crtcs[i]);
|
|
|
|
|
|
|
|
DetachOutputGPU(pScreen);
|
|
|
|
}
|
|
|
|
|
2012-07-05 16:50:24 +02:00
|
|
|
static Bool
|
|
|
|
xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
|
|
|
|
RRProviderPtr provider,
|
|
|
|
RRProviderPtr source_provider)
|
|
|
|
{
|
|
|
|
if (!source_provider) {
|
|
|
|
if (provider->output_source) {
|
2013-04-30 23:14:23 +02:00
|
|
|
xf86DetachOutputGPU(pScreen);
|
2012-07-05 16:50:24 +02:00
|
|
|
}
|
|
|
|
provider->output_source = NULL;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (provider->output_source == source_provider)
|
|
|
|
return TRUE;
|
|
|
|
|
dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.
Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.
Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.
This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-12 17:36:59 +01:00
|
|
|
SetRootClip(source_provider->pScreen, ROOT_CLIP_NONE);
|
2012-07-05 16:50:24 +02:00
|
|
|
|
|
|
|
AttachOutputGPU(source_provider->pScreen, pScreen);
|
|
|
|
|
|
|
|
provider->output_source = source_provider;
|
dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.
Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.
Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.
This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-12 17:36:59 +01:00
|
|
|
SetRootClip(source_provider->pScreen, ROOT_CLIP_FULL);
|
2012-07-05 16:50:24 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-07-05 16:50:56 +02:00
|
|
|
static Bool
|
|
|
|
xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen,
|
|
|
|
RRProviderPtr provider,
|
|
|
|
RRProviderPtr sink_provider)
|
|
|
|
{
|
|
|
|
if (!sink_provider) {
|
|
|
|
if (provider->offload_sink) {
|
2013-04-30 23:14:23 +02:00
|
|
|
xf86DetachOutputGPU(pScreen);
|
2012-07-05 16:50:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
provider->offload_sink = NULL;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (provider->offload_sink == sink_provider)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
AttachOffloadGPU(sink_provider->pScreen, pScreen);
|
|
|
|
|
|
|
|
provider->offload_sink = sink_provider;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-06-13 15:17:06 +02:00
|
|
|
static Bool
|
|
|
|
xf86RandR14ProviderSetProperty(ScreenPtr pScreen,
|
|
|
|
RRProviderPtr randr_provider,
|
|
|
|
Atom property, RRPropertyValuePtr value)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
|
|
|
|
/* If we don't have any property handler, then we don't care what the
|
|
|
|
* user is setting properties to.
|
|
|
|
*/
|
|
|
|
if (config->provider_funcs->set_property == NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This function gets called even when vtSema is FALSE, as
|
|
|
|
* drivers will need to remember the correct value to apply
|
|
|
|
* when the VT switch occurs
|
|
|
|
*/
|
|
|
|
return config->provider_funcs->set_property(pScrn, property, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
xf86RandR14ProviderGetProperty(ScreenPtr pScreen,
|
|
|
|
RRProviderPtr randr_provider, Atom property)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
|
|
|
|
if (config->provider_funcs->get_property == NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* Should be safe even w/o vtSema */
|
|
|
|
return config->provider_funcs->get_property(pScrn, property);
|
|
|
|
}
|
|
|
|
|
2012-06-20 13:37:26 +02:00
|
|
|
static Bool
|
|
|
|
xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap)
|
|
|
|
{
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
if (!crtc->funcs->set_scanout_pixmap)
|
|
|
|
return FALSE;
|
|
|
|
return crtc->funcs->set_scanout_pixmap(crtc, pixmap);
|
|
|
|
}
|
|
|
|
|
2012-07-30 20:32:12 +02:00
|
|
|
static void
|
|
|
|
xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y)
|
|
|
|
{
|
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(screen);
|
|
|
|
|
|
|
|
if (randrp->panning)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (randrp->orig_ConstrainCursorHarder) {
|
|
|
|
screen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;
|
|
|
|
screen->ConstrainCursorHarder(dev, screen, mode, x, y);
|
|
|
|
screen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-09 03:58:28 +01:00
|
|
|
static void
|
|
|
|
xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
2014-10-31 00:45:12 +01:00
|
|
|
|
2013-01-09 03:58:28 +01:00
|
|
|
if (config->randr_provider == provider) {
|
|
|
|
if (config->randr_provider->offload_sink) {
|
|
|
|
DetachOffloadGPU(screen);
|
|
|
|
config->randr_provider->offload_sink = NULL;
|
2013-01-09 05:26:35 +01:00
|
|
|
RRSetChanged(screen);
|
2013-01-09 03:58:28 +01:00
|
|
|
}
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
if (config->randr_provider->output_source) {
|
2013-04-30 23:14:23 +02:00
|
|
|
xf86DetachOutputGPU(screen);
|
2013-01-09 03:58:28 +01:00
|
|
|
config->randr_provider->output_source = NULL;
|
2013-01-09 05:26:35 +01:00
|
|
|
RRSetChanged(screen);
|
2013-01-09 03:58:28 +01:00
|
|
|
}
|
2020-07-05 23:00:50 +02:00
|
|
|
if (screen->current_primary)
|
2013-01-09 03:58:28 +01:00
|
|
|
DetachUnboundGPU(screen);
|
|
|
|
}
|
|
|
|
config->randr_provider = NULL;
|
|
|
|
}
|
|
|
|
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 22:51:56 +01:00
|
|
|
static void
|
|
|
|
xf86CrtcCheckReset(xf86CrtcPtr crtc) {
|
|
|
|
if (xf86CrtcInUse(crtc)) {
|
|
|
|
RRTransformPtr transform;
|
|
|
|
|
|
|
|
if (crtc->desiredTransformPresent)
|
|
|
|
transform = &crtc->desiredTransform;
|
|
|
|
else
|
|
|
|
transform = NULL;
|
|
|
|
xf86CrtcSetModeTransform(crtc, &crtc->desiredMode,
|
|
|
|
crtc->desiredRotation, transform,
|
|
|
|
crtc->desiredX, crtc->desiredY);
|
|
|
|
xf86_crtc_show_cursor(crtc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
xf86CrtcLeaseTerminated(RRLeasePtr lease)
|
|
|
|
{
|
|
|
|
int c;
|
|
|
|
int o;
|
2019-09-07 00:32:44 +02:00
|
|
|
ScrnInfoPtr scrn = xf86ScreenToScrn(lease->screen);
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 22:51:56 +01:00
|
|
|
|
|
|
|
RRLeaseTerminated(lease);
|
|
|
|
/*
|
|
|
|
* Force a full mode set on any crtc in the expiring lease which
|
|
|
|
* was running before the lease started
|
|
|
|
*/
|
|
|
|
for (c = 0; c < lease->numCrtcs; c++) {
|
|
|
|
RRCrtcPtr randr_crtc = lease->crtcs[c];
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
|
|
|
|
xf86CrtcCheckReset(crtc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check to see if any leased output is using a crtc which
|
|
|
|
* was not reset in the above loop
|
|
|
|
*/
|
|
|
|
for (o = 0; o < lease->numOutputs; o++) {
|
|
|
|
RROutputPtr randr_output = lease->outputs[o];
|
|
|
|
xf86OutputPtr output = randr_output->devPrivate;
|
|
|
|
xf86CrtcPtr crtc = output->crtc;
|
|
|
|
|
|
|
|
if (crtc) {
|
|
|
|
for (c = 0; c < lease->numCrtcs; c++)
|
|
|
|
if (lease->crtcs[c] == crtc->randr_crtc)
|
|
|
|
break;
|
|
|
|
if (c != lease->numCrtcs)
|
|
|
|
continue;
|
|
|
|
xf86CrtcCheckReset(crtc);
|
|
|
|
}
|
|
|
|
}
|
2019-09-07 00:32:44 +02:00
|
|
|
|
|
|
|
/* Power off if necessary */
|
|
|
|
xf86DisableUnusedFunctions(scrn);
|
|
|
|
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 22:51:56 +01:00
|
|
|
RRLeaseFree(lease);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
xf86CrtcSoleOutput(xf86CrtcPtr crtc, xf86OutputPtr output)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr scrn = crtc->scrn;
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
|
|
|
int o;
|
|
|
|
|
|
|
|
for (o = 0; o < config->num_output; o++) {
|
|
|
|
xf86OutputPtr other = config->output[o];
|
|
|
|
|
|
|
|
if (other != output && other->crtc == crtc)
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
xf86CrtcLeaseStarted(RRLeasePtr lease)
|
|
|
|
{
|
|
|
|
int c;
|
|
|
|
int o;
|
|
|
|
|
|
|
|
for (c = 0; c < lease->numCrtcs; c++) {
|
|
|
|
RRCrtcPtr randr_crtc = lease->crtcs[c];
|
|
|
|
xf86CrtcPtr crtc = randr_crtc->devPrivate;
|
|
|
|
|
|
|
|
if (crtc->enabled) {
|
|
|
|
/*
|
|
|
|
* Leave the primary plane enabled so we can
|
|
|
|
* flip without blanking the screen. Hide
|
|
|
|
* the cursor so it doesn't remain on the screen
|
|
|
|
* while the lease is active
|
|
|
|
*/
|
|
|
|
xf86_crtc_hide_cursor(crtc);
|
|
|
|
crtc->enabled = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (o = 0; o < lease->numOutputs; o++) {
|
|
|
|
RROutputPtr randr_output = lease->outputs[o];
|
|
|
|
xf86OutputPtr output = randr_output->devPrivate;
|
|
|
|
xf86CrtcPtr crtc = output->crtc;
|
|
|
|
|
|
|
|
if (crtc)
|
|
|
|
if (xf86CrtcSoleOutput(crtc, output))
|
|
|
|
crtc->enabled = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
xf86RandR16CreateLease(ScreenPtr screen, RRLeasePtr randr_lease, int *fd)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
|
|
|
|
|
|
|
if (config->funcs->create_lease)
|
|
|
|
return config->funcs->create_lease(randr_lease, fd);
|
|
|
|
else
|
|
|
|
return BadMatch;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
xf86RandR16TerminateLease(ScreenPtr screen, RRLeasePtr randr_lease)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
|
|
|
|
|
|
|
if (config->funcs->terminate_lease)
|
|
|
|
config->funcs->terminate_lease(randr_lease);
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12Init12(ScreenPtr pScreen)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
|
|
|
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
rp->rrGetInfo = xf86RandR12GetInfo12;
|
|
|
|
rp->rrScreenSetSize = xf86RandR12ScreenSetSize;
|
|
|
|
rp->rrCrtcSet = xf86RandR12CrtcSet;
|
|
|
|
rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma;
|
|
|
|
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
|
2007-02-19 08:49:38 +01:00
|
|
|
rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
|
2011-02-23 20:17:42 +01:00
|
|
|
#if RANDR_13_INTERFACE
|
2008-03-06 22:47:44 +01:00
|
|
|
rp->rrOutputGetProperty = xf86RandR13OutputGetProperty;
|
2008-11-28 17:49:31 +01:00
|
|
|
rp->rrGetPanning = xf86RandR13GetPanning;
|
|
|
|
rp->rrSetPanning = xf86RandR13SetPanning;
|
2011-02-23 20:17:42 +01:00
|
|
|
#endif
|
2007-02-19 08:49:38 +01:00
|
|
|
rp->rrModeDestroy = xf86RandR12ModeDestroy;
|
2007-02-16 05:36:20 +01:00
|
|
|
rp->rrSetConfig = NULL;
|
2012-06-13 15:17:06 +02:00
|
|
|
|
2012-07-05 16:50:24 +02:00
|
|
|
rp->rrProviderSetOutputSource = xf86RandR14ProviderSetOutputSource;
|
2012-07-05 16:50:56 +02:00
|
|
|
rp->rrProviderSetOffloadSink = xf86RandR14ProviderSetOffloadSink;
|
2012-07-05 16:50:24 +02:00
|
|
|
|
2012-06-13 15:17:06 +02:00
|
|
|
rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty;
|
|
|
|
rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty;
|
2012-06-20 13:37:26 +02:00
|
|
|
rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap;
|
2013-01-09 03:58:28 +01:00
|
|
|
rp->rrProviderDestroy = xf86RandR14ProviderDestroy;
|
2012-06-13 15:17:06 +02:00
|
|
|
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 22:51:56 +01:00
|
|
|
rp->rrCreateLease = xf86RandR16CreateLease;
|
|
|
|
rp->rrTerminateLease = xf86RandR16TerminateLease;
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
pScrn->PointerMoved = xf86RandR12PointerMoved;
|
2016-09-17 11:33:13 +02:00
|
|
|
pScrn->ChangeGamma = xf86RandR12ChangeGamma;
|
2009-05-05 02:24:47 +02:00
|
|
|
|
|
|
|
randrp->orig_EnterVT = pScrn->EnterVT;
|
|
|
|
pScrn->EnterVT = xf86RandR12EnterVT;
|
|
|
|
|
2012-07-30 20:32:12 +02:00
|
|
|
randrp->panning = FALSE;
|
|
|
|
randrp->orig_ConstrainCursorHarder = pScreen->ConstrainCursorHarder;
|
|
|
|
pScreen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!xf86RandR12CreateObjects12(pScreen))
|
|
|
|
return FALSE;
|
2007-02-16 05:36:20 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Configure output modes
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!xf86RandR12SetInfo12(pScreen))
|
|
|
|
return FALSE;
|
2016-06-21 08:41:45 +02:00
|
|
|
|
|
|
|
if (!xf86RandR12InitGamma(pScrn, 256))
|
|
|
|
return FALSE;
|
|
|
|
|
2007-02-16 05:36:20 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86RandR12PreInit(ScrnInfoPtr pScrn)
|
2007-02-16 05:36:20 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|