egl: link with libgallium directly
Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29771>
This commit is contained in:
committed by
Marge Bot
parent
50fc7cc290
commit
69c772e4ea
@@ -644,17 +644,15 @@ static const struct dri_extension_match optional_core_extensions[] = {
|
||||
{__DRI_KOPPER, 1, offsetof(struct dri2_egl_display, kopper), true},
|
||||
};
|
||||
|
||||
const __DRIextension **
|
||||
dri_loader_get_extensions(const char *driver_name);
|
||||
|
||||
static const __DRIextension **
|
||||
dri2_open_driver(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
static const char *search_path_vars[] = {
|
||||
"LIBGL_DRIVERS_PATH",
|
||||
NULL,
|
||||
};
|
||||
|
||||
return loader_open_driver(dri2_dpy->driver_name, &dri2_dpy->driver,
|
||||
search_path_vars, disp->Options.FallbackZink);
|
||||
return dri_loader_get_extensions(dri2_dpy->driver_name);
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
@@ -666,13 +664,14 @@ dri2_load_driver_common(_EGLDisplay *disp,
|
||||
const __DRIextension **extensions;
|
||||
|
||||
extensions = dri2_open_driver(disp);
|
||||
if (!extensions)
|
||||
if (!extensions) {
|
||||
if (disp->Options.FallbackZink)
|
||||
_eglLog(_LOADER_WARNING, "MESA-LOADER: failed to open %s: driver not built!)\n", dri2_dpy->driver_name);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (!loader_bind_extensions(dri2_dpy, driver_extensions, num_matches,
|
||||
extensions)) {
|
||||
dlclose(dri2_dpy->driver);
|
||||
dri2_dpy->driver = NULL;
|
||||
return EGL_FALSE;
|
||||
}
|
||||
dri2_dpy->driver_extensions = extensions;
|
||||
@@ -1137,14 +1136,6 @@ dri2_display_destroy(_EGLDisplay *disp)
|
||||
if (dri2_dpy->fd_render_gpu >= 0)
|
||||
close(dri2_dpy->fd_render_gpu);
|
||||
|
||||
/* Don't dlclose the driver when building with the address sanitizer, so
|
||||
* you get good symbols from the leak reports.
|
||||
*/
|
||||
#if !BUILT_WITH_ASAN || defined(NDEBUG)
|
||||
if (dri2_dpy->driver)
|
||||
dlclose(dri2_dpy->driver);
|
||||
#endif
|
||||
|
||||
free(dri2_dpy->driver_name);
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
|
||||
@@ -240,7 +240,6 @@ struct dri2_egl_display {
|
||||
__DRIscreen *dri_screen_display_gpu;
|
||||
bool own_dri_screen;
|
||||
const __DRIconfig **driver_configs;
|
||||
void *driver;
|
||||
const __DRIcoreExtension *core;
|
||||
const __DRImesaCoreExtension *mesa;
|
||||
const __DRIimageDriverExtension *image_driver;
|
||||
|
||||
@@ -1012,8 +1012,6 @@ droid_unload_driver(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
|
||||
dlclose(dri2_dpy->driver);
|
||||
dri2_dpy->driver = NULL;
|
||||
free(dri2_dpy->driver_name);
|
||||
dri2_dpy->driver_name = NULL;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,12 @@ inc_egl_dri2 = include_directories('drivers/dri2')
|
||||
c_args_for_egl = [asan_c_args]
|
||||
cpp_args_for_egl = []
|
||||
link_for_egl = []
|
||||
if with_dri
|
||||
link_for_egl += libgallium_dri
|
||||
endif
|
||||
if with_platform_windows
|
||||
link_for_egl += libgallium_wgl
|
||||
endif
|
||||
deps_for_egl = []
|
||||
incs_for_egl = [inc_include, inc_src, inc_egl]
|
||||
|
||||
@@ -184,6 +190,7 @@ libegl = shared_library(
|
||||
link_args : [ld_args_bsymbolic, ld_args_gc_sections],
|
||||
dependencies : [deps_for_egl, dep_dl, dep_libdrm, dep_clock, dep_thread, idep_mesautil],
|
||||
install : true,
|
||||
install_rpath : dri_drivers_path,
|
||||
version : egl_lib_version,
|
||||
soversion : egl_lib_soversion,
|
||||
name_prefix : host_machine.system() == 'windows' ? 'lib' : [], # always use lib, but avoid warnings on !windows
|
||||
|
||||
@@ -45,6 +45,7 @@ libgbm = shared_library(
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
version : '1.0.0',
|
||||
install : true,
|
||||
install_rpath : dri_drivers_path,
|
||||
)
|
||||
|
||||
if with_tests
|
||||
|
||||
Reference in New Issue
Block a user