Hi Julien,

I found there are patches from Ubuntu and already solve this problem.
As attachment.

I'll upload a new package contain these two patches very soon.

Yours,
Paul

-- 
                                PaulLiu (劉穎駿)
E-mail: Ying-Chun Liu (PaulLiu) <paul...@debian.org>
Description: Port to xorg-server 1.13
 Patch to work against new abi.
 This patch is from Ubuntu xf86-video-msm (1.0.1+git20100122.5f7df591-3ubuntu2)
Author: Matthias Klose <d...@ubuntu.com>
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/Makefile.am
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/Makefile.am	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/Makefile.am	2013-09-25 01:39:33.000000000 +0800
@@ -40,6 +40,7 @@
 	 neon_memsets.c \
 	 neon_memcpy.S \
 	 neon_memmove.S \
+	 compat-api.h \
 	$(MSM_DRI_SRCS)
 
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-cursor.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-cursor.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-cursor.c	2013-09-25 01:39:33.000000000 +0800
@@ -115,7 +115,7 @@
 Bool
 MSMCursorInit(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri2.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-dri2.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri2.c	2013-09-25 01:39:33.000000000 +0800
@@ -273,7 +273,7 @@
 MSMDRI2ScreenInit(ScreenPtr pScreen)
 {
     DRI2InfoRec info;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     MSMPtr pMsm = MSMPTR(pScrn);
 
     if (pMsm->drmFD <= 0) {
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-dri.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri.c	2013-09-25 01:39:33.000000000 +0800
@@ -89,7 +89,7 @@
 void
 MSMDRICloseScreen(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
@@ -106,16 +106,16 @@
 }
 
 static Bool
-MSMDRIDoCloseScreen(int scrnIndex, ScreenPtr pScreen)
+MSMDRIDoCloseScreen(CLOSE_SCREEN_ARGS_DECL)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
    MSMDRICloseScreen(pScreen);
 
    pScreen->CloseScreen = pMsm->dri->DRICloseScreen;
-   return (*pScreen->CloseScreen) (scrnIndex, pScreen);
+   return (*pScreen->CloseScreen) (CLOSE_SCREEN_ARGS);
 }
 
 static void
@@ -126,7 +126,7 @@
 Bool
 MSMDRIScreenInit(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
@@ -210,7 +210,7 @@
 Bool
 MSMDRIFinishScreenInit(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-driver.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-driver.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-driver.c	2013-09-25 01:39:33.000000000 +0800
@@ -792,9 +792,9 @@
 }
 
 static Bool
-MSMCloseScreen(int scrnIndex, ScreenPtr pScreen)
+MSMCloseScreen(CLOSE_SCREEN_ARGS_DECL)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
@@ -816,13 +816,13 @@
 
    pScreen->CloseScreen = pMsm->CloseScreen;
 
-   return (*pScreen->CloseScreen) (scrnIndex, pScreen);
+   return (*pScreen->CloseScreen) (CLOSE_SCREEN_ARGS);
 }
 
 static Bool
-MSMScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+MSMScreenInit(SCREEN_INIT_ARGS_DECL)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
@@ -840,14 +840,14 @@
       // then set the frame buffer cache settings.
       // Otherwise, issue a warning and continue.
       if (ioctl(pMsm->fd, MSMFB_GET_PAGE_PROTECTION, &fb_page_protection)) {
-               xf86DrvMsg(scrnIndex, X_WARNING,
+               xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                           "MSMFB_GET_PAGE_PROTECTION IOCTL: Unable to get current FB cache settings.\n");
       }
       else {
          if (fb_page_protection.page_protection != desired_fb_page_protection) {
             fb_page_protection.page_protection = desired_fb_page_protection;
             if (ioctl(pMsm->fd, MSMFB_SET_PAGE_PROTECTION, &fb_page_protection)) {
-               xf86DrvMsg(scrnIndex, X_ERROR,
+               xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                           "MSMFB_SET_PAGE_PROTECTION IOCTL: Unable to set requested FB cache settings: %s.\n",
                           fbCacheStrings[desired_fb_page_protection]);
               return FALSE;
@@ -864,7 +864,7 @@
    /* If we can't map the memory, then this is a short trip */
 
    if (pMsm->fbmem == MAP_FAILED) {
-      xf86DrvMsg(scrnIndex, X_ERROR, "Unable to map the "
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map the "
 		 "framebuffer memory: %s\n", strerror(errno));
       return FALSE;
    }
@@ -873,7 +873,7 @@
     * but it makes RandR all happy */
 
    if (!xf86SetDesiredModes(pScrn)) {
-      xf86DrvMsg(scrnIndex, X_ERROR, "Unable to set the mode");
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to set the mode");
       return FALSE;
    }
 
@@ -885,13 +885,13 @@
 
    if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
 			 pScrn->rgbBits, TrueColor)) {
-      xf86DrvMsg(scrnIndex, X_ERROR, "Unable to set up the visual"
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to set up the visual"
 		 " for %d BPP\n", pScrn->bitsPerPixel);
       return FALSE;
    }
 
    if (!miSetPixmapDepths()) {
-      xf86DrvMsg(scrnIndex, X_ERROR, "Unable to set the pixmap depth\n");
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to set the pixmap depth\n");
       return FALSE;
    }
 
@@ -918,7 +918,7 @@
 		     pScrn->xDpi, pScrn->yDpi,
 		     pScrn->displayWidth, pScrn->bitsPerPixel)) {
 
-      xf86DrvMsg(scrnIndex, X_ERROR, "fbScreenInit failed\n");
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbScreenInit failed\n");
       return FALSE;
    }
 
@@ -941,7 +941,7 @@
 
    /* Set up the Render fallbacks */
    if (!fbPictureInit(pScreen, NULL, 0)) {
-      xf86DrvMsg(scrnIndex, X_ERROR, "fbPictureInit failed\n");
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbPictureInit failed\n");
       return FALSE;
    }
 
@@ -971,7 +971,7 @@
    /* Set up the default colormap */
 
    if (!miCreateDefColormap(pScreen)) {
-      xf86DrvMsg(scrnIndex, X_ERROR, "miCreateDefColormap failed\n");
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "miCreateDefColormap failed\n");
       return FALSE;
    }
 
