CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
6889cb1d956aefa1fbc9b2300eb81df5e3236d3f
[ports/efikamx-arm.git] / xorg-video-imxng / xorg-video-imxng_imx_drv_compat.patch
1 Binary files xorg-video-imxng.orig/.git/index and xorg-video-imxng/.git/index differ
2 diff -pruN xorg-video-imxng.orig/src/compat-api.h xorg-video-imxng/src/compat-api.h
3 --- xorg-video-imxng.orig/src/compat-api.h 1970-01-01 01:00:00.000000000 +0100
4 +++ xorg-video-imxng/src/compat-api.h 2013-02-13 01:18:02.808280498 +0100
5 @@ -0,0 +1,106 @@
6 +/*
7 + * Copyright 2012 Red Hat, Inc.
8 + *
9 + * Permission is hereby granted, free of charge, to any person obtaining a
10 + * copy of this software and associated documentation files (the "Software"),
11 + * to deal in the Software without restriction, including without limitation
12 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 + * and/or sell copies of the Software, and to permit persons to whom the
14 + * Software is furnished to do so, subject to the following conditions:
15 + *
16 + * The above copyright notice and this permission notice (including the next
17 + * paragraph) shall be included in all copies or substantial portions of the
18 + * Software.
19 + *
20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 + * DEALINGS IN THE SOFTWARE.
27 + *
28 + * Author: Dave Airlie <airlied@redhat.com>
29 + */
30 +
31 +/* this file provides API compat between server post 1.13 and pre it,
32 + it should be reused inside as many drivers as possible */
33 +#ifndef COMPAT_API_H
34 +#define COMPAT_API_H
35 +
36 +#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
37 +#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
38 +#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
39 +#endif
40 +
41 +#ifndef XF86_HAS_SCRN_CONV
42 +#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
43 +#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
44 +#endif
45 +
46 +#ifndef XF86_SCRN_INTERFACE
47 +
48 +#define SCRN_ARG_TYPE int
49 +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
50 +
51 +#define SCREEN_ARG_TYPE int
52 +#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
53 +
54 +#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
55 +
56 +#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
57 +#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
58 +
59 +#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
60 +#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
61 +#define CLOSE_SCREEN_DECL_ScrnInfoPtr ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
62 +
63 +#define FBDEVHWADJUSTFRAME_ARGS(x, y) scrnIndex, (x), (y), 0
64 +
65 +#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
66 +
67 +#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
68 +
69 +#define FREE_SCREEN_ARGS_DECL int arg, int flags
70 +#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
71 +
72 +#define VT_FUNC_ARGS_DECL int arg, int flags
73 +#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
74 +
75 +#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn->scrnIndex, b
76 +
77 +#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
78 +#else
79 +#define SCRN_ARG_TYPE ScrnInfoPtr
80 +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
81 +
82 +#define SCREEN_ARG_TYPE ScreenPtr
83 +#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
84 +
85 +#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
86 +
87 +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
88 +#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
89 +
90 +#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
91 +#define CLOSE_SCREEN_ARGS pScreen
92 +#define CLOSE_SCREEN_DECL_ScrnInfoPtr ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
93 +
94 +#define FBDEVHWADJUSTFRAME_ARGS(x, y) pScrn, (x), (y)
95 +
96 +#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
97 +#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
98 +
99 +#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
100 +#define FREE_SCREEN_ARGS(x) (x)
101 +
102 +#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
103 +#define VT_FUNC_ARGS(flags) pScrn
104 +
105 +#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn, b
106 +
107 +#define XF86_ENABLEDISABLEFB_ARG(x) (x)
108 +
109 +#endif
110 +
111 +#endif
112 diff -pruN xorg-video-imxng.orig/src/imx_drv.c xorg-video-imxng/src/imx_drv.c
113 --- xorg-video-imxng.orig/src/imx_drv.c 2013-02-13 00:31:37.858284376 +0100
114 +++ xorg-video-imxng/src/imx_drv.c 2013-02-14 20:37:53.418271127 +0100
115 @@ -64,6 +64,8 @@
116
117 #include "xf86xv.h"
118
119 +#include "compat-api.h"
120 +
121 static Bool debug = 0;
122
123 #define TRACE_ENTER(str) \
124 @@ -80,8 +82,8 @@ static const OptionInfoRec * IMXAvailabl
125 static void IMXIdentify(int flags);
126 static Bool IMXProbe(DriverPtr drv, int flags);
127 static Bool IMXPreInit(ScrnInfoPtr pScrn, int flags);
128 -static Bool IMXScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv);
129 -static Bool IMXCloseScreen(int scrnIndex, ScreenPtr pScreen);
130 +static Bool IMXScreenInit(SCREEN_INIT_ARGS_DECL);
131 +static Bool IMXCloseScreen(CLOSE_SCREEN_ARGS_DECL);
132 static Bool IMXDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr);
133
134 /* for XV acceleration */
135 @@ -520,9 +522,9 @@ IMXPreInit(ScrnInfoPtr pScrn, int flags)
136 }
137
138 static Bool
139 -IMXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
140 +IMXScreenInit(SCREEN_INIT_ARGS_DECL)
141 {
142 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
143 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
144 IMXPtr fPtr = IMXPTR(pScrn);
145 VisualPtr visual;
146 int init_picture = 0;
147 @@ -540,28 +542,27 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
148 pScrn->mask.red,pScrn->mask.green,pScrn->mask.blue,
149 pScrn->offset.red,pScrn->offset.green,pScrn->offset.blue);
150 #endif
151 -
152 if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) {
153 - xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"
154 - " failed\n");
155 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mapping of video memory"
156 + " failed\n");
157 return FALSE;
158 - }
159 + }
160 fPtr->fboff = fbdevHWLinearOffset(pScrn);
161
162 fbdevHWSave(pScrn);
163
164 if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
165 - xf86DrvMsg(scrnIndex,X_ERROR,"mode initialization failed\n");
166 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mode initialization failed\n");
167 return FALSE;
168 }
169 fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
170 - fbdevHWAdjustFrame(scrnIndex,0,0,0);
171 + fbdevHWAdjustFrame(pScrn, 0, 0);
172
173 /* mi layer */
174 miClearVisualTypes();
175 if (pScrn->bitsPerPixel > 8) {
176 if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
177 - xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
178 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
179 " for %d bits per pixel [1]\n",
180 pScrn->bitsPerPixel);
181 return FALSE;
182 @@ -570,14 +571,14 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
183 if (!miSetVisualTypes(pScrn->depth,
184 miGetDefaultVisualMask(pScrn->depth),
185 pScrn->rgbBits, pScrn->defaultVisual)) {
186 - xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
187 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
188 " for %d bits per pixel [2]\n",
189 pScrn->bitsPerPixel);
190 return FALSE;
191 }
192 }
193 if (!miSetPixmapDepths()) {
194 - xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
195 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
196 return FALSE;
197 }
198
199 @@ -587,7 +588,7 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
200 (pScrn->bitsPerPixel / 8);
201
202 if (pScrn->displayWidth != pScrn->virtualX) {
203 - xf86DrvMsg(scrnIndex, X_INFO,
204 + xf86DrvMsg(pScrn->scrnIndex, X_INFO,
205 "Pitch updated to %d after ModeInit\n",
206 pScrn->displayWidth);
207 }
208 @@ -610,7 +611,7 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
209 init_picture = 1;
210 break;
211 default:
212 - xf86DrvMsg(scrnIndex, X_ERROR,
213 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
214 "internal error: invalid number of bits per"
215 " pixel (%d) encountered in"
216 " IMXScreenInit()\n", pScrn->bitsPerPixel);
217 @@ -621,7 +622,7 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
218 case FBDEVHW_INTERLEAVED_PLANES:
219 /* This should never happen ...
220 * we should check for this much much earlier ... */
221 - xf86DrvMsg(scrnIndex, X_ERROR,
222 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
223 "internal error: interleaved planes are not yet "
224 "supported by the imx driver\n");
225 ret = FALSE;
226 @@ -629,20 +630,20 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
227 case FBDEVHW_TEXT:
228 /* This should never happen ...
229 * we should check for this much much earlier ... */
230 - xf86DrvMsg(scrnIndex, X_ERROR,
231 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
232 "internal error: text mode is not supported by the "
233 "imx driver\n");
234 ret = FALSE;
235 break;
236 case FBDEVHW_VGA_PLANES:
237 /* Not supported yet */
238 - xf86DrvMsg(scrnIndex, X_ERROR,
239 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
240 "internal error: EGA/VGA Planes are not yet "
241 "supported by the imx driver\n");
242 ret = FALSE;
243 break;
244 default:
245 - xf86DrvMsg(scrnIndex, X_ERROR,
246 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
247 "internal error: unrecognised hardware type (%d) "
248 "encountered in IMXScreenInit()\n", type);
249 ret = FALSE;
250 @@ -674,9 +675,9 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
251 xf86SetBlackWhitePixels(pScreen);
252
253 /* INITIALIZE ACCELERATION BEFORE INIT FOR BACKING STORE AND SOFTWARE CURSOR */
254 - if (!IMX_EXA_ScreenInit(scrnIndex, pScreen)) {
255 + if (!IMX_EXA_ScreenInit(pScrn->scrnIndex, pScreen)) {
256
257 - xf86DrvMsg(scrnIndex, X_ERROR,
258 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
259 "IMX EXA failed to initialize screen.\n");
260 return FALSE;
261 }
262 @@ -708,29 +709,29 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
263 /* XXX It would be simpler to use miCreateDefColormap() in all cases. */
264 case FBDEVHW_PACKED_PIXELS:
265 if (!miCreateDefColormap(pScreen)) {
266 - xf86DrvMsg(scrnIndex, X_ERROR,
267 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
268 "internal error: miCreateDefColormap failed "
269 "in IMXScreenInit()\n");
270 return FALSE;
271 }
272 break;
273 case FBDEVHW_INTERLEAVED_PLANES:
274 - xf86DrvMsg(scrnIndex, X_ERROR,
275 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
276 "internal error: interleaved planes are not yet "
277 "supported by the imx driver\n");
278 return FALSE;
279 case FBDEVHW_TEXT:
280 - xf86DrvMsg(scrnIndex, X_ERROR,
281 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
282 "internal error: text mode is not supported by "
283 "the imx driver\n");
284 return FALSE;
285 case FBDEVHW_VGA_PLANES:
286 - xf86DrvMsg(scrnIndex, X_ERROR,
287 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
288 "internal error: EGA/VGA planes are not yet "
289 "supported by the imx driver\n");
290 return FALSE;
291 default:
292 - xf86DrvMsg(scrnIndex, X_ERROR,
293 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
294 "internal error: unrecognised imx hardware type "
295 "(%d) encountered in IMXScreenInit()\n", type);
296 return FALSE;
297 @@ -762,13 +763,12 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
298 }
299
300 static Bool
301 -IMXCloseScreen(int scrnIndex, ScreenPtr pScreen)
302 +IMXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
303 {
304 - IMX_EXA_CloseScreen(scrnIndex, pScreen);
305 -
306 - ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
307 + CLOSE_SCREEN_DECL_ScrnInfoPtr;
308 IMXPtr fPtr = IMXPTR(pScrn);
309
310 + IMX_EXA_CloseScreen(pScrn->scrnIndex, pScreen);
311 fbdevHWRestore(pScrn);
312 fbdevHWUnmapVidmem(pScrn);
313 pScrn->vtSema = FALSE;
314 @@ -777,7 +777,7 @@ IMXCloseScreen(int scrnIndex, ScreenPtr
315
316 IMXFreeRec(pScrn);
317
318 - return (*pScreen->CloseScreen)(scrnIndex, pScreen);
319 + return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
320 }
321
322 Bool
323 @@ -796,7 +796,7 @@ IMXGetPixmapProperties(
324 }
325
326 /* Access screen associated with this pixmap. */
327 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
328 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
329
330 /* Check if the screen associated with this pixmap has IMX driver. */
331 if (0 != strcmp(IMX_DRIVER_NAME, pScrn->driverName)) {
332 diff -pruN xorg-video-imxng.orig/src/imx_exa_c2d.c xorg-video-imxng/src/imx_exa_c2d.c
333 --- xorg-video-imxng.orig/src/imx_exa_c2d.c 2013-02-13 00:31:37.868285501 +0100
334 +++ xorg-video-imxng/src/imx_exa_c2d.c 2013-02-14 18:29:47.368267874 +0100
335 @@ -45,6 +45,8 @@
336
337 #include "imx_type.h"
338
339 +#include "compat-api.h"
340 +
341 #if IMX_EXA_VERSION_COMPILED < IMX_EXA_VERSION(2, 5, 0)
342 #error This driver can be built only against EXA version 2.5.0 or higher.
343 #endif
344 @@ -1204,7 +1206,7 @@ IMX_EXA_GetPixmapProperties(
345 return FALSE;
346
347 /* Access screen info associated with this pixmap. */
348 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
349 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
350
351 /* Access driver specific data associated with the screen. */
352 IMXPtr imxPtr = IMXPTR(pScrn);
353 @@ -1236,7 +1238,7 @@ IMXEXACreatePixmap2(
354 int *pPitch)
355 {
356 /* Access screen info associated with this screen. */
357 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
358 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
359
360 /* Access driver specific data associated with the screen. */
361 IMXPtr imxPtr = IMXPTR(pScrn);
362 @@ -1372,7 +1374,7 @@ IMXEXADestroyPixmap(
363 IMXEXAPixmapPtr fPixmapPtr = (IMXEXAPixmapPtr) driverPriv;
364
365 /* Access screen info associated with this screen. */
366 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
367 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
368
369 /* Access driver specific data associated with the screen. */
370 IMXPtr imxPtr = IMXPTR(pScrn);
371 @@ -1468,7 +1470,7 @@ IMXEXAModifyPixmapHeader(
372 return FALSE;
373
374 /* Access screen info associated with this pixmap. */
375 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
376 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
377
378 /* Access driver specific data associated with the screen. */
379 IMXPtr imxPtr = IMXPTR(pScrn);
380 @@ -1688,7 +1690,7 @@ IMXEXAPrepareAccess(
381 return FALSE;
382
383 /* Access screen info associated with this pixmap. */
384 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
385 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
386
387 /* Access driver specific data associated with the screen. */
388 IMXPtr imxPtr = IMXPTR(pScrn);
389 @@ -1759,7 +1761,7 @@ IMXEXAFinishAccess(
390 return;
391
392 /* Access screen info associated with this pixmap. */
393 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
394 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
395
396 #if 0
397 /* Access driver specific data associated with the screen. */
398 @@ -1802,7 +1804,7 @@ IMXEXAPrepareSolid(
399 return FALSE;
400
401 /* Access screen info associated with this pixmap */
402 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
403 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
404
405 /* Access driver specific data associated with the screen. */
406 IMXPtr imxPtr = IMXPTR(pScrn);
407 @@ -1900,7 +1902,7 @@ IMXEXASolid(
408 int x2, int y2)
409 {
410 /* Access screen info associated with this pixmap */
411 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
412 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
413
414 /* Access driver specific data associated with the screen. */
415 IMXPtr imxPtr = IMXPTR(pScrn);
416 @@ -1953,7 +1955,7 @@ IMXEXADoneSolid(
417 PixmapPtr pPixmap)
418 {
419 /* Access screen info associated with this pixmap */
420 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
421 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
422
423 /* Access driver specific data associated with the screen. */
424 IMXPtr imxPtr = IMXPTR(pScrn);
425 @@ -1985,7 +1987,7 @@ IMXEXAPrepareCopy(
426 return FALSE;
427
428 /* Access the screen associated with this pixmap. */
429 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
430 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
431
432 /* Access driver specific data associated with the screen. */
433 IMXPtr imxPtr = IMXPTR(pScrn);
434 @@ -2083,7 +2085,7 @@ IMXEXACopy(
435 int width, int height)
436 {
437 /* Access screen info associated with dst pixmap */
438 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
439 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
440
441 /* Access driver specific data associated with the screen. */
442 IMXPtr imxPtr = IMXPTR(pScrn);
443 @@ -2143,7 +2145,7 @@ IMXEXADoneCopy(
444 PixmapPtr pPixmapDst)
445 {
446 /* Access screen info associated with this pixmap */
447 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
448 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
449
450 /* Access driver specific data associated with the screen. */
451 IMXPtr imxPtr = IMXPTR(pScrn);
452 @@ -2176,7 +2178,7 @@ IMXEXAUploadToScreen(
453 return FALSE;
454
455 /* Access screen info associated with this pixmap */
456 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
457 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
458
459 if (0 >= width || 0 >= height || 0 > dstX || 0 > dstY) {
460
461 @@ -2268,7 +2270,7 @@ IMXEXADownloadFromScreen(
462 return FALSE;
463
464 /* Access screen info associated with this pixmap */
465 - ScrnInfoPtr pScrn = xf86Screens[pPixmapSrc->drawable.pScreen->myNum];
466 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapSrc->drawable.pScreen);
467
468 if (0 >= width || 0 >= height || 0 > srcX || 0 > srcY) {
469
470 @@ -2352,7 +2354,7 @@ IMXEXAWaitMarker(
471 int marker)
472 {
473 /* Access screen info associated with this screen. */
474 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
475 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
476
477 /* Access driver specific data associated with the screen. */
478 IMXPtr imxPtr = IMXPTR(pScrn);
479 @@ -2411,7 +2413,7 @@ IMXEXACheckComposite(
480 return FALSE;
481
482 /* Access screen associated with dst pixmap. */
483 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
484 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
485
486 /* Access driver specific data associated with the screen. */
487 IMXPtr imxPtr = IMXPTR(pScrn);
488 @@ -2679,7 +2681,7 @@ IMXEXAPrepareComposite(
489 PixmapPtr pPixmapDst)
490 {
491 /* Access the screen associated with this pixmap. */
492 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
493 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
494
495 /* Access driver specific data associated with the screen. */
496 IMXPtr imxPtr = IMXPTR(pScrn);
497 @@ -2825,7 +2827,7 @@ IMXEXAComposite(
498 int height)
499 {
500 /* Access screen info associated with dst pixmap */
501 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
502 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
503
504 /* Access driver specific data associated with the screen. */
505 IMXPtr imxPtr = IMXPTR(pScrn);
506 @@ -2906,7 +2908,7 @@ IMXEXADoneComposite(
507 PixmapPtr pPixmapDst)
508 {
509 /* Access screen info associated with this pixmap */
510 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
511 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
512
513 /* Access driver specific data associated with the screen. */
514 IMXPtr imxPtr = IMXPTR(pScrn);
515 @@ -2949,7 +2951,7 @@ Bool
516 IMX_EXA_ScreenInit(int scrnIndex, ScreenPtr pScreen)
517 {
518 /* Access screen info associated with this screen. */
519 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
520 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
521
522 /* Access driver specific data associated with the screen. */
523 IMXPtr imxPtr = IMXPTR(pScrn);
524 @@ -3066,7 +3068,7 @@ Bool
525 IMX_EXA_CloseScreen(int scrnIndex, ScreenPtr pScreen)
526 {
527 /* Access screen info associated with this screen. */
528 - ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
529 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
530
531 /* Access driver specific data associated with the screen. */
532 IMXPtr imxPtr = IMXPTR(pScrn);
533 diff -pruN xorg-video-imxng.orig/src/imx_xv_c2d.c xorg-video-imxng/src/imx_xv_c2d.c
534 --- xorg-video-imxng.orig/src/imx_xv_c2d.c 2013-02-13 00:31:37.858284376 +0100
535 +++ xorg-video-imxng/src/imx_xv_c2d.c 2013-02-14 19:54:53.408267627 +0100
536 @@ -1169,7 +1169,7 @@ IMXXVInitAdaptorC2D(
537 imxxv_fill_surface(imxexaPtr->gpuContext, imxexaPtr->doubleSurf, 0U);
538
539 /* This early during driver init ScrnInfoPtr does not have a valid ScreenPtr yet. */
540 - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
541 + ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
542
543 XF86VideoAdaptorPtr *ppAdaptor = NULL;
544 const int nAdaptor = imxxv_init_adaptor(pScreen, pScrn, &ppAdaptor);