diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2012-12-30 03:21:34 -0200 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2013-01-09 12:56:18 -0200 |
| commit | 08476a14fdde7156eeb4e4801f17ff184b939904 (patch) | |
| tree | ddbf35cf5f53370653bf555806c3600b18d13efc | |
| parent | 1131d99d9c3d048acd4cd87642941d38a30e1a64 (diff) | |
| download | meta-fsl-arm-08476a14fdde7156eeb4e4801f17ff184b939904.tar.gz | |
xf86-video-imxfb: Port to newer Xorg video API
The new Xorg uses a newer video API thus requiring the drivers to be
ported to them; we use the "compat-api.h" header for forward and
backward compatibility makeing it easy for upstream acceptance.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
3 files changed, 857 insertions, 2 deletions
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 0000000..acfda91 --- /dev/null +++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch | |||
| @@ -0,0 +1,787 @@ | |||
| 1 | From 5216cb0f14414b5451f58df48a36c1c62c035276 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Otavio Salvador <otavio@ossystems.com.br> | ||
| 3 | Date: Sat, 29 Dec 2012 18:02:11 -0200 | ||
| 4 | Subject: [PATCH] Make video API forward and backward compatible | ||
| 5 | |||
| 6 | This updates the video API in a forward and backward compatible way | ||
| 7 | using the "compat-api.h" as used in Xorg maintained drivers. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-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 | |||
| 23 | diff --git a/src/compat-api.h b/src/compat-api.h | ||
| 24 | new file mode 100644 | ||
| 25 | index 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 | ||
| 135 | diff --git a/src/imx_display.c b/src/imx_display.c | ||
| 136 | index 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 | |||
| 208 | diff --git a/src/imx_display.h b/src/imx_display.h | ||
| 209 | index 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); | ||
| 233 | diff --git a/src/imx_driver.c b/src/imx_driver.c | ||
| 234 | index 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 | + SCRN_INFO_PTR(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)) { | ||
| 465 | diff --git a/src/imx_exa_offscreen.c b/src/imx_exa_offscreen.c | ||
| 466 | index 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 | |||
| 523 | diff --git a/src/imx_exa_z160.c b/src/imx_exa_z160.c | ||
| 524 | index 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; | ||
| 763 | diff --git a/src/imx_xv_ipu.c b/src/imx_xv_ipu.c | ||
| 764 | index 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 | -- | ||
| 786 | 1.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 0000000..05be6b3 --- /dev/null +++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | From fc7f191a1a0f290a4e808dd8f9bd58ba1dbd2be4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Otavio Salvador <otavio@ossystems.com.br> | ||
| 3 | Date: Sat, 29 Dec 2012 18:00:36 -0200 | ||
| 4 | Subject: [PATCH 1/2] ext: Update to newer swap macros | ||
| 5 | |||
| 6 | The swap macros now use an internal temporary variable so we need to | ||
| 7 | adapt the code according. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> | ||
| 12 | --- | ||
| 13 | src/imx_ext.c | 16 ++++++---------- | ||
| 14 | 1 file changed, 6 insertions(+), 10 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/src/imx_ext.c b/src/imx_ext.c | ||
| 17 | index 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 | -- | ||
| 64 | 1.7.10.4 | ||
| 65 | |||
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 index 22143a8..668641b 100644 --- a/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb +++ b/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb | |||
| @@ -6,10 +6,13 @@ LICENSE = "MIT-X" | |||
| 6 | DEPENDS = "virtual/xserver virtual/libx11 xproto randrproto util-macros amd-gpu-x11-bin-mx51 libz160" | 6 | DEPENDS = "virtual/xserver virtual/libx11 xproto randrproto util-macros amd-gpu-x11-bin-mx51 libz160" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=f7bdc0c63080175d1667091b864cb12c" | 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=f7bdc0c63080175d1667091b864cb12c" |
| 8 | 8 | ||
| 9 | PR = "r8" | 9 | PR = "r9" |
| 10 | 10 | ||
| 11 | SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-${PV}.tar.gz \ | 11 | SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-${PV}.tar.gz \ |
| 12 | file://xf86-video-imxfb-fix-m4-hardcodded-paths.patch" | 12 | file://xf86-video-imxfb-fix-m4-hardcodded-paths.patch \ |
| 13 | file://Make-video-API-forward-and-backward-compatible.patch \ | ||
| 14 | file://ext-Update-to-newer-swap-macros.patch \ | ||
| 15 | " | ||
| 13 | SRC_URI[md5sum] = "d19148399b5d1c4dab90d0cc6f2c4789" | 16 | SRC_URI[md5sum] = "d19148399b5d1c4dab90d0cc6f2c4789" |
| 14 | SRC_URI[sha256sum] = "d7d85e9f13c6dd58addab89847f3a8a67f6382a54135c7978c9a95368af024d4" | 17 | SRC_URI[sha256sum] = "d7d85e9f13c6dd58addab89847f3a8a67f6382a54135c7978c9a95368af024d4" |
| 15 | 18 | ||
