summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiwei Zhang <zzyiwei@chromium.org>2021-10-25 22:34:04 +0000
committerMarge Bot <eric+marge@anholt.net>2021-10-27 18:33:11 +0000
commit9fa702f28ca030950cd8d79c2cf071eb63003741 (patch)
treea886405e3bb8f30fd9b2252fdad04dc400232f15
parent565d65baafc218209c09e04ff8b25e1518854bca (diff)
venus: refactor private descriptor_set helpers to be private
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Ryan Neph <ryanneph@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13522>
-rw-r--r--src/virtio/vulkan/vn_descriptor_set.c18
-rw-r--r--src/virtio/vulkan/vn_descriptor_set.h20
2 files changed, 17 insertions, 21 deletions
diff --git a/src/virtio/vulkan/vn_descriptor_set.c b/src/virtio/vulkan/vn_descriptor_set.c
index 464b191cbb3..a2a692ae1a7 100644
--- a/src/virtio/vulkan/vn_descriptor_set.c
+++ b/src/virtio/vulkan/vn_descriptor_set.c
@@ -17,7 +17,7 @@
#include "vn_device.h"
-void
+static void
vn_descriptor_set_layout_destroy(struct vn_device *dev,
struct vn_descriptor_set_layout *layout)
{
@@ -33,6 +33,22 @@ vn_descriptor_set_layout_destroy(struct vn_device *dev,
vk_free(alloc, layout);
}
+static inline struct vn_descriptor_set_layout *
+vn_descriptor_set_layout_ref(struct vn_device *dev,
+ struct vn_descriptor_set_layout *layout)
+{
+ vn_refcount_inc(&layout->refcount);
+ return layout;
+}
+
+static inline void
+vn_descriptor_set_layout_unref(struct vn_device *dev,
+ struct vn_descriptor_set_layout *layout)
+{
+ if (vn_refcount_dec(&layout->refcount))
+ vn_descriptor_set_layout_destroy(dev, layout);
+}
+
static void
vn_descriptor_set_destroy(struct vn_device *dev,
struct vn_descriptor_set *set,
diff --git a/src/virtio/vulkan/vn_descriptor_set.h b/src/virtio/vulkan/vn_descriptor_set.h
index 72da33ee61a..240a52d48dd 100644
--- a/src/virtio/vulkan/vn_descriptor_set.h
+++ b/src/virtio/vulkan/vn_descriptor_set.h
@@ -100,24 +100,4 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(vn_descriptor_update_template,
VkDescriptorUpdateTemplate,
VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE)
-void
-vn_descriptor_set_layout_destroy(struct vn_device *dev,
- struct vn_descriptor_set_layout *layout);
-
-static inline struct vn_descriptor_set_layout *
-vn_descriptor_set_layout_ref(struct vn_device *dev,
- struct vn_descriptor_set_layout *layout)
-{
- vn_refcount_inc(&layout->refcount);
- return layout;
-}
-
-static inline void
-vn_descriptor_set_layout_unref(struct vn_device *dev,
- struct vn_descriptor_set_layout *layout)
-{
- if (vn_refcount_dec(&layout->refcount))
- vn_descriptor_set_layout_destroy(dev, layout);
-}
-
#endif /* VN_DESCRIPTOR_SET_H */