From: Eric Anholt Date: Tue, 23 Oct 2018 19:33:09 +0000 (-0700) Subject: pl111: Rename the pl111 driver to "kmsro". X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed65aeec7810a7d98a19461ba933bd77268cb0f6;p=mesa.git pl111: Rename the pl111 driver to "kmsro". The vc4 driver can do prime sharing to many different KMS-only devices, such as the various tinydrm drivers for SPI-attached displays. Rename the driver away from "pl111" to represent what it will actually support: various sorts of KMS displays with the renderonly layer used to attach a GPU. Reviewed-by: Eric Engestrom Reviewed-by: Christian Gmeiner Acked-by: Emil Velikov --- diff --git a/.travis.yml b/.travis.yml index 726622ee46a..d98dcf33659 100644 --- a/.travis.yml +++ b/.travis.yml @@ -352,7 +352,7 @@ matrix: - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl" - DRI_DRIVERS="" - GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa" - - GALLIUM_DRIVERS="i915,nouveau,pl111,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,imx" + - GALLIUM_DRIVERS="i915,nouveau,kmsro,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,imx" - VULKAN_DRIVERS="" - LIBUNWIND_FLAGS="--enable-libunwind" addons: diff --git a/Android.mk b/Android.mk index 914854c27d6..1a0bdd1736c 100644 --- a/Android.mk +++ b/Android.mk @@ -24,7 +24,7 @@ # BOARD_GPU_DRIVERS should be defined. The valid values are # # classic drivers: i915 i965 -# gallium drivers: swrast freedreno i915g nouveau pl111 r300g r600g radeonsi vc4 virgl vmwgfx etnaviv imx +# gallium drivers: swrast freedreno i915g nouveau kmsro r300g r600g radeonsi vc4 virgl vmwgfx etnaviv imx # # The main target is libGLES_mesa. For each classic driver enabled, a DRI # module will also be built. DRI modules will be loaded by libGLES_mesa. @@ -52,7 +52,7 @@ gallium_drivers := \ freedreno.HAVE_GALLIUM_FREEDRENO \ i915g.HAVE_GALLIUM_I915 \ nouveau.HAVE_GALLIUM_NOUVEAU \ - pl111.HAVE_GALLIUM_PL111 \ + kmsro.HAVE_GALLIUM_KMSRO \ r300g.HAVE_GALLIUM_R300 \ r600g.HAVE_GALLIUM_R600 \ radeonsi.HAVE_GALLIUM_RADEONSI \ diff --git a/Makefile.am b/Makefile.am index 9e27db046e5..62c755aeca7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,7 +45,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ --enable-libunwind \ --with-platforms=x11,wayland,drm,surfaceless \ --with-dri-drivers=i915,i965,nouveau,radeon,r200,swrast \ - --with-gallium-drivers=i915,nouveau,r300,pl111,r600,radeonsi,freedreno,svga,swrast,vc4,tegra,virgl,swr,etnaviv,imx \ + --with-gallium-drivers=i915,nouveau,r300,kmsro,r600,radeonsi,freedreno,svga,swrast,vc4,tegra,virgl,swr,etnaviv,imx \ --with-vulkan-drivers=intel,radeon ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index 6766b8ca441..8f668fb10ad 100644 --- a/configure.ac +++ b/configure.ac @@ -1408,7 +1408,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast" AC_ARG_WITH([gallium-drivers], [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@], [comma delimited Gallium drivers list, e.g. - "i915,nouveau,r300,r600,radeonsi,freedreno,pl111,svga,swrast,swr,tegra,v3d,vc4,virgl,etnaviv,imx" + "i915,nouveau,r300,r600,radeonsi,freedreno,kmsro,svga,swrast,swr,tegra,v3d,vc4,virgl,etnaviv,imx" @<:@default=r300,r600,svga,swrast@:>@])], [with_gallium_drivers="$withval"], [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"]) @@ -2830,8 +2830,8 @@ if test -n "$with_gallium_drivers"; then DEFINES="$DEFINES -DUSE_V3D_SIMULATOR"], [USE_V3D_SIMULATOR=no]) ;; - xpl111) - HAVE_GALLIUM_PL111=yes + xkmsro) + HAVE_GALLIUM_KMSRO=yes ;; xvirgl) HAVE_GALLIUM_VIRGL=yes @@ -2868,8 +2868,8 @@ if test "x$HAVE_GALLIUM_ETNAVIV" != xyes -a "x$HAVE_GALLIUM_IMX" = xyes ; then AC_MSG_ERROR([Building with imx requires etnaviv]) fi -if test "x$HAVE_GALLIUM_VC4" != xyes -a "x$HAVE_GALLIUM_PL111" = xyes ; then - AC_MSG_ERROR([Building with pl111 requires vc4]) +if test "x$HAVE_GALLIUM_VC4" != xyes -a "x$HAVE_GALLIUM_KMSRO" = xyes ; then + AC_MSG_ERROR([Building with kmsro requires vc4]) fi if test "x$HAVE_GALLIUM_NOUVEAU" != xyes -a "x$HAVE_GALLIUM_TEGRA" = xyes; then @@ -2966,7 +2966,7 @@ fi AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes) AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes) -AM_CONDITIONAL(HAVE_GALLIUM_PL111, test "x$HAVE_GALLIUM_PL111" = xyes) +AM_CONDITIONAL(HAVE_GALLIUM_KMSRO, test "x$HAVE_GALLIUM_KMSRO" = xyes) AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes) AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes) AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes) @@ -3116,7 +3116,7 @@ AC_CONFIG_FILES([Makefile src/gallium/drivers/i915/Makefile src/gallium/drivers/llvmpipe/Makefile src/gallium/drivers/nouveau/Makefile - src/gallium/drivers/pl111/Makefile + src/gallium/drivers/kmsro/Makefile src/gallium/drivers/r300/Makefile src/gallium/drivers/r600/Makefile src/gallium/drivers/radeonsi/Makefile @@ -3164,7 +3164,7 @@ AC_CONFIG_FILES([Makefile src/gallium/winsys/freedreno/drm/Makefile src/gallium/winsys/i915/drm/Makefile src/gallium/winsys/nouveau/drm/Makefile - src/gallium/winsys/pl111/drm/Makefile + src/gallium/winsys/kmsro/drm/Makefile src/gallium/winsys/radeon/drm/Makefile src/gallium/winsys/amdgpu/drm/Makefile src/gallium/winsys/svga/drm/Makefile diff --git a/meson.build b/meson.build index 2d730708d06..2ebce75b13b 100644 --- a/meson.build +++ b/meson.build @@ -131,7 +131,7 @@ if _drivers.contains('auto') ] elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) _drivers = [ - 'pl111', 'v3d', 'vc4', 'freedreno', 'etnaviv', 'imx', 'nouveau', + 'kmsro', 'v3d', 'vc4', 'freedreno', 'etnaviv', 'imx', 'nouveau', 'tegra', 'virgl', 'swrast', ] else @@ -145,7 +145,7 @@ if _drivers.contains('auto') host_machine.system())) endif endif -with_gallium_pl111 = _drivers.contains('pl111') +with_gallium_kmsro = _drivers.contains('kmsro') with_gallium_radeonsi = _drivers.contains('radeonsi') with_gallium_r300 = _drivers.contains('r300') with_gallium_r600 = _drivers.contains('r600') @@ -213,8 +213,8 @@ endif if with_gallium_imx and not with_gallium_etnaviv error('IMX driver requires etnaviv driver') endif -if with_gallium_pl111 and not with_gallium_vc4 - error('pl111 driver requires vc4 driver') +if with_gallium_kmsro and not with_gallium_vc4 + error('kmsro driver requires vc4 driver') endif if with_gallium_tegra and not with_gallium_nouveau error('tegra driver requires nouveau driver') diff --git a/meson_options.txt b/meson_options.txt index bfb06c4dd42..937137e3bf4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -58,7 +58,7 @@ option( type : 'array', value : ['auto'], choices : [ - '', 'auto', 'pl111', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno', + '', 'auto', 'kmsro', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno', 'swrast', 'v3d', 'vc4', 'etnaviv', 'imx', 'tegra', 'i915', 'svga', 'virgl', 'swr', ], diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk index 21a1620974e..12e55037fdc 100644 --- a/src/gallium/Android.mk +++ b/src/gallium/Android.mk @@ -38,7 +38,7 @@ SUBDIRS += winsys/sw/kms-dri winsys/sw/dri drivers/softpipe SUBDIRS += winsys/freedreno/drm drivers/freedreno SUBDIRS += winsys/i915/drm drivers/i915 SUBDIRS += winsys/nouveau/drm drivers/nouveau -SUBDIRS += winsys/pl111/drm drivers/pl111 +SUBDIRS += winsys/kmsro/drm drivers/kmsro SUBDIRS += winsys/radeon/drm drivers/r300 SUBDIRS += winsys/radeon/drm drivers/r600 SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi diff --git a/src/gallium/Makefile.am b/src/gallium/Makefile.am index e75c1866832..8cb391cfd75 100644 --- a/src/gallium/Makefile.am +++ b/src/gallium/Makefile.am @@ -60,8 +60,8 @@ if HAVE_GALLIUM_IMX SUBDIRS += drivers/imx winsys/imx/drm endif -if HAVE_GALLIUM_PL111 -SUBDIRS += drivers/pl111 winsys/pl111/drm +if HAVE_GALLIUM_KMSRO +SUBDIRS += drivers/kmsro winsys/kmsro/drm endif ## swrast/softpipe diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c index 5a88a2ac2f0..230bafe5e15 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -108,7 +108,7 @@ static const struct drm_driver_descriptor driver_descriptors[] = { }, { .driver_name = "pl111", - .create_screen = pipe_pl111_create_screen, + .create_screen = pipe_kmsro_create_screen, .configuration = pipe_default_configuration_query, }, { diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index bb5c5790d9d..927a0133389 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -83,24 +83,24 @@ pipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config) #endif -#ifdef GALLIUM_PL111 -#include "pl111/drm/pl111_drm_public.h" +#ifdef GALLIUM_KMSRO +#include "kmsro/drm/kmsro_drm_public.h" struct pipe_screen * -pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config) +pipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config) { struct pipe_screen *screen; - screen = pl111_drm_screen_create(fd); + screen = kmsro_drm_screen_create(fd); return screen ? debug_screen_wrap(screen) : NULL; } #else struct pipe_screen * -pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config) +pipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config) { - fprintf(stderr, "pl111: driver missing\n"); + fprintf(stderr, "kmsro: driver missing\n"); return NULL; } diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h index 155c525762c..750ed09335c 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h @@ -43,7 +43,7 @@ struct pipe_screen * pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config); struct pipe_screen * -pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config); +pipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config); struct pipe_screen * pipe_etna_create_screen(int fd, const struct pipe_screen_config *config); diff --git a/src/gallium/drivers/kmsro/Android.mk b/src/gallium/drivers/kmsro/Android.mk new file mode 100644 index 00000000000..8a851024dc8 --- /dev/null +++ b/src/gallium/drivers/kmsro/Android.mk @@ -0,0 +1,39 @@ +# Copyright (C) 2014 Emil Velikov +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +LOCAL_PATH := $(call my-dir) + +# get C_SOURCES +include $(LOCAL_PATH)/Makefile.sources + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(C_SOURCES) + +LOCAL_MODULE := libmesa_pipe_kmsro + +include $(GALLIUM_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) + +ifneq ($(HAVE_GALLIUM_KMSRO),) +GALLIUM_TARGET_DRIVERS += pl111 +$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_kmsro) +endif diff --git a/src/gallium/drivers/kmsro/Automake.inc b/src/gallium/drivers/kmsro/Automake.inc new file mode 100644 index 00000000000..66d125cb440 --- /dev/null +++ b/src/gallium/drivers/kmsro/Automake.inc @@ -0,0 +1,9 @@ +if HAVE_GALLIUM_KMSRO + +TARGET_DRIVERS += pl111 +TARGET_CPPFLAGS += -DGALLIUM_KMSRO +TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/winsys/kmsro/drm/libkmsrodrm.la \ + $(LIBDRM_LIBS) + +endif diff --git a/src/gallium/drivers/kmsro/Makefile.am b/src/gallium/drivers/kmsro/Makefile.am new file mode 100644 index 00000000000..5bfaccaa1e5 --- /dev/null +++ b/src/gallium/drivers/kmsro/Makefile.am @@ -0,0 +1,8 @@ +include $(top_srcdir)/src/gallium/Automake.inc + +AM_CPPFLAGS = \ + $(GALLIUM_CFLAGS) + +noinst_LTLIBRARIES = libkmsro.la + +libkmsro_la_SOURCES = $(C_SOURCES) diff --git a/src/gallium/drivers/kmsro/Makefile.sources b/src/gallium/drivers/kmsro/Makefile.sources new file mode 100644 index 00000000000..20396753fdb --- /dev/null +++ b/src/gallium/drivers/kmsro/Makefile.sources @@ -0,0 +1,2 @@ +C_SOURCES := + diff --git a/src/gallium/drivers/pl111/Android.mk b/src/gallium/drivers/pl111/Android.mk deleted file mode 100644 index 00a123ed7a5..00000000000 --- a/src/gallium/drivers/pl111/Android.mk +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2014 Emil Velikov -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -LOCAL_PATH := $(call my-dir) - -# get C_SOURCES -include $(LOCAL_PATH)/Makefile.sources - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - $(C_SOURCES) - -LOCAL_MODULE := libmesa_pipe_pl111 - -include $(GALLIUM_COMMON_MK) -include $(BUILD_STATIC_LIBRARY) - -ifneq ($(HAVE_GALLIUM_PL111),) -GALLIUM_TARGET_DRIVERS += pl111 -$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_pl111) -endif diff --git a/src/gallium/drivers/pl111/Automake.inc b/src/gallium/drivers/pl111/Automake.inc deleted file mode 100644 index 4ecd7dec988..00000000000 --- a/src/gallium/drivers/pl111/Automake.inc +++ /dev/null @@ -1,9 +0,0 @@ -if HAVE_GALLIUM_PL111 - -TARGET_DRIVERS += pl111 -TARGET_CPPFLAGS += -DGALLIUM_PL111 -TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/pl111/drm/libpl111drm.la \ - $(LIBDRM_LIBS) - -endif diff --git a/src/gallium/drivers/pl111/Makefile.am b/src/gallium/drivers/pl111/Makefile.am deleted file mode 100644 index b3e95eeff44..00000000000 --- a/src/gallium/drivers/pl111/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -include $(top_srcdir)/src/gallium/Automake.inc - -AM_CPPFLAGS = \ - $(GALLIUM_CFLAGS) - -noinst_LTLIBRARIES = libpl111.la - -libpl111_la_SOURCES = $(C_SOURCES) diff --git a/src/gallium/drivers/pl111/Makefile.sources b/src/gallium/drivers/pl111/Makefile.sources deleted file mode 100644 index 20396753fdb..00000000000 --- a/src/gallium/drivers/pl111/Makefile.sources +++ /dev/null @@ -1,2 +0,0 @@ -C_SOURCES := - diff --git a/src/gallium/meson.build b/src/gallium/meson.build index 561af9d339c..a3679e5ef62 100644 --- a/src/gallium/meson.build +++ b/src/gallium/meson.build @@ -89,10 +89,10 @@ if with_gallium_vc4 else driver_vc4 = declare_dependency() endif -if with_gallium_pl111 - subdir('winsys/pl111/drm') +if with_gallium_kmsro + subdir('winsys/kmsro/drm') else - driver_pl111 = declare_dependency() + driver_kmsro = declare_dependency() endif if with_gallium_v3d subdir('winsys/v3d/drm') diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index a857b5129fd..42e4a6b4dc7 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -78,7 +78,7 @@ include $(top_srcdir)/src/gallium/drivers/tegra/Automake.inc include $(top_srcdir)/src/gallium/drivers/v3d/Automake.inc include $(top_srcdir)/src/gallium/drivers/vc4/Automake.inc -include $(top_srcdir)/src/gallium/drivers/pl111/Automake.inc +include $(top_srcdir)/src/gallium/drivers/kmsro/Automake.inc include $(top_srcdir)/src/gallium/drivers/virgl/Automake.inc diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build index 51940a2f350..c1cb616b4da 100644 --- a/src/gallium/targets/dri/meson.build +++ b/src/gallium/targets/dri/meson.build @@ -56,13 +56,13 @@ libgallium_dri = shared_library( dependencies : [ dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_thread, driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau, - driver_pl111, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv, + driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv, driver_imx, driver_tegra, driver_i915, driver_svga, driver_virgl, driver_swr, ], ) -foreach d : [[with_gallium_pl111, 'pl111_dri.so'], +foreach d : [[with_gallium_kmsro, 'pl111_dri.so'], [with_gallium_radeonsi, 'radeonsi_dri.so'], [with_gallium_nouveau, 'nouveau_dri.so'], [with_gallium_freedreno, ['msm_dri.so', 'kgsl_dri.so']], diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c index 835d125f21e..2821cef197e 100644 --- a/src/gallium/targets/dri/target.c +++ b/src/gallium/targets/dri/target.c @@ -77,7 +77,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(v3d) #if defined(GALLIUM_VC4) DEFINE_LOADER_DRM_ENTRYPOINT(vc4) -#if defined(GALLIUM_PL111) +#if defined(GALLIUM_KMSRO) DEFINE_LOADER_DRM_ENTRYPOINT(pl111) #endif #endif diff --git a/src/gallium/winsys/kmsro/drm/Android.mk b/src/gallium/winsys/kmsro/drm/Android.mk new file mode 100644 index 00000000000..13600fd2fd2 --- /dev/null +++ b/src/gallium/winsys/kmsro/drm/Android.mk @@ -0,0 +1,33 @@ +# Copyright (C) 2014 Emil Velikov +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +LOCAL_PATH := $(call my-dir) + +# get C_SOURCES +include $(LOCAL_PATH)/Makefile.sources + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(C_SOURCES) + +LOCAL_MODULE := libmesa_winsys_kmsro + +include $(GALLIUM_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/winsys/kmsro/drm/Makefile.am b/src/gallium/winsys/kmsro/drm/Makefile.am new file mode 100644 index 00000000000..ad471d31d4f --- /dev/null +++ b/src/gallium/winsys/kmsro/drm/Makefile.am @@ -0,0 +1,36 @@ +# Copyright © 2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +include Makefile.sources +include $(top_srcdir)/src/gallium/Automake.inc + +AM_CFLAGS = \ + -I$(top_srcdir)/src/gallium/drivers \ + -I$(top_srcdir)/src/gallium/winsys \ + $(GALLIUM_WINSYS_CFLAGS) \ + $(LIBDRM_CFLAGS) + +noinst_LTLIBRARIES = libkmsrodrm.la + +libkmsrodrm_la_SOURCES = $(C_SOURCES) + +EXTRA_DIST = meson.build diff --git a/src/gallium/winsys/kmsro/drm/Makefile.sources b/src/gallium/winsys/kmsro/drm/Makefile.sources new file mode 100644 index 00000000000..220b6fc8216 --- /dev/null +++ b/src/gallium/winsys/kmsro/drm/Makefile.sources @@ -0,0 +1,3 @@ +C_SOURCES := \ + kmsro_drm_public.h \ + kmsro_drm_winsys.c diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h b/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h new file mode 100644 index 00000000000..4da4e4b72ba --- /dev/null +++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2016 Christian Gmeiner + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Christian Gmeiner + */ + +#ifndef __KMSRO_DRM_PUBLIC_H__ +#define __KMSRO_DRM_PUBLIC_H__ + +struct pipe_screen; + +struct pipe_screen *kmsro_drm_screen_create(int fd); + +#endif /* __KMSRO_DRM_PUBLIC_H__ */ diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c new file mode 100644 index 00000000000..4448150cc0c --- /dev/null +++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 Christian Gmeiner + * Copyright (C) 2017 Broadcom + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include + +#include "kmsro_drm_public.h" +#include "vc4/drm/vc4_drm_public.h" +#include "xf86drm.h" + +#include "pipe/p_screen.h" +#include "renderonly/renderonly.h" + +struct pipe_screen *kmsro_drm_screen_create(int fd) +{ + struct renderonly ro = { + /* Passes the vc4-allocated BO through to the KMS-only DRM device using + * PRIME buffer sharing. The VC4 BO must be linear, which the SCANOUT + * flag on allocation will have ensured. + */ + .create_for_resource = renderonly_create_gpu_import_for_resource, + .kms_fd = fd, + .gpu_fd = drmOpenWithType("vc4", NULL, DRM_NODE_RENDER), + }; + + if (ro.gpu_fd < 0) + return NULL; + + struct pipe_screen *screen = vc4_drm_screen_create_renderonly(&ro); + if (!screen) + close(ro.gpu_fd); + + return screen; +} diff --git a/src/gallium/winsys/kmsro/drm/meson.build b/src/gallium/winsys/kmsro/drm/meson.build new file mode 100644 index 00000000000..f157982d728 --- /dev/null +++ b/src/gallium/winsys/kmsro/drm/meson.build @@ -0,0 +1,36 @@ +# Copyright © 2017 Broadcom +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +libkmsrowinsys = static_library( + 'kmsrowinsys', + files('kmsro_drm_winsys.c'), + include_directories : [ + inc_src, inc_include, + inc_gallium, inc_gallium_aux, inc_gallium_winsys, + ], + c_args : [c_vis_args], + dependencies: dep_libdrm, + link_with : libvc4winsys, +) + +driver_kmsro = declare_dependency( + compile_args : '-DGALLIUM_KMSRO', + link_with : libkmsrowinsys, +) diff --git a/src/gallium/winsys/pl111/drm/Android.mk b/src/gallium/winsys/pl111/drm/Android.mk deleted file mode 100644 index 16edd97ade6..00000000000 --- a/src/gallium/winsys/pl111/drm/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2014 Emil Velikov -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -LOCAL_PATH := $(call my-dir) - -# get C_SOURCES -include $(LOCAL_PATH)/Makefile.sources - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(C_SOURCES) - -LOCAL_MODULE := libmesa_winsys_pl111 - -include $(GALLIUM_COMMON_MK) -include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/winsys/pl111/drm/Makefile.am b/src/gallium/winsys/pl111/drm/Makefile.am deleted file mode 100644 index 148e912ef99..00000000000 --- a/src/gallium/winsys/pl111/drm/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright © 2012 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -include Makefile.sources -include $(top_srcdir)/src/gallium/Automake.inc - -AM_CFLAGS = \ - -I$(top_srcdir)/src/gallium/drivers \ - -I$(top_srcdir)/src/gallium/winsys \ - $(GALLIUM_WINSYS_CFLAGS) \ - $(LIBDRM_CFLAGS) - -noinst_LTLIBRARIES = libpl111drm.la - -libpl111drm_la_SOURCES = $(C_SOURCES) - -EXTRA_DIST = meson.build diff --git a/src/gallium/winsys/pl111/drm/Makefile.sources b/src/gallium/winsys/pl111/drm/Makefile.sources deleted file mode 100644 index b4496e66c04..00000000000 --- a/src/gallium/winsys/pl111/drm/Makefile.sources +++ /dev/null @@ -1,3 +0,0 @@ -C_SOURCES := \ - pl111_drm_public.h \ - pl111_drm_winsys.c diff --git a/src/gallium/winsys/pl111/drm/meson.build b/src/gallium/winsys/pl111/drm/meson.build deleted file mode 100644 index 9cb6faf31e2..00000000000 --- a/src/gallium/winsys/pl111/drm/meson.build +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright © 2017 Broadcom -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -libpl111winsys = static_library( - 'pl111winsys', - files('pl111_drm_winsys.c'), - include_directories : [ - inc_src, inc_include, - inc_gallium, inc_gallium_aux, inc_gallium_winsys, - ], - c_args : [c_vis_args], - dependencies: dep_libdrm, - link_with : libvc4winsys, -) - -driver_pl111 = declare_dependency( - compile_args : '-DGALLIUM_PL111', - link_with : libpl111winsys, -) diff --git a/src/gallium/winsys/pl111/drm/pl111_drm_public.h b/src/gallium/winsys/pl111/drm/pl111_drm_public.h deleted file mode 100644 index f362b0f1f9e..00000000000 --- a/src/gallium/winsys/pl111/drm/pl111_drm_public.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2016 Christian Gmeiner - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Authors: - * Christian Gmeiner - */ - -#ifndef __PL111_DRM_PUBLIC_H__ -#define __PL111_DRM_PUBLIC_H__ - -struct pipe_screen; - -struct pipe_screen *pl111_drm_screen_create(int fd); - -#endif /* __PL111_DRM_PUBLIC_H__ */ diff --git a/src/gallium/winsys/pl111/drm/pl111_drm_winsys.c b/src/gallium/winsys/pl111/drm/pl111_drm_winsys.c deleted file mode 100644 index ef7b080fbad..00000000000 --- a/src/gallium/winsys/pl111/drm/pl111_drm_winsys.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2016 Christian Gmeiner - * Copyright (C) 2017 Broadcom - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include -#include - -#include "pl111_drm_public.h" -#include "vc4/drm/vc4_drm_public.h" -#include "xf86drm.h" - -#include "pipe/p_screen.h" -#include "renderonly/renderonly.h" - -struct pipe_screen *pl111_drm_screen_create(int fd) -{ - struct renderonly ro = { - /* Passes the vc4-allocated BO through to the pl111 DRM device using - * PRIME buffer sharing. The VC4 BO must be linear, which the SCANOUT - * flag on allocation will have ensured. - */ - .create_for_resource = renderonly_create_gpu_import_for_resource, - .kms_fd = fd, - .gpu_fd = drmOpenWithType("vc4", NULL, DRM_NODE_RENDER), - }; - - if (ro.gpu_fd < 0) - return NULL; - - struct pipe_screen *screen = vc4_drm_screen_create_renderonly(&ro); - if (!screen) - close(ro.gpu_fd); - - return screen; -}