17ec681f3Smrg/*
27ec681f3Smrg * Copyright 2019 Google LLC
37ec681f3Smrg * SPDX-License-Identifier: MIT
47ec681f3Smrg *
57ec681f3Smrg * based in part on anv and radv which are:
67ec681f3Smrg * Copyright © 2015 Intel Corporation
77ec681f3Smrg * Copyright © 2016 Red Hat.
87ec681f3Smrg * Copyright © 2016 Bas Nieuwenhuizen
97ec681f3Smrg */
107ec681f3Smrg
117ec681f3Smrg#ifndef VN_WSI_H
127ec681f3Smrg#define VN_WSI_H
137ec681f3Smrg
147ec681f3Smrg#include "vn_common.h"
157ec681f3Smrg
167ec681f3Smrg#include "wsi_common.h"
177ec681f3Smrg
187ec681f3Smrg#ifdef VN_USE_WSI_PLATFORM
197ec681f3Smrg
207ec681f3SmrgVkResult
217ec681f3Smrgvn_wsi_init(struct vn_physical_device *physical_dev);
227ec681f3Smrg
237ec681f3Smrgvoid
247ec681f3Smrgvn_wsi_fini(struct vn_physical_device *physical_dev);
257ec681f3Smrg
267ec681f3Smrgstatic inline const struct wsi_image_create_info *
277ec681f3Smrgvn_wsi_find_wsi_image_create_info(const VkImageCreateInfo *create_info)
287ec681f3Smrg{
297ec681f3Smrg   return vk_find_struct_const(create_info->pNext,
307ec681f3Smrg                               WSI_IMAGE_CREATE_INFO_MESA);
317ec681f3Smrg}
327ec681f3Smrg
337ec681f3SmrgVkResult
347ec681f3Smrgvn_wsi_create_image(struct vn_device *dev,
357ec681f3Smrg                    const VkImageCreateInfo *create_info,
367ec681f3Smrg                    const struct wsi_image_create_info *wsi_info,
377ec681f3Smrg                    const VkAllocationCallbacks *alloc,
387ec681f3Smrg                    struct vn_image **out_img);
397ec681f3Smrg
407ec681f3Smrg#else
417ec681f3Smrg
427ec681f3Smrgstatic inline VkResult
437ec681f3Smrgvn_wsi_init(UNUSED struct vn_physical_device *physical_dev)
447ec681f3Smrg{
457ec681f3Smrg   return VK_SUCCESS;
467ec681f3Smrg}
477ec681f3Smrg
487ec681f3Smrgstatic inline void
497ec681f3Smrgvn_wsi_fini(UNUSED struct vn_physical_device *physical_dev)
507ec681f3Smrg{
517ec681f3Smrg}
527ec681f3Smrg
537ec681f3Smrgstatic inline const struct wsi_image_create_info *
547ec681f3Smrgvn_wsi_find_wsi_image_create_info(const VkImageCreateInfo *create_info)
557ec681f3Smrg{
567ec681f3Smrg   return NULL;
577ec681f3Smrg}
587ec681f3Smrg
597ec681f3Smrgstatic inline VkResult
607ec681f3Smrgvn_wsi_create_image(struct vn_device *dev,
617ec681f3Smrg                    const VkImageCreateInfo *create_info,
627ec681f3Smrg                    const struct wsi_image_create_info *wsi_info,
637ec681f3Smrg                    const VkAllocationCallbacks *alloc,
647ec681f3Smrg                    struct vn_image **out_img)
657ec681f3Smrg{
667ec681f3Smrg   return VK_ERROR_OUT_OF_HOST_MEMORY;
677ec681f3Smrg}
687ec681f3Smrg
697ec681f3Smrg#endif /* VN_USE_WSI_PLATFORM */
707ec681f3Smrg
717ec681f3Smrg#endif /* VN_WSI_H */
72