mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 03:20:33 +01:00
{st,targets}/nine: use static/dynamic pipe-loader
Analogous to previous commits. v2: add the missing winsys libs linkage Cc: Axel Davy <axel.davy@ens.fr> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
611ef64ed5
commit
dddedbec0e
2 changed files with 8 additions and 30 deletions
|
|
@ -34,12 +34,6 @@ AM_CFLAGS = \
|
||||||
$(GALLIUM_TARGET_CFLAGS) \
|
$(GALLIUM_TARGET_CFLAGS) \
|
||||||
$(VISIBILITY_CFLAGS)
|
$(VISIBILITY_CFLAGS)
|
||||||
|
|
||||||
if HAVE_GALLIUM_STATIC_TARGETS
|
|
||||||
AM_CPPFLAGS = \
|
|
||||||
-DGALLIUM_STATIC_TARGETS=1
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
ninedir = $(D3D_DRIVER_INSTALL_DIR)
|
ninedir = $(D3D_DRIVER_INSTALL_DIR)
|
||||||
nine_LTLIBRARIES = d3dadapter9.la
|
nine_LTLIBRARIES = d3dadapter9.la
|
||||||
|
|
||||||
|
|
@ -71,7 +65,6 @@ d3dadapter9_la_LIBADD = \
|
||||||
$(top_builddir)/src/glsl/libnir.la \
|
$(top_builddir)/src/glsl/libnir.la \
|
||||||
$(top_builddir)/src/gallium/state_trackers/nine/libninetracker.la \
|
$(top_builddir)/src/gallium/state_trackers/nine/libninetracker.la \
|
||||||
$(top_builddir)/src/util/libmesautil.la \
|
$(top_builddir)/src/util/libmesautil.la \
|
||||||
$(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la \
|
|
||||||
$(EXPAT_LIBS) \
|
$(EXPAT_LIBS) \
|
||||||
$(GALLIUM_COMMON_LIB_DEPS)
|
$(GALLIUM_COMMON_LIB_DEPS)
|
||||||
|
|
||||||
|
|
@ -80,7 +73,7 @@ EXTRA_DIST = d3dadapter9.sym
|
||||||
|
|
||||||
TARGET_DRIVERS =
|
TARGET_DRIVERS =
|
||||||
TARGET_CPPFLAGS =
|
TARGET_CPPFLAGS =
|
||||||
TARGET_LIB_DEPS = $(top_builddir)/src/loader/libloader.la
|
TARGET_LIB_DEPS =
|
||||||
|
|
||||||
include $(top_srcdir)/src/gallium/drivers/i915/Automake.inc
|
include $(top_srcdir)/src/gallium/drivers/i915/Automake.inc
|
||||||
|
|
||||||
|
|
@ -104,7 +97,10 @@ include $(top_srcdir)/src/gallium/drivers/llvmpipe/Automake.inc
|
||||||
if HAVE_GALLIUM_STATIC_TARGETS
|
if HAVE_GALLIUM_STATIC_TARGETS
|
||||||
|
|
||||||
d3dadapter9_la_CPPFLAGS = $(AM_CPPFLAGS) $(TARGET_CPPFLAGS)
|
d3dadapter9_la_CPPFLAGS = $(AM_CPPFLAGS) $(TARGET_CPPFLAGS)
|
||||||
d3dadapter9_la_LIBADD += $(TARGET_LIB_DEPS) \
|
d3dadapter9_la_LIBADD += \
|
||||||
|
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_static.la \
|
||||||
|
$(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
|
||||||
|
$(TARGET_LIB_DEPS) \
|
||||||
$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
|
$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
|
||||||
|
|
||||||
else # HAVE_GALLIUM_STATIC_TARGETS
|
else # HAVE_GALLIUM_STATIC_TARGETS
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,7 @@
|
||||||
#include "pipe/p_screen.h"
|
#include "pipe/p_screen.h"
|
||||||
#include "pipe/p_state.h"
|
#include "pipe/p_state.h"
|
||||||
|
|
||||||
#include "target-helpers/inline_drm_helper.h"
|
#include "target-helpers/drm_helper.h"
|
||||||
#include "target-helpers/inline_wrapper_sw_helper.h"
|
|
||||||
#include "state_tracker/drm_driver.h"
|
#include "state_tracker/drm_driver.h"
|
||||||
|
|
||||||
#include "d3dadapter/d3dadapter9.h"
|
#include "d3dadapter/d3dadapter9.h"
|
||||||
|
|
@ -91,12 +90,10 @@ drm_destroy( struct d3dadapter9_context *ctx )
|
||||||
else if (ctx->hal)
|
else if (ctx->hal)
|
||||||
ctx->hal->destroy(ctx->hal);
|
ctx->hal->destroy(ctx->hal);
|
||||||
|
|
||||||
#if !GALLIUM_STATIC_TARGETS
|
|
||||||
if (drm->swdev)
|
if (drm->swdev)
|
||||||
pipe_loader_release(&drm->swdev, 1);
|
pipe_loader_release(&drm->swdev, 1);
|
||||||
if (drm->dev)
|
if (drm->dev)
|
||||||
pipe_loader_release(&drm->dev, 1);
|
pipe_loader_release(&drm->dev, 1);
|
||||||
#endif
|
|
||||||
|
|
||||||
close(drm->fd);
|
close(drm->fd);
|
||||||
FREE(ctx);
|
FREE(ctx);
|
||||||
|
|
@ -223,10 +220,6 @@ drm_create_adapter( int fd,
|
||||||
ctx->fd = fd;
|
ctx->fd = fd;
|
||||||
ctx->base.linear_framebuffer = !!different_device;
|
ctx->base.linear_framebuffer = !!different_device;
|
||||||
|
|
||||||
#if GALLIUM_STATIC_TARGETS
|
|
||||||
ctx->base.hal = dd_create_screen(fd);
|
|
||||||
#else
|
|
||||||
/* use pipe-loader to dlopen appropriate drm driver */
|
|
||||||
if (!pipe_loader_drm_probe_fd(&ctx->dev, fd)) {
|
if (!pipe_loader_drm_probe_fd(&ctx->dev, fd)) {
|
||||||
ERR("Failed to probe drm fd %d.\n", fd);
|
ERR("Failed to probe drm fd %d.\n", fd);
|
||||||
FREE(ctx);
|
FREE(ctx);
|
||||||
|
|
@ -234,22 +227,15 @@ drm_create_adapter( int fd,
|
||||||
return D3DERR_DRIVERINTERNALERROR;
|
return D3DERR_DRIVERINTERNALERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use pipe-loader to create a drm screen (hal) */
|
|
||||||
ctx->base.hal = pipe_loader_create_screen(ctx->dev);
|
ctx->base.hal = pipe_loader_create_screen(ctx->dev);
|
||||||
#endif
|
|
||||||
if (!ctx->base.hal) {
|
if (!ctx->base.hal) {
|
||||||
ERR("Unable to load requested driver.\n");
|
ERR("Unable to load requested driver.\n");
|
||||||
drm_destroy(&ctx->base);
|
drm_destroy(&ctx->base);
|
||||||
return D3DERR_DRIVERINTERNALERROR;
|
return D3DERR_DRIVERINTERNALERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GALLIUM_STATIC_TARGETS
|
|
||||||
dmabuf_ret = dd_configuration(DRM_CONF_SHARE_FD);
|
|
||||||
throttle_ret = dd_configuration(DRM_CONF_THROTTLE);
|
|
||||||
#else
|
|
||||||
dmabuf_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_SHARE_FD);
|
dmabuf_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_SHARE_FD);
|
||||||
throttle_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_THROTTLE);
|
throttle_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_THROTTLE);
|
||||||
#endif // GALLIUM_STATIC_TARGETS
|
|
||||||
if (!dmabuf_ret || !dmabuf_ret->val.val_bool) {
|
if (!dmabuf_ret || !dmabuf_ret->val.val_bool) {
|
||||||
ERR("The driver is not capable of dma-buf sharing."
|
ERR("The driver is not capable of dma-buf sharing."
|
||||||
"Abandon to load nine state tracker\n");
|
"Abandon to load nine state tracker\n");
|
||||||
|
|
@ -296,14 +282,10 @@ drm_create_adapter( int fd,
|
||||||
driDestroyOptionCache(&userInitOptions);
|
driDestroyOptionCache(&userInitOptions);
|
||||||
driDestroyOptionInfo(&defaultInitOptions);
|
driDestroyOptionInfo(&defaultInitOptions);
|
||||||
|
|
||||||
#if GALLIUM_STATIC_TARGETS
|
|
||||||
ctx->base.ref = sw_screen_wrap(ctx->base.hal);
|
|
||||||
#else
|
|
||||||
/* wrap it to create a software screen that can share resources */
|
/* wrap it to create a software screen that can share resources */
|
||||||
if (pipe_loader_sw_probe_wrapped(&ctx->swdev, ctx->base.hal)) {
|
if (pipe_loader_sw_probe_wrapped(&ctx->swdev, ctx->base.hal))
|
||||||
ctx->base.ref = pipe_loader_create_screen(ctx->swdev);
|
ctx->base.ref = pipe_loader_create_screen(ctx->swdev);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!ctx->base.ref) {
|
if (!ctx->base.ref) {
|
||||||
ERR("Couldn't wrap drm screen to swrast screen. Software devices "
|
ERR("Couldn't wrap drm screen to swrast screen. Software devices "
|
||||||
"will be unavailable.\n");
|
"will be unavailable.\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue