drop compat with ancient xserver versions

We're relying on at least 1.18 now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-05-14 16:29:17 +02:00
parent 7d7aa65d64
commit 3f45b624ef
17 changed files with 92 additions and 349 deletions

View File

@@ -40,15 +40,9 @@
#include "saa.h"
#include "saa_priv.h"
#ifdef SAA_DEVPRIVATEKEYREC
DevPrivateKeyRec saa_screen_index;
DevPrivateKeyRec saa_pixmap_index;
DevPrivateKeyRec saa_gc_index;
#else
int saa_screen_index = -1;
int saa_pixmap_index = -1;
int saa_gc_index = -1;
#endif
/**
* saa_get_drawable_pixmap() returns a backing pixmap for a given drawable.
@@ -712,7 +706,6 @@ saa_driver_init(ScreenPtr screen, struct saa_driver * saa_driver)
return FALSE;
}
#endif
#ifdef SAA_DEVPRIVATEKEYREC
if (!dixRegisterPrivateKey(&saa_screen_index, PRIVATE_SCREEN, 0)) {
LogMessage(X_ERROR, "Failed to register SAA screen private.\n");
return FALSE;
@@ -727,20 +720,6 @@ saa_driver_init(ScreenPtr screen, struct saa_driver * saa_driver)
LogMessage(X_ERROR, "Failed to register SAA gc private.\n");
return FALSE;
}
#else
if (!dixRequestPrivate(&saa_screen_index, 0)) {
LogMessage(X_ERROR, "Failed to register SAA screen private.\n");
return FALSE;
}
if (!dixRequestPrivate(&saa_pixmap_index, saa_driver->pixmap_size)) {
LogMessage(X_ERROR, "Failed to register SAA pixmap private.\n");
return FALSE;
}
if (!dixRequestPrivate(&saa_gc_index, sizeof(struct saa_gc_priv))) {
LogMessage(X_ERROR, "Failed to register SAA gc private.\n");
return FALSE;
}
#endif
sscreen = calloc(1, sizeof(*sscreen));

View File

@@ -141,13 +141,7 @@ saa_copy_area(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
srcx, srcy, width, height, dstx, dsty);
}
#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 6)
return miDoCopy(pSrcDrawable, pDstDrawable, pGC,
srcx, srcy, width, height,
dstx, dsty, saa_copy_nton, 0, NULL);
#else
return fbDoCopy(pSrcDrawable, pDstDrawable, pGC,
srcx, srcy, width, height,
dstx, dsty, saa_copy_nton, 0, NULL);
#endif
}

View File

@@ -66,8 +66,8 @@
struct saa_gc_priv {
/* GC values from the layer below. */
CONST_ABI_18_0 GCOps *saved_ops;
CONST_ABI_18_0 GCFuncs *saved_funcs;
const GCOps *saved_ops;
const GCFuncs *saved_funcs;
};
struct saa_screen_priv {
@@ -138,14 +138,11 @@ do { \
}
#define saa_swap(priv, real, mem) {\
CONST_ABI_18_0 void *tmp = (priv)->saved_##mem; \
const void *tmp = (priv)->saved_##mem; \
(priv)->saved_##mem = (real)->mem; \
(real)->mem = tmp; \
}
#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 8)
#define SAA_DEVPRIVATEKEYREC 1
extern DevPrivateKeyRec saa_screen_index;
extern DevPrivateKeyRec saa_pixmap_index;
extern DevPrivateKeyRec saa_gc_index;
@@ -170,34 +167,6 @@ saa_pixmap(PixmapPtr pix)
return (struct saa_pixmap *)dixGetPrivateAddr(&pix->devPrivates,
&saa_pixmap_index);
}
#else
#undef SAA_DEVPRIVATEKEYREC
extern int saa_screen_index;
extern int saa_pixmap_index;
extern int saa_gc_index;
static inline struct saa_screen_priv *
saa_screen(ScreenPtr screen)
{
return (struct saa_screen_priv *)dixLookupPrivate(&screen->devPrivates,
&saa_screen_index);
}
static inline struct saa_gc_priv *
saa_gc(GCPtr gc)
{
return (struct saa_gc_priv *)dixLookupPrivateAddr(&gc->devPrivates,
&saa_gc_index);
}
static inline struct saa_pixmap *
saa_pixmap(PixmapPtr pix)
{
return (struct saa_pixmap *)dixLookupPrivateAddr(&pix->devPrivates,
&saa_pixmap_index);
}
#endif
extern void
saa_check_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int nspans,

View File

@@ -649,15 +649,10 @@ saa_check_copy_window(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
#ifdef RENDER
#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10)
static void
saa_src_validate(DrawablePtr pDrawable,
int x,
int y, int width, int height, unsigned int subWindowMode)
#else
static void
saa_src_validate(DrawablePtr pDrawable, int x, int y, int width, int height)
#endif
{
ScreenPtr pScreen = pDrawable->pScreen;
struct saa_screen_priv *sscreen = saa_screen(pScreen);
@@ -682,9 +677,7 @@ saa_src_validate(DrawablePtr pDrawable, int x, int y, int width, int height)
if (sscreen->saved_SourceValidate) {
saa_swap(sscreen, pScreen, SourceValidate);
pScreen->SourceValidate(pDrawable, x, y, width, height
#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10)
, subWindowMode
#endif
);
saa_swap(sscreen, pScreen, SourceValidate);
}