aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/vulkan/vulkan.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/render/vulkan/vulkan.c b/render/vulkan/vulkan.c
index 4932ec4d..7e9e9396 100644
--- a/render/vulkan/vulkan.c
+++ b/render/vulkan/vulkan.c
@@ -343,22 +343,40 @@ VkPhysicalDevice vulkan_find_drm_phdev(struct wlr_vk_instance *ini, int drm_fd)
}
const char *name = VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME;
- if (find_extensions(avail_ext_props, avail_extc, &name, 1) != NULL) {
- wlr_log(WLR_DEBUG, " Ignoring physical device \"%s\": "
- "VK_EXT_physical_device_drm not supported",
- phdev_props.deviceName);
- continue;
- }
+ bool has_drm_props = find_extensions(avail_ext_props, avail_extc, &name, 1) == NULL;
+ name = VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME;
+ bool has_driver_props = find_extensions(avail_ext_props, avail_extc, &name, 1) == NULL;
+
+ VkPhysicalDeviceProperties2 props = {0};
+ props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
VkPhysicalDeviceDrmPropertiesEXT drm_props = {0};
drm_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT;
+ if (has_drm_props) {
+ drm_props.pNext = props.pNext;
+ props.pNext = &drm_props;
+ }
- VkPhysicalDeviceProperties2 props = {0};
- props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
- props.pNext = &drm_props;
+ VkPhysicalDeviceDriverPropertiesKHR driver_props = {0};
+ driver_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
+ if (has_driver_props) {
+ driver_props.pNext = props.pNext;
+ props.pNext = &driver_props;
+ }
vkGetPhysicalDeviceProperties2(phdev, &props);
+ if (has_driver_props) {
+ wlr_log(WLR_INFO, " Driver name: %s (%s)", driver_props.driverName, driver_props.driverInfo);
+ }
+
+ if (!has_drm_props) {
+ wlr_log(WLR_DEBUG, " Ignoring physical device \"%s\": "
+ "VK_EXT_physical_device_drm not supported",
+ phdev_props.deviceName);
+ continue;
+ }
+
dev_t primary_devid = makedev(drm_props.primaryMajor, drm_props.primaryMinor);
dev_t render_devid = makedev(drm_props.renderMajor, drm_props.renderMinor);
if (primary_devid == drm_stat.st_rdev ||