@@ -993,7 +993,7 @@
    pScreen->CloseScreen = MSMCloseScreen;
 
    if (!xf86CrtcScreenInit(pScreen)) {
-        xf86DrvMsg(scrnIndex, X_ERROR, "CRTCScreenInit failed\n");
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRTCScreenInit failed\n");
         return FALSE;
     }
 
@@ -1001,7 +1001,7 @@
 }
 
 static Bool
-MSMSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+MSMSwitchMode(SWITCH_MODE_ARGS_DECL)
 {
    /* FIXME:  We should only have the one mode, so we shouldn't ever call
     * this function - regardless, it needs to be stubbed - so what
@@ -1011,7 +1011,7 @@
 }
 
 static Bool
-MSMEnterVT(int ScrnIndex, int flags)
+MSMEnterVT(VT_FUNC_ARGS_DECL)
 {
    /* Nothing to do here yet - there might be some triggers that we need
     * to throw at the framebuffer */
@@ -1020,7 +1020,7 @@
 }
 
 static void
-MSMLeaveVT(int ScrnIndex, int flags)
+MSMLeaveVT(VT_FUNC_ARGS_DECL)
 {
    /* Restore any framebufferish things here */
 }
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-exa.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-exa.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-exa.c	2013-09-25 01:39:33.000000000 +0800
@@ -64,7 +64,7 @@
 #define INT(_x)    xFixedToInt(_x)
 
 #define MSMPTR_FROM_PIXMAP(_x)         \
-	MSMPTR(xf86Screens[(_x)->drawable.pScreen->myNum])
+	MSMPTR(xf86ScreenToScrn((_x)->drawable.pScreen))
 
 /* This is a local scratch structure used to store information */
 static struct
