From 42e29feb8bdaf2854da69f9b5d779a891ffa5d71 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 2 Jul 2020 11:06:15 -0700 Subject: [PATCH] virgl: move protocol headers to a common place Tested with meson. Android.mk changes are not tested. Signed-off-by: Chia-I Wu Reviewed-by: Gurchetan Singh Part-of: --- src/gallium/drivers/virgl/Android.mk | 3 +++ src/gallium/drivers/virgl/Makefile.sources | 2 -- src/gallium/drivers/virgl/meson.build | 2 +- src/gallium/drivers/virgl/tests/meson.build | 2 +- src/gallium/drivers/virgl/virgl_context.c | 2 +- src/gallium/drivers/virgl/virgl_encode.c | 2 +- src/gallium/drivers/virgl/virgl_encode.h | 2 +- src/gallium/drivers/virgl/virgl_query.c | 2 +- src/gallium/drivers/virgl/virgl_resource.h | 2 +- src/gallium/drivers/virgl/virgl_screen.c | 2 +- src/gallium/drivers/virgl/virgl_streamout.c | 2 +- .../drivers/virgl/virgl_transfer_queue.c | 2 +- src/gallium/drivers/virgl/virgl_winsys.h | 2 +- src/gallium/winsys/virgl/drm/Android.mk | 2 ++ src/gallium/winsys/virgl/drm/meson.build | 2 +- src/gallium/winsys/virgl/vtest/Android.mk | 2 ++ .../winsys/virgl/vtest/Makefile.sources | 3 +-- src/gallium/winsys/virgl/vtest/meson.build | 2 +- .../winsys/virgl/vtest/virgl_vtest_winsys.h | 2 +- src/meson.build | 3 +++ src/virtio/meson.build | 21 +++++++++++++++++++ .../virgl => virtio/virtio-gpu}/virgl_hw.h | 0 .../virtio-gpu}/virgl_protocol.h | 0 .../virgl => virtio}/vtest/vtest_protocol.h | 0 24 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 src/virtio/meson.build rename src/{gallium/drivers/virgl => virtio/virtio-gpu}/virgl_hw.h (100%) rename src/{gallium/drivers/virgl => virtio/virtio-gpu}/virgl_protocol.h (100%) rename src/{gallium/winsys/virgl => virtio}/vtest/vtest_protocol.h (100%) diff --git a/src/gallium/drivers/virgl/Android.mk b/src/gallium/drivers/virgl/Android.mk index c06c16558c3..31b8a5b0292 100644 --- a/src/gallium/drivers/virgl/Android.mk +++ b/src/gallium/drivers/virgl/Android.mk @@ -31,6 +31,9 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libmesa_pipe_virgl LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +LOCAL_C_INCLUDES := $(MESA_TOP)/src/virtio + intermediates := $(call local-generated-sources-dir) LOCAL_GENERATED_SOURCES := $(intermediates)/virgl/virgl_driinfo.h diff --git a/src/gallium/drivers/virgl/Makefile.sources b/src/gallium/drivers/virgl/Makefile.sources index 6730568033b..c8372677f70 100644 --- a/src/gallium/drivers/virgl/Makefile.sources +++ b/src/gallium/drivers/virgl/Makefile.sources @@ -4,8 +4,6 @@ C_SOURCES := \ virgl_context.h \ virgl_encode.c \ virgl_encode.h \ - virgl_hw.h \ - virgl_protocol.h \ virgl_public.h \ virgl_query.c \ virgl_resource.c \ diff --git a/src/gallium/drivers/virgl/meson.build b/src/gallium/drivers/virgl/meson.build index f94099bc200..00cde5f3fe1 100644 --- a/src/gallium/drivers/virgl/meson.build +++ b/src/gallium/drivers/virgl/meson.build @@ -47,7 +47,7 @@ libvirgl = static_library( 'virgl', [ files_libvirgl, virgl_driinfo_h ], gnu_symbol_visibility : 'hidden', - include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], + include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_virtio], dependencies : dep_libdrm ) diff --git a/src/gallium/drivers/virgl/tests/meson.build b/src/gallium/drivers/virgl/tests/meson.build index ec538c9e0b0..53c68f9ee3d 100644 --- a/src/gallium/drivers/virgl/tests/meson.build +++ b/src/gallium/drivers/virgl/tests/meson.build @@ -24,7 +24,7 @@ test( 'virgl_staging_mgr_test', files('virgl_staging_mgr_test.cpp'), dependencies : [dep_thread, idep_gtest], - include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, include_directories('..')], + include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_virtio, include_directories('..')], link_with : [libvirgl, libgallium], ), suite : ['virgl'], diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c index e2698b9845e..4fabc89b1bd 100644 --- a/src/gallium/drivers/virgl/virgl_context.c +++ b/src/gallium/drivers/virgl/virgl_context.c @@ -44,7 +44,7 @@ #include "virgl_encode.h" #include "virgl_context.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" #include "virgl_resource.h" #include "virgl_screen.h" #include "virgl_staging_mgr.h" diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c index 8e65a90d40d..2d1b91a4300 100644 --- a/src/gallium/drivers/virgl/virgl_encode.c +++ b/src/gallium/drivers/virgl/virgl_encode.c @@ -33,7 +33,7 @@ #include "virgl_context.h" #include "virgl_encode.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" #include "virgl_resource.h" #include "virgl_screen.h" diff --git a/src/gallium/drivers/virgl/virgl_encode.h b/src/gallium/drivers/virgl/virgl_encode.h index 385b8ed262e..2b87fb943b0 100644 --- a/src/gallium/drivers/virgl/virgl_encode.h +++ b/src/gallium/drivers/virgl/virgl_encode.h @@ -27,7 +27,7 @@ #include "pipe/p_state.h" #include "virgl_winsys.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" struct tgsi_token; diff --git a/src/gallium/drivers/virgl/virgl_query.c b/src/gallium/drivers/virgl/virgl_query.c index 9d6989c0ae3..8ff9aa5b835 100644 --- a/src/gallium/drivers/virgl/virgl_query.c +++ b/src/gallium/drivers/virgl/virgl_query.c @@ -25,7 +25,7 @@ #include "util/u_inlines.h" #include "virgl_context.h" #include "virgl_encode.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" #include "virgl_resource.h" #include "virgl_screen.h" diff --git a/src/gallium/drivers/virgl/virgl_resource.h b/src/gallium/drivers/virgl/virgl_resource.h index f17dac72a0e..ef9e0681a02 100644 --- a/src/gallium/drivers/virgl/virgl_resource.h +++ b/src/gallium/drivers/virgl/virgl_resource.h @@ -29,7 +29,7 @@ #include "util/list.h" #include "util/u_transfer.h" -#include "virgl_hw.h" +#include "virtio-gpu/virgl_hw.h" #include "virgl_screen.h" #define VR_MAX_TEXTURE_2D_LEVELS 15 diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index fc2a403104a..b7cd406dbca 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -37,7 +37,7 @@ #include "virgl_resource.h" #include "virgl_public.h" #include "virgl_context.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" int virgl_debug = 0; static const struct debug_named_value debug_options[] = { diff --git a/src/gallium/drivers/virgl/virgl_streamout.c b/src/gallium/drivers/virgl/virgl_streamout.c index ba601f9fef1..6e4be7c3af8 100644 --- a/src/gallium/drivers/virgl/virgl_streamout.c +++ b/src/gallium/drivers/virgl/virgl_streamout.c @@ -24,7 +24,7 @@ #include "util/u_memory.h" #include "virgl_context.h" #include "virgl_encode.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" #include "virgl_resource.h" static struct pipe_stream_output_target *virgl_create_so_target( diff --git a/src/gallium/drivers/virgl/virgl_transfer_queue.c b/src/gallium/drivers/virgl/virgl_transfer_queue.c index 34ea5183fcc..2353ad5042e 100644 --- a/src/gallium/drivers/virgl/virgl_transfer_queue.c +++ b/src/gallium/drivers/virgl/virgl_transfer_queue.c @@ -24,7 +24,7 @@ #include "util/u_box.h" #include "util/u_inlines.h" -#include "virgl_protocol.h" +#include "virtio-gpu/virgl_protocol.h" #include "virgl_context.h" #include "virgl_screen.h" #include "virgl_encode.h" diff --git a/src/gallium/drivers/virgl/virgl_winsys.h b/src/gallium/drivers/virgl/virgl_winsys.h index 97885c99955..cdfeeaca96c 100644 --- a/src/gallium/drivers/virgl/virgl_winsys.h +++ b/src/gallium/drivers/virgl/virgl_winsys.h @@ -24,7 +24,7 @@ #define VIRGL_WINSYS_H #include "pipe/p_defines.h" -#include "virgl_hw.h" +#include "virtio-gpu/virgl_hw.h" struct pipe_box; struct pipe_fence_handle; diff --git a/src/gallium/winsys/virgl/drm/Android.mk b/src/gallium/winsys/virgl/drm/Android.mk index 5e2500774e7..f3d9df79c4f 100644 --- a/src/gallium/winsys/virgl/drm/Android.mk +++ b/src/gallium/winsys/virgl/drm/Android.mk @@ -29,6 +29,8 @@ LOCAL_SRC_FILES := $(C_SOURCES) LOCAL_MODULE := libmesa_winsys_virgl +LOCAL_C_INCLUDES := $(MESA_TOP)/src/virtio + LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common include $(GALLIUM_COMMON_MK) diff --git a/src/gallium/winsys/virgl/drm/meson.build b/src/gallium/winsys/virgl/drm/meson.build index cf15b78aff4..ba6439a5f41 100644 --- a/src/gallium/winsys/virgl/drm/meson.build +++ b/src/gallium/winsys/virgl/drm/meson.build @@ -21,7 +21,7 @@ libvirgldrm = static_library( 'virgldrm', 'virgl_drm_winsys.c', - include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_gallium_drivers], + include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_gallium_drivers, inc_virtio], dependencies : [dep_libdrm, dep_libvirglcommon], gnu_symbol_visibility : 'hidden', ) diff --git a/src/gallium/winsys/virgl/vtest/Android.mk b/src/gallium/winsys/virgl/vtest/Android.mk index 5b33f677114..454d830d042 100644 --- a/src/gallium/winsys/virgl/vtest/Android.mk +++ b/src/gallium/winsys/virgl/vtest/Android.mk @@ -29,6 +29,8 @@ LOCAL_SRC_FILES := $(C_SOURCES) LOCAL_MODULE := libmesa_winsys_virgl_vtest +LOCAL_C_INCLUDES := $(MESA_TOP)/src/virtio + LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common include $(GALLIUM_COMMON_MK) diff --git a/src/gallium/winsys/virgl/vtest/Makefile.sources b/src/gallium/winsys/virgl/vtest/Makefile.sources index 12370d96fa8..cda28e575a8 100644 --- a/src/gallium/winsys/virgl/vtest/Makefile.sources +++ b/src/gallium/winsys/virgl/vtest/Makefile.sources @@ -2,5 +2,4 @@ C_SOURCES := \ virgl_vtest_public.h \ virgl_vtest_socket.c \ virgl_vtest_winsys.c \ - virgl_vtest_winsys.h \ - vtest_protocol.h + virgl_vtest_winsys.h diff --git a/src/gallium/winsys/virgl/vtest/meson.build b/src/gallium/winsys/virgl/vtest/meson.build index f8b38b42d7a..caf81220f10 100644 --- a/src/gallium/winsys/virgl/vtest/meson.build +++ b/src/gallium/winsys/virgl/vtest/meson.build @@ -21,7 +21,7 @@ libvirglvtest = static_library( 'virglvtest', ['virgl_vtest_socket.c', 'virgl_vtest_winsys.c'], - include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_gallium_drivers], + include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_gallium_drivers, inc_virtio], dependencies : dep_libvirglcommon, gnu_symbol_visibility : 'hidden', ) diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h index 27b4172814b..4254a551f01 100644 --- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h +++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h @@ -31,7 +31,7 @@ #include "os/os_thread.h" #include "virgl/virgl_winsys.h" -#include "vtest_protocol.h" +#include "vtest/vtest_protocol.h" #include "virgl_resource_cache.h" struct pipe_fence_handle; diff --git a/src/meson.build b/src/meson.build index b16717193e9..1d8e7633369 100644 --- a/src/meson.build +++ b/src/meson.build @@ -85,6 +85,9 @@ endif if with_gallium_panfrost or with_gallium_lima subdir('panfrost') endif +if with_gallium_virgl + subdir('virtio') +endif if with_dri_i965 or with_intel_vk or with_gallium_iris subdir('intel') endif diff --git a/src/virtio/meson.build b/src/virtio/meson.build new file mode 100644 index 00000000000..1bd14feba91 --- /dev/null +++ b/src/virtio/meson.build @@ -0,0 +1,21 @@ +# Copyright © 2017 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 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. + +inc_virtio = include_directories('.') diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/virtio/virtio-gpu/virgl_hw.h similarity index 100% rename from src/gallium/drivers/virgl/virgl_hw.h rename to src/virtio/virtio-gpu/virgl_hw.h diff --git a/src/gallium/drivers/virgl/virgl_protocol.h b/src/virtio/virtio-gpu/virgl_protocol.h similarity index 100% rename from src/gallium/drivers/virgl/virgl_protocol.h rename to src/virtio/virtio-gpu/virgl_protocol.h diff --git a/src/gallium/winsys/virgl/vtest/vtest_protocol.h b/src/virtio/vtest/vtest_protocol.h similarity index 100% rename from src/gallium/winsys/virgl/vtest/vtest_protocol.h rename to src/virtio/vtest/vtest_protocol.h -- 2.30.2