glamor_egl: add support of GlxVendorLibrary option
Same semantics as in glxdri2.c, and same purpose. Signed-off-by: Konstantin <ria.freelander@gmail.com>
This commit is contained in:
parent
a987fc7c36
commit
a449bb4c5d
|
@ -59,6 +59,7 @@ struct glamor_egl_screen_private {
|
|||
int fd;
|
||||
struct gbm_device *gbm;
|
||||
int dmabuf_capable;
|
||||
Bool force_vendor; /* if GLVND vendor is forced from options */
|
||||
|
||||
CloseScreenProcPtr saved_close_screen;
|
||||
DestroyPixmapProcPtr saved_destroy_pixmap;
|
||||
|
@ -904,10 +905,13 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
|
|||
|
||||
glamor_ctx->make_current = glamor_egl_make_current;
|
||||
|
||||
gbm_backend_name = gbm_device_get_backend_name(glamor_egl->gbm);
|
||||
/* Mesa uses "drm" as backend name, in that case, just do nothing */
|
||||
if (gbm_backend_name && strcmp(gbm_backend_name, "drm") != 0)
|
||||
glamor_set_glvnd_vendor(screen, gbm_backend_name);
|
||||
/* Use dynamic logic only if vendor is not forced via xorg.conf */
|
||||
if (!glamor_egl->force_vendor) {
|
||||
gbm_backend_name = gbm_device_get_backend_name(glamor_egl->gbm);
|
||||
/* Mesa uses "drm" as backend name, in that case, just do nothing */
|
||||
if (gbm_backend_name && strcmp(gbm_backend_name, "drm") != 0)
|
||||
glamor_set_glvnd_vendor(screen, gbm_backend_name);
|
||||
}
|
||||
#ifdef DRI3
|
||||
/* Tell the core that we have the interfaces for import/export
|
||||
* of pixmaps.
|
||||
|
@ -1061,10 +1065,12 @@ glamor_egl_try_gles_api(ScrnInfoPtr scrn)
|
|||
|
||||
enum {
|
||||
GLAMOREGLOPT_RENDERING_API,
|
||||
GLAMOREGLOPT_VENDOR_LIBRARY
|
||||
};
|
||||
|
||||
static const OptionInfoRec GlamorEGLOptions[] = {
|
||||
{ GLAMOREGLOPT_RENDERING_API, "RenderingAPI", OPTV_STRING, {0}, FALSE },
|
||||
{ GLAMOREGLOPT_VENDOR_LIBRARY, "GlxVendorLibrary", OPTV_STRING, {0}, FALSE },
|
||||
{ -1, NULL, OPTV_NONE, {0}, FALSE },
|
||||
};
|
||||
|
||||
|
@ -1077,6 +1083,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|||
const char *api = NULL;
|
||||
Bool es_allowed = TRUE;
|
||||
Bool force_es = FALSE;
|
||||
const char *glvnd_vendor = NULL;
|
||||
|
||||
glamor_egl = calloc(sizeof(*glamor_egl), 1);
|
||||
if (glamor_egl == NULL)
|
||||
|
@ -1087,6 +1094,11 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|||
options = xnfalloc(sizeof(GlamorEGLOptions));
|
||||
memcpy(options, GlamorEGLOptions, sizeof(GlamorEGLOptions));
|
||||
xf86ProcessOptions(scrn->scrnIndex, scrn->options, options);
|
||||
glvnd_vendor = xf86GetOptValString(options, GLAMOREGLOPT_VENDOR_LIBRARY);
|
||||
if (glvnd_vendor) {
|
||||
glamor_set_glvnd_vendor(xf86ScrnToScreen(scrn), glvnd_vendor);
|
||||
glamor_egl->force_vendor = TRUE;
|
||||
}
|
||||
api = xf86GetOptValString(options, GLAMOREGLOPT_RENDERING_API);
|
||||
if (api && !strncasecmp(api, "es", 2))
|
||||
force_es = TRUE;
|
||||
|
|
Loading…
Reference in New Issue