Update RandR protocol

This commit is contained in:
Keith Packard 2001-06-03 21:52:46 +00:00
parent 88ae32841d
commit 54e66d92db
3 changed files with 80 additions and 83 deletions

View File

@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/fbdev/fbdev.c,v 1.15 2001/05/29 17:47:55 keithp Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/fbdev/fbdev.c,v 1.16 2001/05/29 21:55:41 keithp Exp $ */
#include "fbdev.h" #include "fbdev.h"
@ -358,20 +358,19 @@ fbdevLayerCreate (ScreenPtr pScreen)
#ifdef RANDR #ifdef RANDR
Bool Bool
fbdevRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps) fbdevRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
FbdevPriv *priv = pScreenPriv->card->driver; FbdevPriv *priv = pScreenPriv->card->driver;
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
FbdevScrPriv *scrpriv = screen->driver; FbdevScrPriv *scrpriv = screen->driver;
RRVisualSetPtr pVisualSet; RRVisualGroupPtr pVisualGroup;
RRSetOfVisualSetPtr pSetOfVisualSet; RRGroupOfVisualGroupPtr pGroupOfVisualGroup;
RRSizeInfoPtr pSize; RRScreenSizePtr pSize;
int rotateKind; Rotation rotateKind;
int n; int n;
*swaps = 0; *rotations = RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270;
*rotations = RR_ROTATE_0|RR_ROTATE_90|RR_ROTATE_180|RR_ROTATE_270;
for (n = 0; n < pScreen->numDepths; n++) for (n = 0; n < pScreen->numDepths; n++)
if (pScreen->allowedDepths[n].numVids) if (pScreen->allowedDepths[n].numVids)
@ -379,34 +378,34 @@ fbdevRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps)
if (n == pScreen->numDepths) if (n == pScreen->numDepths)
return FALSE; return FALSE;
pVisualSet = RRCreateVisualSet (pScreen); pVisualGroup = RRCreateVisualGroup (pScreen);
if (!pVisualSet) if (!pVisualGroup)
return FALSE; return FALSE;
if (!RRAddDepthToVisualSet (pScreen, if (!RRAddDepthToVisualGroup (pScreen,
pVisualSet, pVisualGroup,
&pScreen->allowedDepths[n])) &pScreen->allowedDepths[n]))
{ {
RRDestroyVisualSet (pScreen, pVisualSet); RRDestroyVisualGroup (pScreen, pVisualGroup);
return FALSE; return FALSE;
} }
pVisualSet = RRRegisterVisualSet (pScreen, pVisualSet); pVisualGroup = RRRegisterVisualGroup (pScreen, pVisualGroup);
if (!pVisualSet) if (!pVisualGroup)
return FALSE; return FALSE;
pSetOfVisualSet = RRCreateSetOfVisualSet (pScreen); pGroupOfVisualGroup = RRCreateGroupOfVisualGroup (pScreen);
if (!RRAddVisualSetToSetOfVisualSet (pScreen, if (!RRAddVisualGroupToGroupOfVisualGroup (pScreen,
pSetOfVisualSet, pGroupOfVisualGroup,
pVisualSet)) pVisualGroup))
{ {
RRDestroySetOfVisualSet (pScreen, pSetOfVisualSet); RRDestroyGroupOfVisualGroup (pScreen, pGroupOfVisualGroup);
/* pVisualSet left until screen closed */ /* pVisualGroup left until screen closed */
return FALSE; return FALSE;
} }
pSetOfVisualSet = RRRegisterSetOfVisualSet (pScreen, pSetOfVisualSet); pGroupOfVisualGroup = RRRegisterGroupOfVisualGroup (pScreen, pGroupOfVisualGroup);
if (!pSetOfVisualSet) if (!pGroupOfVisualGroup)
return FALSE; return FALSE;
pSize = RRRegisterSize (pScreen, pSize = RRRegisterSize (pScreen,
@ -414,25 +413,25 @@ fbdevRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps)
screen->height, screen->height,
screen->width_mm, screen->width_mm,
screen->height_mm, screen->height_mm,
pSetOfVisualSet); pGroupOfVisualGroup);
switch (scrpriv->rotation) switch (scrpriv->rotation)
{ {
case 0: case 0:
rotateKind = RR_ROTATE_0; rotateKind = RR_Rotate_0;
break; break;
case 90: case 90:
rotateKind = RR_ROTATE_90; rotateKind = RR_Rotate_90;
break; break;
case 180: case 180:
rotateKind = RR_ROTATE_180; rotateKind = RR_Rotate_180;
break; break;
case 270: case 270:
rotateKind = RR_ROTATE_270; rotateKind = RR_Rotate_270;
break; break;
} }
RRSetCurrentConfig (pScreen, rotateKind, 0, pSize, pVisualSet); RRSetCurrentConfig (pScreen, rotateKind, pSize, pVisualGroup);
return TRUE; return TRUE;
} }
@ -460,11 +459,10 @@ fbdevLayerRemove (WindowPtr pWin, pointer value)
return WT_WALKCHILDREN; return WT_WALKCHILDREN;
} }
fbdevRandRSetConfig (ScreenPtr pScreen, fbdevRandRSetConfig (ScreenPtr pScreen,
int rotateKind, Rotation rotateKind,
int swap, RRScreenSizePtr pSize,
RRSizeInfoPtr pSize, RRVisualGroupPtr pVisualGroup)
RRVisualSetPtr pVisualSet)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
@ -478,16 +476,16 @@ fbdevRandRSetConfig (ScreenPtr pScreen,
*/ */
switch (rotateKind) switch (rotateKind)
{ {
case RR_ROTATE_0: case RR_Rotate_0:
rotation = 0; rotation = 0;
break; break;
case RR_ROTATE_90: case RR_Rotate_90:
rotation = 90; rotation = 90;
break; break;
case RR_ROTATE_180: case RR_Rotate_180:
rotation = 180; rotation = 180;
break; break;
case RR_ROTATE_270: case RR_Rotate_270:
rotation = 270; rotation = 270;
break; break;
} }

View File

@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/fbdev/fbdev.h,v 1.9 2001/05/29 04:54:11 keithp Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/fbdev/fbdev.h,v 1.10 2001/05/29 17:47:55 keithp Exp $ */
#ifndef _FBDEV_H_ #ifndef _FBDEV_H_
#define _FBDEV_H_ #define _FBDEV_H_
@ -31,6 +31,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include "kdrive.h" #include "kdrive.h"
#include "layer.h" #include "layer.h"
#ifdef RANDR #ifdef RANDR
#include "randrstr.h" #include "randrstr.h"
#endif #endif

View File

@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vesa.c,v 1.10 2001/05/26 01:25:41 keithp Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vesa.c,v 1.11 2001/05/29 04:54:12 keithp Exp $ */
#include "vesa.h" #include "vesa.h"
#ifdef RANDR #ifdef RANDR
@ -852,21 +852,20 @@ vesaCreateColormap16 (ColormapPtr pmap)
#ifdef RANDR #ifdef RANDR
Bool Bool
vesaRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps) vesaRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
VesaModePtr modes, mode; VesaModePtr modes, mode;
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
VesaCardPrivPtr priv = pScreenPriv->card->driver; VesaCardPrivPtr priv = pScreenPriv->card->driver;
VesaScreenPrivPtr pscr = pScreenPriv->screen->driver; VesaScreenPrivPtr pscr = pScreenPriv->screen->driver;
int nmode; int nmode;
int n; int n;
RRVisualSetPtr pVisualSet; RRVisualGroupPtr pVisualGroup;
RRSetOfVisualSetPtr pSetOfVisualSet; RRGroupOfVisualGroupPtr pGroupOfVisualGroup;
RRSizeInfoPtr pSize; RRScreenSizePtr pSize;
*rotations = RR_ROTATE_0; *rotations = RR_Rotate_0;
*swaps = 0;
/* /*
* Get mode information from BIOS -- every time in case * Get mode information from BIOS -- every time in case
* something changes, like an external monitor is plugged in * something changes, like an external monitor is plugged in
@ -888,34 +887,34 @@ vesaRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps)
if (n == pScreen->numDepths) if (n == pScreen->numDepths)
return FALSE; return FALSE;
pVisualSet = RRCreateVisualSet (pScreen); pVisualGroup = RRCreateVisualGroup (pScreen);
if (!pVisualSet) if (!pVisualGroup)
return FALSE; return FALSE;
if (!RRAddDepthToVisualSet (pScreen, if (!RRAddDepthToVisualGroup (pScreen,
pVisualSet, pVisualGroup,
&pScreen->allowedDepths[n])) &pScreen->allowedDepths[n]))
{ {
RRDestroyVisualSet (pScreen, pVisualSet); RRDestroyVisualGroup (pScreen, pVisualGroup);
return FALSE; return FALSE;
} }
pVisualSet = RRRegisterVisualSet (pScreen, pVisualSet); pVisualGroup = RRRegisterVisualGroup (pScreen, pVisualGroup);
if (!pVisualSet) if (!pVisualGroup)
return FALSE; return FALSE;
pSetOfVisualSet = RRCreateSetOfVisualSet (pScreen); pGroupOfVisualGroup = RRCreateGroupOfVisualGroup (pScreen);
if (!RRAddVisualSetToSetOfVisualSet (pScreen, if (!RRAddVisualGroupToGroupOfVisualGroup (pScreen,
pSetOfVisualSet, pGroupOfVisualGroup,
pVisualSet)) pVisualGroup))
{ {
RRDestroySetOfVisualSet (pScreen, pSetOfVisualSet); RRDestroyGroupOfVisualGroup (pScreen, pGroupOfVisualGroup);
/* pVisualSet left until screen closed */ /* pVisualGroup left until screen closed */
return FALSE; return FALSE;
} }
pSetOfVisualSet = RRRegisterSetOfVisualSet (pScreen, pSetOfVisualSet); pGroupOfVisualGroup = RRRegisterGroupOfVisualGroup (pScreen, pGroupOfVisualGroup);
if (!pSetOfVisualSet) if (!pGroupOfVisualGroup)
return FALSE; return FALSE;
for (n = 0; n < nmode; n++) for (n = 0; n < nmode; n++)
@ -942,12 +941,12 @@ vesaRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps)
mode->YResolution, mode->YResolution,
pScreen->mmWidth, pScreen->mmWidth,
pScreen->mmHeight, pScreen->mmHeight,
pSetOfVisualSet); pGroupOfVisualGroup);
if (mode->XResolution == pScreen->width && if (mode->XResolution == pScreen->width &&
mode->YResolution == pScreen->height) mode->YResolution == pScreen->height)
{ {
RRSetCurrentConfig (pScreen, RR_ROTATE_0, 0, pSize, RRSetCurrentConfig (pScreen, RR_Rotate_0, pSize,
pVisualSet); pVisualGroup);
} }
} }
} }
@ -955,11 +954,10 @@ vesaRandRGetInfo (ScreenPtr pScreen, int *rotations, int *swaps)
} }
Bool Bool
vesaRandRSetConfig (ScreenPtr pScreen, vesaRandRSetConfig (ScreenPtr pScreen,
int rotation, Rotation rotation,
int swap, RRScreenSizePtr pSize,
RRSizeInfoPtr pSize, RRVisualGroupPtr pVisualGroup)
RRVisualSetPtr pVisualSet)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
VesaModePtr mode; VesaModePtr mode;
@ -1007,16 +1005,16 @@ vesaRandRSetConfig (ScreenPtr pScreen,
case 32: case 32:
switch (rotation) switch (rotation)
{ {
case RR_ROTATE_0: case RR_Rotate_0:
pscr->rotate = 0; pscr->rotate = 0;
break; break;
case RR_ROTATE_90: case RR_Rotate_90:
pscr->rotate = 90; pscr->rotate = 90;
break; break;
case RR_ROTATE_180: case RR_Rotate_180:
pscr->rotate = 180; pscr->rotate = 180;
break; break;
case RR_ROTATE_270: case RR_Rotate_270:
pscr->rotate = 270; pscr->rotate = 270;
break; break;
} }