radv: fix build with mingw

Cc: 21.2 mesa-stable
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

Closes #5092

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12178>
This commit is contained in:
Michel Zou
2021-06-14 15:57:17 +02:00
parent 277ac9c30f
commit e4c0a34bfe
4 changed files with 29 additions and 16 deletions

View File

@@ -136,76 +136,76 @@ struct amdgpu_gpu_info {
uint32_t vce_harvest_config; uint32_t vce_harvest_config;
uint32_t pci_rev_id; uint32_t pci_rev_id;
}; };
int drmGetCap(int fd, uint64_t capability, uint64_t *value) static int drmGetCap(int fd, uint64_t capability, uint64_t *value)
{ {
return -EINVAL; return -EINVAL;
} }
void drmFreeDevice(drmDevicePtr *device) static void drmFreeDevice(drmDevicePtr *device)
{ {
} }
int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device) static int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
{ {
return -ENODEV; return -ENODEV;
} }
int amdgpu_bo_alloc(amdgpu_device_handle dev, static int amdgpu_bo_alloc(amdgpu_device_handle dev,
struct amdgpu_bo_alloc_request *alloc_buffer, struct amdgpu_bo_alloc_request *alloc_buffer,
amdgpu_bo_handle *buf_handle) amdgpu_bo_handle *buf_handle)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_bo_free(amdgpu_bo_handle buf_handle) static int amdgpu_bo_free(amdgpu_bo_handle buf_handle)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_buffer_size_alignment(amdgpu_device_handle dev, static int amdgpu_query_buffer_size_alignment(amdgpu_device_handle dev,
struct amdgpu_buffer_size_alignments struct amdgpu_buffer_size_alignments
*info) *info)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_firmware_version(amdgpu_device_handle dev, unsigned fw_type, static int amdgpu_query_firmware_version(amdgpu_device_handle dev, unsigned fw_type,
unsigned ip_instance, unsigned index, unsigned ip_instance, unsigned index,
uint32_t *version, uint32_t *feature) uint32_t *version, uint32_t *feature)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_hw_ip_info(amdgpu_device_handle dev, unsigned type, static int amdgpu_query_hw_ip_info(amdgpu_device_handle dev, unsigned type,
unsigned ip_instance, unsigned ip_instance,
struct drm_amdgpu_info_hw_ip *info) struct drm_amdgpu_info_hw_ip *info)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_heap_info(amdgpu_device_handle dev, uint32_t heap, static int amdgpu_query_heap_info(amdgpu_device_handle dev, uint32_t heap,
uint32_t flags, struct amdgpu_heap_info *info) uint32_t flags, struct amdgpu_heap_info *info)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_gpu_info(amdgpu_device_handle dev, static int amdgpu_query_gpu_info(amdgpu_device_handle dev,
struct amdgpu_gpu_info *info) struct amdgpu_gpu_info *info)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_info(amdgpu_device_handle dev, unsigned info_id, static int amdgpu_query_info(amdgpu_device_handle dev, unsigned info_id,
unsigned size, void *value) unsigned size, void *value)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_sw_info(amdgpu_device_handle dev, enum amdgpu_sw_info info, static int amdgpu_query_sw_info(amdgpu_device_handle dev, enum amdgpu_sw_info info,
void *value) void *value)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_gds_info(amdgpu_device_handle dev, static int amdgpu_query_gds_info(amdgpu_device_handle dev,
struct amdgpu_gds_resource_info *gds_info) struct amdgpu_gds_resource_info *gds_info)
{ {
return -EINVAL; return -EINVAL;
} }
int amdgpu_query_video_caps_info(amdgpu_device_handle dev, unsigned cap_type, static int amdgpu_query_video_caps_info(amdgpu_device_handle dev, unsigned cap_type,
unsigned size, void *value) unsigned size, void *value)
{ {
return -EINVAL; return -EINVAL;
} }
const char *amdgpu_get_marketing_name(amdgpu_device_handle dev) static const char *amdgpu_get_marketing_name(amdgpu_device_handle dev)
{ {
return NULL; return NULL;
} }

View File

@@ -139,7 +139,6 @@ endif
if with_platform_windows if with_platform_windows
radv_flags += [ radv_flags += [
'-DVK_USE_PLATFORM_WIN32_KHR', '-DVK_USE_PLATFORM_WIN32_KHR',
'-DVK_NO_PROTOTYPES',
] ]
endif endif
@@ -153,9 +152,12 @@ if with_llvm and with_ld_version_script
libvulkan_radeon_link_depends += files('vulkan.sym') libvulkan_radeon_link_depends += files('vulkan.sym')
endif endif
vulkan_radv_def = 'vulkan_radv.def'
libvulkan_radeon = shared_library( libvulkan_radeon = shared_library(
'vulkan_radeon', 'vulkan_radeon',
[libradv_files, radv_entrypoints, sha1_h], [libradv_files, radv_entrypoints, sha1_h],
vs_module_defs : vulkan_radv_def,
include_directories : [ include_directories : [
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_amd, inc_amd_common, inc_amd_common_llvm, inc_compiler, inc_util, inc_vulkan_wsi, inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_amd, inc_amd_common, inc_amd_common_llvm, inc_compiler, inc_util, inc_vulkan_wsi,
], ],

View File

@@ -62,6 +62,7 @@ typedef void *drmDevicePtr;
#include "git_sha1.h" #include "git_sha1.h"
#include "sid.h" #include "sid.h"
#include "vk_format.h" #include "vk_format.h"
#include "vulkan/vk_icd.h"
/* The number of IBs per submit isn't infinite, it depends on the ring type /* The number of IBs per submit isn't infinite, it depends on the ring type
* (ie. some initial setup needed for a submit) and the number of IBs (4 DW). * (ie. some initial setup needed for a submit) and the number of IBs (4 DW).
@@ -5201,6 +5202,12 @@ radv_GetInstanceProcAddr(VkInstance _instance, const char *pName)
return vk_instance_get_proc_addr(&instance->vk, &radv_instance_entrypoints, pName); return vk_instance_get_proc_addr(&instance->vk, &radv_instance_entrypoints, pName);
} }
/* Windows will use a dll definition file to avoid build errors. */
#ifdef _WIN32
#undef PUBLIC
#define PUBLIC
#endif
/* The loader wants us to expose a second GetInstanceProcAddr function /* The loader wants us to expose a second GetInstanceProcAddr function
* to work around certain LD_PRELOAD issues seen in apps. * to work around certain LD_PRELOAD issues seen in apps.
*/ */

View File

@@ -0,0 +1,4 @@
EXPORTS
vk_icdNegotiateLoaderICDInterfaceVersion
vk_icdGetInstanceProcAddr
vk_icdGetPhysicalDeviceProcAddr