summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/pipe-loader
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-08-26 16:59:42 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-08-26 16:59:42 +0000
commit81ece42815e80818f160cdd85fab57d65b56ad15 (patch)
tree1059ff094da1aa50334115952fcb1cfcbda3acc6 /lib/mesa/src/gallium/auxiliary/pipe-loader
parentb0244145d5bb49623d58f6b5cab8143ada692b60 (diff)
Revert to Mesa 13.0.6 to hopefully address rendering issues a handful of
people have reported with xpdf/fvwm on ivy bridge with modesetting driver.
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/pipe-loader')
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.in59
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c169
2 files changed, 171 insertions, 57 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.in b/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.in
index a7fdc77e0..3abeaa18d 100644
--- a/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.in
+++ b/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.in
@@ -54,23 +54,20 @@ target_triplet = @target@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/Makefile.sources $(top_srcdir)/bin/depcomp \
$(top_srcdir)/src/gallium/Automake.inc
-@HAVE_LIBDRM_TRUE@am__append_1 = \
-@HAVE_LIBDRM_TRUE@ $(LIBDRM_LIBS)
-
-@HAVE_DRISW_TRUE@am__append_2 = \
+@HAVE_DRISW_TRUE@am__append_1 = \
@HAVE_DRISW_TRUE@ $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la
-@HAVE_DRISW_KMS_TRUE@am__append_3 = \
+@HAVE_DRISW_KMS_TRUE@am__append_2 = \
@HAVE_DRISW_KMS_TRUE@ $(top_builddir)/src/gallium/winsys/sw/kms-dri/libswkmsdri.la \
@HAVE_DRISW_KMS_TRUE@ $(LIBDRM_LIBS)
-@HAVE_LIBDRM_TRUE@am__append_4 = \
+@HAVE_LIBDRM_TRUE@am__append_3 = \
@HAVE_LIBDRM_TRUE@ $(LIBDRM_CFLAGS)
-@HAVE_LIBDRM_TRUE@am__append_5 = \
+@HAVE_LIBDRM_TRUE@am__append_4 = \
@HAVE_LIBDRM_TRUE@ $(DRM_SOURCES)
-@HAVE_LIBDRM_TRUE@am__append_6 = \
+@HAVE_LIBDRM_TRUE@am__append_5 = \
@HAVE_LIBDRM_TRUE@ $(DRM_SOURCES)
subdir = src/gallium/auxiliary/pipe-loader
@@ -180,8 +177,6 @@ AMDGPU_CFLAGS = @AMDGPU_CFLAGS@
AMDGPU_LIBS = @AMDGPU_LIBS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-ANDROID_CFLAGS = @ANDROID_CFLAGS@
-ANDROID_LIBS = @ANDROID_LIBS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -212,6 +207,8 @@ DLLTOOL = @DLLTOOL@
DLOPEN_LIBS = @DLOPEN_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@
+DRI3PROTO_LIBS = @DRI3PROTO_LIBS@
DRIGL_CFLAGS = @DRIGL_CFLAGS@
DRIGL_LIBS = @DRIGL_LIBS@
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
@@ -224,11 +221,10 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGL_CFLAGS = @EGL_CFLAGS@
+EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
EGL_LIB_DEPS = @EGL_LIB_DEPS@
EGL_NATIVE_PLATFORM = @EGL_NATIVE_PLATFORM@
EGREP = @EGREP@
-ETNAVIV_CFLAGS = @ETNAVIV_CFLAGS@
-ETNAVIV_LIBS = @ETNAVIV_LIBS@
EXEEXT = @EXEEXT@
EXPAT_CFLAGS = @EXPAT_CFLAGS@
EXPAT_LIBS = @EXPAT_LIBS@
@@ -276,27 +272,31 @@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIBS = @LIBDRM_LIBS@
LIBELF_CFLAGS = @LIBELF_CFLAGS@
LIBELF_LIBS = @LIBELF_LIBS@
-LIBGLVND_DATADIR = @LIBGLVND_DATADIR@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
-LIBSENSORS_LIBS = @LIBSENSORS_LIBS@
+LIBSENSORS_LDFLAGS = @LIBSENSORS_LDFLAGS@
+LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@
+LIBSHA1_LIBS = @LIBSHA1_LIBS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@
-LIBUNWIND_LIBS = @LIBUNWIND_LIBS@
LIB_DIR = @LIB_DIR@
LIB_EXT = @LIB_EXT@
LIPO = @LIPO@
+LLVM_BINDIR = @LLVM_BINDIR@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_CONFIG = @LLVM_CONFIG@
+LLVM_CPPFLAGS = @LLVM_CPPFLAGS@
LLVM_CXXFLAGS = @LLVM_CXXFLAGS@
LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
+LLVM_LIBDIR = @LLVM_LIBDIR@
LLVM_LIBS = @LLVM_LIBS@
+LLVM_VERSION = @LLVM_VERSION@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
+MESA_LLVM = @MESA_LLVM@
MKDIR_P = @MKDIR_P@
MSVC2013_COMPAT_CFLAGS = @MSVC2013_COMPAT_CFLAGS@
MSVC2013_COMPAT_CXXFLAGS = @MSVC2013_COMPAT_CXXFLAGS@
@@ -317,6 +317,8 @@ OMX_LIBS = @OMX_LIBS@
OMX_LIB_INSTALL_DIR = @OMX_LIB_INSTALL_DIR@
OPENCL_LIBNAME = @OPENCL_LIBNAME@
OPENCL_VERSION = @OPENCL_VERSION@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
OSMESA_LIB = @OSMESA_LIB@
OSMESA_LIB_DEPS = @OSMESA_LIB_DEPS@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
@@ -336,6 +338,8 @@ PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSIX_SHELL = @POSIX_SHELL@
+PRESENTPROTO_CFLAGS = @PRESENTPROTO_CFLAGS@
+PRESENTPROTO_LIBS = @PRESENTPROTO_LIBS@
PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@
PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@
PTHREAD_CC = @PTHREAD_CC@
@@ -351,6 +355,8 @@ SED = @SED@
SELINUX_CFLAGS = @SELINUX_CFLAGS@
SELINUX_LIBS = @SELINUX_LIBS@
SET_MAKE = @SET_MAKE@
+SHA1_CFLAGS = @SHA1_CFLAGS@
+SHA1_LIBS = @SHA1_LIBS@
SHELL = @SHELL@
SIMPENROSE_CFLAGS = @SIMPENROSE_CFLAGS@
SIMPENROSE_LIBS = @SIMPENROSE_LIBS@
@@ -359,6 +365,7 @@ STRIP = @STRIP@
SWR_AVX2_CXXFLAGS = @SWR_AVX2_CXXFLAGS@
SWR_AVX_CXXFLAGS = @SWR_AVX_CXXFLAGS@
SWR_CXX11_CXXFLAGS = @SWR_CXX11_CXXFLAGS@
+TIMESTAMP_CMD = @TIMESTAMP_CMD@
VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
VALGRIND_LIBS = @VALGRIND_LIBS@
VA_CFLAGS = @VA_CFLAGS@
@@ -374,6 +381,7 @@ VDPAU_LIB_INSTALL_DIR = @VDPAU_LIB_INSTALL_DIR@
VDPAU_MAJOR = @VDPAU_MAJOR@
VDPAU_MINOR = @VDPAU_MINOR@
VERSION = @VERSION@
+VG_LIB_DEPS = @VG_LIB_DEPS@
VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
VISIBILITY_CXXFLAGS = @VISIBILITY_CXXFLAGS@
VL_CFLAGS = @VL_CFLAGS@
@@ -402,10 +410,9 @@ XVMC_LIBS = @XVMC_LIBS@
XVMC_LIB_INSTALL_DIR = @XVMC_LIB_INSTALL_DIR@
XVMC_MAJOR = @XVMC_MAJOR@
XVMC_MINOR = @XVMC_MINOR@
+XXD = @XXD@
YACC = @YACC@
YFLAGS = @YFLAGS@
-ZLIB_CFLAGS = @ZLIB_CFLAGS@
-ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -522,8 +529,12 @@ GALLIUM_TARGET_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
-GALLIUM_COMMON_LIB_DEPS = -lm $(LIBUNWIND_LIBS) $(LIBSENSORS_LIBS) \
- $(CLOCK_LIB) $(PTHREAD_LIBS) $(DLOPEN_LIBS) $(am__append_1)
+GALLIUM_COMMON_LIB_DEPS = \
+ -lm \
+ $(CLOCK_LIB) \
+ $(PTHREAD_LIBS) \
+ $(DLOPEN_LIBS)
+
GALLIUM_WINSYS_CFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/include \
@@ -535,13 +546,13 @@ GALLIUM_WINSYS_CFLAGS = \
GALLIUM_PIPE_LOADER_WINSYS_LIBS = \
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
$(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la \
- $(am__append_2) $(am__append_3)
+ $(am__append_1) $(am__append_2)
# XXX: check if we need the gallium/winsys include
AM_CFLAGS = -I$(top_srcdir)/src/loader \
-I$(top_srcdir)/src/gallium/winsys \
$(GALLIUM_PIPE_LOADER_DEFINES) $(GALLIUM_CFLAGS) \
- $(VISIBILITY_CFLAGS) $(am__append_4)
+ $(VISIBILITY_CFLAGS) $(am__append_3)
noinst_LTLIBRARIES = \
libpipe_loader_static.la \
libpipe_loader_dynamic.la
@@ -554,8 +565,8 @@ libpipe_loader_dynamic_la_CFLAGS = \
$(AM_CFLAGS) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
-libpipe_loader_static_la_SOURCES = $(COMMON_SOURCES) $(am__append_5)
-libpipe_loader_dynamic_la_SOURCES = $(COMMON_SOURCES) $(am__append_6)
+libpipe_loader_static_la_SOURCES = $(COMMON_SOURCES) $(am__append_4)
+libpipe_loader_dynamic_la_SOURCES = $(COMMON_SOURCES) $(am__append_5)
libpipe_loader_static_la_LIBADD = \
$(top_builddir)/src/loader/libloader.la
diff --git a/lib/mesa/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/lib/mesa/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 1799df7e4..2b7ab2757 100644
--- a/lib/mesa/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/lib/mesa/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -36,6 +36,7 @@
#include <unistd.h>
#include "loader.h"
+#include "target-helpers/drm_helper_public.h"
#include "state_tracker/drm_driver.h"
#include "pipe_loader_priv.h"
@@ -50,13 +51,111 @@
struct pipe_loader_drm_device {
struct pipe_loader_device base;
+ const struct drm_driver_descriptor *dd;
+#ifndef GALLIUM_STATIC_TARGETS
struct util_dl_library *lib;
+#endif
int fd;
};
#define pipe_loader_drm_device(dev) ((struct pipe_loader_drm_device *)dev)
-static struct pipe_loader_ops pipe_loader_drm_ops;
+static const struct pipe_loader_ops pipe_loader_drm_ops;
+
+#ifdef GALLIUM_STATIC_TARGETS
+static const struct drm_conf_ret throttle_ret = {
+ DRM_CONF_INT,
+ {2},
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+ DRM_CONF_BOOL,
+ {true},
+};
+
+static inline const struct drm_conf_ret *
+configuration_query(enum drm_conf conf)
+{
+ switch (conf) {
+ case DRM_CONF_THROTTLE:
+ return &throttle_ret;
+ case DRM_CONF_SHARE_FD:
+ return &share_fd_ret;
+ default:
+ break;
+ }
+ return NULL;
+}
+
+static const struct drm_driver_descriptor driver_descriptors[] = {
+ {
+ .driver_name = "i915",
+ .create_screen = pipe_i915_create_screen,
+ .configuration = configuration_query,
+ },
+#ifdef USE_VC4_SIMULATOR
+ /* VC4 simulator and ILO (i965) are mutually exclusive (error at
+ * configure). As the latter is unconditionally added, keep this one above
+ * it.
+ */
+ {
+ .driver_name = "i965",
+ .create_screen = pipe_vc4_create_screen,
+ .configuration = configuration_query,
+ },
+#endif
+ {
+ .driver_name = "i965",
+ .create_screen = pipe_ilo_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "nouveau",
+ .create_screen = pipe_nouveau_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "r300",
+ .create_screen = pipe_r300_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "r600",
+ .create_screen = pipe_r600_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "radeonsi",
+ .create_screen = pipe_radeonsi_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "vmwgfx",
+ .create_screen = pipe_vmwgfx_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "kgsl",
+ .create_screen = pipe_freedreno_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "msm",
+ .create_screen = pipe_freedreno_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "virtio_gpu",
+ .create_screen = pipe_virgl_create_screen,
+ .configuration = configuration_query,
+ },
+ {
+ .driver_name = "vc4",
+ .create_screen = pipe_vc4_create_screen,
+ .configuration = configuration_query,
+ },
+};
+#endif
bool
pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd)
@@ -77,14 +176,40 @@ pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd)
ddev->base.ops = &pipe_loader_drm_ops;
ddev->fd = fd;
- ddev->base.driver_name = loader_get_driver_for_fd(fd, _LOADER_GALLIUM);
+ ddev->base.driver_name = loader_get_driver_for_fd(fd);
if (!ddev->base.driver_name)
goto fail;
+#ifdef GALLIUM_STATIC_TARGETS
+ for (int i = 0; i < ARRAY_SIZE(driver_descriptors); i++) {
+ if (strcmp(driver_descriptors[i].driver_name, ddev->base.driver_name) == 0) {
+ ddev->dd = &driver_descriptors[i];
+ break;
+ }
+ }
+ if (!ddev->dd)
+ goto fail;
+#else
+ ddev->lib = pipe_loader_find_module(&ddev->base, PIPE_SEARCH_DIR);
+ if (!ddev->lib)
+ goto fail;
+
+ ddev->dd = (const struct drm_driver_descriptor *)
+ util_dl_get_proc_address(ddev->lib, "driver_descriptor");
+
+ /* sanity check on the driver name */
+ if (!ddev->dd || strcmp(ddev->dd->driver_name, ddev->base.driver_name) != 0)
+ goto fail;
+#endif
+
*dev = &ddev->base;
return true;
fail:
+#ifndef GALLIUM_STATIC_TARGETS
+ if (ddev->lib)
+ util_dl_close(ddev->lib);
+#endif
FREE(ddev);
return false;
}
@@ -105,8 +230,9 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
- fd = open_drm_render_node_minor(i);
struct pipe_loader_device *dev;
+
+ fd = open_drm_render_node_minor(i);
if (fd < 0)
continue;
@@ -132,8 +258,10 @@ pipe_loader_drm_release(struct pipe_loader_device **dev)
{
struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(*dev);
+#ifndef GALLIUM_STATIC_TARGETS
if (ddev->lib)
util_dl_close(ddev->lib);
+#endif
close(ddev->fd);
FREE(ddev->base.driver_name);
@@ -146,47 +274,22 @@ pipe_loader_drm_configuration(struct pipe_loader_device *dev,
enum drm_conf conf)
{
struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
- const struct drm_driver_descriptor *dd;
- if (!ddev->lib)
+ if (!ddev->dd->configuration)
return NULL;
- dd = (const struct drm_driver_descriptor *)
- util_dl_get_proc_address(ddev->lib, "driver_descriptor");
-
- /* sanity check on the name */
- if (!dd || strcmp(dd->name, ddev->base.driver_name) != 0)
- return NULL;
-
- if (!dd->configuration)
- return NULL;
-
- return dd->configuration(conf);
+ return ddev->dd->configuration(conf);
}
static struct pipe_screen *
-pipe_loader_drm_create_screen(struct pipe_loader_device *dev,
- const char *library_paths)
+pipe_loader_drm_create_screen(struct pipe_loader_device *dev)
{
struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
- const struct drm_driver_descriptor *dd;
-
- if (!ddev->lib)
- ddev->lib = pipe_loader_find_module(dev, library_paths);
- if (!ddev->lib)
- return NULL;
-
- dd = (const struct drm_driver_descriptor *)
- util_dl_get_proc_address(ddev->lib, "driver_descriptor");
-
- /* sanity check on the name */
- if (!dd || strcmp(dd->name, ddev->base.driver_name) != 0)
- return NULL;
- return dd->create_screen(ddev->fd);
+ return ddev->dd->create_screen(ddev->fd);
}
-static struct pipe_loader_ops pipe_loader_drm_ops = {
+static const struct pipe_loader_ops pipe_loader_drm_ops = {
.create_screen = pipe_loader_drm_create_screen,
.configuration = pipe_loader_drm_configuration,
.release = pipe_loader_drm_release