xf86-video-intel: Branch 'restructure-outputs' - 3 commits - src/i830_driver.c src/i830.h src/i830_modes.c src/i830_randr.c src/i830_randr.h src/i830_rotate.c
Keith Packard
keithp at kemper.freedesktop.org
Fri Dec 1 00:09:38 EET 2006
src/i830.h | 10 ----
src/i830_driver.c | 9 ++--
src/i830_modes.c | 2
src/i830_randr.c | 120 ++++++++++++++++++++++++++++++------------------------
src/i830_randr.h | 37 ++++++++++++++++
src/i830_rotate.c | 2
6 files changed, 112 insertions(+), 68 deletions(-)
New commits:
diff-tree 16e01b117bb7ae90b150dd4f25a887dd895cf473 (from bcf206ff17c6eca8212db72dd86fcd8fdc0162da)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Nov 30 11:55:29 2006 -0800
Oops. Don't try to use xf86RandR names, use xf86RandR12 instead.
Attempts to override functions in core server fail, so use
new names instead.
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b4333c4..e4d6772 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1584,7 +1584,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"Maximum frambuffer space: %d kByte\n", pScrn->videoRam);
- if (!xf86RandRPreInit (pScrn))
+ if (!xf86RandR12PreInit (pScrn))
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
PreInitCleanup(pScrn);
@@ -2613,7 +2613,7 @@ I830CreateScreenResources (ScreenPtr pSc
if (!(*pScreen->CreateScreenResources)(pScreen))
return FALSE;
- if (!xf86RandRCreateScreenResources (pScreen))
+ if (!xf86RandR12CreateScreenResources (pScreen))
return FALSE;
return TRUE;
@@ -3156,11 +3156,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr
xf86DisableRandR(); /* Disable built-in RandR extension */
shadowSetup(pScreen);
/* support all rotations */
- xf86RandRInit (pScreen);
+ xf86RandR12Init (pScreen);
if (IS_I965G(pI830)) {
- xf86RandRSetRotations (pScreen, RR_Rotate_0); /* only 0 degrees for I965G */
+ xf86RandR12SetRotations (pScreen, RR_Rotate_0); /* only 0 degrees for I965G */
} else {
- xf86RandRSetRotations (pScreen, RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270);
+ xf86RandR12SetRotations (pScreen, RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270);
}
pI830->PointerMoved = pScrn->PointerMoved;
pScrn->PointerMoved = I830PointerMoved;
diff --git a/src/i830_modes.c b/src/i830_modes.c
index 7b48794..513e233 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -519,7 +519,7 @@ i830_set_xf86_modes_from_outputs(ScrnInf
}
}
- xf86GetOriginalVirtualSize(pScrn, &originalVirtualX, &originalVirtualY);
+ xf86RandR12GetOriginalVirtualSize(pScrn, &originalVirtualX, &originalVirtualY);
/* Disable modes in the XFree86 DDX list that are larger than the current
* virtual size.
diff --git a/src/i830_randr.c b/src/i830_randr.c
index 38ac320..1ff2360 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -44,7 +44,7 @@
#include "i830_display.h"
#include "i830.h"
-typedef struct _xf86RandRInfo {
+typedef struct _xf86RandR12Info {
int virtualX;
int virtualY;
int mmWidth;
@@ -56,18 +56,18 @@ typedef struct _xf86RandRInfo {
} XF86RandRInfoRec, *XF86RandRInfoPtr;
#ifdef RANDR_12_INTERFACE
-static Bool xf86RandRInit12 (ScreenPtr pScreen);
-static Bool xf86RandRCreateScreenResources12 (ScreenPtr pScreen);
+static Bool xf86RandR12Init12 (ScreenPtr pScreen);
+static Bool xf86RandR12CreateScreenResources12 (ScreenPtr pScreen);
#endif
-static int xf86RandRIndex;
-static int xf86RandRGeneration;
+static int xf86RandR12Index;
+static int xf86RandR12Generation;
#define XF86RANDRINFO(p) \
- ((XF86RandRInfoPtr)(p)->devPrivates[xf86RandRIndex].ptr)
+ ((XF86RandRInfoPtr)(p)->devPrivates[xf86RandR12Index].ptr)
static int
-xf86RandRModeRefresh (DisplayModePtr mode)
+xf86RandR12ModeRefresh (DisplayModePtr mode)
{
if (mode->VRefresh)
return (int) (mode->VRefresh + 0.5);
@@ -76,7 +76,7 @@ xf86RandRModeRefresh (DisplayModePtr mod
}
static Bool
-xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
+xf86RandR12GetInfo (ScreenPtr pScreen, Rotation *rotations)
{
RRScreenSizePtr pSize;
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
@@ -98,7 +98,7 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rot
for (mode = scrp->modes; ; mode = mode->next)
{
- int refresh = xf86RandRModeRefresh (mode);
+ int refresh = xf86RandR12ModeRefresh (mode);
if (randrp->maxX == 0 || randrp->maxY == 0)
{
if (maxX < mode->HDisplay)
@@ -152,7 +152,7 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rot
}
static Bool
-xf86RandRSetMode (ScreenPtr pScreen,
+xf86RandR12SetMode (ScreenPtr pScreen,
DisplayModePtr mode,
Bool useVirtual,
int mmWidth,
@@ -241,7 +241,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
}
Bool
-xf86RandRSetConfig (ScreenPtr pScreen,
+xf86RandR12SetConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize)
@@ -274,7 +274,7 @@ xf86RandRSetConfig (ScreenPtr pScreen,
}
if (mode->HDisplay == pSize->width &&
mode->VDisplay == pSize->height &&
- (rate == 0 || xf86RandRModeRefresh (mode) == rate))
+ (rate == 0 || xf86RandR12ModeRefresh (mode) == rate))
break;
if (mode->next == scrp->modes)
{
@@ -300,7 +300,7 @@ xf86RandRSetConfig (ScreenPtr pScreen,
randrp->maxY = maxY;
}
- if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth,
+ if (!xf86RandR12SetMode (pScreen, mode, useVirtual, pSize->mmWidth,
pSize->mmHeight)) {
randrp->rotation = oldRotation;
return FALSE;
@@ -323,7 +323,7 @@ xf86RandRSetConfig (ScreenPtr pScreen,
}
Rotation
-xf86RandRGetRotation(ScreenPtr pScreen)
+xf86RandR12GetRotation(ScreenPtr pScreen)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
@@ -331,7 +331,7 @@ xf86RandRGetRotation(ScreenPtr pScreen)
}
Bool
-xf86RandRCreateScreenResources (ScreenPtr pScreen)
+xf86RandR12CreateScreenResources (ScreenPtr pScreen)
{
#if 0
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -343,7 +343,7 @@ xf86RandRCreateScreenResources (ScreenPt
return TRUE;
#endif
#if RANDR_12_INTERFACE
- if (xf86RandRCreateScreenResources12 (pScreen))
+ if (xf86RandR12CreateScreenResources12 (pScreen))
return TRUE;
#endif
#if 0
@@ -361,7 +361,7 @@ xf86RandRCreateScreenResources (ScreenPt
p.mmHeight = pScreen->mmHeight;
pI830->starting = TRUE; /* abuse this for dual head & rotation */
- xf86RandRSetConfig (pScreen, requestedRotation, 0, &p);
+ xf86RandR12SetConfig (pScreen, requestedRotation, 0, &p);
pI830->starting = FALSE;
}
#endif
@@ -370,7 +370,7 @@ xf86RandRCreateScreenResources (ScreenPt
Bool
-xf86RandRInit (ScreenPtr pScreen)
+xf86RandR12Init (ScreenPtr pScreen)
{
rrScrPrivPtr rp;
XF86RandRInfoPtr randrp;
@@ -380,10 +380,10 @@ xf86RandRInit (ScreenPtr pScreen)
if (!noPanoramiXExtension)
return TRUE;
#endif
- if (xf86RandRGeneration != serverGeneration)
+ if (xf86RandR12Generation != serverGeneration)
{
- xf86RandRIndex = AllocateScreenPrivateIndex();
- xf86RandRGeneration = serverGeneration;
+ xf86RandR12Index = AllocateScreenPrivateIndex();
+ xf86RandR12Generation = serverGeneration;
}
randrp = xalloc (sizeof (XF86RandRInfoRec));
@@ -396,8 +396,8 @@ xf86RandRInit (ScreenPtr pScreen)
return FALSE;
}
rp = rrGetScrPriv(pScreen);
- rp->rrGetInfo = xf86RandRGetInfo;
- rp->rrSetConfig = xf86RandRSetConfig;
+ rp->rrGetInfo = xf86RandR12GetInfo;
+ rp->rrSetConfig = xf86RandR12SetConfig;
randrp->virtualX = -1;
randrp->virtualY = -1;
@@ -410,17 +410,17 @@ xf86RandRInit (ScreenPtr pScreen)
randrp->maxX = randrp->maxY = 0;
- pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
+ pScreen->devPrivates[xf86RandR12Index].ptr = randrp;
#if RANDR_12_INTERFACE
- if (!xf86RandRInit12 (pScreen))
+ if (!xf86RandR12Init12 (pScreen))
return FALSE;
#endif
return TRUE;
}
void
-xf86RandRSetRotations (ScreenPtr pScreen, Rotation rotations)
+xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
@@ -428,11 +428,11 @@ xf86RandRSetRotations (ScreenPtr pScreen
}
void
-xf86GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
+xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
{
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
- if (xf86RandRGeneration != serverGeneration ||
+ if (xf86RandR12Generation != serverGeneration ||
XF86RANDRINFO(pScreen)->virtualX == -1)
{
*x = pScrn->virtualX;
@@ -447,7 +447,7 @@ xf86GetOriginalVirtualSize(ScrnInfoPtr p
#if RANDR_12_INTERFACE
static Bool
-xf86RandRScreenSetSize (ScreenPtr pScreen,
+xf86RandR12ScreenSetSize (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
CARD32 mmWidth,
@@ -483,7 +483,7 @@ xf86RandRScreenSetSize (ScreenPtr pScree
}
static Bool
-xf86RandRCrtcNotify (RRCrtcPtr randr_crtc)
+xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
{
ScreenPtr pScreen = randr_crtc->pScreen;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -532,7 +532,7 @@ xf86RandRCrtcNotify (RRCrtcPtr randr_crt
}
static Bool
-xf86RandRCrtcSet (ScreenPtr pScreen,
+xf86RandR12CrtcSet (ScreenPtr pScreen,
RRCrtcPtr randr_crtc,
RRModePtr randr_mode,
int x,
@@ -603,11 +603,11 @@ xf86RandRCrtcSet (ScreenPtr pScreen,
}
i830DisableUnusedFunctions (pScrn);
}
- return xf86RandRCrtcNotify (randr_crtc);
+ return xf86RandR12CrtcNotify (randr_crtc);
}
static Bool
-xf86RandRCrtcSetGamma (ScreenPtr pScreen,
+xf86RandR12CrtcSetGamma (ScreenPtr pScreen,
RRCrtcPtr crtc)
{
return FALSE;
@@ -677,7 +677,7 @@ I830xf86RROutputSetModes (RROutputPtr ra
* Mirror the current mode configuration to RandR
*/
static Bool
-xf86RandRSetInfo12 (ScrnInfoPtr pScrn)
+xf86RandR12SetInfo12 (ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
RROutputPtr clones[MAX_OUTPUTS];
@@ -787,16 +787,16 @@ xf86RandRSetInfo12 (ScrnInfoPtr pScrn)
* that to RandR
*/
static Bool
-xf86RandRGetInfo12 (ScreenPtr pScreen, Rotation *rotations)
+xf86RandR12GetInfo12 (ScreenPtr pScreen, Rotation *rotations)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
i830_reprobe_output_modes(pScrn);
- return xf86RandRSetInfo12 (pScrn);
+ return xf86RandR12SetInfo12 (pScrn);
}
static Bool
-xf86RandRCreateObjects12 (ScrnInfoPtr pScrn)
+xf86RandR12CreateObjects12 (ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
int p;
@@ -818,7 +818,7 @@ xf86RandRCreateObjects12 (ScrnInfoPtr pS
}
static Bool
-xf86RandRCreateScreenResources12 (ScreenPtr pScreen)
+xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -866,7 +866,7 @@ xf86RandRCreateScreenResources12 (Screen
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Setting screen physical size to %d x %d\n",
mmWidth, mmHeight);
- xf86RandRScreenSetSize (pScreen,
+ xf86RandR12ScreenSetSize (pScreen,
width,
height,
mmWidth,
@@ -874,7 +874,7 @@ xf86RandRCreateScreenResources12 (Screen
}
for (p = 0; p < pI830->xf86_config.num_crtc; p++)
- xf86RandRCrtcNotify (pI830->xf86_config.crtc[p]->randr_crtc);
+ xf86RandR12CrtcNotify (pI830->xf86_config.crtc[p]->randr_crtc);
if (randrp->virtualX == -1 || randrp->virtualY == -1)
{
@@ -888,22 +888,22 @@ xf86RandRCreateScreenResources12 (Screen
}
static void
-xf86RandRPointerMoved (int scrnIndex, int x, int y)
+xf86RandR12PointerMoved (int scrnIndex, int x, int y)
{
}
static Bool
-xf86RandRInit12 (ScreenPtr pScreen)
+xf86RandR12Init12 (ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
- rp->rrGetInfo = xf86RandRGetInfo12;
- rp->rrScreenSetSize = xf86RandRScreenSetSize;
- rp->rrCrtcSet = xf86RandRCrtcSet;
- rp->rrCrtcSetGamma = xf86RandRCrtcSetGamma;
+ rp->rrGetInfo = xf86RandR12GetInfo12;
+ rp->rrScreenSetSize = xf86RandR12ScreenSetSize;
+ rp->rrCrtcSet = xf86RandR12CrtcSet;
+ rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma;
rp->rrSetConfig = NULL;
- pScrn->PointerMoved = xf86RandRPointerMoved;
+ pScrn->PointerMoved = xf86RandR12PointerMoved;
return TRUE;
}
@@ -1169,7 +1169,7 @@ I830RRDefaultScreenLimits (RROutputPtr *
#endif
Bool
-xf86RandRPreInit (ScrnInfoPtr pScrn)
+xf86RandR12PreInit (ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
#if RANDR_12_INTERFACE
@@ -1188,13 +1188,13 @@ xf86RandRPreInit (ScrnInfoPtr pScrn)
i830_reprobe_output_modes(pScrn);
#if RANDR_12_INTERFACE
- if (!xf86RandRCreateObjects12 (pScrn))
+ if (!xf86RandR12CreateObjects12 (pScrn))
return FALSE;
/*
* Configure output modes
*/
- if (!xf86RandRSetInfo12 (pScrn))
+ if (!xf86RandR12SetInfo12 (pScrn))
return FALSE;
/*
* With RandR info set up, let RandR choose
diff --git a/src/i830_randr.h b/src/i830_randr.h
index 8c6af92..8a4668b 100644
--- a/src/i830_randr.h
+++ b/src/i830_randr.h
@@ -25,13 +25,13 @@
#include <randrstr.h>
#include <X11/extensions/render.h>
-Bool xf86RandRCreateScreenResources (ScreenPtr pScreen);
-Bool xf86RandRInit(ScreenPtr pScreen);
-void xf86RandRSetRotations (ScreenPtr pScreen, Rotation rotation);
-Bool xf86RandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate,
+Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen);
+Bool xf86RandR12Init(ScreenPtr pScreen);
+void xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotation);
+Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate,
RRScreenSizePtr pSize);
-Rotation xf86RandRGetRotation(ScreenPtr pScreen);
-void xf86GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
-Bool xf86RandRPreInit (ScrnInfoPtr pScrn);
+Rotation xf86RandR12GetRotation(ScreenPtr pScreen);
+void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
+Bool xf86RandR12PreInit (ScrnInfoPtr pScrn);
#endif /* _XF86_RANDR_H_ */
diff --git a/src/i830_rotate.c b/src/i830_rotate.c
index 1427c24..891a8f7 100644
--- a/src/i830_rotate.c
+++ b/src/i830_rotate.c
@@ -757,7 +757,7 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayMod
pScrn2 = pScrn;
}
- pI830->rotation = xf86RandRGetRotation(pScrn->pScreen);
+ pI830->rotation = xf86RandR12GetRotation(pScrn->pScreen);
/* Check if we've still got the same orientation, or same mode */
if (pI830->rotation == oldRotation && pI830->currentMode == mode)
diff-tree bcf206ff17c6eca8212db72dd86fcd8fdc0162da (from parents)
Merge: 27ca1c17aab30670dd1d07e0809fd58cdecfc3b6 2c8c310bd8a105dbeda5c989dca31cc766eb6bb8
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Nov 30 11:39:56 2006 -0800
Merge branch 'restructure-outputs-origin' into restructure-outputs
diff --cc src/i830.h
index 1b0b305,4e8e8de..14adb3c
@@@ -58,9 -58,7 +58,8 @@@
#include "xf86int10.h"
#include "vbe.h"
#include "vgaHW.h"
- #include "randrstr.h"
#include "i830_xf86Crtc.h"
+#include "i830_randr.h"
#ifdef XF86DRI
#include "xf86drm.h"
diff-tree 27ca1c17aab30670dd1d07e0809fd58cdecfc3b6 (from e8d1db326388c9a112f2b8e2eff5a81210b8d6e4)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Nov 30 11:39:37 2006 -0800
Rename I830 randr functions to xf86 as they are becoming generic.
Change function names, create separate i830_randr.h header file
to contain definitions.
diff --git a/src/i830.h b/src/i830.h
index e88cd43..1b0b305 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -60,6 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
#include "vgaHW.h"
#include "randrstr.h"
#include "i830_xf86Crtc.h"
+#include "i830_randr.h"
#ifdef XF86DRI
#include "xf86drm.h"
@@ -606,15 +607,6 @@ void i830_set_xf86_modes_from_outputs(Sc
void i830_set_default_screen_size(ScrnInfoPtr pScrn);
DisplayModePtr i830_ddc_get_modes(xf86OutputPtr output);
-/* i830_randr.c */
-Bool I830RandRCreateScreenResources (ScreenPtr pScreen);
-Bool I830RandRInit(ScreenPtr pScreen, int rotation);
-Bool I830RandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate,
- RRScreenSizePtr pSize);
-Rotation I830GetRotation(ScreenPtr pScreen);
-void I830GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
-Bool I830RandRPreInit (ScrnInfoPtr pScrn);
-
/* i830_tv.c */
void i830_tv_init(ScrnInfoPtr pScrn);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 50a5da0..6b7439a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1585,7 +1585,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"Maximum frambuffer space: %d kByte\n", pScrn->videoRam);
- if (!I830RandRPreInit (pScrn))
+ if (!xf86RandRPreInit (pScrn))
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
PreInitCleanup(pScrn);
@@ -2614,7 +2614,7 @@ I830CreateScreenResources (ScreenPtr pSc
if (!(*pScreen->CreateScreenResources)(pScreen))
return FALSE;
- if (!I830RandRCreateScreenResources (pScreen))
+ if (!xf86RandRCreateScreenResources (pScreen))
return FALSE;
return TRUE;
@@ -3157,10 +3157,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr
xf86DisableRandR(); /* Disable built-in RandR extension */
shadowSetup(pScreen);
/* support all rotations */
+ xf86RandRInit (pScreen);
if (IS_I965G(pI830)) {
- I830RandRInit(pScreen, RR_Rotate_0); /* only 0 degrees for I965G */
+ xf86RandRSetRotations (pScreen, RR_Rotate_0); /* only 0 degrees for I965G */
} else {
- I830RandRInit(pScreen, RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270);
+ xf86RandRSetRotations (pScreen, RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270);
}
pI830->PointerMoved = pScrn->PointerMoved;
pScrn->PointerMoved = I830PointerMoved;
diff --git a/src/i830_modes.c b/src/i830_modes.c
index 19ea05c..7b48794 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -519,7 +519,7 @@ i830_set_xf86_modes_from_outputs(ScrnInf
}
}
- I830GetOriginalVirtualSize(pScrn, &originalVirtualX, &originalVirtualY);
+ xf86GetOriginalVirtualSize(pScrn, &originalVirtualX, &originalVirtualY);
/* Disable modes in the XFree86 DDX list that are larger than the current
* virtual size.
diff --git a/src/i830_randr.c b/src/i830_randr.c
index ec0a2ec..38ac320 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -39,11 +39,12 @@
#include <randrstr.h>
#include <X11/extensions/render.h>
-#include "i830.h"
-#include "i830_xf86Modes.h"
+#include "i830_xf86Crtc.h"
+#include "i830_randr.h"
#include "i830_display.h"
+#include "i830.h"
-typedef struct _i830RandRInfo {
+typedef struct _xf86RandRInfo {
int virtualX;
int virtualY;
int mmWidth;
@@ -55,18 +56,18 @@ typedef struct _i830RandRInfo {
} XF86RandRInfoRec, *XF86RandRInfoPtr;
#ifdef RANDR_12_INTERFACE
-static Bool I830RandRInit12 (ScreenPtr pScreen);
-static Bool I830RandRCreateScreenResources12 (ScreenPtr pScreen);
+static Bool xf86RandRInit12 (ScreenPtr pScreen);
+static Bool xf86RandRCreateScreenResources12 (ScreenPtr pScreen);
#endif
-static int i830RandRIndex;
-static int i830RandRGeneration;
+static int xf86RandRIndex;
+static int xf86RandRGeneration;
#define XF86RANDRINFO(p) \
- ((XF86RandRInfoPtr)(p)->devPrivates[i830RandRIndex].ptr)
+ ((XF86RandRInfoPtr)(p)->devPrivates[xf86RandRIndex].ptr)
static int
-I830RandRModeRefresh (DisplayModePtr mode)
+xf86RandRModeRefresh (DisplayModePtr mode)
{
if (mode->VRefresh)
return (int) (mode->VRefresh + 0.5);
@@ -75,7 +76,7 @@ I830RandRModeRefresh (DisplayModePtr mod
}
static Bool
-I830RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
+xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
{
RRScreenSizePtr pSize;
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
@@ -97,7 +98,7 @@ I830RandRGetInfo (ScreenPtr pScreen, Rot
for (mode = scrp->modes; ; mode = mode->next)
{
- int refresh = I830RandRModeRefresh (mode);
+ int refresh = xf86RandRModeRefresh (mode);
if (randrp->maxX == 0 || randrp->maxY == 0)
{
if (maxX < mode->HDisplay)
@@ -151,7 +152,7 @@ I830RandRGetInfo (ScreenPtr pScreen, Rot
}
static Bool
-I830RandRSetMode (ScreenPtr pScreen,
+xf86RandRSetMode (ScreenPtr pScreen,
DisplayModePtr mode,
Bool useVirtual,
int mmWidth,
@@ -240,7 +241,7 @@ I830RandRSetMode (ScreenPtr pScreen,
}
Bool
-I830RandRSetConfig (ScreenPtr pScreen,
+xf86RandRSetConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize)
@@ -273,7 +274,7 @@ I830RandRSetConfig (ScreenPtr pScreen,
}
if (mode->HDisplay == pSize->width &&
mode->VDisplay == pSize->height &&
- (rate == 0 || I830RandRModeRefresh (mode) == rate))
+ (rate == 0 || xf86RandRModeRefresh (mode) == rate))
break;
if (mode->next == scrp->modes)
{
@@ -299,7 +300,7 @@ I830RandRSetConfig (ScreenPtr pScreen,
randrp->maxY = maxY;
}
- if (!I830RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth,
+ if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth,
pSize->mmHeight)) {
randrp->rotation = oldRotation;
return FALSE;
@@ -322,7 +323,7 @@ I830RandRSetConfig (ScreenPtr pScreen,
}
Rotation
-I830GetRotation(ScreenPtr pScreen)
+xf86RandRGetRotation(ScreenPtr pScreen)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
@@ -330,19 +331,23 @@ I830GetRotation(ScreenPtr pScreen)
}
Bool
-I830RandRCreateScreenResources (ScreenPtr pScreen)
+xf86RandRCreateScreenResources (ScreenPtr pScreen)
{
+#if 0
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- I830Ptr pI830 = I830PTR(pScrn);
+ I830Ptr pI830 = I830PTR(pScrn);
+#endif
#ifdef PANORAMIX
/* XXX disable RandR when using Xinerama */
if (!noPanoramiXExtension)
return TRUE;
#endif
#if RANDR_12_INTERFACE
- if (I830RandRCreateScreenResources12 (pScreen))
+ if (xf86RandRCreateScreenResources12 (pScreen))
return TRUE;
#endif
+#if 0
+ /* XXX deal with initial rotation */
if (pI830->rotation != RR_Rotate_0) {
RRScreenSize p;
Rotation requestedRotation = pI830->rotation;
@@ -356,15 +361,16 @@ I830RandRCreateScreenResources (ScreenPt
p.mmHeight = pScreen->mmHeight;
pI830->starting = TRUE; /* abuse this for dual head & rotation */
- I830RandRSetConfig (pScreen, requestedRotation, 0, &p);
+ xf86RandRSetConfig (pScreen, requestedRotation, 0, &p);
pI830->starting = FALSE;
}
+#endif
return TRUE;
}
Bool
-I830RandRInit (ScreenPtr pScreen, int rotation)
+xf86RandRInit (ScreenPtr pScreen)
{
rrScrPrivPtr rp;
XF86RandRInfoPtr randrp;
@@ -374,10 +380,10 @@ I830RandRInit (ScreenPtr pScreen, int
if (!noPanoramiXExtension)
return TRUE;
#endif
- if (i830RandRGeneration != serverGeneration)
+ if (xf86RandRGeneration != serverGeneration)
{
- i830RandRIndex = AllocateScreenPrivateIndex();
- i830RandRGeneration = serverGeneration;
+ xf86RandRIndex = AllocateScreenPrivateIndex();
+ xf86RandRGeneration = serverGeneration;
}
randrp = xalloc (sizeof (XF86RandRInfoRec));
@@ -390,8 +396,8 @@ I830RandRInit (ScreenPtr pScreen, int
return FALSE;
}
rp = rrGetScrPriv(pScreen);
- rp->rrGetInfo = I830RandRGetInfo;
- rp->rrSetConfig = I830RandRSetConfig;
+ rp->rrGetInfo = xf86RandRGetInfo;
+ rp->rrSetConfig = xf86RandRSetConfig;
randrp->virtualX = -1;
randrp->virtualY = -1;
@@ -400,25 +406,33 @@ I830RandRInit (ScreenPtr pScreen, int
randrp->rotation = RR_Rotate_0; /* initial rotated mode */
- randrp->supported_rotations = rotation;
+ randrp->supported_rotations = RR_Rotate_0;
randrp->maxX = randrp->maxY = 0;
- pScreen->devPrivates[i830RandRIndex].ptr = randrp;
+ pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
#if RANDR_12_INTERFACE
- if (!I830RandRInit12 (pScreen))
+ if (!xf86RandRInit12 (pScreen))
return FALSE;
#endif
return TRUE;
}
void
-I830GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
+xf86RandRSetRotations (ScreenPtr pScreen, Rotation rotations)
+{
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+
+ randrp->supported_rotations = rotations;
+}
+
+void
+xf86GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
{
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
- if (i830RandRGeneration != serverGeneration ||
+ if (xf86RandRGeneration != serverGeneration ||
XF86RANDRINFO(pScreen)->virtualX == -1)
{
*x = pScrn->virtualX;
@@ -433,7 +447,7 @@ I830GetOriginalVirtualSize(ScrnInfoPtr p
#if RANDR_12_INTERFACE
static Bool
-I830RandRScreenSetSize (ScreenPtr pScreen,
+xf86RandRScreenSetSize (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
CARD32 mmWidth,
@@ -469,7 +483,7 @@ I830RandRScreenSetSize (ScreenPtr pScree
}
static Bool
-I830RandRCrtcNotify (RRCrtcPtr randr_crtc)
+xf86RandRCrtcNotify (RRCrtcPtr randr_crtc)
{
ScreenPtr pScreen = randr_crtc->pScreen;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -518,7 +532,7 @@ I830RandRCrtcNotify (RRCrtcPtr randr_crt
}
static Bool
-I830RandRCrtcSet (ScreenPtr pScreen,
+xf86RandRCrtcSet (ScreenPtr pScreen,
RRCrtcPtr randr_crtc,
RRModePtr randr_mode,
int x,
@@ -589,11 +603,11 @@ I830RandRCrtcSet (ScreenPtr pScreen,
}
i830DisableUnusedFunctions (pScrn);
}
- return I830RandRCrtcNotify (randr_crtc);
+ return xf86RandRCrtcNotify (randr_crtc);
}
static Bool
-I830RandRCrtcSetGamma (ScreenPtr pScreen,
+xf86RandRCrtcSetGamma (ScreenPtr pScreen,
RRCrtcPtr crtc)
{
return FALSE;
@@ -663,7 +677,7 @@ I830xf86RROutputSetModes (RROutputPtr ra
* Mirror the current mode configuration to RandR
*/
static Bool
-I830RandRSetInfo12 (ScrnInfoPtr pScrn)
+xf86RandRSetInfo12 (ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
RROutputPtr clones[MAX_OUTPUTS];
@@ -773,16 +787,16 @@ I830RandRSetInfo12 (ScrnInfoPtr pScrn)
* that to RandR
*/
static Bool
-I830RandRGetInfo12 (ScreenPtr pScreen, Rotation *rotations)
+xf86RandRGetInfo12 (ScreenPtr pScreen, Rotation *rotations)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
i830_reprobe_output_modes(pScrn);
- return I830RandRSetInfo12 (pScrn);
+ return xf86RandRSetInfo12 (pScrn);
}
static Bool
-I830RandRCreateObjects12 (ScrnInfoPtr pScrn)
+xf86RandRCreateObjects12 (ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
int p;
@@ -804,7 +818,7 @@ I830RandRCreateObjects12 (ScrnInfoPtr pS
}
static Bool
-I830RandRCreateScreenResources12 (ScreenPtr pScreen)
+xf86RandRCreateScreenResources12 (ScreenPtr pScreen)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -852,7 +866,7 @@ I830RandRCreateScreenResources12 (Screen
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Setting screen physical size to %d x %d\n",
mmWidth, mmHeight);
- I830RandRScreenSetSize (pScreen,
+ xf86RandRScreenSetSize (pScreen,
width,
height,
mmWidth,
@@ -860,7 +874,7 @@ I830RandRCreateScreenResources12 (Screen
}
for (p = 0; p < pI830->xf86_config.num_crtc; p++)
- I830RandRCrtcNotify (pI830->xf86_config.crtc[p]->randr_crtc);
+ xf86RandRCrtcNotify (pI830->xf86_config.crtc[p]->randr_crtc);
if (randrp->virtualX == -1 || randrp->virtualY == -1)
{
@@ -874,22 +888,22 @@ I830RandRCreateScreenResources12 (Screen
}
static void
-I830RandRPointerMoved (int scrnIndex, int x, int y)
+xf86RandRPointerMoved (int scrnIndex, int x, int y)
{
}
static Bool
-I830RandRInit12 (ScreenPtr pScreen)
+xf86RandRInit12 (ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
- rp->rrGetInfo = I830RandRGetInfo12;
- rp->rrScreenSetSize = I830RandRScreenSetSize;
- rp->rrCrtcSet = I830RandRCrtcSet;
- rp->rrCrtcSetGamma = I830RandRCrtcSetGamma;
+ rp->rrGetInfo = xf86RandRGetInfo12;
+ rp->rrScreenSetSize = xf86RandRScreenSetSize;
+ rp->rrCrtcSet = xf86RandRCrtcSet;
+ rp->rrCrtcSetGamma = xf86RandRCrtcSetGamma;
rp->rrSetConfig = NULL;
- pScrn->PointerMoved = I830RandRPointerMoved;
+ pScrn->PointerMoved = xf86RandRPointerMoved;
return TRUE;
}
@@ -1155,7 +1169,7 @@ I830RRDefaultScreenLimits (RROutputPtr *
#endif
Bool
-I830RandRPreInit (ScrnInfoPtr pScrn)
+xf86RandRPreInit (ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
#if RANDR_12_INTERFACE
@@ -1174,13 +1188,13 @@ I830RandRPreInit (ScrnInfoPtr pScrn)
i830_reprobe_output_modes(pScrn);
#if RANDR_12_INTERFACE
- if (!I830RandRCreateObjects12 (pScrn))
+ if (!xf86RandRCreateObjects12 (pScrn))
return FALSE;
/*
* Configure output modes
*/
- if (!I830RandRSetInfo12 (pScrn))
+ if (!xf86RandRSetInfo12 (pScrn))
return FALSE;
/*
* With RandR info set up, let RandR choose
diff --git a/src/i830_randr.h b/src/i830_randr.h
new file mode 100644
index 0000000..8c6af92
--- /dev/null
+++ b/src/i830_randr.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2006 Keith Packard
+ *
+ * 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.
+ */
+
+#ifndef _XF86_RANDR_H_
+#define _XF86_RANDR_H_
+#include <randrstr.h>
+#include <X11/extensions/render.h>
+
+Bool xf86RandRCreateScreenResources (ScreenPtr pScreen);
+Bool xf86RandRInit(ScreenPtr pScreen);
+void xf86RandRSetRotations (ScreenPtr pScreen, Rotation rotation);
+Bool xf86RandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate,
+ RRScreenSizePtr pSize);
+Rotation xf86RandRGetRotation(ScreenPtr pScreen);
+void xf86GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
+Bool xf86RandRPreInit (ScrnInfoPtr pScrn);
+
+#endif /* _XF86_RANDR_H_ */
diff --git a/src/i830_rotate.c b/src/i830_rotate.c
index 0471b55..1427c24 100644
--- a/src/i830_rotate.c
+++ b/src/i830_rotate.c
@@ -757,7 +757,7 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayMod
pScrn2 = pScrn;
}
- pI830->rotation = I830GetRotation(pScrn->pScreen);
+ pI830->rotation = xf86RandRGetRotation(pScrn->pScreen);
/* Check if we've still got the same orientation, or same mode */
if (pI830->rotation == oldRotation && pI830->currentMode == mode)
More information about the xorg-commit
mailing list