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 miRROutputValidateMode (ScreenPtr pScreen
,
85 miRRModeDestroy (ScreenPtr pScreen
,
91 * This function assumes that only a single depth can be
92 * displayed at a time, but that all visuals of that depth
93 * can be displayed simultaneously. It further assumes that
94 * only a single size is available. Hardware providing
95 * additional capabilties should use different code.
96 * XXX what to do here....
100 miRandRInit (ScreenPtr pScreen
)
102 rrScrPrivPtr pScrPriv
;
103 #if RANDR_12_INTERFACE
107 xRRModeInfo modeInfo
;
111 if (!RRScreenInit (pScreen
))
113 pScrPriv
= rrGetScrPriv(pScreen
);
114 pScrPriv
->rrGetInfo
= miRRGetInfo
;
115 #if RANDR_12_INTERFACE
116 pScrPriv
->rrCrtcSet
= miRRCrtcSet
;
117 pScrPriv
->rrCrtcSetGamma
= miRRCrtcSetGamma
;
118 pScrPriv
->rrOutputSetProperty
= miRROutputSetProperty
;
119 pScrPriv
->rrOutputValidateMode
= miRROutputValidateMode
;
120 pScrPriv
->rrModeDestroy
= miRRModeDestroy
;
122 RRScreenSetSizeRange (pScreen
,
123 pScreen
->width
, pScreen
->height
,
124 pScreen
->width
, pScreen
->height
);
126 sprintf (name
, "%dx%d", pScreen
->width
, pScreen
->height
);
127 memset (&modeInfo
, '\0', sizeof (modeInfo
));
128 modeInfo
.width
= pScreen
->width
;
129 modeInfo
.height
= pScreen
->height
;
130 modeInfo
.nameLength
= strlen (name
);
132 mode
= RRModeGet (&modeInfo
, name
);
136 crtc
= RRCrtcCreate (pScreen
, NULL
);
140 output
= RROutputCreate (pScreen
, "screen", 6, NULL
);
143 if (!RROutputSetClones (output
, NULL
, 0))
145 if (!RROutputSetModes (output
, &mode
, 1, 0))
147 if (!RROutputSetCrtcs (output
, &crtc
, 1))
149 if (!RROutputSetConnection (output
, RR_Connected
))
151 RRCrtcNotify (crtc
, mode
, 0, 0, RR_Rotate_0
, 1, &output
);