author | Niveditha Rau <Niveditha.Rau@Oracle.COM> |
Fri, 06 Apr 2012 21:57:14 -0700 | |
changeset 1265 | 0b5cc5c013e4 |
parent 1244 | 94b8d1e21e14 |
child 1322 | c0ba569ea901 |
permissions | -rw-r--r-- |
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
1 |
diff --git a/src/mga.h b/src/mga.h |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
2 |
index 77406f1..25dcf53 100644 |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
3 |
--- a/src/mga.h |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
4 |
+++ b/src/mga.h |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
5 |
@@ -46,6 +46,10 @@ |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
6 |
#include "mga_dri.h" |
1244 | 7 |
#endif |
8 |
||
9 |
+#ifdef __sparc__ |
|
10 |
+#include <sys/visual_io.h> |
|
11 |
+#endif |
|
12 |
+ |
|
13 |
typedef enum { |
|
14 |
OPTION_SW_CURSOR, |
|
15 |
OPTION_HW_CURSOR, |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
16 |
@@ -200,6 +204,28 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*); |
1244 | 17 |
#define MGA_MODULE_DATA mgaModuleData |
18 |
#define MGA_DRIVER_NAME "mga" |
|
19 |
||
20 |
+#ifdef __sparc__ |
|
21 |
+#ifndef VIS_GETPCICONFIG |
|
22 |
+ |
|
23 |
+/* |
|
24 |
+ * These definitions will be removed when they are included in the |
|
25 |
+ * visual_io.h |
|
26 |
+ */ |
|
27 |
+#define VIS_GETVIDEOMODENAME (VIOC | 12) |
|
28 |
+#define VIS_STOREVIDEOMODENAME (VIOC | 13) |
|
29 |
+#define VIS_MAX_VMODE_LEN 48 |
|
30 |
+ |
|
31 |
+typedef struct vis_video_mode { |
|
32 |
+ char mode_name[VIS_MAX_VMODE_LEN]; |
|
33 |
+ uint32_t vRefresh; |
|
34 |
+ char pad[96]; |
|
35 |
+} vis_video_mode_t; |
|
36 |
+ |
|
37 |
+ |
|
38 |
+#define VIS_GETPCICONFIG (VIOC | 14) |
|
39 |
+#endif |
|
40 |
+#endif |
|
41 |
+ |
|
42 |
typedef struct { |
|
43 |
unsigned char ExtVga[6]; |
|
44 |
unsigned char DacClk[6]; |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
45 |
@@ -667,6 +693,9 @@ typedef struct { |
1244 | 46 |
if in merged mode */ |
47 |
/* End of Merged Framebuffer Data */ |
|
48 |
int HALGranularityOffX, HALGranularityOffY; |
|
49 |
+#ifdef __sparc__ |
|
50 |
+ int fd; |
|
51 |
+#endif |
|
52 |
} MGARec, *MGAPtr; |
|
53 |
||
54 |
extern CARD32 MGAAtype[16]; |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
55 |
diff --git a/src/mga_dacG.c b/src/mga_dacG.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
56 |
index b489dea..e549f6c 100644 |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
57 |
--- a/src/mga_dacG.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
58 |
+++ b/src/mga_dacG.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
59 |
@@ -1711,11 +1711,35 @@ MGAGLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) |
1244 | 60 |
MGAPtr pMga = MGAPTR(pScrn); |
61 |
CARD32 *dst = (CARD32*)(pMga->FbBase + pMga->FbCursorOffset); |
|
62 |
int i = 128; |
|
63 |
- |
|
64 |
- /* swap bytes in each line */ |
|
65 |
+#ifdef X_BYTE_ORDER != X_LITTLE_ENDIAN |
|
66 |
+ MGAFBLayout *pLayout = &pMga->CurrentLayout; |
|
67 |
+#endif |
|
68 |
+ |
|
69 |
+ /* |
|
70 |
+ * HW cursor expects image that is both bytes and words swapped |
|
71 |
+ * see DAC Registers section of the manual |
|
72 |
+ */ |
|
73 |
while( i-- ) { |
|
74 |
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN |
|
75 |
+ /* swap bytes in each line, byte swap happens during explict byte shift */ |
|
76 |
*dst++ = (src[4] << 24) | (src[5] << 16) | (src[6] << 8) | src[7]; |
|
77 |
*dst++ = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; |
|
78 |
+#else |
|
79 |
+ if (pLayout->depth == 8) { |
|
80 |
+ /* byte swap happens during assembly of word, no explict byte shift */ |
|
81 |
+ *dst++ = (src[7] << 24) | (src[6] << 16) | (src[5] << 8) | src[4]; |
|
82 |
+ *dst++ = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; |
|
83 |
+ } else if (pLayout->depth == 16) { |
|
84 |
+ /* byte swap happens during assembly of word, partial byte shift to |
|
85 |
+ offset effects from HW cursor's double bytes reading */ |
|
86 |
+ *dst++ = (src[6] << 24) | (src[7] << 16) | (src[4] << 8) | src[5]; |
|
87 |
+ *dst++ = (src[2] << 24) | (src[3] << 16) | (src[0] << 8) | src[1]; |
|
88 |
+ } else { |
|
89 |
+ /* depth = 32. no byte swap needed, HW cursor's word reading does swap */ |
|
90 |
+ *dst++ = ((CARD32 *)src)[1]; |
|
91 |
+ *dst++ = ((CARD32 *)src)[0]; |
|
92 |
+ } |
|
93 |
+#endif |
|
94 |
src += 8; |
|
95 |
} |
|
96 |
} |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
97 |
diff --git a/src/mga_driver.c b/src/mga_driver.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
98 |
index af005f1..ae4a005 100644 |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
99 |
--- a/src/mga_driver.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
100 |
+++ b/src/mga_driver.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
101 |
@@ -107,6 +107,11 @@ |
1244 | 102 |
|
103 |
#include <unistd.h> |
|
104 |
||
105 |
+#ifdef __sparc__ |
|
106 |
+#include <stdio.h> |
|
107 |
+#include <fcntl.h> |
|
108 |
+#endif |
|
109 |
+ |
|
110 |
/* |
|
111 |
* Forward definitions for the functions that make up the driver. |
|
112 |
*/ |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
113 |
@@ -156,6 +161,10 @@ static Bool MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); |
1244 | 114 |
static void MGABlockHandler(int, pointer, pointer, pointer); |
115 |
static void MGAG100BlackMagic(ScrnInfoPtr pScrn); |
|
116 |
||
117 |
+#ifdef __sparc__ |
|
118 |
+static void MGANotifyModeChanged(ScrnInfoPtr pScrn); |
|
119 |
+#endif |
|
120 |
+ |
|
121 |
static int MGAEntityIndex = -1; |
|
122 |
||
123 |
#include "mga_merge.h" |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
124 |
@@ -455,6 +464,15 @@ static const struct pci_id_match mga_device_match[] = { |
1244 | 125 |
|
126 |
{ 0, 0, 0 }, |
|
127 |
}; |
|
128 |
+ |
|
129 |
+#ifdef __sparc__ |
|
130 |
+/* mimic pci_device_private struct so that define of DEV_PATH becomes valid */ |
|
131 |
+static struct mga_device_private { |
|
132 |
+ struct pci_device base; |
|
133 |
+ const char * device_string; |
|
134 |
+}; |
|
135 |
+#define DEV_PATH(dev) (((struct mga_device_private *) (dev))->device_string) |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
136 |
+#endif |
1244 | 137 |
#endif |
138 |
||
139 |
/* Supported chipsets */ |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
140 |
@@ -1296,9 +1314,11 @@ MGAdoDDC(ScrnInfoPtr pScrn) |
1244 | 141 |
|
142 |
/* Map the VGA memory when the primary video */ |
|
143 |
if (pMga->Primary) { |
|
144 |
+#if !defined(__sparc__) |
|
145 |
hwp->MapSize = 0x10000; |
|
146 |
if (!vgaHWMapMem(pScrn)) |
|
147 |
return NULL; |
|
148 |
+#endif |
|
149 |
} else { |
|
150 |
/* XXX Need to write an MGA mode ddc1SetSpeed */ |
|
151 |
if (pMga->DDC1SetSpeed == vgaHWddc1SetSpeedWeak()) { |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
152 |
@@ -1341,6 +1361,7 @@ MGAdoDDC(ScrnInfoPtr pScrn) |
1244 | 153 |
pMga->ddc1Read ) ; |
154 |
from = "DDC1"; |
|
155 |
} |
|
156 |
+#if !defined(__sparc__) |
|
157 |
if (!MonInfo){ |
|
158 |
vbeInfoPtr pVbe; |
|
159 |
if (xf86LoadSubModule(pScrn, "vbe")) { |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
160 |
@@ -1350,6 +1371,7 @@ MGAdoDDC(ScrnInfoPtr pScrn) |
1244 | 161 |
from = "VBE"; |
162 |
} |
|
163 |
} |
|
164 |
+#endif |
|
165 |
} |
|
166 |
||
167 |
if (MonInfo) { |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
168 |
@@ -1571,6 +1593,20 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) |
1244 | 169 |
pMga->PciInfo = xf86GetPciInfoForEntity(pMga->pEnt->index); |
170 |
pMga->PciTag = pciTag(pMga->PciInfo->bus, pMga->PciInfo->device, |
|
171 |
pMga->PciInfo->func); |
|
172 |
+#else |
|
173 |
+#ifdef __sparc__ |
|
174 |
+ { |
|
175 |
+ char dev[128]; |
|
176 |
+ if (DEV_PATH(pMga->PciInfo)) |
|
177 |
+ snprintf(dev, sizeof (dev), "%s%s", "/devices", |
|
178 |
+ DEV_PATH(pMga->PciInfo)); |
|
179 |
+ else |
|
180 |
+ strcpy (dev, "/dev/fb0"); |
|
181 |
+ |
|
182 |
+ if ((pMga->fd = open(dev, O_RDWR)) < 0) |
|
183 |
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot open device %s\n", dev); |
|
184 |
+ } |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
185 |
+#endif |
1244 | 186 |
#endif |
187 |
||
188 |
pMga->Primary = xf86IsPrimaryPci(pMga->PciInfo); |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
189 |
@@ -1922,7 +1958,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) |
1244 | 190 |
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling KVM\n"); |
191 |
} |
|
192 |
||
193 |
-#if !defined(__powerpc__) |
|
194 |
+#if (!defined(__powerpc__) && !defined(__sparc__)) |
|
195 |
pMga->softbooted = FALSE; |
|
196 |
Default = (pMga->chip_attribs->dual_head_possible |
|
197 |
&& !pMga->Primary && !pMga->SecondCrtc); |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
198 |
@@ -2838,7 +2874,11 @@ MGASave(ScrnInfoPtr pScrn) |
1244 | 199 |
/* Could call it dac2Saved */ |
200 |
||
201 |
/* Only save text mode fonts/text for the primary card */ |
|
202 |
+#ifdef __sparc__ |
|
203 |
+ (*pMga->Save)(pScrn, vgaReg, mgaReg, FALSE); |
|
204 |
+#else |
|
205 |
(*pMga->Save)(pScrn, vgaReg, mgaReg, pMga->Primary); |
|
206 |
+#endif |
|
207 |
} |
|
208 |
||
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
209 |
/* |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
210 |
@@ -2996,6 +3036,10 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) |
1244 | 211 |
#ifdef DEBUG |
212 |
MGAG450PrintPLL(pScrn); |
|
213 |
#endif |
|
214 |
+ |
|
215 |
+#ifdef __sparc__ |
|
216 |
+ MGANotifyModeChanged(pScrn); |
|
217 |
+#endif |
|
218 |
return TRUE; |
|
219 |
} |
|
220 |
||
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
221 |
@@ -3085,7 +3129,11 @@ MGARestore(ScrnInfoPtr pScrn) |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
222 |
vgaHWProtect(pScrn, TRUE); |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
223 |
} |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
224 |
if (pMga->Primary) { |
1244 | 225 |
+#ifdef __sparc__ |
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
226 |
+ (*pMga->Restore)(pScrn, vgaReg, mgaReg, FALSE); |
1244 | 227 |
+#else |
228 |
(*pMga->Restore)(pScrn, vgaReg, mgaReg, TRUE); |
|
229 |
+#endif |
|
230 |
} else { |
|
231 |
vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); |
|
232 |
} |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
233 |
@@ -3215,9 +3263,11 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) |
1244 | 234 |
/* Map the VGA memory when the primary video */ |
235 |
if (!pMga->FBDev) { |
|
236 |
if (pMga->Primary) { |
|
237 |
+#if !defined(__sparc__) |
|
238 |
hwp->MapSize = 0x10000; |
|
239 |
if (!vgaHWMapMem(pScrn)) |
|
240 |
return FALSE; |
|
241 |
+#endif |
|
242 |
} |
|
243 |
||
244 |
/* Save the current state */ |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
245 |
@@ -3473,6 +3523,10 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) |
1244 | 246 |
|
247 |
MGAInitVideo(pScreen); |
|
248 |
||
249 |
+#ifdef __sparc__ |
|
250 |
+ MGANotifyModeChanged(pScrn); |
|
251 |
+#endif |
|
252 |
+ |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
253 |
#ifdef MGADRI |
1244 | 254 |
if (pMga->directRenderingEnabled) { |
255 |
/* Now that mi, drm and others have done their thing, |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
256 |
@@ -3792,6 +3846,13 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen) |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
257 |
free(pMga->portPrivate); |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
258 |
free(pMga->ScratchBuffer); |
1244 | 259 |
|
260 |
+#ifdef __sparc__ |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
261 |
+ MGANotifyModeChanged(pScrn); |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
262 |
+ |
1244 | 263 |
+ if (pMga->fd) |
264 |
+ close(pMga->fd); |
|
265 |
+#endif |
|
266 |
+ |
|
267 |
pScrn->vtSema = FALSE; |
|
268 |
||
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
269 |
xf86ClearPrimInitDone(pScrn->entityList[0]); |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
270 |
@@ -4194,3 +4253,21 @@ MGAG100BlackMagic(ScrnInfoPtr pScrn) |
1244 | 271 |
usleep(10); |
272 |
} |
|
273 |
||
274 |
+#ifdef __sparc__ |
|
275 |
+static void |
|
276 |
+MGANotifyModeChanged(ScrnInfoPtr pScrn) |
|
277 |
+{ |
|
278 |
+ struct vis_video_mode mode; |
|
279 |
+ MGAPtr pMga = MGAPTR(pScrn); |
|
280 |
+ |
|
281 |
+ if (pScrn->currentMode->name != NULL) { |
|
282 |
+ strlcpy(mode.mode_name, pScrn->currentMode->name, VIS_MAX_VMODE_LEN); |
|
283 |
+ } else { |
|
284 |
+ strlcpy(mode.mode_name, " ", VIS_MAX_VMODE_LEN); |
|
285 |
+ } |
|
286 |
+ mode.vRefresh = pScrn->currentMode->VRefresh; |
|
287 |
+ |
|
288 |
+ ioctl(pMga->fd, VIS_STOREVIDEOMODENAME, &mode); |
|
289 |
+ |
|
290 |
+} |
|
291 |
+#endif |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
292 |
diff --git a/src/mga_storm.c b/src/mga_storm.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
293 |
index 96bb6b9..57fdba5 100644 |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
294 |
--- a/src/mga_storm.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
295 |
+++ b/src/mga_storm.c |
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
296 |
@@ -989,7 +989,12 @@ static void mgaRestoreAccelState(ScrnInfoPtr pScrn) |
1244 | 297 |
#if X_BYTE_ORDER == X_LITTLE_ENDIAN |
298 |
OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT ); |
|
299 |
#else |
|
300 |
- OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT | 0x10000); |
|
301 |
+ if (pLayout->depth == 8) |
|
302 |
+ OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT); |
|
303 |
+ else if (pLayout->depth == 16) |
|
304 |
+ OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT | 0x10000); |
|
305 |
+ else |
|
306 |
+ OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT | 0x20000); |
|
307 |
#endif |
|
308 |
OUTREG(MGAREG_CXBNDRY, 0xFFFF0000); /* (maxX << 16) | minX */ |
|
309 |
OUTREG(MGAREG_YTOP, 0x00000000); /* minPixelPointer */ |
|
1265
0b5cc5c013e4
7083537 Xorg 1.12 & associated module updates
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1244
diff
changeset
|
310 |
@@ -1077,9 +1082,9 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn ) |
1244 | 311 |
maccess |= (1 << 31); |
312 |
} |
|
313 |
||
314 |
- opmode |= opmode_table[ pLayout->bitsPerPixel / 8 ]; |
|
315 |
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN |
|
316 |
opmode &= ~0x30000; |
|
317 |
+#if X_BYTE_ORDER == X_BIG_ENDIAN |
|
318 |
+ opmode |= opmode_table[ pLayout->bitsPerPixel / 8 ]; |
|
319 |
#endif |
|
320 |
||
321 |
pMga->SetupForSolidFill = mgaSetupForSolidFill; |