mirror of
https://github.com/X11Libre/xf86-video-fbdev.git
synced 2026-03-24 01:24:49 +00:00
drop compat with ancient xservers
We're relying on >= 1.18 now, so no compat with older ones needed. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/8>
This commit is contained in:
@@ -29,5 +29,4 @@ fbdev_drv_la_LDFLAGS = -module -avoid-version
|
||||
fbdev_drv_ladir = @moduledir@/drivers
|
||||
|
||||
fbdev_drv_la_SOURCES = \
|
||||
compat-api.h \
|
||||
fbdev.c
|
||||
|
||||
101
src/compat-api.h
101
src/compat-api.h
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 Red Hat, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Dave Airlie <airlied@redhat.com>
|
||||
*/
|
||||
|
||||
/* this file provides API compat between server post 1.13 and pre it,
|
||||
it should be reused inside as many drivers as possible */
|
||||
#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 FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
|
||||
|
||||
#define VT_FUNC_ARGS_DECL int arg, int flags
|
||||
#define VT_FUNC_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)
|
||||
|
||||
#define SCREEN_ARG_TYPE ScreenPtr
|
||||
#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
|
||||
|
||||
#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 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 FREE_SCREEN_ARGS(x) (x)
|
||||
|
||||
#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
|
||||
#define VT_FUNC_ARGS(flags) pScrn
|
||||
|
||||
#define XF86_ENABLEDISABLEFB_ARG(x) (x)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
29
src/fbdev.c
29
src/fbdev.c
@@ -27,8 +27,6 @@
|
||||
|
||||
#include "xf86xv.h"
|
||||
|
||||
#include "compat-api.h"
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
#include <pciaccess.h>
|
||||
#endif
|
||||
@@ -60,11 +58,11 @@ static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
|
||||
struct pci_device *dev, intptr_t match_data);
|
||||
#endif
|
||||
static Bool FBDevPreInit(ScrnInfoPtr pScrn, int flags);
|
||||
static Bool FBDevScreenInit(SCREEN_INIT_ARGS_DECL);
|
||||
static Bool FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL);
|
||||
static Bool FBDevScreenInit(ScreenPtr pScreen, int argc, char **argv);
|
||||
static Bool FBDevCloseScreen(ScreenPtr pScreen);
|
||||
static void * FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
|
||||
CARD32 *size, void *closure);
|
||||
static void FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y);
|
||||
static void FBDevPointerMoved(ScrnInfoPtr pScrn, int x, int y);
|
||||
static Bool FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
|
||||
static Bool FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
|
||||
pointer ptr);
|
||||
@@ -184,7 +182,7 @@ typedef struct {
|
||||
void *shadow;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
CreateScreenResourcesProcPtr CreateScreenResources;
|
||||
void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
|
||||
void (*PointerMoved)(ScrnInfoPtr pScrn, int x, int y);
|
||||
EntityInfoPtr pEnt;
|
||||
/* DGA info */
|
||||
DGAModePtr pDGAMode;
|
||||
@@ -742,7 +740,7 @@ fbdevSaveScreen(ScreenPtr pScreen, int mode)
|
||||
}
|
||||
|
||||
static Bool
|
||||
FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
FBDevScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
@@ -777,7 +775,7 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
return FALSE;
|
||||
}
|
||||
fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
|
||||
fbdevHWAdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
|
||||
fbdevHWAdjustFrame(pScrn, 0, 0);
|
||||
|
||||
/* mi layer */
|
||||
miClearVisualTypes();
|
||||
@@ -1004,7 +1002,7 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
}
|
||||
|
||||
static Bool
|
||||
FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
FBDevCloseScreen(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
@@ -1025,7 +1023,7 @@ FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
|
||||
pScreen->CreateScreenResources = fPtr->CreateScreenResources;
|
||||
pScreen->CloseScreen = fPtr->CloseScreen;
|
||||
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
|
||||
return (*pScreen->CloseScreen)(pScreen);
|
||||
}
|
||||
|
||||
|
||||
@@ -1053,9 +1051,8 @@ FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
|
||||
}
|
||||
|
||||
static void
|
||||
FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
|
||||
FBDevPointerMoved(ScrnInfoPtr pScrn, int x, int y)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
int newX, newY;
|
||||
|
||||
@@ -1087,7 +1084,7 @@ FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
|
||||
}
|
||||
|
||||
/* Pass adjusted pointer coordinates to wrapped PointerMoved function. */
|
||||
(*fPtr->PointerMoved)(arg, newX, newY);
|
||||
(*fPtr->PointerMoved)(pScrn, newX, newY);
|
||||
}
|
||||
|
||||
|
||||
@@ -1133,9 +1130,9 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
|
||||
frameY0 = pScrn->frameY0;
|
||||
}
|
||||
|
||||
if (!(*pScrn->SwitchMode)(SWITCH_MODE_ARGS(pScrn, pMode)))
|
||||
if (!(*pScrn->SwitchMode)(pScrn, pMode))
|
||||
return FALSE;
|
||||
(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, frameX0, frameY0));
|
||||
(*pScrn->AdjustFrame)(pScrn, frameX0, frameY0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1143,7 +1140,7 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
|
||||
static void
|
||||
FBDevDGASetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
|
||||
{
|
||||
(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, x, y));
|
||||
(*pScrn->AdjustFrame)(pScrn, x, y);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user