INREG(DDCReg) & ~(RADEON_GPIO_EN_0));
- MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, radeon_output->pI2CBus);
+ MonInfo = xf86OutputGetEDID(output, radeon_output->pI2CBus);
OUTREG(DDCReg, INREG(DDCReg) | RADEON_GPIO_EN_1);
OUTREG(DDCReg, INREG(DDCReg) | RADEON_GPIO_EN_0);
} else if (radeon_output->pI2CBus && info->ddc2 && ((DDCReg == RADEON_LCD_GPIO_MASK) || (DDCReg == RADEON_MDGPIO_EN_REG))) {
- MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, radeon_output->pI2CBus);
+ MonInfo = xf86OutputGetEDID(output, radeon_output->pI2CBus);
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "
DDC2/I2C is not properly initialized\n");
extern Bool RADEONPreInit(ScrnInfoPtr, int);
-extern Bool RADEONScreenInit(int, ScreenPtr, int, char **);
-extern Bool RADEONSwitchMode(int, DisplayModePtr, int);
+extern Bool RADEONScreenInit(SCREEN_INIT_ARGS_DECL);
+extern Bool RADEONSwitchMode(SWITCH_MODE_ARGS_DECL);
#ifdef X_XF86MiscPassMessage
extern Bool RADEONHandleMessage(int, const char*, const char*,
-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(ADJUST_FRAME_ARGS_DECL);
+extern Bool RADEONEnterVT(VT_FUNC_ARGS_DECL);
+extern void RADEONLeaveVT(VT_FUNC_ARGS_DECL);
+extern void RADEONFreeScreen(FREE_SCREEN_ARGS_DECL);
+extern ModeStatus RADEONValidMode(SCRN_ARG_TYPE, DisplayModePtr, Bool, int);
extern const OptionInfoRec *RADEONOptionsWeak(void);
/* 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 RADEONBlockHandler(int i, pointer blockData,
- pointer pTimeout, pointer pReadmask)
+static void RADEONBlockHandler(BLOCKHANDLER_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[i];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
pScreen->BlockHandler = info->BlockHandler;
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
pScreen->BlockHandler = RADEONBlockHandler;
if (info->VideoTimerCallback)
/* Called at the start of each server generation. */
-Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+Bool RADEONScreenInit(SCREEN_INIT_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
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");
- 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");
- xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n");
if (xf86QueryLargestOffscreenArea(pScreen, &width, &height,
- xf86DrvMsg(scrnIndex, X_INFO,
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Largest offscreen area available: %d x %d\n",
- 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");
- xf86DrvMsg(scrnIndex, X_INFO, "Using software cursor\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using software cursor\n");
/* Wrap pointer motion to flip touch screen around */
info->PointerMoved = pScrn->PointerMoved;
pScrn->PointerMoved = RADEONPointerMoved;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
-Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+Bool RADEONSwitchMode(SWITCH_MODE_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
Bool tilingOld = info->tilingEnabled;
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 */
/* 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,
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
-void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
+void RADEONAdjustFrame(ADJUST_FRAME_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
/* Called when VT switching back to the X server. Reinitialize the
-Bool RADEONEnterVT(int scrnIndex, int flags)
+Bool RADEONEnterVT(VT_FUNC_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
/* Called when VT switching away from the X server. Restore the
-void RADEONLeaveVT(int scrnIndex, int flags)
+void RADEONLeaveVT(VT_FUNC_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
* text mode, unmap video memory, and unwrap and call the saved
-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);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
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(FREE_SCREEN_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
-static Bool RADEONDRIDoCloseScreen(int scrnIndex, ScreenPtr pScreen)
+static Bool RADEONDRIDoCloseScreen(CLOSE_SCREEN_ARGS_DECL)
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONDRICloseScreen(pScreen);
pScreen->CloseScreen = info->DRICloseScreen;
- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
/* Finish initializing the device-dependent DRI state, and call
- RADEONSwitchMode(indx, pScrn->currentMode, 0);
+ RADEONSwitchMode(indx, pScrn->currentMode);
if (info->directRenderingEnabled) {
RADEONCP_STOP(pScrn, info);
RADEONCP_START(pScrn, info);
- RADEONAdjustFrame(indx, 0, 0, 0);
+ RADEONAdjustFrame(indx, 0, 0);
if (!info->DGAactive) { /* save the old parameters */
/* RADEONModeInit() will set the mode field */
- RADEONSwitchMode(indx, pMode->mode, 0);
+ RADEONSwitchMode(indx, pMode->mode);
if (info->directRenderingEnabled) {
RADEONInfoPtr info = RADEONPTR(pScrn);
- RADEONAdjustFrame(pScrn->pScreen->myNum, x, y, flags);
+ RADEONAdjustFrame(pScrn->pScreen->myNum, x, y);
info->DGAViewportStatus = 0; /* FIXME */