@@ -676,7 +676,7 @@
 MSMCreatePixmap(ScreenPtr pScreen, int size, int align)
 {
     struct msm_pixmap_priv *priv;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     MSMPtr pMsm = MSMPTR(pScrn);
 
     priv = calloc(1, sizeof(struct msm_pixmap_priv));
@@ -713,7 +713,7 @@
 Bool
 MSMSetupExa(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm.h
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm.h	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm.h	2013-09-25 01:39:33.000000000 +0800
@@ -33,6 +33,7 @@
 #include "xf86.h"
 #include "damage.h"
 #include "exa.h"
+#include "compat-api.h"
 
 #if USEDRI
 #define _XF86DRI_SERVER_
@@ -44,7 +45,9 @@
 #include <linux/ioctl.h>
 #include <linux/msm_mdp.h>
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(a) (sizeof((a)) / (sizeof(*(a))))
+#endif
 
 typedef enum
 {
@@ -64,7 +67,7 @@
    int numVisualConfigs;
    __GLXvisualConfig *pVisualConfigs;
 
-      Bool(*DRICloseScreen) (int, ScreenPtr);
+      Bool(*DRICloseScreen) (CLOSE_SCREEN_ARGS_DECL);
 } MSMDRIRec, *MSMDRIPtr;
 
 typedef struct
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-pixmap.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-pixmap.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-pixmap.c	2013-09-25 01:39:33.000000000 +0800
@@ -35,7 +35,7 @@
 #include "msm-drm.h"
 
 #define MSMPTR_FROM_PIXMAP(_x)         \
-	MSMPTR(xf86Screens[(_x)->drawable.pScreen->myNum])
+	MSMPTR(xf86ScreenToScrn((_x)->drawable.pScreen))
 
 int
 msm_pixmap_offset(PixmapPtr pixmap)
@@ -104,7 +104,7 @@
 struct msm_offscreen_area *
 msm_alloc_offscreen_memory(ScreenPtr pScreen, int size)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     MSMPtr pMsm = MSMPTR(pScrn);
     struct msm_offscreen_area *ret =
 	calloc(1, sizeof(struct msm_offscreen_area));
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-video.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-video.c	2013-09-25 01:39:33.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-video.c	2013-09-25 01:39:33.000000000 +0800
@@ -694,7 +694,7 @@
 static XF86VideoAdaptorPtr
 MSMInitAdaptor(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    MSMPtr pMsm = MSMPTR(pScrn);
 
@@ -758,7 +758,7 @@
 void
 MSMInitVideo(ScreenPtr pScreen)
 {
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
    XF86VideoAdaptorPtr adapt = MSMInitAdaptor(pScreen);
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/compat-api.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/compat-api.h	2013-09-25 01:39:33.000000000 +0800
@@ -0,0 +1,99 @@
+ /*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Dave Airlie <airl...@redhat.com>
+ */
+
+/* this file provides API compat between server post 1.13 and pre it,
+   it should be reused inside as many drivers as possible */
+#ifndef COMPAT_API_H
+#define COMPAT_API_H
+
+#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
+#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
+#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
+#endif
+
+#ifndef XF86_HAS_SCRN_CONV
+#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
+#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
+#endif
+
+#ifndef XF86_SCRN_INTERFACE
+
+#define SCRN_ARG_TYPE int
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
+
+#define SCREEN_ARG_TYPE int
+#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
+
+#define SCREEN_INIT_ARGS_DECL int scrnIndex, ScreenPtr pScreen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
+
+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
+
+#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
+#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0
+
+#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
+#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0
+
+#define FREE_SCREEN_ARGS_DECL int arg, int flags
+
+#define VT_FUNC_ARGS_DECL int arg, int flags
+#define VT_FUNC_ARGS pScrn->scrnIndex, 0
+
+#define XF86_SCRN_ARG(x) ((x)->scrnIndex)
+#else
+#define SCRN_ARG_TYPE ScrnInfoPtr
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
+
+#define SCREEN_ARG_TYPE ScreenPtr
+#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
+
+#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
+
+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
+#define CLOSE_SCREEN_ARGS pScreen
+
+#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
+#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y
+
+#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
+#define SWITCH_MODE_ARGS(arg, m) arg, m
+
+#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
+
+#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
+#define VT_FUNC_ARGS pScrn
+
+#define XF86_SCRN_ARG(x) (x)
+
+#endif
+
+#endif
Description: Port to xorg-server 1.14
 kill mibstore to fix building against 1.14
 This patch is from Ubuntu xf86-video-msm (1.0.1+git20100122.5f7df591-3ubuntu3)
Author: Maarten Lankhorst <maarten.lankho...@ubuntu.com>
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-driver.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-driver.c	2013-09-25 01:39:36.000000000 +0800
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-driver.c	2013-09-25 01:39:36.000000000 +0800
@@ -41,7 +41,6 @@
 #include "xf86Crtc.h"
 
 #include "mipointer.h"
-#include "mibstore.h"
 #include "micmap.h"
 #include "fb.h"
 #include "dixstruct.h"
@@ -949,7 +948,6 @@
    xf86SetBlackWhitePixels(pScreen);
 
    /* Set up the backing store */
-   miInitializeBackingStore(pScreen);
    xf86SetBackingStore(pScreen);
 
    if (pMsm->accel) {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to