[Openchrome-devel] [PATCH] openchrome: fix issues with compat-api against latest server.
Dave Airlie
airlied
Mon Jul 16 03:04:02 PDT 2012
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/compat-api.h | 5 ++---
src/via_driver.c | 19 ++++++++++++-------
src/via_driver.h | 2 +-
src/via_lvds.c | 2 +-
4 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/compat-api.h b/src/compat-api.h
index b1591b1..f930294 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -64,7 +64,7 @@
#define VT_FUNC_ARGS_DECL int arg, int flags
#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
-#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
+#define XF86_SCRN_ARG(x) ((x)->scrnIndex)
#else
#define SCRN_ARG_TYPE ScrnInfoPtr
#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
@@ -89,8 +89,7 @@
#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
#define VT_FUNC_ARGS(flags) pScrn
-#define XF86_ENABLEDISABLEFB_ARG(x) (x)
-
+#define XF86_SCRN_ARG(x) (x)
#endif
#endif
diff --git a/src/via_driver.c b/src/via_driver.c
index bd7593f..51cc93d 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -76,8 +76,7 @@ static Bool VIAProbe(DriverPtr drv, int flags);
static Bool VIASetupDefaultOptions(ScrnInfoPtr pScrn);
static Bool VIAPreInit(ScrnInfoPtr pScrn, int flags);
-static Bool VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
- char **argv);
+static Bool VIAScreenInit(SCREEN_INIT_ARGS_DECL);
static const OptionInfoRec *VIAAvailableOptions(int chipid, int busid);
#ifdef XSERVER_LIBPCIACCESS
@@ -312,9 +311,8 @@ VIAAdjustFrame(ADJUST_FRAME_ARGS_DECL)
}
static Bool
-VIAEnterVT(VT_FUNC_ARGS_DECL)
+VIAEnterVT_internal(ScrnInfoPtr pScrn, int flags)
{
- SCRN_INFO_PTR(arg);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
int i;
@@ -355,6 +353,13 @@ VIAEnterVT(VT_FUNC_ARGS_DECL)
return TRUE;
}
+static Bool
+VIAEnterVT(VT_FUNC_ARGS_DECL)
+{
+ SCRN_INFO_PTR(arg);
+ return VIAEnterVT_internal(pScrn, 0);
+}
+
static void
VIALeaveVT(VT_FUNC_ARGS_DECL)
{
@@ -1715,7 +1720,7 @@ VIACloseScreen(CLOSE_SCREEN_ARGS_DECL)
/* Is the display currently visible? */
if (pScrn->vtSema)
- VIALeaveVT(scrnIndex, 0);
+ VIALeaveVT(VT_FUNC_ARGS(0));
xf86_cursors_fini(pScreen);
@@ -1750,7 +1755,7 @@ VIACloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pVia->CloseScreen;
- return (*pScreen->CloseScreen) (scrnIndex, pScreen);
+ return (*pScreen->CloseScreen) (CLOSE_SCREEN_ARGS);
}
static Bool
@@ -1931,7 +1936,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
xf86DPMSInit(pScreen, xf86DPMSSet, 0);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- DPMS set up\n"));
- if (!VIAEnterVT(VT_FUNC_ARGS(1)))
+ if (!VIAEnterVT_internal(pScrn, 1))
return FALSE;
if (pVia->directRenderingType != DRI_2) {
diff --git a/src/via_driver.h b/src/via_driver.h
index bb4bdf7..21f26fb 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -34,7 +34,6 @@
#define DEBUG(x)
#endif
-#include "compat-api.h"
#include "vgaHW.h"
#include "xf86.h"
@@ -83,6 +82,7 @@
#endif
#include <errno.h>
+#include "compat-api.h"
#define VIA_AGP_UPL_SIZE (1024*128)
#define VIA_DMA_DL_SIZE (1024*128)
#define VIA_SCRATCH_SIZE (4*1024*1024)
diff --git a/src/via_lvds.c b/src/via_lvds.c
index d85b007..bcb83e7 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -491,7 +491,7 @@ ViaPanelGetSizeFromDDCv1(xf86OutputPtr output, int *width, int *height)
if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0))
return FALSE;
- pMon = xf86DoEEDID(pScrn->scrnIndex, pVia->pI2CBus2, TRUE);
+ pMon = xf86DoEEDID(XF86_SCRN_ARG(pScrn), pVia->pI2CBus2, TRUE);
if (!pMon)
return FALSE;
--
1.7.10.4
More information about the Openchrome-devel
mailing list