From 73a7ac2ec8201123785ec17eff97364f72a474a1 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Fri, 3 Jan 2014 07:39:30 +0000 Subject: [PATCH] Fix Mesa bug with some drivers by preloading libglapi Some mesa drivers (i965, etc) require glapi functions but a current Mesa bug does not always link those drivers to glapi so we will preload the library to avoid "driver loading" errors. Signed-off-by: Chris Michael --- src/lib/ecore_drm/ecore_drm_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c index 359f01d2d1..2135cab90e 100644 --- a/src/lib/ecore_drm/ecore_drm_device.c +++ b/src/lib/ecore_drm/ecore_drm_device.c @@ -3,6 +3,7 @@ #endif #include "ecore_drm_private.h" +#include static void _ecore_drm_device_cb_page_flip(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) @@ -262,6 +263,13 @@ ecore_drm_device_open(Ecore_Drm_Device *dev) #ifdef HAVE_GBM if (getenv("ECORE_DRM_HW_ACCEL")) { + /* Typically, gbm loads the dri driver However some versions of Mesa + * do not have libglapi symbols linked in the driver. Because of this, + * using hardware accel for our drm code Could fail with a + * message that the driver could not load. Let's be proactive and + * work around this for the user by preloading the glapi library */ + dlopen("libglapi.so.0", (RTLD_LAZY | RTLD_GLOBAL)); + if ((dev->gbm = gbm_create_device(dev->drm.fd))) { dev->use_hw_accel = EINA_TRUE;