From: Rob Clark <robclark@xxxxxxxxxxxxxxx> libdrm_freedreno currently supports two backends, 'msm' for the upstream drm/msm driver, and 'kgsl' which supports (to some extent), the android/ downstream kgsl driver plus a sort of drm shim nonsense to get flink names. However, kgsl support is strictly on a best-effort basis. Different android devices with different versions of kgsl may have different abi's. And the existing kgsl interface (at least the parts of it that we use) is completely broken for 64bit. Lets disable it by default lest anyone actually try to use it. Signed-off-by: Rob Clark <robclark@xxxxxxxxxxxxxxx> --- configure.ac | 12 +++++++++++- freedreno/Makefile.am | 3 +++ freedreno/Makefile.sources | 16 +++++++++------- freedreno/freedreno_device.c | 10 ++++++---- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index c88a1c5..0412d5b 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,11 @@ AC_ARG_ENABLE(freedreno-experimental-api, [Enable support for freedreno's experimental API (default: disabled)]), [FREEDRENO=$enableval], [FREEDRENO=no]) +AC_ARG_ENABLE(freedreno-kgsl, + AS_HELP_STRING([--enable-freedreno-kgsl], + [Enable support for freedreno's to use downstream android kernel API (default: disabled)]), + [FREEDRENO_KGSL=$enableval], [FREEDRENO_KGSL=no]) + AC_ARG_ENABLE(tegra-experimental-api, AS_HELP_STRING([--enable-tegra-experimental-api], [Enable support for Tegra's experimental API (default: disabled)]), @@ -304,6 +309,11 @@ if test "x$FREEDRENO" = xyes; then AC_DEFINE(HAVE_FREEDRENO, 1, [Have freedreno support]) fi +AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes]) +if test "x$FREEDRENO_KGSL" = xyes; then + AC_DEFINE(HAVE_FREEDRENO_KGSL, 1, [Have freedreno support for KGSL kernel interface]) +fi + AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes]) if test "x$RADEON" = xyes; then AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) @@ -438,6 +448,6 @@ echo " Radeon API $RADEON" echo " Nouveau API $NOUVEAU" echo " OMAP API $OMAP" echo " EXYNOS API $EXYNOS" -echo " Freedreno API $FREEDRENO" +echo " Freedreno API $FREEDRENO (kgsl: $FREEDRENO_KGSL)" echo " Tegra API $TEGRA" echo "" diff --git a/freedreno/Makefile.am b/freedreno/Makefile.am index 4818431..4482afe 100644 --- a/freedreno/Makefile.am +++ b/freedreno/Makefile.am @@ -15,6 +15,9 @@ libdrm_freedreno_la_LDFLAGS = -version-number 1:0:0 -no-undefined libdrm_freedreno_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ libdrm_freedreno_la_SOURCES = $(LIBDRM_FREEDRENO_FILES) +if HAVE_FREEDRENO_KGSL +libdrm_freedreno_la_SOURCES += $(LIBDRM_FREEDRENO_KGSL_FILES) +endif libdrm_freedrenocommonincludedir = ${includedir}/freedreno libdrm_freedrenocommoninclude_HEADERS = $(LIBDRM_FREEDRENO_H_FILES) diff --git a/freedreno/Makefile.sources b/freedreno/Makefile.sources index 91020df..c8c0244 100644 --- a/freedreno/Makefile.sources +++ b/freedreno/Makefile.sources @@ -4,13 +4,6 @@ LIBDRM_FREEDRENO_FILES := \ freedreno_priv.h \ freedreno_ringbuffer.c \ freedreno_bo.c \ - kgsl/kgsl_bo.c \ - kgsl/kgsl_device.c \ - kgsl/kgsl_drm.h \ - kgsl/kgsl_pipe.c \ - kgsl/kgsl_priv.h \ - kgsl/kgsl_ringbuffer.c \ - kgsl/msm_kgsl.h \ msm/msm_bo.c \ msm/msm_device.c \ msm/msm_drm.h \ @@ -19,6 +12,15 @@ LIBDRM_FREEDRENO_FILES := \ msm/msm_ringbuffer.c \ list.h +LIBDRM_FREEDRENO_KGSL_FILES := \ + kgsl/kgsl_bo.c \ + kgsl/kgsl_device.c \ + kgsl/kgsl_drm.h \ + kgsl/kgsl_pipe.c \ + kgsl/kgsl_priv.h \ + kgsl/kgsl_ringbuffer.c \ + kgsl/msm_kgsl.h + LIBDRM_FREEDRENO_H_FILES := \ freedreno_drmif.h \ freedreno_ringbuffer.h diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c index 09bc5e9..e8b5f60 100644 --- a/freedreno/freedreno_device.c +++ b/freedreno/freedreno_device.c @@ -92,12 +92,14 @@ drm_public struct fd_device * fd_device_new(int fd) return NULL; } - if (!strcmp(version->name, "kgsl")) { - DEBUG_MSG("kgsl DRM device"); - dev = kgsl_device_new(fd); - } else if (!strcmp(version->name, "msm")) { + if (!strcmp(version->name, "msm")) { DEBUG_MSG("msm DRM device"); dev = msm_device_new(fd); +#ifdef HAVE_FREEDRENO_KGSL + } else if (!strcmp(version->name, "kgsl")) { + DEBUG_MSG("kgsl DRM device"); + dev = kgsl_device_new(fd); +#endif } else { ERROR_MSG("unknown device: %s", version->name); dev = NULL; -- 2.1.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel