xorg: initialize glamor provider

This allows Xorg to use Glamor GLX when Glamor is requested,
and eliminates usage of DRI2 in case of Glamor.

Signed-off-by: Konstantin Pugin <ria.freelander@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Emma Anholt <emma@anholt.net>
This commit is contained in:
Konstantin Pugin 2022-07-21 00:49:13 +03:00 committed by Konstantin
parent a563f530f6
commit a987fc7c36
2 changed files with 12 additions and 1 deletions

View File

@ -46,6 +46,7 @@
#include "glamor.h"
#include "glamor_priv.h"
#include "glamor_glx_provider.h"
#include "dri3.h"
struct glamor_egl_screen_private {
@ -886,6 +887,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
glamor_egl_get_screen_private(scrn);
#ifdef DRI3
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
#endif
#ifdef GLXEXT
static Bool vendor_initialized = FALSE;
#endif
const char *gbm_backend_name;
@ -927,6 +931,13 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
}
}
#endif
#ifdef GLXEXT
if (!vendor_initialized) {
GlxPushProvider(&glamor_provider);
xorgGlxCreateVendor();
vendor_initialized = TRUE;
}
#endif
}
static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)

View File

@ -15,7 +15,7 @@ shared_module(
dependency('libdrm', version: '>= 2.4.46'),
gbm_dep,
],
link_with: glamor,
link_with: [glamor, libxserver_glx],
install: true,
install_dir: module_dir,