#include "gbm_driint.h"
#include "gbmint.h"
+#include "loader.h"
/* For importing wl_buffer */
#if HAVE_WAYLAND_PLATFORM
dri_lookup_egl_image
};
-const __DRIdri2LoaderExtension dri2_loader_extension = {
+static const __DRIdri2LoaderExtension dri2_loader_extension = {
{ __DRI_DRI2_LOADER, 3 },
dri_get_buffers,
dri_flush_front_buffer,
dri_get_buffers_with_format,
};
-const __DRIimageLoaderExtension image_loader_extension = {
+static const __DRIimageLoaderExtension image_loader_extension = {
{ __DRI_IMAGE_LOADER, 1 },
image_get_buffers,
dri_flush_front_buffer,
snprintf(path, sizeof path,
"%.*s/%s_dri.so", len, p, dri->base.driver_name);
dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
- if (dri->driver == NULL)
- fprintf(stderr, "failed to open %s: %s\n", path, dlerror());
}
+ /* not need continue to loop all paths once the driver is found */
+ if (dri->driver != NULL)
+ break;
}
if (dri->driver == NULL) {
const __DRIextension **extensions;
int ret = 0;
- dri->base.driver_name = dri_fd_get_driver_name(dri->base.base.fd);
+ dri->base.driver_name = loader_get_driver_for_fd(dri->base.base.fd, 0);
if (dri->base.driver_name == NULL)
return -1;