VK_EXT_memory_budget DONE (anv, radv, tu)
VK_EXT_memory_priority DONE (radv)
VK_EXT_pci_bus_info DONE (anv, radv)
- VK_EXT_physical_device_drm DONE (anv)
+ VK_EXT_physical_device_drm DONE (anv, radv)
VK_EXT_pipeline_creation_cache_control DONE (anv, radv)
VK_EXT_pipeline_creation_feedback DONE (anv, radv)
VK_EXT_post_depth_coverage DONE (anv/gfx10+, lvp, radv)
#include <stdbool.h>
#include <string.h>
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#elif !defined(_WIN32)
+#include <sys/sysmacros.h>
+#endif
+
#include "util/debug.h"
#include "util/disk_cache.h"
#include "radv_cs.h"
.EXT_memory_budget = true,
.EXT_memory_priority = true,
.EXT_pci_bus_info = true,
+#ifndef _WIN32
+ .EXT_physical_device_drm = true,
+#endif
.EXT_pipeline_creation_cache_control = true,
.EXT_pipeline_creation_feedback = true,
.EXT_post_depth_coverage = device->rad_info.chip_class >= GFX10,
radv_physical_device_get_supported_extensions(device, &device->vk.supported_extensions);
#ifndef _WIN32
- if (drm_device)
+ if (drm_device) {
+ struct stat primary_stat = {0}, render_stat = {0};
+
+ device->available_nodes = drm_device->available_nodes;
device->bus_info = *drm_device->businfo.pci;
+
+ if ((drm_device->available_nodes & (1 << DRM_NODE_PRIMARY)) &&
+ stat(drm_device->nodes[DRM_NODE_PRIMARY], &primary_stat) != 0) {
+ result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
+ "failed to stat DRM primary node %s",
+ drm_device->nodes[DRM_NODE_PRIMARY]);
+ goto fail_disk_cache;
+ }
+ device->primary_devid = primary_stat.st_rdev;
+
+ if ((drm_device->available_nodes & (1 << DRM_NODE_RENDER)) &&
+ stat(drm_device->nodes[DRM_NODE_RENDER], &render_stat) != 0) {
+ result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
+ "failed to stat DRM render node %s",
+ drm_device->nodes[DRM_NODE_RENDER]);
+ goto fail_disk_cache;
+ }
+ device->render_devid = render_stat.st_rdev;
+ }
#endif
if ((device->instance->debug_flags & RADV_DEBUG_INFO))
props->minAccelerationStructureScratchOffsetAlignment = 128;
break;
}
+#ifndef _WIN32
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+ VkPhysicalDeviceDrmPropertiesEXT *props = (VkPhysicalDeviceDrmPropertiesEXT *)ext;
+ if (pdevice->available_nodes & (1 << DRM_NODE_PRIMARY)) {
+ props->hasPrimary = true;
+ props->primaryMajor = (int64_t)major(pdevice->primary_devid);
+ props->primaryMinor = (int64_t)minor(pdevice->primary_devid);
+ } else {
+ props->hasPrimary = false;
+ }
+ if (pdevice->available_nodes & (1 << DRM_NODE_RENDER)) {
+ props->hasRender = true;
+ props->renderMajor = (int64_t)major(pdevice->render_devid);
+ props->renderMinor = (int64_t)minor(pdevice->render_devid);
+ } else {
+ props->hasRender = false;
+ }
+ break;
+ }
+#endif
default:
break;
}