Module: Mesa Branch: main Commit: f42f3ac1f715dd9e4fc2117bb14f148a2f4b813a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f42f3ac1f715dd9e4fc2117bb14f148a2f4b813a
Author: Chia-I Wu <[email protected]> Date: Wed May 12 14:15:33 2021 -0700 venus: move wsi_image_create_info parsing Move it from vn_CreateImage to vn_wsi_create_image. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Yiwei Zhang <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10709> --- src/virtio/vulkan/vn_image.c | 4 ++-- src/virtio/vulkan/vn_wsi.c | 24 ++++++++++++++---------- src/virtio/vulkan/vn_wsi.h | 18 ++++++++++-------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/virtio/vulkan/vn_image.c b/src/virtio/vulkan/vn_image.c index bfb51250a89..3f2f2b5d3af 100644 --- a/src/virtio/vulkan/vn_image.c +++ b/src/virtio/vulkan/vn_image.c @@ -399,8 +399,8 @@ vn_CreateImage(VkDevice device, external_info->handleTypes == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID; - if (wsi_info && wsi_info->scanout) { - result = vn_wsi_create_scanout_image(dev, pCreateInfo, alloc, &img); + if (wsi_info) { + result = vn_wsi_create_image(dev, pCreateInfo, wsi_info, alloc, &img); } else if (anb_info) { result = vn_android_image_from_anb(dev, pCreateInfo, anb_info, alloc, &img); diff --git a/src/virtio/vulkan/vn_wsi.c b/src/virtio/vulkan/vn_wsi.c index b19cb5f8e1c..ea62bda2797 100644 --- a/src/virtio/vulkan/vn_wsi.c +++ b/src/virtio/vulkan/vn_wsi.c @@ -92,10 +92,11 @@ vn_wsi_fini(struct vn_physical_device *physical_dev) } VkResult -vn_wsi_create_scanout_image(struct vn_device *dev, - const VkImageCreateInfo *create_info, - const VkAllocationCallbacks *alloc, - struct vn_image **out_img) +vn_wsi_create_image(struct vn_device *dev, + const VkImageCreateInfo *create_info, + const struct wsi_image_create_info *wsi_info, + const VkAllocationCallbacks *alloc, + struct vn_image **out_img) { /* TODO This is the legacy path used by wsi_create_native_image when there * is no modifier support. Instead of forcing VK_IMAGE_TILING_LINEAR, we @@ -105,12 +106,15 @@ vn_wsi_create_scanout_image(struct vn_device *dev, * the host compositor. There can be requirements we fail to meet. We * should require modifier support at some point. */ - VkImageCreateInfo local_create_info = *create_info; - local_create_info.tiling = VK_IMAGE_TILING_LINEAR; - create_info = &local_create_info; - - if (VN_DEBUG(WSI)) - vn_log(dev->instance, "forcing scanout image linear"); + VkImageCreateInfo local_create_info; + if (wsi_info->scanout) { + local_create_info = *create_info; + local_create_info.tiling = VK_IMAGE_TILING_LINEAR; + create_info = &local_create_info; + + if (VN_DEBUG(WSI)) + vn_log(dev->instance, "forcing scanout image linear"); + } return vn_image_create(dev, create_info, alloc, out_img); } diff --git a/src/virtio/vulkan/vn_wsi.h b/src/virtio/vulkan/vn_wsi.h index f63e2d4e2ab..e863f210c95 100644 --- a/src/virtio/vulkan/vn_wsi.h +++ b/src/virtio/vulkan/vn_wsi.h @@ -31,10 +31,11 @@ vn_wsi_find_wsi_image_create_info(const VkImageCreateInfo *create_info) } VkResult -vn_wsi_create_scanout_image(struct vn_device *dev, - const VkImageCreateInfo *create_info, - const VkAllocationCallbacks *alloc, - struct vn_image **out_img); +vn_wsi_create_image(struct vn_device *dev, + const VkImageCreateInfo *create_info, + const struct wsi_image_create_info *wsi_info, + const VkAllocationCallbacks *alloc, + struct vn_image **out_img); #else @@ -56,10 +57,11 @@ vn_wsi_find_wsi_image_create_info(const VkImageCreateInfo *create_info) } static inline VkResult -vn_wsi_create_scanout_image(struct vn_device *dev, - const VkImageCreateInfo *create_info, - const VkAllocationCallbacks *alloc, - struct vn_image **out_img) +vn_wsi_create_image(struct vn_device *dev, + const VkImageCreateInfo *create_info, + const struct wsi_image_create_info *wsi_info, + const VkAllocationCallbacks *alloc, + struct vn_image **out_img) { return VK_ERROR_OUT_OF_HOST_MEMORY; } _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
