diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index a0610f3f2a5..a17b03e8427 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -108,6 +108,17 @@ v3dv_EnumerateInstanceVersion(uint32_t *pApiVersion) #include "wsi_common.h" #endif +static bool v3d_has_feature(const struct v3dv_physical_device *device, + enum drm_v3d_param feature) +{ + struct drm_v3d_get_param p = { + .param = feature, + }; + if (v3d_ioctl(device->render_fd, DRM_IOCTL_V3D_GET_PARAM, &p) != 0) + return false; + return p.value; +} + static const struct vk_instance_extension_table instance_extensions = { .KHR_device_group_creation = true, #ifdef VK_USE_PLATFORM_DISPLAY_KHR @@ -177,7 +188,7 @@ get_device_extensions(const struct v3dv_physical_device *device, .KHR_index_type_uint8 = true, .KHR_line_rasterization = true, .KHR_load_store_op_none = true, - .KHR_performance_query = device->caps.perfmon, + .KHR_performance_query = v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_PERFMON), .KHR_relaxed_block_layout = true, .KHR_robustness2 = true, .KHR_maintenance1 = true, @@ -502,7 +513,7 @@ get_features(const struct v3dv_physical_device *physical_device, .vertexAttributeInstanceRateZeroDivisor = false, /* VK_KHR_performance_query */ - .performanceCounterQueryPools = physical_device->caps.perfmon, + .performanceCounterQueryPools = v3d_has_feature(physical_device, DRM_V3D_PARAM_SUPPORTS_PERFMON), .performanceCounterMultipleQueryPools = false, /* VK_EXT_texel_buffer_alignment */ @@ -818,25 +829,14 @@ compute_memory_budget(struct v3dv_physical_device *device) #endif } -static bool -v3d_has_feature(struct v3dv_physical_device *device, enum drm_v3d_param feature) -{ - struct drm_v3d_get_param p = { - .param = feature, - }; - if (v3d_ioctl(device->render_fd, DRM_IOCTL_V3D_GET_PARAM, &p) != 0) - return false; - return p.value; -} - static bool device_has_expected_features(struct v3dv_physical_device *device) { return v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_TFU) && v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_CSD) && v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH) && - v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE) && - device->caps.multisync; + v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT) && + v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE); } @@ -1444,12 +1444,6 @@ create_physical_device(struct v3dv_instance *instance, goto fail; } - device->caps.multisync = - v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT); - - device->caps.perfmon = - v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_PERFMON); - /* Always mention only the newest kernel version we require */ if (!device_has_expected_features(device)) { result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, @@ -1458,7 +1452,7 @@ create_physical_device(struct v3dv_instance *instance, goto fail; } - if (device->caps.perfmon) { + if (v3d_has_feature(device, DRM_V3D_PARAM_SUPPORTS_PERFMON)) { device->perfcntr = v3d_perfcntrs_init(&device->devinfo, device->render_fd); if (!device->perfcntr) { diff --git a/src/broadcom/vulkan/v3dv_device.h b/src/broadcom/vulkan/v3dv_device.h index 8a3d64cff90..843d9a11589 100644 --- a/src/broadcom/vulkan/v3dv_device.h +++ b/src/broadcom/vulkan/v3dv_device.h @@ -116,11 +116,6 @@ struct v3dv_physical_device { */ struct util_sparse_array bo_map; - struct { - bool multisync; - bool perfmon; - } caps; - bool merge_jobs; bool is_shim; };