diff --git a/src/meson.build b/src/meson.build index 973ead0..a6c48a0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -77,9 +77,9 @@ vrend_winsys_glx_sources = [ venus_sources = [ 'venus_hw.h', 'venus/venus-protocol/vn_protocol_renderer.h', + 'venus/vkr_common.h', 'venus/vkr_cs.c', 'venus/vkr_cs.h', - 'venus/vkr_object.h', 'venus/vkr_renderer.c', 'venus/vkr_renderer.h', 'venus/vkr_ring.c', diff --git a/src/venus/.clang-format b/src/venus/.clang-format index cb805cf..00011ee 100644 --- a/src/venus/.clang-format +++ b/src/venus/.clang-format @@ -17,7 +17,7 @@ ForEachMacros: - LIST_FOR_EACH_ENTRY_SAFE IncludeBlocks: Regroup IncludeCategories: - - Regex: '^"config.h"$' + - Regex: '^("config.h"|"vkr_common.h")$' Priority: 0 - Regex: '^"vkr_' Priority: 3 diff --git a/src/venus/vkr_object.h b/src/venus/vkr_common.h similarity index 71% rename from src/venus/vkr_object.h rename to src/venus/vkr_common.h index 38fc3bd..058d8e3 100644 --- a/src/venus/vkr_object.h +++ b/src/venus/vkr_common.h @@ -3,14 +3,35 @@ * SPDX-License-Identifier: MIT */ -#ifndef VKR_OBJECT_H -#define VKR_OBJECT_H +#ifndef VKR_COMMON_H +#define VKR_COMMON_H +#include "config.h" + +#include +#include +#include #include +#include #include +#include +#include +#include "c11/threads.h" +#include "os/os_misc.h" +#include "os/os_thread.h" +#include "pipe/p_compiler.h" #include "util/u_double_list.h" +#include "util/u_hash_table.h" +#include "util/u_math.h" +#include "util/u_memory.h" +#include "util/u_pointer.h" #include "venus-protocol/vulkan.h" +#include "virgl_util.h" +#include "virglrenderer.h" +#include "vrend_debug.h" + +#include "vkr_renderer.h" typedef uint64_t vkr_object_id; @@ -55,4 +76,4 @@ struct vkr_object { struct list_head track_head; }; -#endif /* VKR_OBJECT_H */ +#endif /* VKR_COMMON_H */ diff --git a/src/venus/vkr_cs.c b/src/venus/vkr_cs.c index 25a02be..6748e9e 100644 --- a/src/venus/vkr_cs.c +++ b/src/venus/vkr_cs.c @@ -5,7 +5,6 @@ #include "vkr_cs.h" -#include "util/u_memory.h" #include "vrend_iov.h" void diff --git a/src/venus/vkr_cs.h b/src/venus/vkr_cs.h index 3acb0f8..beae166 100644 --- a/src/venus/vkr_cs.h +++ b/src/venus/vkr_cs.h @@ -6,16 +6,7 @@ #ifndef VKR_CS_H #define VKR_CS_H -#include -#include -#include -#include -#include - -#include "util/u_hash_table.h" -#include "util/u_math.h" - -#include "vkr_object.h" +#include "vkr_common.h" #define VKR_CS_DECODER_TEMP_POOL_MAX_SIZE (64u * 1024 * 1024) diff --git a/src/venus/vkr_renderer.c b/src/venus/vkr_renderer.c index 91d735e..99a1f83 100644 --- a/src/venus/vkr_renderer.c +++ b/src/venus/vkr_renderer.c @@ -3,35 +3,22 @@ * SPDX-License-Identifier: MIT */ -#include "vkr_renderer.h" +#include "vkr_common.h" -#include -#include #include -#include -#include "c11/threads.h" -#include "os/os_thread.h" -#include "pipe/p_compiler.h" #include "pipe/p_state.h" #include "util/u_debug.h" -#include "util/u_double_list.h" -#include "util/u_hash_table.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "util/u_pointer.h" #include "venus-protocol/vn_protocol_renderer.h" #include "virgl_context.h" #include "virgl_protocol.h" /* for transfer_mode */ #include "virgl_resource.h" -#include "virgl_util.h" #include "virglrenderer.h" #include "virglrenderer_hw.h" #include "vrend_debug.h" #include "vrend_iov.h" #include "vkr_cs.h" -#include "vkr_object.h" #include "vkr_ring.h" /* diff --git a/src/venus/vkr_ring.c b/src/venus/vkr_ring.c index e9c8348..4065019 100644 --- a/src/venus/vkr_ring.c +++ b/src/venus/vkr_ring.c @@ -5,17 +5,10 @@ #include "vkr_ring.h" -#include #include -#include -#include #include -#include "os/os_thread.h" -#include "util/u_math.h" -#include "util/u_memory.h" #include "virgl_context.h" -#include "virgl_util.h" enum vkr_ring_status_flag { VKR_RING_STATUS_IDLE = 1u << 0, diff --git a/src/venus/vkr_ring.h b/src/venus/vkr_ring.h index f7fd016..727bb2b 100644 --- a/src/venus/vkr_ring.h +++ b/src/venus/vkr_ring.h @@ -6,17 +6,7 @@ #ifndef VKR_RING_H #define VKR_RING_H -#include "config.h" - -#include -#include -#include -#include - -#include "c11/threads.h" -#include "util/u_double_list.h" - -#include "vkr_object.h" +#include "vkr_common.h" struct virgl_context;