hardware/intel/common/libva
Revisión | b832b37c6a6f7ff69a4ea4656007827a1b7e67e8 (tree) |
---|---|
Tiempo | 2017-02-16 02:43:52 |
Autor | Hans de Goede <hdegoede@redh...> |
Commiter | Sean V. Kelley |
Wayland-drm: Fix not finding wl_drm_interface on systems with libglvnd
We do not want just any libEGL.so.1 we want mesa's libEGL.so.1 as that
is the only way which defines the wl_drm_interface symbol we need,
one systems with libglvnd libEGL.so.1 is a dispatcher library provided
by libglvnd and the actual mesa libEGL we want is named libEGL_mesa.so.0
so try that first.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
@@ -38,7 +38,10 @@ | ||
38 | 38 | #include "wayland-drm-client-protocol.h" |
39 | 39 | |
40 | 40 | /* XXX: Wayland/DRM support currently lives in Mesa libEGL.so.* library */ |
41 | -#define LIBWAYLAND_DRM_NAME "libEGL.so.1" | |
41 | +/* First try the soname of a glvnd enabled mesa build */ | |
42 | +#define LIBWAYLAND_DRM_NAME "libEGL_mesa.so.0" | |
43 | +/* Then fallback to plain libEGL.so.1 (which might not be mesa) */ | |
44 | +#define LIBWAYLAND_DRM_NAME_FALLBACK "libEGL.so.1" | |
42 | 45 | |
43 | 46 | typedef struct va_wayland_drm_context { |
44 | 47 | struct va_wayland_context base; |
@@ -207,8 +210,11 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext) | ||
207 | 210 | vtable->has_prime_sharing = 0; |
208 | 211 | |
209 | 212 | wl_drm_ctx->handle = dlopen(LIBWAYLAND_DRM_NAME, RTLD_LAZY|RTLD_LOCAL); |
210 | - if (!wl_drm_ctx->handle) | |
211 | - return false; | |
213 | + if (!wl_drm_ctx->handle) { | |
214 | + wl_drm_ctx->handle = dlopen(LIBWAYLAND_DRM_NAME_FALLBACK, RTLD_LAZY|RTLD_LOCAL); | |
215 | + if (!wl_drm_ctx->handle) | |
216 | + return false; | |
217 | + } | |
212 | 218 | |
213 | 219 | wl_drm_ctx->drm_interface = |
214 | 220 | dlsym(wl_drm_ctx->handle, "wl_drm_interface"); |