[PATCH xserver 3/3] kdrive: Remove dead slots from KdCardFuncs
Adam Jackson
ajax at redhat.com
Fri Mar 24 19:58:55 UTC 2017
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
hw/kdrive/ephyr/ephyr.c | 27 ------------------
hw/kdrive/ephyr/ephyrinit.c | 9 ------
hw/kdrive/src/kcmap.c | 9 ------
hw/kdrive/src/kdrive.c | 67 +--------------------------------------------
hw/kdrive/src/kdrive.h | 9 ------
5 files changed, 1 insertion(+), 120 deletions(-)
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 546a76c..d064f51 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -735,33 +735,6 @@ ephyrCreateResources(ScreenPtr pScreen)
}
void
-ephyrPreserve(KdCardInfo * card)
-{
-}
-
-Bool
-ephyrEnable(ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-Bool
-ephyrDPMS(ScreenPtr pScreen, int mode)
-{
- return TRUE;
-}
-
-void
-ephyrDisable(ScreenPtr pScreen)
-{
-}
-
-void
-ephyrRestore(KdCardInfo * card)
-{
-}
-
-void
ephyrScreenFini(KdScreenInfo * screen)
{
EphyrScrPriv *scrpriv = screen->driver;
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 4870f16..8a4e3a3 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -386,19 +386,10 @@ KdCardFuncs ephyrFuncs = {
ephyrInitScreen, /* initScreen */
ephyrFinishInitScreen, /* finishInitScreen */
ephyrCreateResources, /* createRes */
- ephyrPreserve, /* preserve */
- ephyrEnable, /* enable */
- ephyrDPMS, /* dpms */
- ephyrDisable, /* disable */
- ephyrRestore, /* restore */
ephyrScreenFini, /* scrfini */
ephyrCardFini, /* cardfini */
0, /* initCursor */
- 0, /* enableCursor */
- 0, /* disableCursor */
- 0, /* finiCursor */
- 0, /* recolorCursor */
0, /* initAccel */
0, /* enableAccel */
diff --git a/hw/kdrive/src/kcmap.c b/hw/kdrive/src/kcmap.c
index 455e877..b8697ca 100644
--- a/hw/kdrive/src/kcmap.c
+++ b/hw/kdrive/src/kcmap.c
@@ -72,10 +72,6 @@ KdSetColormap(ScreenPtr pScreen)
(*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen,
(1 << pScreenPriv->screen->fb.
depth), defs);
-
- /* recolor hardware cursor */
- if (pScreenPriv->card->cfuncs->recolorCursor)
- (*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, 0, 0);
}
/*
@@ -235,9 +231,4 @@ KdStoreColors(ColormapPtr pCmap, int ndef, xColorItem * pdefs)
}
(*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, ndef, pdefs);
-
- /* recolor hardware cursor */
- if (pScreenPriv->card->cfuncs->recolorCursor)
- (*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, ndef,
- pdefs);
}
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index cd46556..8912a38 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -102,14 +102,7 @@ KdDisableScreen(ScreenPtr pScreen)
KdDisableColormap(pScreen);
if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel)
(*pScreenPriv->card->cfuncs->disableAccel) (pScreen);
- if (!pScreenPriv->screen->softCursor &&
- pScreenPriv->card->cfuncs->disableCursor)
- (*pScreenPriv->card->cfuncs->disableCursor) (pScreen);
- if (pScreenPriv->card->cfuncs->dpms)
- (*pScreenPriv->card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL);
pScreenPriv->enabled = FALSE;
- if (pScreenPriv->card->cfuncs->disable)
- (*pScreenPriv->card->cfuncs->disable) (pScreen);
}
static void
@@ -143,8 +136,6 @@ KdSuspend(void)
for (screen = card->screenList; screen; screen = screen->next)
if (screen->mynum == card->selected && screen->pScreen)
KdDisableScreen(screen->pScreen);
- if (card->driver && card->cfuncs->restore)
- (*card->cfuncs->restore) (card);
}
KdDisableInput();
KdDoSwitchCmd("suspend");
@@ -165,21 +156,13 @@ KdEnableScreen(ScreenPtr pScreen)
if (pScreenPriv->enabled)
return TRUE;
- if (pScreenPriv->card->cfuncs->enable)
- if (!(*pScreenPriv->card->cfuncs->enable) (pScreen))
- return FALSE;
pScreenPriv->enabled = TRUE;
pScreenPriv->dpmsState = KD_DPMS_NORMAL;
pScreenPriv->card->selected = pScreenPriv->screen->mynum;
- if (!pScreenPriv->screen->softCursor &&
- pScreenPriv->card->cfuncs->enableCursor)
- (*pScreenPriv->card->cfuncs->enableCursor) (pScreen);
if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel)
(*pScreenPriv->card->cfuncs->enableAccel) (pScreen);
KdEnableColormap(pScreen);
SetRootClip(pScreen, ROOT_CLIP_FULL);
- if (pScreenPriv->card->cfuncs->dpms)
- (*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState);
return TRUE;
}
@@ -598,26 +581,12 @@ KdCloseScreen(ScreenPtr pScreen)
else
ret = TRUE;
- if (pScreenPriv->dpmsState != KD_DPMS_NORMAL)
- (*card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL);
-
if (screen->mynum == card->selected)
KdDisableScreen(pScreen);
- /*
- * Restore video hardware when last screen is closed
- */
- if (screen == card->screenList) {
- if (kdEnabled && card->cfuncs->restore)
- (*card->cfuncs->restore) (card);
- }
-
if (!pScreenPriv->screen->dumb && card->cfuncs->finiAccel)
(*card->cfuncs->finiAccel) (pScreen);
- if (!pScreenPriv->screen->softCursor && card->cfuncs->finiCursor)
- (*card->cfuncs->finiCursor) (pScreen);
-
if (card->cfuncs->scrfini)
(*card->cfuncs->scrfini) (screen);
@@ -645,34 +614,7 @@ KdCloseScreen(ScreenPtr pScreen)
static Bool
KdSaveScreen(ScreenPtr pScreen, int on)
{
- KdScreenPriv(pScreen);
- int dpmsState;
-
- if (!pScreenPriv->card->cfuncs->dpms)
- return FALSE;
-
- dpmsState = pScreenPriv->dpmsState;
- switch (on) {
- case SCREEN_SAVER_OFF:
- dpmsState = KD_DPMS_NORMAL;
- break;
- case SCREEN_SAVER_ON:
- if (dpmsState == KD_DPMS_NORMAL)
- dpmsState = KD_DPMS_NORMAL + 1;
- break;
- case SCREEN_SAVER_CYCLE:
- if (dpmsState < KD_DPMS_MAX)
- dpmsState++;
- break;
- case SCREEN_SAVER_FORCER:
- break;
- }
- if (dpmsState != pScreenPriv->dpmsState) {
- if (pScreenPriv->enabled)
- (*pScreenPriv->card->cfuncs->dpms) (pScreen, dpmsState);
- pScreenPriv->dpmsState = dpmsState;
- }
- return TRUE;
+ return FALSE;
}
static Bool
@@ -886,14 +828,7 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
kdEnabled = TRUE;
if (screen->mynum == card->selected) {
- if (card->cfuncs->preserve)
- (*card->cfuncs->preserve) (card);
- if (card->cfuncs->enable)
- if (!(*card->cfuncs->enable) (pScreen))
- return FALSE;
pScreenPriv->enabled = TRUE;
- if (!screen->softCursor && card->cfuncs->enableCursor)
- (*card->cfuncs->enableCursor) (pScreen);
KdEnableColormap(pScreen);
if (!screen->dumb && card->cfuncs->enableAccel)
(*card->cfuncs->enableAccel) (pScreen);
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index ad7d1c7..432f891 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -110,19 +110,10 @@ typedef struct _KdCardFuncs {
Bool (*initScreen) (ScreenPtr); /* initialize ScreenRec */
Bool (*finishInitScreen) (ScreenPtr pScreen);
Bool (*createRes) (ScreenPtr); /* create screen resources */
- void (*preserve) (KdCardInfo *); /* save graphics card state */
- Bool (*enable) (ScreenPtr); /* set up for rendering */
- Bool (*dpms) (ScreenPtr, int); /* set DPMS screen saver */
- void (*disable) (ScreenPtr); /* turn off rendering */
- void (*restore) (KdCardInfo *); /* restore graphics card state */
void (*scrfini) (KdScreenInfo *); /* close down screen */
void (*cardfini) (KdCardInfo *); /* close down */
Bool (*initCursor) (ScreenPtr); /* detect and map cursor */
- void (*enableCursor) (ScreenPtr); /* enable cursor */
- void (*disableCursor) (ScreenPtr); /* disable cursor */
- void (*finiCursor) (ScreenPtr); /* close down */
- void (*recolorCursor) (ScreenPtr, int, xColorItem *);
Bool (*initAccel) (ScreenPtr);
void (*enableAccel) (ScreenPtr);
--
2.9.3
More information about the xorg-devel
mailing list