kdrive/fbdev: Use ShadowFB by default

It can be disabled by passing `-noshadow` to the command-line args

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2026-01-08 19:39:08 +02:00
committed by Enrico Weigelt
parent 5d3490d135
commit cb445cef6b
3 changed files with 15 additions and 3 deletions

View File

@@ -35,6 +35,7 @@
#endif
const char *fbdevDevicePath = NULL;
Bool fbDisableShadow = FALSE;
static Bool
fbdevInitialize(KdCardInfo * card, FbdevPriv * priv)
@@ -345,11 +346,14 @@ fbdevMapFramebuffer(KdScreenInfo * screen)
KdPointerMatrix m;
FbdevPriv *priv = screen->card->driver;
if (scrpriv->randr != RR_Rotate_0 ||
priv->fix.type != FB_TYPE_PACKED_PIXELS)
if (!fbDisableShadow) {
scrpriv->shadow = TRUE;
else
} else if (scrpriv->randr != RR_Rotate_0 ||
priv->fix.type != FB_TYPE_PACKED_PIXELS) {
scrpriv->shadow = TRUE;
} else {
scrpriv->shadow = FALSE;
}
KdComputePointerMatrix(&m, scrpriv->randr, screen->width, screen->height);

View File

@@ -50,6 +50,7 @@ typedef struct _fbdevScrPriv {
extern KdCardFuncs fbdevFuncs;
extern const char *fbdevDevicePath;
extern Bool fbDisableShadow;
Bool fbdevCardInit(KdCardInfo * card);

View File

@@ -68,6 +68,8 @@ ddxUseMsg(void)
ErrorF("\nXfbdev Device Usage:\n");
ErrorF
("-fb path Framebuffer device to use. Defaults to /dev/fb0\n");
ErrorF
("-noshadow Disable the ShadowFB layer if possible\n");
ErrorF("\n");
}
@@ -83,6 +85,11 @@ ddxProcessArgument(int argc, char **argv, int i)
exit(1);
}
if (!strcmp(argv[i], "-noshadow")) {
fbDisableShadow = TRUE;
return 1;
}
return KdProcessArgument(argc, argv, i);
}