summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-24 08:17:11 +0100
committerDave Airlie <airlied@redhat.com>2012-05-24 08:17:11 +0100
commit5ed959585f35a4eff2cd803ae222b46d164f210d (patch)
tree61739fa5034aa483782eb35db0ddc1dbdf0e2a2f
parent2de17efdcb502f91fb145130c12be3cb164f03c5 (diff)
radeon: update compat-api.h for block handler + enable/disable fb.
This updates the compat stuff for the latest block handler code, and the enable/disable interface. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/atombios_crtc.c4
-rw-r--r--src/compat-api.h13
-rw-r--r--src/legacy_crtc.c4
-rw-r--r--src/radeon.h2
-rw-r--r--src/radeon_driver.c7
-rw-r--r--src/radeon_kms.c7
-rw-r--r--src/radeon_probe.h4
7 files changed, 24 insertions, 17 deletions
diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index 54724752..d0eefa5f 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -1025,10 +1025,10 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
/* need to redraw front buffer, I guess this can be considered a hack ? */
/* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
if (pScrn->pScreen)
- xf86EnableDisableFBAccess(pScrn->scrnIndex, FALSE);
+ xf86EnableDisableFBAccess(XF86_ENABLEDISABLEFB_ARG(pScrn), FALSE);
RADEONChangeSurfaces(pScrn);
if (pScrn->pScreen)
- xf86EnableDisableFBAccess(pScrn->scrnIndex, TRUE);
+ xf86EnableDisableFBAccess(XF86_ENABLEDISABLEFB_ARG(pScrn), TRUE);
/* xf86SetRootClip would do, but can't access that here */
}
diff --git a/src/compat-api.h b/src/compat-api.h
index 2356250d..aa6b9561 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -46,12 +46,16 @@
#define SCREEN_ARG_TYPE int
#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
-#define SCREEN_INIT_ARGS int i, ScreenPtr pScreen, int argc, char **argv
+#define SCREEN_INIT_ARGS_DECL int i, 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 VTFUNC_ARGS(flags) pScrn->scrnIndex, (flags)
+#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
#else
#define SCRN_ARG_TYPE ScrnInfoPtr
#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
@@ -59,13 +63,18 @@
#define SCREEN_ARG_TYPE ScreenPtr
#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
-#define SCREEN_INIT_ARGS ScreenPtr pScreen, int argc, char **argv
+#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 VTFUNC_ARGS(flags) pScrn, (flags)
+#define XF86_ENABLEDISABLEFB_ARG(x) (x)
+
#endif
#endif
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index 8949c291..30119f5e 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -1884,10 +1884,10 @@ legacy_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
/* need to redraw front buffer, I guess this can be considered a hack ? */
/* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
if (pScrn->pScreen)
- xf86EnableDisableFBAccess(pScrn->scrnIndex, FALSE);
+ xf86EnableDisableFBAccess(XF86_ENABLEDISABLEFB_ARG(pScrn), FALSE);
RADEONChangeSurfaces(pScrn);
if (pScrn->pScreen)
- xf86EnableDisableFBAccess(pScrn->scrnIndex, TRUE);
+ xf86EnableDisableFBAccess(XF86_ENABLEDISABLEFB_ARG(pScrn), TRUE);
/* xf86SetRootClip would do, but can't access that here */
}
diff --git a/src/radeon.h b/src/radeon.h
index c7c7252b..151ef43b 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -867,7 +867,7 @@ typedef struct {
RADEONSavePtr ModeReg; /* Current mode */
Bool (*CloseScreen)(CLOSE_SCREEN_ARGS_DECL);
- void (*BlockHandler)(SCREEN_ARG_TYPE, pointer, pointer, pointer);
+ void (*BlockHandler)(BLOCKHANDLER_ARGS_DECL);
Bool PaletteSavedOnVT; /* Palette saved on last VT switch */
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 611d7364..cee25d89 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3373,15 +3373,14 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
#endif
}
-static void RADEONBlockHandler(SCREEN_ARG_TYPE arg, pointer blockData,
- pointer pTimeout, pointer pReadmask)
+static void RADEONBlockHandler(BLOCKHANDLER_ARGS_DECL)
{
SCREEN_PTR(arg);
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
pScreen->BlockHandler = info->BlockHandler;
- (*pScreen->BlockHandler) (arg, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
pScreen->BlockHandler = RADEONBlockHandler;
if (info->VideoTimerCallback)
@@ -3448,7 +3447,7 @@ RADEONInitBIOSRegisters(ScrnInfoPtr pScrn)
/* Called at the start of each server generation. */
-Bool RADEONScreenInit(SCREEN_INIT_ARGS)
+Bool RADEONScreenInit(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 2df2d256..1ef811f5 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -192,15 +192,14 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
return TRUE;
}
-static void RADEONBlockHandler_KMS(SCREEN_ARG_TYPE arg, pointer blockData,
- pointer pTimeout, pointer pReadmask)
+static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
{
SCREEN_PTR(arg);
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
pScreen->BlockHandler = info->BlockHandler;
- (*pScreen->BlockHandler) (arg, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
pScreen->BlockHandler = RADEONBlockHandler_KMS;
if (info->VideoTimerCallback)
@@ -916,7 +915,7 @@ void RADEONFreeScreen_KMS(SCRN_ARG_TYPE arg, int flags)
RADEONFreeRec(pScrn);
}
-Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS)
+Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 40dc5433..a952820e 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -761,7 +761,7 @@ extern PciChipsets RADEONPciChipsets[];
/* radeon_driver.c */
extern Bool RADEONPreInit(ScrnInfoPtr, int);
-extern Bool RADEONScreenInit(SCREEN_INIT_ARGS);
+extern Bool RADEONScreenInit(SCREEN_INIT_ARGS_DECL);
extern Bool RADEONSwitchMode(SCRN_ARG_TYPE, DisplayModePtr, int);
#ifdef X_XF86MiscPassMessage
extern Bool RADEONHandleMessage(int, const char*, const char*,
@@ -777,7 +777,7 @@ extern const OptionInfoRec *RADEONOptionsWeak(void);
#ifdef XF86DRM_MODE
extern Bool RADEONPreInit_KMS(ScrnInfoPtr, int);
-extern Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS);
+extern Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL);
extern Bool RADEONSwitchMode_KMS(SCRN_ARG_TYPE, DisplayModePtr, int);
extern void RADEONAdjustFrame_KMS(SCRN_ARG_TYPE, int, int, int);
extern Bool RADEONEnterVT_KMS(SCRN_ARG_TYPE, int);