summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-22 16:17:55 +0100
committerDave Airlie <airlied@redhat.com>2012-05-23 11:06:12 +0100
commit2101e485480e3ffd6a17ed12f5287b8b1e4e0223 (patch)
tree7a3af02f72444445bc0d3ee6391acf2ec1595065
parent9d2549057ffced996bfaeb8df4901ef57da636c7 (diff)
compat for new server API
-rw-r--r--src/compat-api.h30
-rw-r--r--src/radeon.h10
-rw-r--r--src/radeon_dri.c4
-rw-r--r--src/radeon_driver.c67
-rw-r--r--src/radeon_kms.c47
-rw-r--r--src/radeon_probe.h27
6 files changed, 107 insertions, 78 deletions
diff --git a/src/compat-api.h b/src/compat-api.h
index 1bb77241..2356250d 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -35,7 +35,37 @@
#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 int i, ScreenPtr pScreen, int argc, char **argv
+
+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
+
+#define VTFUNC_ARGS(flags) pScrn->scrnIndex, (flags)
+#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 ScreenPtr pScreen, int argc, char **argv
+
+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
+#define CLOSE_SCREEN_ARGS pScreen
+
+#define VTFUNC_ARGS(flags) pScrn, (flags)
+
+#endif
+
#endif
diff --git a/src/radeon.h b/src/radeon.h
index 4fdfca6c..c7c7252b 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -64,14 +64,12 @@
/* DDC support */
#include "xf86DDC.h"
/* Xv support */
#include "xf86xv.h"
-#include "compat-api.h"
-
#include "radeon_probe.h"
#include "radeon_tv.h"
/* DRI support */
#ifdef XF86DRI
#define _XF86DRI_SERVER_
@@ -101,12 +99,14 @@
/* Render support */
#ifdef RENDER
#include "picturestr.h"
#endif
+#include "compat-api.h"
+
#include "simple_list.h"
#include "atipcirename.h"
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
@@ -512,13 +512,13 @@ struct radeon_dri {
drmVersionPtr pKernelDRMVersion;
DRIInfoPtr pDRIInfo;
int drmFD;
int numVisualConfigs;
__GLXvisualConfig *pVisualConfigs;
RADEONConfigPrivPtr pVisualConfigsPriv;
- Bool (*DRICloseScreen)(int, ScreenPtr);
+ Bool (*DRICloseScreen)(CLOSE_SCREEN_ARGS_DECL);
drm_handle_t fbHandle;
drmSize registerSize;
drm_handle_t registerHandle;
@@ -862,15 +862,15 @@ typedef struct {
float mclk; /* in MHz */
Bool IsDDR;
int DispPriority;
RADEONSavePtr SavedReg; /* Original (text) mode */
RADEONSavePtr ModeReg; /* Current mode */
- Bool (*CloseScreen)(int, ScreenPtr);
+ Bool (*CloseScreen)(CLOSE_SCREEN_ARGS_DECL);
- void (*BlockHandler)(int, pointer, pointer, pointer);
+ void (*BlockHandler)(SCREEN_ARG_TYPE, pointer, pointer, pointer);
Bool PaletteSavedOnVT; /* Palette saved on last VT switch */
xf86CursorInfoPtr cursor;
#ifdef ARGB_CURSOR
Bool cursor_argb;
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 035556d6..f180f3a2 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -1713,21 +1713,21 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n");
return TRUE;
}
-static Bool RADEONDRIDoCloseScreen(int scrnIndex, ScreenPtr pScreen)
+static Bool RADEONDRIDoCloseScreen(CLOSE_SCREEN_ARGS_DECL)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONDRICloseScreen(pScreen);
pScreen->CloseScreen = info->dri->DRICloseScreen;
- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
}
/* Finish initializing the device-dependent DRI state, and call
* DRIFinishScreenInit() to complete the device-independent DRI
* initialization.
*/
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index e79ddba0..611d7364 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -118,13 +118,13 @@
#include "radeon_chipset_gen.h"
#include "radeon_chipinfo_gen.h"
/* Forward definitions for driver functions */
-static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen);
+static Bool RADEONCloseScreen(CLOSE_SCREEN_ARGS_DECL);
static Bool RADEONSaveScreen(ScreenPtr pScreen, int mode);
static void RADEONSave(ScrnInfoPtr pScrn);
static void RADEONSaveMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
static void
@@ -3370,21 +3370,21 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
#ifdef XF86DRI
if (info->cp->CPStarted && pScrn->pScreen) DRIUnlock(pScrn->pScreen);
#endif
}
-static void RADEONBlockHandler(int i, pointer blockData,
+static void RADEONBlockHandler(SCREEN_ARG_TYPE arg, pointer blockData,
pointer pTimeout, pointer pReadmask)
{
- ScreenPtr pScreen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
+ SCREEN_PTR(arg);
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
pScreen->BlockHandler = info->BlockHandler;
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (arg, blockData, pTimeout, pReadmask);
pScreen->BlockHandler = RADEONBlockHandler;
if (info->VideoTimerCallback)
(*info->VideoTimerCallback)(pScrn, currentTime.milliseconds);
#if defined(RENDER) && defined(USE_XAA)
@@ -3445,14 +3445,13 @@ RADEONInitBIOSRegisters(ScrnInfoPtr pScrn)
}
}
/* Called at the start of each server generation. */
-Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
- int argc, char **argv)
+Bool RADEONScreenInit(SCREEN_INIT_ARGS)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int hasDRI = 0;
#ifdef RENDER
int subPixelOrder = SubPixelUnknown;
@@ -3662,15 +3661,15 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
*/
int width_bytes = (pScrn->displayWidth *
info->CurrentLayout.pixel_bytes);
int maxy = info->FbMapSize / width_bytes;
if (maxy <= pScrn->virtualY * 3) {
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Static buffer allocation failed. Disabling DRI.\n");
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"At least %d kB of video memory needed at this "
"resolution and depth.\n",
(pScrn->displayWidth * pScrn->virtualY *
info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024);
info->directRenderingEnabled = FALSE;
} else {
@@ -3813,22 +3812,22 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
/* Enable aceleration */
if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing Acceleration\n");
if (RADEONAccelInit(pScreen)) {
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration enabled\n");
info->accelOn = TRUE;
} else {
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Acceleration initialization failed\n");
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n");
info->accelOn = FALSE;
}
} else {
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n");
info->accelOn = FALSE;
}
/* Init DPMS */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing DPMS\n");
@@ -3849,25 +3848,25 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
#ifdef USE_XAA
if (!info->useEXA) {
int width, height;
if (xf86QueryLargestOffscreenArea(pScreen, &width, &height,
0, 0, 0)) {
- xf86DrvMsg(scrnIndex, X_INFO,
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Largest offscreen area available: %d x %d\n",
width, height);
}
}
#endif /* USE_XAA */
} else {
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
- xf86DrvMsg(scrnIndex, X_INFO, "Using software cursor\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using software cursor\n");
}
} else {
- xf86DrvMsg(scrnIndex, X_INFO, "Using software cursor\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using software cursor\n");
}
/* DGA setup */
#ifdef XFreeXDGA
xf86DiDGAInit(pScreen, info->LinearAddr + pScrn->fbOffset);
#endif
@@ -5951,15 +5950,15 @@ static Bool RADEONSaveScreen(ScreenPtr pScreen, int mode)
else
RADEONBlank(pScrn);
}
return TRUE;
}
-Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+Bool RADEONSwitchMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
Bool tilingOld = info->tilingEnabled;
Bool ret;
#ifdef XF86DRI
Bool CPStarted = info->cp->CPStarted;
@@ -5990,15 +5989,15 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
RADEON_SYNC(info, pScrn);
ret = xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
if (info->tilingEnabled != tilingOld) {
/* need to redraw front buffer, I guess this can be considered a hack ? */
- xf86EnableDisableFBAccess(scrnIndex, FALSE);
+ xf86EnableDisableFBAccess(arg, FALSE);
RADEONChangeSurfaces(pScrn);
- xf86EnableDisableFBAccess(scrnIndex, TRUE);
+ xf86EnableDisableFBAccess(arg, TRUE);
/* xf86SetRootClip would do, but can't access that here */
}
if (info->accelOn) {
RADEON_SYNC(info, pScrn);
if (info->ChipFamily < CHIP_FAMILY_R600)
@@ -6047,16 +6046,16 @@ xf86ModeBandwidth(DisplayModePtr mode, int depth)
return (unsigned int)(pixels_per_second * bytes_per_pixel / (1024 * 1024));
}
#endif
/* Used to disallow modes that are not supported by the hardware */
-ModeStatus RADEONValidMode(int scrnIndex, DisplayModePtr mode,
+ModeStatus RADEONValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
Bool verbose, int flag)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
/*
* RN50 has effective maximum mode bandwidth of about 300MiB/s.
* XXX should really do this for all chips by properly computing
@@ -6185,15 +6184,15 @@ void RADEONDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, Bool crtc2)
OUTREG(regcntl, crtcoffsetcntl);
}
OUTREG(reg, Base);
}
-void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
+void RADEONAdjustFrame(SCRN_ARG_TYPE arg, int x, int y, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86OutputPtr output = config->output[config->compat_output];
xf86CrtcPtr crtc = output->crtc;
@@ -6223,15 +6222,15 @@ void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
#endif
}
/* Called when VT switching back to the X server. Reinitialize the
* video mode.
*/
-Bool RADEONEnterVT(int scrnIndex, int flags)
+Bool RADEONEnterVT(SCRN_ARG_TYPE arg, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONEnterVT\n");
@@ -6323,15 +6322,15 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
return TRUE;
}
/* Called when VT switching away from the X server. Restore the
* original text mode.
*/
-void RADEONLeaveVT(int scrnIndex, int flags)
+void RADEONLeaveVT(SCRN_ARG_TYPE arg, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONLeaveVT\n");
@@ -6410,15 +6409,15 @@ void RADEONLeaveVT(int scrnIndex, int flags)
}
/* Called at the end of each server generation. Restore the original
* text mode, unmap video memory, and unwrap and call the saved
* CloseScreen function.
*/
-static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
+static Bool RADEONCloseScreen(CLOSE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONCloseScreen\n");
@@ -6495,18 +6494,18 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
pScrn->vtSema = FALSE;
xf86ClearPrimInitDone(info->pEnt->index);
pScreen->BlockHandler = info->BlockHandler;
pScreen->CloseScreen = info->CloseScreen;
- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
}
-void RADEONFreeScreen(int scrnIndex, int flags)
+void RADEONFreeScreen(SCRN_ARG_TYPE arg, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONFreeScreen\n");
/* when server quits at PreInit, we don't need do this anymore*/
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index cf446ab9..2df2d256 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -189,21 +189,21 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
}
}
}
return TRUE;
}
-static void RADEONBlockHandler_KMS(int i, pointer blockData,
+static void RADEONBlockHandler_KMS(SCREEN_ARG_TYPE arg, pointer blockData,
pointer pTimeout, pointer pReadmask)
{
- ScreenPtr pScreen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
+ SCREEN_PTR(arg);
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
pScreen->BlockHandler = info->BlockHandler;
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (arg, blockData, pTimeout, pReadmask);
pScreen->BlockHandler = RADEONBlockHandler_KMS;
if (info->VideoTimerCallback)
(*info->VideoTimerCallback)(pScrn, currentTime.milliseconds);
radeon_cs_flush_indirect(pScrn);
}
@@ -860,15 +860,15 @@ static Bool RADEONSaveScreen_KMS(ScreenPtr pScreen, int mode)
}
/* Called at the end of each server generation. Restore the original
* text mode, unmap video memory, and unwrap and call the saved
* CloseScreen function.
*/
-static Bool RADEONCloseScreen_KMS(int scrnIndex, ScreenPtr pScreen)
+static Bool RADEONCloseScreen_KMS(CLOSE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONCloseScreen\n");
drmmode_uevent_fini(pScrn, &info->drmmode);
@@ -895,32 +895,31 @@ static Bool RADEONCloseScreen_KMS(int scrnIndex, ScreenPtr pScreen)
radeon_dri2_close_screen(pScreen);
pScrn->vtSema = FALSE;
xf86ClearPrimInitDone(info->pEnt->index);
pScreen->BlockHandler = info->BlockHandler;
pScreen->CloseScreen = info->CloseScreen;
- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
}
-void RADEONFreeScreen_KMS(int scrnIndex, int flags)
+void RADEONFreeScreen_KMS(SCRN_ARG_TYPE arg, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONFreeScreen\n");
/* when server quits at PreInit, we don't need do this anymore*/
if (!info) return;
RADEONFreeRec(pScrn);
}
-Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
- int argc, char **argv)
+Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int subPixelOrder = SubPixelUnknown;
char* s;
void *front_ptr;
@@ -1050,24 +1049,24 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
} else {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Direct rendering disabled\n");
}
if (info->r600_shadow_fb) {
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n");
info->accelOn = FALSE;
} else {
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing Acceleration\n");
if (RADEONAccelInit(pScreen)) {
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration enabled\n");
info->accelOn = TRUE;
} else {
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Acceleration initialization failed\n");
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n");
info->accelOn = FALSE;
}
}
/* Init DPMS */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
@@ -1101,13 +1100,13 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
"Initializing Xv\n");
RADEONInitVideo(pScreen);
}
if (info->r600_shadow_fb == TRUE) {
if (!shadowSetup(pScreen)) {
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Shadowfb initialization failed\n");
return FALSE;
}
}
pScrn->pScreen = pScreen;
@@ -1147,15 +1146,15 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
info->accel_state->XInited3D = FALSE;
info->accel_state->engineMode = EXA_ENGINEMODE_UNKNOWN;
return TRUE;
}
-Bool RADEONEnterVT_KMS(int scrnIndex, int flags)
+Bool RADEONEnterVT_KMS(SCRN_ARG_TYPE arg, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
int ret;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONEnterVT_KMS\n");
@@ -1175,15 +1174,15 @@ Bool RADEONEnterVT_KMS(int scrnIndex, int flags)
RADEONResetVideo(pScrn);
return TRUE;
}
-void RADEONLeaveVT_KMS(int scrnIndex, int flags)
+void RADEONLeaveVT_KMS(SCRN_ARG_TYPE arg, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONLeaveVT_KMS\n");
drmDropMaster(info->dri->drmFD);
@@ -1198,24 +1197,24 @@ void RADEONLeaveVT_KMS(int scrnIndex, int flags)
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Ok, leaving now...\n");
}
-Bool RADEONSwitchMode_KMS(int scrnIndex, DisplayModePtr mode, int flags)
+Bool RADEONSwitchMode_KMS(SCRN_ARG_TYPE arg, DisplayModePtr mode, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
Bool ret;
ret = xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
return ret;
}
-void RADEONAdjustFrame_KMS(int scrnIndex, int x, int y, int flags)
+void RADEONAdjustFrame_KMS(SCRN_ARG_TYPE arg, int x, int y, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
drmmode_adjust_frame(pScrn, &info->drmmode, x, y, flags);
return;
}
static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 66905022..40dc5433 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -40,12 +40,13 @@
#include "xf86str.h"
#include "xf86DDC.h"
#include "randrstr.h"
#include "xf86Crtc.h"
+#include "compat-api.h"
#ifdef USE_EXA
#include "exa.h"
#endif
#ifdef USE_XAA
#include "xaa.h"
#endif
@@ -757,31 +758,31 @@ typedef struct
/* radeon_probe.c */
extern PciChipsets RADEONPciChipsets[];
/* radeon_driver.c */
extern Bool RADEONPreInit(ScrnInfoPtr, int);
-extern Bool RADEONScreenInit(int, ScreenPtr, int, char **);
-extern Bool RADEONSwitchMode(int, DisplayModePtr, int);
+extern Bool RADEONScreenInit(SCREEN_INIT_ARGS);
+extern Bool RADEONSwitchMode(SCRN_ARG_TYPE, DisplayModePtr, int);
#ifdef X_XF86MiscPassMessage
extern Bool RADEONHandleMessage(int, const char*, const char*,
char**);
#endif
-extern void RADEONAdjustFrame(int, int, int, int);
-extern Bool RADEONEnterVT(int, int);
-extern void RADEONLeaveVT(int, int);
-extern void RADEONFreeScreen(int, int);
-extern ModeStatus RADEONValidMode(int, DisplayModePtr, Bool, int);
+extern void RADEONAdjustFrame(SCRN_ARG_TYPE, int, int, int);
+extern Bool RADEONEnterVT(SCRN_ARG_TYPE, int);
+extern void RADEONLeaveVT(SCRN_ARG_TYPE, int);
+extern void RADEONFreeScreen(SCRN_ARG_TYPE, int);
+extern ModeStatus RADEONValidMode(SCRN_ARG_TYPE, DisplayModePtr, Bool, int);
extern const OptionInfoRec *RADEONOptionsWeak(void);
#ifdef XF86DRM_MODE
extern Bool RADEONPreInit_KMS(ScrnInfoPtr, int);
-extern Bool RADEONScreenInit_KMS(int, ScreenPtr, int, char **);
-extern Bool RADEONSwitchMode_KMS(int, DisplayModePtr, int);
-extern void RADEONAdjustFrame_KMS(int, int, int, int);
-extern Bool RADEONEnterVT_KMS(int, int);
-extern void RADEONLeaveVT_KMS(int, int);
-extern void RADEONFreeScreen_KMS(int scrnIndex, int flags);
+extern Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS);
+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);
+extern void RADEONLeaveVT_KMS(SCRN_ARG_TYPE, int);
+extern void RADEONFreeScreen_KMS(SCRN_ARG_TYPE, int flags);
#endif
#endif /* _RADEON_PROBE_H_ */