diff --git a/docs/envvars.rst b/docs/envvars.rst index 5eb7152c8d2..beec1a7ceb7 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -1502,10 +1502,6 @@ RADV driver environment variables ``validatevas`` Enable tracking of VA ranges for radv_build_is_valid_va. -.. envvar:: RADV_FORCE_FAMILY - - create a null device to compile shaders without a AMD GPU (e.g. VEGA10) - .. envvar:: RADV_FORCE_VRS allow to force per-pipeline vertex VRS rates on GFX10.3+. This is only diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c index 4d056f10d8b..452aafb83e1 100644 --- a/src/amd/vulkan/radv_instance.c +++ b/src/amd/vulkan/radv_instance.c @@ -369,6 +369,12 @@ radv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationC struct radv_instance *instance; VkResult result; + /* Report RADV_FORCE_FAMILY as deprecated for one or two release cycles. */ + if (os_get_option("RADV_FORCE_FAMILY")) { + fprintf(stderr, "radv: RADV_FORCE_FAMILY= has been removed. Please use AMDGPU drm-shim now.\n"); + return VK_ERROR_INITIALIZATION_FAILED; + } + if (!pAllocator) pAllocator = vk_default_allocator(); @@ -423,15 +429,7 @@ radv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationC fprintf(stderr, "radv: Failed to open log file: %s.\n", filename); } - /* When RADV_FORCE_FAMILY is set, the driver creates a null - * device that allows to test the compiler without having an - * AMDGPU instance. - */ - if (os_get_option("RADV_FORCE_FAMILY")) - instance->vk.physical_devices.enumerate = create_null_physical_device; - else - instance->vk.physical_devices.try_create_for_drm = create_drm_physical_device; - + instance->vk.physical_devices.try_create_for_drm = create_drm_physical_device; instance->vk.physical_devices.destroy = radv_physical_device_destroy; if (instance->debug_flags & RADV_DEBUG_STARTUP) diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index 256ec797392..99a2550aac7 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -2220,35 +2220,19 @@ radv_is_gpu_supported(const struct radeon_info *info) return true; } -static const struct vk_sync_type *const dummy_types[2] = { - &vk_sync_dummy_type, - NULL, -}; - -static VkResult -radv_create_null_device(struct radv_instance *instance, struct radv_physical_device *pdev) -{ - const char *family = os_get_option("RADV_FORCE_FAMILY"); - - if (!ac_null_device_create(&pdev->info, family)) - return vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, "Unknown family: %s\n", family); - - pdev->vk.supported_sync_types = dummy_types; - return VK_SUCCESS; -} - static VkResult radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm_device, struct radv_physical_device **pdev_out) { +#ifdef _WIN32 + assert(drm_device == NULL); + return VK_ERROR_INCOMPATIBLE_DRIVER; +#else VkResult result; int fd = -1; int master_fd = -1; - -#ifdef _WIN32 - assert(drm_device == NULL); -#else bool is_virtio = false; + if (drm_device) { const char *path = drm_device->nodes[DRM_NODE_RENDER]; drmVersionPtr version; @@ -2292,7 +2276,6 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm if (instance->debug_flags & RADV_DEBUG_STARTUP) fprintf(stderr, "radv: info: Found device '%s'.\n", path); } -#endif struct radv_physical_device *pdev = vk_zalloc2(&instance->vk.alloc, NULL, sizeof(*pdev), 8, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); @@ -2310,11 +2293,6 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm goto fail_alloc; } -#ifdef _WIN32 - result = radv_create_null_device(instance, pdev); - if (result != VK_SUCCESS) - goto fail_base; -#else if (drm_device) { bool reserve_vmid = instance->vk.trace_mode & RADV_TRACE_MODE_RGP; @@ -2358,14 +2336,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm result = VK_ERROR_INITIALIZATION_FAILED; goto fail_wsi; } - - } else { - /* Create NULL device if no DRM device was provided. */ - result = radv_create_null_device(instance, pdev); - if (result != VK_SUCCESS) - goto fail_base; } -#endif pdev->master_fd = master_fd; pdev->local_fd = fd; @@ -2478,7 +2449,6 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm radv_physical_device_get_supported_extensions(pdev, &pdev->vk.supported_extensions); radv_physical_device_get_features(pdev, &pdev->vk.supported_features); -#ifndef _WIN32 if (drm_device) { struct stat primary_stat = {0}, render_stat = {0}; @@ -2501,7 +2471,6 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm } pdev->render_devid = render_stat.st_rdev; } -#endif radv_physical_device_init_cache_key(pdev); @@ -2582,6 +2551,7 @@ fail_fd: if (master_fd != -1) close(master_fd); return result; +#endif } VkResult