summaryrefslogtreecommitdiff
path: root/src/radeon_randr.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-12-16 12:02:37 +1100
committerDave Airlie <airlied@linux.ie>2006-12-16 12:02:37 +1100
commitb47013f41249516ae82e22bd75caf573da2cc13c (patch)
tree7138a3ef7a29fae1017dd3d4fe1cf848c7a7160c /src/radeon_randr.c
parent62a5e7565b66d7b7d65609c034f34b55bd266617 (diff)
hook up mode detect to new randr code
Diffstat (limited to 'src/radeon_randr.c')
-rw-r--r--src/radeon_randr.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/radeon_randr.c b/src/radeon_randr.c
index baa92072..ce28e7b7 100644
--- a/src/radeon_randr.c
+++ b/src/radeon_randr.c
@@ -66,12 +66,31 @@ static Bool xf86RandR12CreateScreenResources12 (ScreenPtr pScreen);
#endif
-static int RADEONRandRIndex;
-static int RADEONRandRGeneration;
+static int xf86RandR12Index;
+static int xf86RandR12Generation;
-#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[RADEONRandRIndex].ptr)
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandR12Index].ptr)
#if RANDR_12_INTERFACE
+
+void
+xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
+{
+ ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+
+ if (xf86RandR12Generation != serverGeneration ||
+ XF86RANDRINFO(pScreen)->virtualX == -1)
+ {
+ *x = pScrn->virtualX;
+ *y = pScrn->virtualY;
+ } else {
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+
+ *x = randrp->virtualX;
+ *y = randrp->virtualY;
+ }
+}
+
static int
xf86RandR12ModeRefresh (DisplayModePtr mode)
{
@@ -811,10 +830,10 @@ RADEONRandRInit (ScreenPtr pScreen, int rotation)
if (!noPanoramiXExtension)
return TRUE;
#endif
- if (RADEONRandRGeneration != serverGeneration)
+ if (xf86RandR12Generation != serverGeneration)
{
- RADEONRandRIndex = AllocateScreenPrivateIndex();
- RADEONRandRGeneration = serverGeneration;
+ xf86RandR12Index = AllocateScreenPrivateIndex();
+ xf86RandR12Generation = serverGeneration;
}
randrp = xalloc (sizeof (XF86RandRInfoRec));
@@ -841,7 +860,7 @@ RADEONRandRInit (ScreenPtr pScreen, int rotation)
randrp->maxX = randrp->maxY = 0;
- pScreen->devPrivates[RADEONRandRIndex].ptr = randrp;
+ pScreen->devPrivates[xf86RandR12Index].ptr = randrp;
#if RANDR_12_INTERFACE
if (!RADEONRandRInit12 (pScreen))