glamor_egl: disable modifiers via glamor_init()

Currently we parse through xf86Info.debug to check if we the modifiers
should be disabled. Handle that within DDX and pass GLAMOR_NO_MODIFIERS
into the glamor_init() flags.

This allows individual DDX control over the setting - say when modifiers
are woking OK with one implementation and not the other.

Most importantly, this removes the final xf86 piece from the codebase.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
Emil Velikov 2019-07-18 13:57:02 +01:00 committed by Emil Velikov
parent 4018811838
commit f3ab3d0c61
3 changed files with 13 additions and 6 deletions

View File

@ -68,8 +68,10 @@ typedef Bool (*GetDrawableModifiersFuncPtr) (DrawablePtr draw,
#define GLAMOR_EGL_EXTERNAL_BUFFER 3
#define GLAMOR_USE_EGL_SCREEN (1 << 0)
#define GLAMOR_NO_DRI3 (1 << 1)
#define GLAMOR_NO_MODIFIERS (1 << 2)
#define GLAMOR_VALID_FLAGS (GLAMOR_USE_EGL_SCREEN \
| GLAMOR_NO_DRI3)
| GLAMOR_NO_DRI3 \
| GLAMOR_NO_MODIFIERS)
/* until we need geometry shaders GL3.1 should suffice. */
#define GLAMOR_GL_CORE_VER_MAJOR 3

View File

@ -870,6 +870,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
*/
glamor_enable_dri3(screen);
if (glamor_priv->flags & GLAMOR_NO_MODIFIERS)
glamor_egl->dmabuf_capable = FALSE;
/* If the driver wants to do its own auth dance (e.g. Xwayland
* on pre-3.15 kernels that don't have render nodes and thus
* has the wayland compositor as a master), then it needs us
@ -1034,10 +1037,6 @@ glamor_egl_init(ScreenPtr screen, int fd)
"EGL_EXT_image_dma_buf_import") &&
epoxy_has_egl_extension(glamor_egl->display,
"EGL_EXT_image_dma_buf_import_modifiers")) {
if (xf86Info.debug != NULL)
glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
"dmabuf_capable");
else
glamor_egl->dmabuf_capable = TRUE;
}
#endif

View File

@ -36,6 +36,7 @@
#include "dumb_bo.h"
#include "inputstr.h"
#include "xf86str.h"
#include "xf86Priv.h"
#include "X11/Xatom.h"
#include "micmap.h"
#include "xf86cmap.h"
@ -3412,7 +3413,12 @@ drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
if (drmmode->glamor) {
if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
unsigned int flags = GLAMOR_USE_EGL_SCREEN;
if (xf86Info.debug != NULL && !strstr(xf86Info.debug, "dmabuf_capable"))
flags |= GLAMOR_NO_MODIFIERS;
if (!glamor_init(pScreen, flags)) {
return FALSE;
}
#ifdef GBM_BO_WITH_MODIFIERS