mirror of
https://github.com/X11Libre/xf86-video-r128.git
synced 2026-03-24 01:24:26 +00:00
drop support for ancient xserver versions
We're now relying on at least 1.18 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-r128/-/merge_requests/11>
This commit is contained in:
@@ -28,77 +28,12 @@
|
||||
#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 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 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
|
||||
|
||||
#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
|
||||
#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout
|
||||
#define BLOCKHANDLER_ARGS arg, pTimeout
|
||||
#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout
|
||||
#define BLOCKHANDLER_ARGS pScreen, pTimeout
|
||||
#else
|
||||
#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
|
||||
#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
|
||||
#endif
|
||||
|
||||
#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)
|
||||
|
||||
#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout, pointer pReadmask
|
||||
#define BLOCKHANDLER_ARGS pScreen, pTimeout, pReadmask
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -329,7 +329,7 @@ typedef struct {
|
||||
|
||||
R128SaveRec SavedReg; /* Original (text) mode */
|
||||
R128SaveRec ModeReg; /* Current mode */
|
||||
Bool (*CloseScreen)(CLOSE_SCREEN_ARGS_DECL);
|
||||
Bool (*CloseScreen)(ScreenPtr pScreen);
|
||||
void (*BlockHandler)(BLOCKHANDLER_ARGS_DECL);
|
||||
|
||||
Bool PaletteSavedOnVT; /* Palette saved on last VT switch */
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
#include <X11/extensions/dpms.h>
|
||||
#endif
|
||||
|
||||
static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL);
|
||||
static Bool R128CloseScreen(ScreenPtr pScreen);
|
||||
static Bool R128SaveScreen(ScreenPtr pScreen, int mode);
|
||||
static void R128Save(ScrnInfoPtr pScrn);
|
||||
static void R128Restore(ScrnInfoPtr pScrn);
|
||||
@@ -1691,7 +1691,6 @@ static void R128LoadPalette(ScrnInfoPtr pScrn, int numColors,
|
||||
static void
|
||||
R128BlockHandler(BLOCKHANDLER_ARGS_DECL)
|
||||
{
|
||||
SCREEN_PTR(arg);
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
|
||||
@@ -1710,7 +1709,7 @@ R128BlockHandler(BLOCKHANDLER_ARGS_DECL)
|
||||
}
|
||||
|
||||
/* Called at the start of each server generation. */
|
||||
Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
Bool R128ScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
@@ -2084,7 +2083,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
}
|
||||
|
||||
R128SaveScreen(pScreen, SCREEN_SAVER_ON);
|
||||
//pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
|
||||
//pScrn->AdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
|
||||
|
||||
/* DGA setup */
|
||||
#ifdef XFreeXDGA
|
||||
@@ -2715,9 +2714,8 @@ static Bool R128SaveScreen(ScreenPtr pScreen, int mode)
|
||||
* The workaround is to switch the mode, then switch to another VT, then
|
||||
* switch back. --AGD
|
||||
*/
|
||||
Bool R128SwitchMode(SWITCH_MODE_ARGS_DECL)
|
||||
Bool R128SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
Bool ret;
|
||||
|
||||
@@ -2796,10 +2794,9 @@ ModeStatus R128DoValidMode(xf86OutputPtr output, DisplayModePtr mode, int flags)
|
||||
}
|
||||
|
||||
/* Used to disallow modes that are not supported by the hardware. */
|
||||
ModeStatus R128ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
|
||||
ModeStatus R128ValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
|
||||
Bool verbose, int flags)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
R128EntPtr pR128Ent = R128EntPriv(pScrn);
|
||||
xf86OutputPtr output = R128FirstOutput(pR128Ent->pCrtc[0]);
|
||||
|
||||
@@ -2808,9 +2805,8 @@ ModeStatus R128ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
|
||||
|
||||
/* Adjust viewport into virtual desktop such that (0,0) in viewport space
|
||||
is (x,y) in virtual space. */
|
||||
void R128AdjustFrame(ADJUST_FRAME_ARGS_DECL)
|
||||
void R128AdjustFrame(ScrnInfoPtr pScrn, int x, int y)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
unsigned char *R128MMIO = info->MMIO;
|
||||
int Base;
|
||||
@@ -2837,9 +2833,8 @@ void R128AdjustFrame(ADJUST_FRAME_ARGS_DECL)
|
||||
|
||||
/* Called when VT switching back to the X server. Reinitialize the video
|
||||
mode. */
|
||||
Bool R128EnterVT(VT_FUNC_ARGS_DECL)
|
||||
Bool R128EnterVT(ScrnInfoPtr pScrn)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
|
||||
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
@@ -2847,7 +2842,7 @@ Bool R128EnterVT(VT_FUNC_ARGS_DECL)
|
||||
|
||||
pScrn->vtSema = TRUE;
|
||||
if (info->FBDev) {
|
||||
if (!fbdevHWEnterVT(VT_FUNC_ARGS)) return FALSE;
|
||||
if (!fbdevHWEnterVT(pScrn)) return FALSE;
|
||||
} else {
|
||||
if (!xf86SetDesiredModes(pScrn)) return FALSE;
|
||||
}
|
||||
@@ -2870,16 +2865,15 @@ Bool R128EnterVT(VT_FUNC_ARGS_DECL)
|
||||
#endif
|
||||
|
||||
info->PaletteSavedOnVT = FALSE;
|
||||
//pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
|
||||
//pScrn->AdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Called when VT switching away from the X server. Restore the original
|
||||
text mode. */
|
||||
void R128LeaveVT(VT_FUNC_ARGS_DECL)
|
||||
void R128LeaveVT(ScrnInfoPtr pScrn)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
R128SavePtr save = &info->ModeReg;
|
||||
|
||||
@@ -2898,7 +2892,7 @@ void R128LeaveVT(VT_FUNC_ARGS_DECL)
|
||||
R128SavePalette(pScrn, save);
|
||||
info->PaletteSavedOnVT = TRUE;
|
||||
if (info->FBDev)
|
||||
fbdevHWLeaveVT(VT_FUNC_ARGS);
|
||||
fbdevHWLeaveVT(pScrn);
|
||||
else
|
||||
R128Restore(pScrn);
|
||||
}
|
||||
@@ -2907,7 +2901,7 @@ void R128LeaveVT(VT_FUNC_ARGS_DECL)
|
||||
/* 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 R128CloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
static Bool R128CloseScreen(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
@@ -2948,12 +2942,11 @@ static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
|
||||
pScreen->BlockHandler = info->BlockHandler;
|
||||
pScreen->CloseScreen = info->CloseScreen;
|
||||
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
|
||||
return (*pScreen->CloseScreen)(pScreen);
|
||||
}
|
||||
|
||||
void R128FreeScreen(FREE_SCREEN_ARGS_DECL)
|
||||
void R128FreeScreen(ScrnInfoPtr pScrn)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
R128InfoPtr info = R128PTR(pScrn);
|
||||
|
||||
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
|
||||
@@ -333,7 +333,7 @@ static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output)
|
||||
/* XXX: Radeon does something here to appease old monitors. */
|
||||
OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg) | mask1);
|
||||
OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg) & ~mask2);
|
||||
*MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), r128_output->pI2CBus);
|
||||
*MonInfo = xf86DoEDID_DDC2(pScrn, r128_output->pI2CBus);
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DDC2/I2C is not properly initialized\n");
|
||||
return MT_NONE;
|
||||
|
||||
@@ -169,13 +169,13 @@ extern SymTabRec R128Chipsets[];
|
||||
|
||||
/* r128_driver.c */
|
||||
extern Bool R128PreInit(ScrnInfoPtr, int);
|
||||
extern Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL);
|
||||
extern Bool R128SwitchMode(SWITCH_MODE_ARGS_DECL);
|
||||
extern void R128AdjustFrame(ADJUST_FRAME_ARGS_DECL);
|
||||
extern Bool R128EnterVT(VT_FUNC_ARGS_DECL);
|
||||
extern void R128LeaveVT(VT_FUNC_ARGS_DECL);
|
||||
extern void R128FreeScreen(FREE_SCREEN_ARGS_DECL);
|
||||
extern ModeStatus R128ValidMode(SCRN_ARG_TYPE, DisplayModePtr, Bool, int);
|
||||
extern Bool R128ScreenInit(ScreenPtr pScreen, int argc, char **argv);
|
||||
extern Bool R128SwitchMode(ScrnInfoPtr pScrnInfo, DisplayModePtr mode);
|
||||
extern void R128AdjustFrame(ScrnInfoPtr arg, int x, int y);
|
||||
extern Bool R128EnterVT(ScrnInfoPtr pScrn);
|
||||
extern void R128LeaveVT(ScrnInfoPtr pScrn);
|
||||
extern void R128FreeScreen(ScrnInfoPtr pScrn);
|
||||
extern ModeStatus R128ValidMode(ScrnInfoPtr, DisplayModePtr, Bool, int);
|
||||
|
||||
extern const OptionInfoRec * R128OptionsWeak(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user