summaryrefslogtreecommitdiff
path: root/src/nouveau_ms.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nouveau_ms.h')
-rw-r--r--src/nouveau_ms.h159
1 files changed, 0 insertions, 159 deletions
diff --git a/src/nouveau_ms.h b/src/nouveau_ms.h
deleted file mode 100644
index c613be3..0000000
--- a/src/nouveau_ms.h
+++ /dev/null
@@ -1,159 +0,0 @@
1/*
2 * Copyright 2006 Dave Airlie
3 * Copyright 2007 Maarten Maathuis
4 * Copyright 2007-2009 Stuart Bennett
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef __NOUVEAU_MS_H__
27#define __NOUVEAU_MS_H__
28
29//#define NOUVEAU_DEBUG
30#ifdef NOUVEAU_DEBUG
31#define NV_DEBUG(d, fmt, arg...) xf86DrvMsg(d->scrnIndex, X_INFO, fmt, ##arg)
32#else
33#define NV_DEBUG(d, fmt, arg...)
34#endif
35#define NV_ERROR(d, fmt, arg...) xf86DrvMsg(d->scrnIndex, X_ERROR, fmt, ##arg)
36#define NV_INFO(d, fmt, arg...) xf86DrvMsg(d->scrnIndex, X_PROBED, fmt, ##arg)
37#define NV_TRACEWARN(d, fmt, arg...) xf86DrvMsg(d->scrnIndex, X_NOTICE, fmt, ##arg)
38#define NV_TRACE(d, fmt, arg...) xf86DrvMsg(d->scrnIndex, X_INFO, fmt, ##arg)
39#define NV_WARN(d, fmt, arg...) xf86DrvMsg(d->scrnIndex, X_WARNING, fmt, ##arg)
40
41#define NV_DPMS_CLEARED 0x80
42
43enum scaling_modes {
44 SCALE_PANEL,
45 SCALE_FULLSCREEN,
46 SCALE_ASPECT,
47 SCALE_NOSCALE,
48 SCALE_INVALID
49};
50
51struct nouveau_pll_vals {
52 union {
53 struct {
54#if X_BYTE_ORDER == X_BIG_ENDIAN
55 uint8_t N1, M1, N2, M2;
56#else
57 uint8_t M1, N1, M2, N2;
58#endif
59 };
60 struct {
61 uint16_t NM1, NM2;
62 } __attribute__((packed));
63 };
64 int log2P;
65
66 int refclk;
67};
68
69struct nouveau_crtc_state {
70 uint8_t MiscOutReg;
71 uint8_t CRTC[0x9f];
72 uint8_t CR58[0x10];
73 uint8_t Sequencer[5];
74 uint8_t Graphics[9];
75 uint8_t Attribute[21];
76 uint8_t DAC[768];
77
78 /* PCRTC regs */
79 uint32_t fb_start;
80 uint32_t crtc_cfg;
81 uint32_t cursor_cfg;
82 uint32_t gpio_ext;
83 uint32_t crtc_830;
84 uint32_t crtc_834;
85 uint32_t crtc_850;
86 uint32_t crtc_eng_ctrl;
87
88 /* PRAMDAC regs */
89 uint32_t nv10_cursync;
90 struct nouveau_pll_vals pllvals;
91 uint32_t ramdac_gen_ctrl;
92 uint32_t ramdac_630;
93 uint32_t ramdac_634;
94 uint32_t fp_horiz_regs[7];
95 uint32_t fp_vert_regs[7];
96 uint32_t dither;
97 uint32_t fp_control;
98 uint32_t dither_regs[6];
99 uint32_t fp_debug_0;
100 uint32_t fp_debug_1;
101 uint32_t fp_debug_2;
102 uint32_t ramdac_a20;
103 uint32_t ramdac_a24;
104 uint32_t ramdac_a34;
105};
106
107struct nouveau_encoder_state {
108 uint32_t output;
109 int head;
110};
111
112struct nouveau_mode_state
113{
114 uint32_t pllsel;
115 uint32_t sel_clk;
116
117 struct nouveau_crtc_state head[2];
118};
119
120struct nouveau_crtc {
121 int head;
122 uint8_t last_dpms;
123 int fp_users;
124 uint32_t dpms_saved_fp_control;
125 int saturation, sharpness;
126
127 /* convenient pointer to pNv->set_state.head[head_nr] */
128 struct nouveau_crtc_state *state;
129
130 uint32_t cursor_fg, cursor_bg;
131
132 struct nouveau_bo *bo;
133 ExaOffscreenArea *shadow;
134 unsigned shadow_pitch;
135};
136
137struct nouveau_encoder {
138 uint8_t last_dpms;
139 struct dcb_entry *dcb;
140 DisplayModePtr native_mode;
141 uint8_t scaling_mode;
142 bool dithering;
143 bool dual_link;
144 struct nouveau_encoder_state restore;
145};
146
147struct nouveau_connector {
148 xf86MonPtr edid;
149 I2CBusPtr pDDCBus;
150 uint16_t possible_encoders;
151 struct nouveau_encoder *detected_encoder;
152 struct nouveau_encoder *nv_encoder;
153};
154
155#define to_nouveau_connector(x) ((struct nouveau_connector *)(x)->driver_private)
156#define to_nouveau_crtc(x) ((struct nouveau_crtc *)(x)->driver_private)
157#define to_nouveau_encoder(x) ((struct nouveau_connector *)(x)->driver_private)->nv_encoder
158
159#endif /* __NOUVEAU_MS_H__ */