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
6 + * Copyright 2012 Red Hat, Inc.
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:
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
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.
27 + * Author: Dave Airlie <airlied@redhat.com>
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 */
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
40 +#ifndef XF86_HAS_SCRN_CONV
41 +#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
42 +#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
45 +#ifndef XF86_SCRN_INTERFACE
47 +#define SCRN_ARG_TYPE int
48 +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
50 +#define SCREEN_ARG_TYPE int
51 +#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
53 +#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
55 +#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
56 +#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
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];
62 +#define FBDEVHWADJUSTFRAME_ARGS(x, y) scrnIndex, (x), (y), 0
64 +#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
66 +#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
68 +#define FREE_SCREEN_ARGS_DECL int arg, int flags
69 +#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
71 +#define VT_FUNC_ARGS_DECL int arg, int flags
72 +#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
74 +#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn->scrnIndex, b
76 +#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
78 +#define SCRN_ARG_TYPE ScrnInfoPtr
79 +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
81 +#define SCREEN_ARG_TYPE ScreenPtr
82 +#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
84 +#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
86 +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
87 +#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
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];
93 +#define FBDEVHWADJUSTFRAME_ARGS(x, y) pScrn, (x), (y)
95 +#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
96 +#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
98 +#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
99 +#define FREE_SCREEN_ARGS(x) (x)
101 +#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
102 +#define VT_FUNC_ARGS(flags) pScrn
104 +#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn, b
106 +#define XF86_ENABLEDISABLEFB_ARG(x) (x)
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
115 #include "xf86_OSproc.h"
117 #include "mipointer.h"
118 -#include "mibstore.h"
120 #include "colormapst.h"
121 #include "xf86cmap.h"
126 +#include "compat-api.h"
128 static Bool debug = 0;
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);
141 /* for XV acceleration */
142 @@ -520,9 +521,9 @@ IMXPreInit(ScrnInfoPtr pScrn, int flags)
146 -IMXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
147 +IMXScreenInit(SCREEN_INIT_ARGS_DECL)
149 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
150 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
151 IMXPtr fPtr = IMXPTR(pScrn);
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);
159 if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) {
160 - xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"
162 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mapping of video memory"
167 fPtr->fboff = fbdevHWLinearOffset(pScrn);
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");
176 fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
177 - fbdevHWAdjustFrame(scrnIndex,0,0,0);
178 + fbdevHWAdjustFrame(pScrn, 0, 0);
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);
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);
200 if (!miSetPixmapDepths()) {
201 - xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
202 + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
206 @@ -587,7 +587,7 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
207 (pScrn->bitsPerPixel / 8);
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);
215 @@ -610,7 +610,7 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
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");
233 @@ -629,20 +629,20 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
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 "
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");
252 - xf86DrvMsg(scrnIndex, X_ERROR,
253 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
254 "internal error: unrecognised hardware type (%d) "
255 "encountered in IMXScreenInit()\n", type);
257 @@ -674,9 +674,9 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
258 xf86SetBlackWhitePixels(pScreen);
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)) {
264 - xf86DrvMsg(scrnIndex, X_ERROR,
265 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
266 "IMX EXA failed to initialize screen.\n");
269 @@ -696,7 +696,6 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
271 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IMX EXA acceleration setup failed - no acceleration in use\n");
273 - miInitializeBackingStore(pScreen);
274 xf86SetBackingStore(pScreen);
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");
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");
295 - xf86DrvMsg(scrnIndex, X_ERROR,
296 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
297 "internal error: text mode is not supported by "
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");
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);
312 @@ -762,13 +761,12 @@ IMXScreenInit(int scrnIndex, ScreenPtr p
316 -IMXCloseScreen(int scrnIndex, ScreenPtr pScreen)
317 +IMXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
319 - IMX_EXA_CloseScreen(scrnIndex, pScreen);
321 - ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
322 + CLOSE_SCREEN_DECL_ScrnInfoPtr;
323 IMXPtr fPtr = IMXPTR(pScrn);
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
333 - return (*pScreen->CloseScreen)(scrnIndex, pScreen);
334 + return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
338 @@ -796,7 +794,7 @@ IMXGetPixmapProperties(
341 /* Access screen associated with this pixmap. */
342 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
343 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
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
352 #include "imx_type.h"
354 +#include "compat-api.h"
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.
359 @@ -1204,7 +1206,7 @@ IMX_EXA_GetPixmapProperties(
362 /* Access screen info associated with this pixmap. */
363 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
364 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
366 /* Access driver specific data associated with the screen. */
367 IMXPtr imxPtr = IMXPTR(pScrn);
368 @@ -1236,7 +1238,7 @@ IMXEXACreatePixmap2(
371 /* Access screen info associated with this screen. */
372 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
373 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
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;
380 /* Access screen info associated with this screen. */
381 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
382 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
384 /* Access driver specific data associated with the screen. */
385 IMXPtr imxPtr = IMXPTR(pScrn);
386 @@ -1468,7 +1470,7 @@ IMXEXAModifyPixmapHeader(
389 /* Access screen info associated with this pixmap. */
390 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
391 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
393 /* Access driver specific data associated with the screen. */
394 IMXPtr imxPtr = IMXPTR(pScrn);
395 @@ -1688,7 +1690,7 @@ IMXEXAPrepareAccess(
398 /* Access screen info associated with this pixmap. */
399 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
400 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
402 /* Access driver specific data associated with the screen. */
403 IMXPtr imxPtr = IMXPTR(pScrn);
404 @@ -1759,7 +1761,7 @@ IMXEXAFinishAccess(
407 /* Access screen info associated with this pixmap. */
408 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
409 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
412 /* Access driver specific data associated with the screen. */
413 @@ -1802,7 +1804,7 @@ IMXEXAPrepareSolid(
416 /* Access screen info associated with this pixmap */
417 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
418 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
420 /* Access driver specific data associated with the screen. */
421 IMXPtr imxPtr = IMXPTR(pScrn);
422 @@ -1900,7 +1902,7 @@ IMXEXASolid(
425 /* Access screen info associated with this pixmap */
426 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
427 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
429 /* Access driver specific data associated with the screen. */
430 IMXPtr imxPtr = IMXPTR(pScrn);
431 @@ -1953,7 +1955,7 @@ IMXEXADoneSolid(
434 /* Access screen info associated with this pixmap */
435 - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
436 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
438 /* Access driver specific data associated with the screen. */
439 IMXPtr imxPtr = IMXPTR(pScrn);
440 @@ -1985,7 +1987,7 @@ IMXEXAPrepareCopy(
443 /* Access the screen associated with this pixmap. */
444 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
445 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
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)
452 /* Access screen info associated with dst pixmap */
453 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
454 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
456 /* Access driver specific data associated with the screen. */
457 IMXPtr imxPtr = IMXPTR(pScrn);
458 @@ -2143,7 +2145,7 @@ IMXEXADoneCopy(
459 PixmapPtr pPixmapDst)
461 /* Access screen info associated with this pixmap */
462 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
463 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
465 /* Access driver specific data associated with the screen. */
466 IMXPtr imxPtr = IMXPTR(pScrn);
467 @@ -2176,7 +2178,7 @@ IMXEXAUploadToScreen(
470 /* Access screen info associated with this pixmap */
471 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
472 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
474 if (0 >= width || 0 >= height || 0 > dstX || 0 > dstY) {
476 @@ -2268,7 +2270,7 @@ IMXEXADownloadFromScreen(
479 /* Access screen info associated with this pixmap */
480 - ScrnInfoPtr pScrn = xf86Screens[pPixmapSrc->drawable.pScreen->myNum];
481 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapSrc->drawable.pScreen);
483 if (0 >= width || 0 >= height || 0 > srcX || 0 > srcY) {
485 @@ -2352,7 +2354,7 @@ IMXEXAWaitMarker(
488 /* Access screen info associated with this screen. */
489 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
490 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
492 /* Access driver specific data associated with the screen. */
493 IMXPtr imxPtr = IMXPTR(pScrn);
494 @@ -2411,7 +2413,7 @@ IMXEXACheckComposite(
497 /* Access screen associated with dst pixmap. */
498 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
499 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
501 /* Access driver specific data associated with the screen. */
502 IMXPtr imxPtr = IMXPTR(pScrn);
503 @@ -2679,7 +2681,7 @@ IMXEXAPrepareComposite(
504 PixmapPtr pPixmapDst)
506 /* Access the screen associated with this pixmap. */
507 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
508 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
510 /* Access driver specific data associated with the screen. */
511 IMXPtr imxPtr = IMXPTR(pScrn);
512 @@ -2825,7 +2827,7 @@ IMXEXAComposite(
515 /* Access screen info associated with dst pixmap */
516 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
517 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
519 /* Access driver specific data associated with the screen. */
520 IMXPtr imxPtr = IMXPTR(pScrn);
521 @@ -2906,7 +2908,7 @@ IMXEXADoneComposite(
522 PixmapPtr pPixmapDst)
524 /* Access screen info associated with this pixmap */
525 - ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
526 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
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)
533 /* Access screen info associated with this screen. */
534 - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
535 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
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)
542 /* Access screen info associated with this screen. */
543 - ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
544 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
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);
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);
558 XF86VideoAdaptorPtr *ppAdaptor = NULL;
559 const int nAdaptor = imxxv_init_adaptor(pScreen, pScrn, &ppAdaptor);