summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/xorg-driver
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2015-07-15 17:14:27 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2015-07-16 15:01:29 -0300
commitf8517afc7a5ada4538b3b7d397fa32586d57ffe5 (patch)
tree79349f091306d1760fd4687e62336ffa8fb8c721 /recipes-graphics/xorg-driver
parentc92b415d653afc55f33b6b93fb9248193bfd4fa0 (diff)
downloadmeta-freescale-f8517afc7a5ada4538b3b7d397fa32586d57ffe5.tar.gz
Move meta-fsl-arm content to layer root
The meta-fsl-arm is going to be used as the base for this layer. It contains a clean history and allowing a more granullar set of changes. This commit is just a rename of all contents of meta-fsl-arm subdirectory to this layer's root, subsequent changes are based on top of that. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-graphics/xorg-driver')
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc79
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi42
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb8
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch33
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch787
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch65
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/glibc-2.20.patch57
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch53
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch34
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb48
10 files changed, 1206 insertions, 0 deletions
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc
new file mode 100644
index 00000000..684cdb4c
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc
@@ -0,0 +1,79 @@
1# Copyright (C) 2012-2015 Freescale Semiconductor
2# Copyright (C) 2012-2014 O.S. Systems Software LTDA.
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5require recipes-graphics/xorg-driver/xorg-driver-video.inc
6
7PE = "3"
8
9inherit autotools-brokensep update-rc.d pkgconfig
10
11DEPENDS += "virtual/xserver virtual/libx11 virtual/libgal-x11 imx-gpu-viv pixman"
12
13LIC_FILES_CHKSUM = "file://EXA/src/vivante_fbdev/vivante.h;endline=19;md5=95cf961a2ceacdf7cf43caef25766779"
14
15SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-viv-${PV}.tar.gz \
16 file://rc.autohdmi"
17
18INITSCRIPT_PACKAGES = "xserver-xorg-extension-viv-autohdmi"
19INITSCRIPT_NAME = "rc.autohdmi"
20INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
21
22EXTRA_OEMAKE += "-C ${S} -d -f Makefile prefix=${D}/usr \
23 sysroot=${STAGING_DIR_TARGET} \
24 BUSID_HAS_NUMBER=1 \
25 BUILD_IN_YOCTO=1 \
26 XSERVER_GREATER_THAN_13=1"
27
28CFLAGS += "-I${STAGING_INCDIR}/xorg \
29 -I${STAGING_INCDIR}/drm \
30 -I../../DRI_1.10.4/src"
31
32S = "${WORKDIR}/xserver-xorg-video-imx-viv-${PV}/"
33
34PACKAGES =+ "xserver-xorg-extension-viv-autohdmi"
35
36# FIXME: The Freescale provided Makefile has hardcodec include paths
37# and this does not work in case prefix is different than /usr,
38# sed it.
39do_configure_prepend () {
40 sed -i 's,$(sysroot)/usr/include,${STAGING_INCDIR},g' \
41 ${S}EXA/src/makefile.linux
42}
43
44# FIXME: This is need as Freescale didn't use standard Makefile filename
45# thus oe_runmame thinks nothing is need to be done, use ln to
46# workaround it.
47base_do_compile () {
48 oe_runmake || die "make failed"
49}
50
51do_install_append () {
52 install -d ${D}${includedir}
53 cp -axr ${S}/EXA/src/vivante_gal/vivante_priv.h ${D}${includedir}
54 cp -axr ${S}/EXA/src/vivante_gal/vivante_gal.h ${D}${includedir}
55
56 install -d ${D}/${sysconfdir}/init.d
57 install -m 755 ${WORKDIR}/rc.autohdmi ${D}/${sysconfdir}/init.d/rc.autohdmi
58
59 find ${D}${includedir} -type f -exec chmod 660 {} \;
60}
61
62RDEPENDS_${PN} += "libvivante-dri-mx6 \
63 xserver-xorg-module-exa \
64 mesa-driver-swrast \
65 xserver-xorg-extension-dri \
66 xserver-xorg-extension-dri2 \
67 xserver-xorg-extension-glx"
68
69REALSOLIBS := "${SOLIBS}"
70SOLIBS = "${SOLIBSDEV}"
71
72FILES_${PN} = "${libdir}/*/*/*/vivante_drv${SOLIBS}"
73FILES_${PN}-dev = "${includedir} /usr/src ${libdir}/libfsl_x11_ext${SOLIBSDEV}"
74FILES_${PN}-dbg = "${libdir}/*/*/*/.debug ${libdir}/.debug/libfsl_x11_ext${SOLIBS} ${exec_prefix}/bin/.debug/autohdmi"
75
76FILES_xserver-xorg-extension-viv-autohdmi = " ${libdir}/libfsl_x11_ext${SOLIBS} ${exec_prefix}/bin/autohdmi ${sysconfdir}/init.d/rc.autohdmi"
77
78PACKAGE_ARCH = "${MACHINE_SOCARCH}"
79COMPATIBLE_MACHINE = "(mx6)"
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi
new file mode 100644
index 00000000..8c16a1d7
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi
@@ -0,0 +1,42 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: rc.autohdmi
4# Required-Start: $all
5# Required-Stop:
6# Default-Start: 2 3 4 5
7# Default-Stop:
8### END INIT INFO
9
10PATH=/sbin:/usr/sbin:/bin:/usr/bin
11
12# Source function library.
13. /etc/init.d/functions
14
15case "$1" in
16 start)
17 echo -n "Starting autohdmi: "
18 export DISPLAY=:0
19 autohdmi &
20 echo
21 exit 0
22 ;;
23 reload|force-reload)
24 echo "Error: argument '$1' not supported" >&2
25 exit 3
26 ;;
27 stop)
28 echo -n "Shutting down autohdmi: "
29 killproc autohdmi
30 echo
31 ;;
32 restart)
33 echo -n "Restarting autohdmi: "
34 $0 stop
35 $0 start
36 echo
37 ;;
38 *)
39 echo "Usage: $0 start|stop" >&2
40 exit 3
41 ;;
42esac
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb
new file mode 100644
index 00000000..c5cf2715
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb
@@ -0,0 +1,8 @@
1# Copyright (C) 2012-2015 Freescale Semiconductor
2# Copyright (C) 2012-2014 O.S. Systems Software LTDA.
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5require xf86-video-imxfb-vivante.inc
6
7SRC_URI[md5sum] = "e89cd72f6d35d53accfd6b6bb3e05f42"
8SRC_URI[sha256sum] = "1a0b25a91b493e99dfa94a802290320ea998ebd45d7aab0f73d7c7bb521b7e84"
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch
new file mode 100644
index 00000000..6a2fcdf4
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch
@@ -0,0 +1,33 @@
1From ccdfce5e75ba707deacdd5808a8f3de8744848d0 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
3Date: Tue, 5 Feb 2013 10:57:47 +0100
4Subject: [PATCH] Fix "error: unknown type name 'uint'"
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9In file included from imx_driver.c:33:0:
10.../sysroots/imx53qsb/usr/src/kernel/include/linux/mxcfb.h:107:2: error: unknown type name 'uint'
11
12Upstream-Status: Pending
13
14Signed-off-by: Eric Bénard <eric@eukrea.com>
15---
16 src/imx_driver.c | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/src/imx_driver.c b/src/imx_driver.c
20index f4b3e38..4cf662d 100644
21--- a/src/imx_driver.c
22+++ b/src/imx_driver.c
23@@ -29,6 +29,7 @@
24 #include <errno.h>
25 #include <fcntl.h>
26 #include <string.h>
27+#include <sys/types.h>
28 #include <linux/fb.h>
29 #include <linux/mxcfb.h>
30
31--
321.7.10.4
33
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch
new file mode 100644
index 00000000..2ac6311f
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch
@@ -0,0 +1,787 @@
1From 5216cb0f14414b5451f58df48a36c1c62c035276 Mon Sep 17 00:00:00 2001
2From: Otavio Salvador <otavio@ossystems.com.br>
3Date: Sat, 29 Dec 2012 18:02:11 -0200
4Subject: [PATCH] Make video API forward and backward compatible
5
6This updates the video API in a forward and backward compatible way
7using the "compat-api.h" as used in Xorg maintained drivers.
8
9Upstream-Status: Pending
10
11Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
12---
13 src/compat-api.h | 106 +++++++++++++++++++++++++++++++++++++++++++++++
14 src/imx_display.c | 22 +++++-----
15 src/imx_display.h | 8 ++--
16 src/imx_driver.c | 60 ++++++++++++++-------------
17 src/imx_exa_offscreen.c | 12 +++---
18 src/imx_exa_z160.c | 53 ++++++++++++------------
19 src/imx_xv_ipu.c | 4 +-
20 7 files changed, 188 insertions(+), 77 deletions(-)
21 create mode 100644 src/compat-api.h
22
23diff --git a/src/compat-api.h b/src/compat-api.h
24new file mode 100644
25index 0000000..73ac8a2
26--- /dev/null
27+++ b/src/compat-api.h
28@@ -0,0 +1,106 @@
29+/*
30+ * Copyright 2012 Red Hat, Inc.
31+ *
32+ * Permission is hereby granted, free of charge, to any person obtaining a
33+ * copy of this software and associated documentation files (the "Software"),
34+ * to deal in the Software without restriction, including without limitation
35+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
36+ * and/or sell copies of the Software, and to permit persons to whom the
37+ * Software is furnished to do so, subject to the following conditions:
38+ *
39+ * The above copyright notice and this permission notice (including the next
40+ * paragraph) shall be included in all copies or substantial portions of the
41+ * Software.
42+ *
43+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
46+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
48+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
49+ * DEALINGS IN THE SOFTWARE.
50+ *
51+ * Author: Dave Airlie <airlied@redhat.com>
52+ */
53+
54+/* this file provides API compat between server post 1.13 and pre it,
55+ it should be reused inside as many drivers as possible */
56+#ifndef COMPAT_API_H
57+#define COMPAT_API_H
58+
59+#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
60+#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
61+#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
62+#endif
63+
64+#ifndef XF86_HAS_SCRN_CONV
65+#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
66+#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
67+#endif
68+
69+#ifndef XF86_SCRN_INTERFACE
70+
71+#define SCRN_ARG_TYPE int
72+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
73+
74+#define SCREEN_ARG_TYPE int
75+#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
76+
77+#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
78+
79+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
80+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
81+
82+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
83+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
84+#define CLOSE_SCREEN_DECL_ScrnInfoPtr ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
85+
86+#define FBDEVHWADJUSTFRAME_ARGS(x, y) scrnIndex, (x), (y), 0
87+
88+#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
89+
90+#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
91+
92+#define FREE_SCREEN_ARGS_DECL int arg, int flags
93+#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
94+
95+#define VT_FUNC_ARGS_DECL int arg, int flags
96+#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
97+
98+#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn->scrnIndex, b
99+
100+#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
101+#else
102+#define SCRN_ARG_TYPE ScrnInfoPtr
103+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
104+
105+#define SCREEN_ARG_TYPE ScreenPtr
106+#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
107+
108+#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
109+
110+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
111+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
112+
113+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
114+#define CLOSE_SCREEN_ARGS pScreen
115+#define CLOSE_SCREEN_DECL_ScrnInfoPtr ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
116+
117+#define FBDEVHWADJUSTFRAME_ARGS(x, y) pScrn, (x), (y)
118+
119+#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
120+#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
121+
122+#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
123+#define FREE_SCREEN_ARGS(x) (x)
124+
125+#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
126+#define VT_FUNC_ARGS(flags) pScrn
127+
128+#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn, b
129+
130+#define XF86_ENABLEDISABLEFB_ARG(x) (x)
131+
132+#endif
133+
134+#endif
135diff --git a/src/imx_display.c b/src/imx_display.c
136index fcb8195..e2dc36a 100644
137--- a/src/imx_display.c
138+++ b/src/imx_display.c
139@@ -42,6 +42,8 @@
140 #include "imx.h"
141 #include "imx_display.h"
142
143+#include "compat-api.h"
144+
145 #include <X11/Xatom.h>
146
147 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,6,0,0)
148@@ -1373,19 +1375,19 @@ imxDisplayPreInit(ScrnInfoPtr pScrn)
149 Bool
150 imxDisplayStartScreenInit(int scrnIndex, ScreenPtr pScreen)
151 {
152- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
153+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
154 ImxPtr fPtr = IMXPTR(pScrn);
155
156 if (!xf86SetDesiredModes(pScrn)) {
157
158- xf86DrvMsg(scrnIndex, X_ERROR, "mode initialization failed\n");
159+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mode initialization failed\n");
160 return FALSE;
161 }
162
163 #if 0
164 if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
165
166- xf86DrvMsg(scrnIndex, X_ERROR, "mode initialization failed\n");
167+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mode initialization failed\n");
168 return FALSE;
169 }
170 pScrn->displayWidth =
171@@ -1463,29 +1465,29 @@ imxDisplayFinishScreenInit(int scrnIndex, ScreenPtr pScreen)
172 /* -------------------------------------------------------------------- */
173
174 Bool
175-imxDisplaySwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
176+imxDisplaySwitchMode(SWITCH_MODE_ARGS_DECL)
177 {
178- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
179+ SCRN_INFO_PTR(arg);
180
181 return xf86SetSingleMode(pScrn, mode, RR_Rotate_0);
182 }
183
184 void
185-imxDisplayAdjustFrame(int scrnIndex, int x, int y, int flags)
186+imxDisplayAdjustFrame(ADJUST_FRAME_ARGS_DECL)
187 {
188-// fbdevHWAdjustFrame(scrnIndex, x, y, flags);
189+// fbdevHWAdjustFrame(pScrn->scrnIndex, x, y, flags);
190 }
191
192 Bool
193-imxDisplayEnterVT(int scrnIndex, int flags)
194+imxDisplayEnterVT(VT_FUNC_ARGS_DECL)
195 {
196- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
197+ SCRN_INFO_PTR(arg);
198
199 return xf86SetDesiredModes(pScrn);
200 }
201
202 void
203-imxDisplayLeaveVT(int scrnIndex, int flags)
204+imxDisplayLeaveVT(VT_FUNC_ARGS_DECL)
205 {
206 }
207
208diff --git a/src/imx_display.h b/src/imx_display.h
209index 4a5d5aa..3a3d43a 100644
210--- a/src/imx_display.h
211+++ b/src/imx_display.h
212@@ -59,16 +59,16 @@ imxDisplayValidMode(int scrnIndex, DisplayModePtr mode,
213 Bool verbose, int flags);
214
215 extern Bool
216-imxDisplaySwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
217+imxDisplaySwitchMode(SWITCH_MODE_ARGS_DECL);
218
219 extern void
220-imxDisplayAdjustFrame(int scrnIndex, int x, int y, int flags);
221+imxDisplayAdjustFrame(ADJUST_FRAME_ARGS_DECL);
222
223 extern Bool
224-imxDisplayEnterVT(int scrnIndex, int flags);
225+imxDisplayEnterVT(VT_FUNC_ARGS_DECL);
226
227 extern void
228-imxDisplayLeaveVT(int scrnIndex, int flags);
229+imxDisplayLeaveVT(VT_FUNC_ARGS_DECL);
230
231 extern Bool
232 imxDisplayChangeFrameBufferRotateEPDC(int scrnIndex, int fbRotate);
233diff --git a/src/imx_driver.c b/src/imx_driver.c
234index 178e36e..f4b3e38 100644
235--- a/src/imx_driver.c
236+++ b/src/imx_driver.c
237@@ -46,6 +46,8 @@
238 #include "fb.h"
239 #include "fbdevhw.h"
240
241+#include "compat-api.h"
242+
243 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
244 #include "xf86Resources.h"
245 #include "xf86RAC.h"
246@@ -435,17 +437,17 @@ errorPreInit:
247 }
248
249 static void
250-imxFreeScreen(int scrnIndex, int flags)
251+imxFreeScreen(FREE_SCREEN_ARGS_DECL)
252 {
253- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
254+ SCRN_INFO_PTR(arg);
255
256 imxFreeRec(pScrn);
257 }
258
259 static Bool
260-imxCloseScreen(int scrnIndex, ScreenPtr pScreen)
261+imxCloseScreen(CLOSE_SCREEN_ARGS_DECL)
262 {
263- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
264+ CLOSE_SCREEN_DECL_ScrnInfoPtr;
265 ImxPtr fPtr = IMXPTR(pScrn);
266
267 fbdevHWRestore(pScrn);
268@@ -453,7 +455,7 @@ imxCloseScreen(int scrnIndex, ScreenPtr pScreen)
269 pScrn->vtSema = FALSE;
270
271 pScreen->CloseScreen = fPtr->saveCloseScreen;
272- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
273+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
274 }
275
276 static int
277@@ -488,9 +490,9 @@ LCM(a, b)
278 }
279
280 static Bool
281-imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
282+imxScreenInit(SCREEN_INIT_ARGS_DECL)
283 {
284- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
285+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
286 ImxPtr fPtr = IMXPTR(pScrn);
287 VisualPtr visual;
288 int init_picture = 0;
289@@ -514,7 +516,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
290 /* Map frame buffer memory */
291 fPtr->fbMemoryBase = fbdevHWMapVidmem(pScrn);
292 if (NULL == fPtr->fbMemoryBase) {
293- xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"
294+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mapping of video memory"
295 " failed\n");
296 return FALSE;
297 }
298@@ -558,7 +560,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
299 const int fbOffsetScreen2 =
300 IMX_ALIGN(fbMaxScreenSize, fbMaxAlignOffset);
301 fPtr->fbMemoryScreenReserve = fbMaxScreenSize;
302- xf86DrvMsg(scrnIndex, X_INFO,
303+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
304 "reserve %d bytes of frame buffer for screen\n",
305 fPtr->fbMemoryScreenReserve);
306 fPtr->fbMemoryStart2 = NULL;
307@@ -568,12 +570,12 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
308
309 fPtr->fbMemoryScreenReserve += fbOffsetScreen2;
310
311- xf86DrvMsg(scrnIndex, X_INFO,
312+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
313 "reserve same number of bytes for XRandR rotated screen at offset %d\n",
314 fbOffsetScreen2);
315 }
316
317- if (!imxDisplayStartScreenInit(scrnIndex, pScreen)) {
318+ if (!imxDisplayStartScreenInit(pScrn->scrnIndex, pScreen)) {
319
320 return FALSE;
321 }
322@@ -582,7 +584,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
323 miClearVisualTypes();
324 if (pScrn->bitsPerPixel > 8) {
325 if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
326- xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
327+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
328 " for %d bits per pixel [1]\n",
329 pScrn->bitsPerPixel);
330 return FALSE;
331@@ -591,14 +593,14 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
332 if (!miSetVisualTypes(pScrn->depth,
333 miGetDefaultVisualMask(pScrn->depth),
334 pScrn->rgbBits, pScrn->defaultVisual)) {
335- xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
336+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
337 " for %d bits per pixel [2]\n",
338 pScrn->bitsPerPixel);
339 return FALSE;
340 }
341 }
342 if (!miSetPixmapDepths()) {
343- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
344+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
345 return FALSE;
346 }
347
348@@ -607,10 +609,10 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
349 has a padding which is independent from the depth (controlfb) */
350 pScrn->displayWidth = fbdevHWGetLineLength(pScrn) /
351 (pScrn->bitsPerPixel / 8);
352- xf86DrvMsg(scrnIndex, X_INFO, "displayWidth = %d\n", pScrn->displayWidth);
353+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "displayWidth = %d\n", pScrn->displayWidth);
354
355 if (pScrn->displayWidth != pScrn->virtualX) {
356- xf86DrvMsg(scrnIndex, X_INFO,
357+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
358 "Pitch updated to %d after ModeInit\n",
359 pScrn->displayWidth);
360 }
361@@ -633,7 +635,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
362 init_picture = 1;
363 break;
364 default:
365- xf86DrvMsg(scrnIndex, X_ERROR,
366+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
367 "internal error: invalid number of bits per"
368 " pixel (%d) encountered in"
369 " imxScreenInit()\n", pScrn->bitsPerPixel);
370@@ -644,7 +646,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
371 case FBDEVHW_INTERLEAVED_PLANES:
372 /* This should never happen ...
373 * we should check for this much much earlier ... */
374- xf86DrvMsg(scrnIndex, X_ERROR,
375+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
376 "internal error: interleaved planes are not yet "
377 "supported by the imx driver\n");
378 ret = FALSE;
379@@ -652,20 +654,20 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
380 case FBDEVHW_TEXT:
381 /* This should never happen ...
382 * we should check for this much much earlier ... */
383- xf86DrvMsg(scrnIndex, X_ERROR,
384+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
385 "internal error: text mode is not supported by the "
386 "imx driver\n");
387 ret = FALSE;
388 break;
389 case FBDEVHW_VGA_PLANES:
390 /* Not supported yet */
391- xf86DrvMsg(scrnIndex, X_ERROR,
392+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
393 "internal error: EGA/VGA Planes are not yet "
394 "supported by the imx driver\n");
395 ret = FALSE;
396 break;
397 default:
398- xf86DrvMsg(scrnIndex, X_ERROR,
399+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
400 "internal error: unrecognised hardware type (%d) "
401 "encountered in imxScreenInit()\n", type);
402 ret = FALSE;
403@@ -699,7 +701,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
404 /* INIT ACCELERATION BEFORE INIT FOR BACKING STORE & SOFTWARE CURSOR */
405 if (fPtr->useAccel) {
406
407- if (!imxExaZ160Setup(scrnIndex, pScreen)) {
408+ if (!imxExaZ160Setup(pScrn->scrnIndex, pScreen)) {
409
410 fPtr->useAccel = FALSE;
411 }
412@@ -731,29 +733,29 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
413 /* XXX It would be simpler to use miCreateDefColormap() in all cases. */
414 case FBDEVHW_PACKED_PIXELS:
415 if (!miCreateDefColormap(pScreen)) {
416- xf86DrvMsg(scrnIndex, X_ERROR,
417+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
418 "internal error: miCreateDefColormap failed "
419 "in imxScreenInit()\n");
420 return FALSE;
421 }
422 break;
423 case FBDEVHW_INTERLEAVED_PLANES:
424- xf86DrvMsg(scrnIndex, X_ERROR,
425+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
426 "internal error: interleaved planes are not yet "
427 "supported by the imx driver\n");
428 return FALSE;
429 case FBDEVHW_TEXT:
430- xf86DrvMsg(scrnIndex, X_ERROR,
431+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
432 "internal error: text mode is not supported by "
433 "the imx driver\n");
434 return FALSE;
435 case FBDEVHW_VGA_PLANES:
436- xf86DrvMsg(scrnIndex, X_ERROR,
437+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
438 "internal error: EGA/VGA planes are not yet "
439 "supported by the imx driver\n");
440 return FALSE;
441 default:
442- xf86DrvMsg(scrnIndex, X_ERROR,
443+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
444 "internal error: unrecognised imx hardware type "
445 "(%d) encountered in imxScreenInit()\n", type);
446 return FALSE;
447@@ -782,7 +784,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
448 }
449 #endif
450
451- if (!imxDisplayFinishScreenInit(scrnIndex, pScreen)) {
452+ if (!imxDisplayFinishScreenInit(pScrn->scrnIndex, pScreen)) {
453 return FALSE;
454 }
455
456@@ -810,7 +812,7 @@ IMXGetPixmapProperties(
457 }
458
459 /* Access screen associated with this pixmap. */
460- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
461+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
462
463 /* Check if the screen associated with this pixmap has IMX driver. */
464 if (0 != strcmp(IMX_DRIVER_NAME, pScrn->driverName)) {
465diff --git a/src/imx_exa_offscreen.c b/src/imx_exa_offscreen.c
466index 3a5c24d..0fbe2fc 100644
467--- a/src/imx_exa_offscreen.c
468+++ b/src/imx_exa_offscreen.c
469@@ -79,7 +79,7 @@ static void
470 imxExaOffscreenValidate (ScreenPtr pScreen)
471 {
472 /* Access the driver specific data. */
473- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
474+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
475 ImxPtr imxPtr = IMXPTR(pScrn);
476 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
477 ExaOffscreenArea *prev = 0, *area;
478@@ -135,7 +135,7 @@ imxExaOffscreenMerge (ImxExaPtr imxExaPtr, ExaOffscreenArea *area)
479 ExaOffscreenArea *
480 imxExaOffscreenFree (ScreenPtr pScreen, ExaOffscreenArea *area)
481 {
482- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
483+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
484 ImxPtr imxPtr = IMXPTR(pScrn);
485 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
486 ExaOffscreenArea *next = area->next;
487@@ -281,7 +281,7 @@ imxExaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
488 pointer privData)
489 {
490 ExaOffscreenArea *area;
491- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
492+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
493 ImxPtr imxPtr = IMXPTR(pScrn);
494 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
495 int real_size = 0, largest_avail = 0;
496@@ -418,7 +418,7 @@ imxExaOffscreenSwapIn (ScreenPtr pScreen)
497 Bool
498 imxExaOffscreenInit (ScreenPtr pScreen)
499 {
500- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
501+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
502 ImxPtr imxPtr = IMXPTR(pScrn);
503 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
504 ExaOffscreenArea *area;
505@@ -453,7 +453,7 @@ imxExaOffscreenInit (ScreenPtr pScreen)
506 void
507 imxExaOffscreenFini (ScreenPtr pScreen)
508 {
509- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
510+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
511 ImxPtr imxPtr = IMXPTR(pScrn);
512 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
513 ExaOffscreenArea *area;
514@@ -472,7 +472,7 @@ imxExaOffscreenFini (ScreenPtr pScreen)
515 void
516 imxExaOffscreenSwapOut (ScreenPtr pScreen)
517 {
518- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
519+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
520 ImxPtr imxPtr = IMXPTR(pScrn);
521 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
522
523diff --git a/src/imx_exa_z160.c b/src/imx_exa_z160.c
524index fb718e0..3d0bc96 100644
525--- a/src/imx_exa_z160.c
526+++ b/src/imx_exa_z160.c
527@@ -32,6 +32,7 @@
528 #include <errno.h>
529 #include <fcntl.h>
530
531+#include "compat-api.h"
532
533 /* Set if handles pixmap allocation and migration, i.e, EXA_HANDLES_PIXMAPS */
534 #define IMX_EXA_ENABLE_HANDLES_PIXMAPS \
535@@ -299,7 +300,7 @@ imxExaZ160GetPixmapAddress(PixmapPtr pPixmap)
536 return fPixmapPtr->ptr;
537 #else
538 /* Access screen associated with this pixmap. */
539- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
540+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
541
542 /* Access driver specific data */
543 ImxPtr imxPtr = IMXPTR(pScrn);
544@@ -344,7 +345,7 @@ imxExaZ160GetPixmapProperties(
545 #else
546
547 /* Access screen associated with this pixmap. */
548- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
549+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
550
551 /* Make sure pixmap is in framebuffer */
552 if (!exaDrawableIsOffscreen(&(pPixmap->drawable))) {
553@@ -856,7 +857,7 @@ imxExaZ160SyncIfBusyPixmap(PixmapPtr pPixmap)
554 {
555 /* Access screen associated with this pixmap. */
556 ScreenPtr pScreen = pPixmap->drawable.pScreen;
557- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
558+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
559
560 /* Access driver specific data for screen. */
561 ImxPtr imxPtr = IMXPTR(pScrn);
562@@ -924,7 +925,7 @@ imxExaZ160CreatePixmap2(ScreenPtr pScreen, int width, int height,
563 }
564
565 /* Access the driver specific data. */
566- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
567+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
568 ImxPtr imxPtr = IMXPTR(pScrn);
569 ImxExaZ160Ptr fPtr = IMXEXAZ160PTR(imxPtr);
570
571@@ -1028,7 +1029,7 @@ imxExaZ160DestroyPixmap(ScreenPtr pScreen, void *driverPriv)
572 ImxExaPixmapPtr fPixmapPtr = (ImxExaPixmapPtr)driverPriv;
573
574 /* Access the driver specific data. */
575- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
576+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
577 ImxPtr imxPtr = IMXPTR(pScrn);
578 ImxExaZ160Ptr fPtr = IMXEXAZ160PTR(imxPtr);
579
580@@ -1068,7 +1069,7 @@ imxExaZ160ModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
581 }
582
583 /* Access screen associated with this pixmap */
584- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
585+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
586
587 /* Access driver specific data */
588 ImxPtr imxPtr = IMXPTR(pScrn);
589@@ -1194,7 +1195,7 @@ imxExaZ160TrackBusyPixmap(ImxExaZ160Ptr fPtr, PixmapPtr pPixmap)
590 static void
591 imxExaZ160WaitMarker(ScreenPtr pScreen, int marker)
592 {
593- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
594+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
595
596 /* Access driver specific data associated with the screen. */
597 ImxPtr imxPtr = IMXPTR(pScrn);
598@@ -1249,7 +1250,7 @@ imxExaZ160PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
599 }
600
601 /* Access screen associated with this pixmap */
602- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
603+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
604
605 /* Access driver specific data */
606 ImxPtr imxPtr = IMXPTR(pScrn);
607@@ -1352,7 +1353,7 @@ static void
608 imxExaZ160Solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
609 {
610 /* Access screen associated with this pixmap */
611- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
612+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
613
614 /* Access driver specific data */
615 ImxPtr imxPtr = IMXPTR(pScrn);
616@@ -1423,7 +1424,7 @@ static void
617 imxExaZ160DoneSolid(PixmapPtr pPixmap)
618 {
619 /* Access screen associated with this pixmap */
620- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
621+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
622
623 /* Access driver specific data */
624 ImxPtr imxPtr = IMXPTR(pScrn);
625@@ -1485,7 +1486,7 @@ imxExaZ160PrepareCopy(
626 }
627
628 /* Access the screen associated with this pixmap. */
629- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
630+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
631
632 /* Access driver specific data */
633 ImxPtr imxPtr = IMXPTR(pScrn);
634@@ -1599,7 +1600,7 @@ static void
635 imxExaZ160Copy(PixmapPtr pPixmapDst, int srcX, int srcY, int dstX, int dstY, int width, int height)
636 {
637 /* Access screen associated with dst pixmap */
638- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
639+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
640
641 /* Access driver specific data */
642 ImxPtr imxPtr = IMXPTR(pScrn);
643@@ -1661,7 +1662,7 @@ static void
644 imxExaZ160DoneCopy(PixmapPtr pPixmapDst)
645 {
646 /* Access screen associated with this pixmap */
647- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
648+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
649
650 /* Access driver specific data */
651 ImxPtr imxPtr = IMXPTR(pScrn);
652@@ -1770,7 +1771,7 @@ imxExaZ160CheckComposite(int op, PicturePtr pPictureSrc, PicturePtr pPictureMask
653 }
654
655 /* Access screen associated with dst pixmap (same screen as for src pixmap). */
656- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
657+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
658
659 /* Check the number of entities, and fail if it isn't one. */
660 if (pScrn->numEntities != 1) {
661@@ -1987,7 +1988,7 @@ imxExaZ160PrepareComposite(
662 {
663 /* Access screen associated with dst pixmap. */
664 /* Should be same screen as for src pixmap. */
665- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
666+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
667
668 /* NOTE - many preconditions already verified in CheckComposite. */
669
670@@ -2196,7 +2197,7 @@ imxExaZ160Composite(
671 int height)
672 {
673 /* Access screen associated with dst pixmap */
674- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
675+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
676
677 /* Access driver specific data */
678 ImxPtr imxPtr = IMXPTR(pScrn);
679@@ -2275,7 +2276,7 @@ static void
680 imxExaZ160DoneComposite(PixmapPtr pPixmapDst)
681 {
682 /* Access screen associated with this pixmap */
683- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
684+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
685
686 /* Access driver specific data */
687 ImxPtr imxPtr = IMXPTR(pScrn);
688@@ -2323,7 +2324,7 @@ imxExaZ160UploadToScreen(
689
690 /* Access screen associated with this pixmap */
691 ScreenPtr pScreen = pPixmapDst->drawable.pScreen;
692- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
693+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
694
695 /* Access driver specific data */
696 ImxPtr imxPtr = IMXPTR(pScrn);
697@@ -2381,7 +2382,7 @@ imxExaZ160DownloadFromScreen(
698
699 /* Access screen associated with this pixmap */
700 ScreenPtr pScreen = pPixmapSrc->drawable.pScreen;
701- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
702+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
703
704 /* Access driver specific data */
705 ImxPtr imxPtr = IMXPTR(pScrn);
706@@ -2412,9 +2413,9 @@ imxExaZ160DownloadFromScreen(
707 }
708
709 Bool
710-imxExaZ160CloseScreen(int scrnIndex, ScreenPtr pScreen)
711+imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS_DECL)
712 {
713- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
714+ CLOSE_SCREEN_DECL_ScrnInfoPtr;
715 ImxPtr imxPtr = IMXPTR(pScrn);
716
717 ImxExaZ160Ptr fPtr = IMXEXAZ160PTR(imxPtr);
718@@ -2504,7 +2505,7 @@ imxExaZ160CloseScreen(int scrnIndex, ScreenPtr pScreen)
719 /* Install our CloseScreen function so that it gets called. */
720 if (NULL != pScreen->CloseScreen) {
721
722- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
723+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
724 }
725
726 return TRUE;
727@@ -2514,7 +2515,7 @@ Bool
728 imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
729 {
730 /* Access the screen info and then private data structures. */
731- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
732+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
733 ImxPtr imxPtr = IMXPTR(pScrn);
734
735 /* Private data structure must not already be in use. */
736@@ -2582,7 +2583,7 @@ imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
737
738 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
739 "Initialize Z160 interfaces failed.\n");
740- imxExaZ160CloseScreen(scrnIndex, pScreen);
741+ imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS);
742 return FALSE;
743 }
744
745@@ -2592,7 +2593,7 @@ imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
746
747 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
748 "Allocate EXA driver structure.\n");
749- imxExaZ160CloseScreen(scrnIndex, pScreen);
750+ imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS);
751 return FALSE;
752 }
753
754@@ -2657,7 +2658,7 @@ imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
755 if (!exaDriverInit(pScreen, exaDriverPtr)) {
756
757 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "EXA initialization failed.\n");
758- imxExaZ160CloseScreen(scrnIndex, pScreen);
759+ imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS);
760 return FALSE;
761 }
762 fPtr->imxExaRec.exaDriverPtr = exaDriverPtr;
763diff --git a/src/imx_xv_ipu.c b/src/imx_xv_ipu.c
764index a517742..fc8a827 100644
765--- a/src/imx_xv_ipu.c
766+++ b/src/imx_xv_ipu.c
767@@ -398,7 +398,7 @@ xf86XVFillKeyHelper1 (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
768 xRectangle *rects;
769 GCPtr gc;
770
771- if(!xf86Screens[pScreen->myNum]->vtSema) return;
772+ if(!xf86ScreenToScrn(pScreen)->vtSema) return;
773
774 gc = GetScratchGC(root->depth, pScreen);
775 pval[0] = key;
776@@ -771,7 +771,7 @@ MXXVInitializeAdaptor
777 XF86VideoAdaptorPtr **pppAdaptor
778 )
779 {
780- ScreenPtr pScreen = screenInfo.screens[pScreenInfo->scrnIndex];
781+ ScreenPtr pScreen = xf86ScrnToScreen(pScreenInfo);
782 XF86VideoAdaptorPtr *ppAdaptor = NULL;
783 IMXPtr fPtr = IMXPTR(pScreenInfo);
784 int nAdaptor;
785--
7861.7.10.4
787
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch
new file mode 100644
index 00000000..05be6b32
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch
@@ -0,0 +1,65 @@
1From fc7f191a1a0f290a4e808dd8f9bd58ba1dbd2be4 Mon Sep 17 00:00:00 2001
2From: Otavio Salvador <otavio@ossystems.com.br>
3Date: Sat, 29 Dec 2012 18:00:36 -0200
4Subject: [PATCH 1/2] ext: Update to newer swap macros
5
6The swap macros now use an internal temporary variable so we need to
7adapt the code according.
8
9Upstream-Status: Pending
10
11Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
12---
13 src/imx_ext.c | 16 ++++++----------
14 1 file changed, 6 insertions(+), 10 deletions(-)
15
16diff --git a/src/imx_ext.c b/src/imx_ext.c
17index f12469a..710cba4 100644
18--- a/src/imx_ext.c
19+++ b/src/imx_ext.c
20@@ -57,8 +57,6 @@ void imxExtInit()
21 static int
22 Proc_IMX_EXT_GetPixmapPhysAddr(ClientPtr client)
23 {
24- int n;
25-
26 REQUEST(xIMX_EXT_GetPixmapPhysAddrReq);
27 REQUEST_SIZE_MATCH(xIMX_EXT_GetPixmapPhysAddrReq);
28
29@@ -96,10 +94,10 @@ Proc_IMX_EXT_GetPixmapPhysAddr(ClientPtr client)
30 /* Check if any reply values need byte swapping */
31 if (client->swapped) {
32
33- swaps(&rep.sequenceNumber, n);
34- swapl(&rep.length, n);
35- swapl(&rep.pixmapPhysAddr, n);
36- swapl(&rep.pixmapPitch, n);
37+ swaps(&rep.sequenceNumber);
38+ swapl(&rep.length);
39+ swapl(&rep.pixmapPhysAddr);
40+ swapl(&rep.pixmapPitch);
41 }
42
43 /* Reply to client */
44@@ -123,16 +121,14 @@ Proc_IMX_EXT_Dispatch(ClientPtr client)
45 static int
46 SProc_IMX_EXT_GetPixmapPhysAddr(ClientPtr client)
47 {
48- int n;
49-
50 REQUEST(xIMX_EXT_GetPixmapPhysAddrReq);
51
52 /* Swap request message length and verify it is correct. */
53- swaps(&stuff->length, n);
54+ swaps(&stuff->length);
55 REQUEST_SIZE_MATCH(xIMX_EXT_GetPixmapPhysAddrReq);
56
57 /* Swap remaining request message parameters. */
58- swapl(&stuff->pixmap, n);
59+ swapl(&stuff->pixmap);
60
61 return Proc_IMX_EXT_GetPixmapPhysAddr(client);
62 }
63--
641.7.10.4
65
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/glibc-2.20.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/glibc-2.20.patch
new file mode 100644
index 00000000..3b1b84d1
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/glibc-2.20.patch
@@ -0,0 +1,57 @@
1Fix build errors seen with glibc 2.20
2
3/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/imx53qsb/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
4 strndup(const char *str, size_t n);
5 ^
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8Upstream-Status: Pending
9Index: xserver-xorg-video-imx-11.09.01/src/imx_accel.c
10===================================================================
11--- xserver-xorg-video-imx-11.09.01.orig/src/imx_accel.c 2011-07-26 14:22:47.000000000 -0700
12+++ xserver-xorg-video-imx-11.09.01/src/imx_accel.c 2014-08-29 15:54:43.648070587 -0700
13@@ -21,6 +21,7 @@
14 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15 * SOFTWARE.
16 */
17+#include <xorg-server.h>
18
19 #include <stdint.h>
20 #include "xf86.h"
21Index: xserver-xorg-video-imx-11.09.01/src/imx_exa_offscreen.c
22===================================================================
23--- xserver-xorg-video-imx-11.09.01.orig/src/imx_exa_offscreen.c 2014-08-29 15:26:31.992070587 -0700
24+++ xserver-xorg-video-imx-11.09.01/src/imx_exa_offscreen.c 2014-08-29 15:54:54.632070587 -0700
25@@ -53,7 +53,7 @@
26 * When allocating, the contiguous block of areas with the minimum eviction
27 * cost is found and evicted in order to make room for the new allocation.
28 */
29-
30+#include <xorg-server.h>
31
32 #include "xf86.h"
33 #include "exa.h"
34Index: xserver-xorg-video-imx-11.09.01/src/imx_exa_z160.c
35===================================================================
36--- xserver-xorg-video-imx-11.09.01.orig/src/imx_exa_z160.c 2014-08-29 15:26:31.992070587 -0700
37+++ xserver-xorg-video-imx-11.09.01/src/imx_exa_z160.c 2014-08-29 15:54:36.056070587 -0700
38@@ -21,6 +21,7 @@
39 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40 * SOFTWARE.
41 */
42+#include <xorg-server.h>
43
44 #include "xf86.h"
45 #include "xf86_OSproc.h"
46Index: xserver-xorg-video-imx-11.09.01/src/imx_ext.c
47===================================================================
48--- xserver-xorg-video-imx-11.09.01.orig/src/imx_ext.c 2014-08-29 15:26:32.064070587 -0700
49+++ xserver-xorg-video-imx-11.09.01/src/imx_ext.c 2014-08-29 15:55:18.048070587 -0700
50@@ -21,6 +21,7 @@
51 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
52 * SOFTWARE.
53 */
54+#include <xorg-server.h>
55
56 #include <X11/X.h>
57 #include <X11/Xproto.h>
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch
new file mode 100644
index 00000000..64af7732
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch
@@ -0,0 +1,53 @@
1From 5b348e7be67957f4be6fcfa4942128c04f6db905 Mon Sep 17 00:00:00 2001
2From: Adrian Alonso <b38018@freescale.com>
3Date: Thu, 4 Aug 2011 14:24:26 -0500
4Subject: [PATCH] xf86-video-imxfb: fix m4 hardcodded paths
5
6* Fix m4 macros lookup location; remove /usr/share/aclocal path
7
8Signed-off-by: Adrian Alonso <b38018@freescale.com>
9---
10 Makefile.am | 2 +-
11 Makefile.in | 2 +-
12 configure.ac | 2 +-
13 3 files changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/Makefile.am b/Makefile.am
16index 6752256..e205657 100644
17--- a/Makefile.am
18+++ b/Makefile.am
19@@ -20,4 +20,4 @@
20
21 AUTOMAKE_OPTIONS = foreign
22 SUBDIRS = src
23-ACLOCAL_AMFLAGS = -I /usr/share/aclocal
24+ACLOCAL_AMFLAGS = -I m4
25diff --git a/Makefile.in b/Makefile.in
26index 5c0ba0e..f829db7 100644
27--- a/Makefile.in
28+++ b/Makefile.in
29@@ -243,7 +243,7 @@ top_builddir = @top_builddir@
30 top_srcdir = @top_srcdir@
31 AUTOMAKE_OPTIONS = foreign
32 SUBDIRS = src
33-ACLOCAL_AMFLAGS = -I /usr/share/aclocal
34+ACLOCAL_AMFLAGS = -I m4
35 all: config.h
36 $(MAKE) $(AM_MAKEFLAGS) all-recursive
37
38diff --git a/configure.ac b/configure.ac
39index a1ac73b..0078b86 100644
40--- a/configure.ac
41+++ b/configure.ac
42@@ -29,7 +29,7 @@ AC_INIT([xf86-video-imx],
43 AC_CONFIG_SRCDIR([Makefile.am])
44 AM_CONFIG_HEADER([config.h])
45 AC_CONFIG_AUX_DIR(.)
46-AC_CONFIG_MACRO_DIR([/usr/share/aclocal])
47+AC_CONFIG_MACRO_DIR([m4])
48
49 AM_INIT_AUTOMAKE([dist-bzip2])
50
51--
521.7.4.1
53
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch
new file mode 100644
index 00000000..14ccbbf9
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch
@@ -0,0 +1,34 @@
1Fix building using new Xorg 1.14
2
3mibstore functions are no longer supported. This patch removes them
4from this driver, following the pattern in
5http://patches.openembedded.org/patch/46133/
6
7This checkin shows when/where the changes to the X server were made
8that deleted the header mibstore.h and mentions the reasons.
9http://lists.x.org/archives/xorg-devel/2012-September/033575.html
10
11Upstream-Status: Pending
12
13Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
14
15Index: xserver-xorg-video-imx-11.09.01/src/imx_driver.c
16===================================================================
17--- xserver-xorg-video-imx-11.09.01.orig/src/imx_driver.c
18+++ xserver-xorg-video-imx-11.09.01/src/imx_driver.c
19@@ -37,7 +37,6 @@
20 #include "xf86_OSproc.h"
21
22 #include "mipointer.h"
23-#include "mibstore.h"
24 #include "micmap.h"
25 #include "colormapst.h"
26 #include "xf86cmap.h"
27@@ -722,7 +721,6 @@ imxScreenInit(SCREEN_INIT_ARGS_DECL)
28 /* Initialize for X extensions. */
29 imxExtInit();
30
31- miInitializeBackingStore(pScreen);
32 xf86SetBackingStore(pScreen);
33
34 /* software cursor */
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb b/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb
new file mode 100644
index 00000000..51f243fc
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb
@@ -0,0 +1,48 @@
1# Copyright (C) 2011-2015 O.S. Systems Software LTDA.
2# Copyright (C) 2011, 2012 Freescale
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5require recipes-graphics/xorg-driver/xorg-driver-video.inc
6
7DESCRIPTION = "X.Org X server -- Freescale iMx framebuffer driver"
8LIC_FILES_CHKSUM = "file://COPYING;md5=f7bdc0c63080175d1667091b864cb12c"
9DEPENDS = "virtual/kernel virtual/xserver virtual/libx11 xproto randrproto util-macros amd-gpu-x11-bin-mx51 libz160"
10
11PR = "r12"
12
13SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-${PV}.tar.gz \
14 file://xf86-video-imxfb-fix-m4-hardcodded-paths.patch \
15 file://Make-video-API-forward-and-backward-compatible.patch \
16 file://ext-Update-to-newer-swap-macros.patch \
17 file://Fix-error-unknown-type-name-uint.patch \
18 file://xserver-1.14-compat.patch \
19 file://glibc-2.20.patch \
20"
21SRC_URI[md5sum] = "d19148399b5d1c4dab90d0cc6f2c4789"
22SRC_URI[sha256sum] = "d7d85e9f13c6dd58addab89847f3a8a67f6382a54135c7978c9a95368af024d4"
23
24inherit autotools pkgconfig
25
26# Make sure kernel sources are available
27do_configure[depends] += "virtual/kernel:do_shared_workdir"
28
29# Skip warning
30UNKNOWN_CONFIGURE_WHITELIST += "--enable-neon"
31
32FILES_${PN} += " ${libdir}/xorg/modules/drivers/*.so"
33FILES_${PN}-dbg += " ${libdir}/xorg/modules/drivers/.debug"
34EXTRA_OECONF_armv7a = " --enable-neon "
35CFLAGS += " -I${STAGING_INCDIR}/xorg -I${STAGING_KERNEL_DIR}/include"
36
37S = "${WORKDIR}/xserver-xorg-video-imx-${PV}"
38
39do_install_append () {
40 # driver's la files are not packaged
41 rm -f ${D}${libdir}/xorg/modules/drivers/*.la
42}
43
44RDEPENDS_${PN} += "xserver-xorg-module-exa"
45
46INSANE_SKIP_${PN} = "ldflags"
47INSANE_SKIP_${PN}-dbg = "ldflags"
48COMPATIBLE_MACHINE = "(mx5)"