diff options
author | Keith Packard <keithp@keithp.com> | 2008-03-18 15:35:44 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:39 -0800 |
commit | 197aa784694992f6bcfd194932309e440334c237 (patch) | |
tree | 2d61104d9a51e80430ebe651c5cd5f75026601c7 /hw | |
parent | e86c34663ef97e946a1129450105efa89a123af6 (diff) |
Report whether transforms are support from driver through extension to client
Add APIs to xf86RandR12 support and randr extension to record whether the
driver supports transforms, report that value in the RRGetCrtcTransform
reply.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 6 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 25 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.h | 1 |
3 files changed, 32 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 57b0140b7..65c003057 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -735,11 +735,17 @@ xf86CrtcScreenInit (ScreenPtr screen) break; } if (c == config->num_crtc) + { xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270 | RR_Reflect_X | RR_Reflect_Y); + xf86RandR12SetTransform (screen, TRUE); + } else + { xf86RandR12SetRotations (screen, RR_Rotate_0); + xf86RandR12SetTransform (screen, FALSE); + } /* Wrap CreateScreenResources so we can initialize the RandR code */ config->CreateScreenResources = screen->CreateScreenResources; diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 6e14bd790..f247a882f 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -569,6 +569,31 @@ xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations) } _X_EXPORT void +xf86RandR12SetTransform (ScreenPtr pScreen, Bool transforms) +{ + XF86RandRInfoPtr randrp; +#if RANDR_13_INTERFACE + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + int c; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); +#endif + +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) + if (xf86RandR12Key == NULL) + return; +#endif + + randrp = XF86RANDRINFO(pScreen); +#if RANDR_13_INTERFACE + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + + RRCrtcSetTransform (crtc->randr_crtc, transforms); + } +#endif +} + +_X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) { ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; diff --git a/hw/xfree86/modes/xf86RandR12.h b/hw/xfree86/modes/xf86RandR12.h index 4fd855cf5..c361b4733 100644 --- a/hw/xfree86/modes/xf86RandR12.h +++ b/hw/xfree86/modes/xf86RandR12.h @@ -31,6 +31,7 @@ Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen); Bool xf86RandR12Init(ScreenPtr pScreen); void xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotation); +void xf86RandR12SetTransform (ScreenPtr pScreen, Bool transforms); Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize); Rotation xf86RandR12GetRotation(ScreenPtr pScreen); |