kdrive/fbdev: Allow forcing glamor to create GL/GLES contexts only

This brings Xfbdev's glamor code in line with glamor/glamor_egl.c

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2026-01-27 05:22:35 +02:00
committed by Enrico Weigelt
parent ebd217aafb
commit 04a30c2719
3 changed files with 21 additions and 2 deletions

View File

@@ -18,6 +18,9 @@
const char *fbdev_glvnd_provider = "mesa";
Bool es_allowed = TRUE;
Bool force_es = FALSE;
static void
fbdev_glamor_egl_cleanup(FbdevScrPriv *scrpriv)
{
@@ -310,11 +313,11 @@ fbdev_glamor_egl_try_gles_api(FbdevScrPriv *scrpriv)
static Bool
fbdev_glamor_bind_gl_api(FbdevScrPriv *scrpriv)
{
if (fbdev_glamor_egl_try_big_gl_api(scrpriv)) {
if (!force_es && fbdev_glamor_egl_try_big_gl_api(scrpriv)) {
return TRUE;
}
return fbdev_glamor_egl_try_gles_api(scrpriv);
return es_allowed && fbdev_glamor_egl_try_gles_api(scrpriv);
}
static Bool

View File

@@ -64,6 +64,8 @@ extern Bool fbDisableShadow;
#if defined(GLAMOR) && defined(GLXEXT)
extern const char *fbdev_glvnd_provider;
extern Bool es_allowed;
extern Bool force_es;
#endif
Bool fbdevCardInit(KdCardInfo * card);

View File

@@ -72,6 +72,10 @@ ddxUseMsg(void)
("-noshadow Disable the ShadowFB layer if possible\n");
ErrorF
("-glvendor Suggest what glvnd vendor library should be used\n");
ErrorF
("-force-gl Force glamor to only use GL contexts\n");
ErrorF
("-force-es Force glamor to only use GLES contexts\n");
ErrorF("\n");
}
@@ -101,6 +105,16 @@ ddxProcessArgument(int argc, char **argv, int i)
UseMsg();
exit(1);
}
if (!strcmp(argv[i], "-force-gl")) {
es_allowed = FALSE;
return 1;
}
if (!strcmp(argv[i], "-force-es")) {
force_es = TRUE;
return 1;
}
#endif
return KdProcessArgument(argc, argv, i);