2
* Copyright © 2000 Compaq Computer Corporation
3
* Copyright © 2002 Hewlett-Packard Company
4
* Copyright © 2006 Intel Corporation
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that copyright
9
* notice and this permission notice appear in supporting documentation, and
10
* that the name of the copyright holders not be used in advertising or
11
* publicity pertaining to distribution of the software without specific,
12
* written prior permission. The copyright holders make no representations
13
* about the suitability of this software for any purpose. It is provided "as
14
* is" without express or implied warranty.
16
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24
* Author: Jim Gettys, Hewlett-Packard Company, Inc.
25
* Keith Packard, Intel Corporation
28
#ifdef HAVE_DIX_CONFIG_H
29
#include <dix-config.h>
32
#include "scrnintstr.h"
38
miRRGetInfo (ScreenPtr pScreen, Rotation *rotations)
44
* Any hardware that can actually change anything will need something
48
miRRCrtcSet (ScreenPtr pScreen,
61
miRRCrtcSetGamma (ScreenPtr pScreen,
68
miRROutputSetProperty (ScreenPtr pScreen,
71
RRPropertyValuePtr value)
77
miRROutputGetProperty (ScreenPtr pScreen,
85
miRROutputValidateMode (ScreenPtr pScreen,
93
miRRModeDestroy (ScreenPtr pScreen,
99
* This function assumes that only a single depth can be
100
* displayed at a time, but that all visuals of that depth
101
* can be displayed simultaneously. It further assumes that
102
* only a single size is available. Hardware providing
103
* additional capabilties should use different code.
104
* XXX what to do here....
108
miRandRInit (ScreenPtr pScreen)
110
rrScrPrivPtr pScrPriv;
111
#if RANDR_12_INTERFACE
115
xRRModeInfo modeInfo;
119
if (!RRScreenInit (pScreen))
121
pScrPriv = rrGetScrPriv(pScreen);
122
pScrPriv->rrGetInfo = miRRGetInfo;
123
#if RANDR_12_INTERFACE
124
pScrPriv->rrCrtcSet = miRRCrtcSet;
125
pScrPriv->rrCrtcSetGamma = miRRCrtcSetGamma;
126
pScrPriv->rrOutputSetProperty = miRROutputSetProperty;
127
#if RANDR_13_INTERFACE
128
pScrPriv->rrOutputGetProperty = miRROutputGetProperty;
130
pScrPriv->rrOutputValidateMode = miRROutputValidateMode;
131
pScrPriv->rrModeDestroy = miRRModeDestroy;
133
RRScreenSetSizeRange (pScreen,
134
pScreen->width, pScreen->height,
135
pScreen->width, pScreen->height);
137
sprintf (name, "%dx%d", pScreen->width, pScreen->height);
138
memset (&modeInfo, '\0', sizeof (modeInfo));
139
modeInfo.width = pScreen->width;
140
modeInfo.height = pScreen->height;
141
modeInfo.nameLength = strlen (name);
143
mode = RRModeGet (&modeInfo, name);
147
crtc = RRCrtcCreate (pScreen, NULL);
151
output = RROutputCreate (pScreen, "screen", 6, NULL);
154
if (!RROutputSetClones (output, NULL, 0))
156
if (!RROutputSetModes (output, &mode, 1, 0))
158
if (!RROutputSetCrtcs (output, &crtc, 1))
160
if (!RROutputSetConnection (output, RR_Connected))
162
RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output);