CRUX-ARM : Home

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