vulkan,anv: Auto-detect syncobj features

Instead of having a bunch of const vk_sync_type for each permutation of
vk_drm_syncobj capabilities, have a vk_drm_syncobj_get_type helper which
auto-detects features.  If a driver can't support a feature for some
reason (i915 got timeline support very late, for instance), they can
always mask off feature bits they don't want.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
This commit is contained in:
Jason Ekstrand
2021-11-12 09:51:59 -06:00
parent 36b4d12f02
commit 2a910071bc
6 changed files with 83 additions and 126 deletions

View File

@@ -918,8 +918,6 @@ struct anv_physical_device {
int cmd_parser_version;
bool has_exec_async;
bool has_exec_capture;
bool has_syncobj_wait;
bool has_syncobj_wait_available;
int max_context_priority;
bool has_context_isolation;
bool has_mmap_offset;
@@ -976,6 +974,7 @@ struct anv_physical_device {
uint8_t driver_uuid[VK_UUID_SIZE];
uint8_t device_uuid[VK_UUID_SIZE];
struct vk_sync_type sync_syncobj_type;
struct vk_sync_timeline_type sync_timeline_type;
const struct vk_sync_type * sync_types[4];
@@ -1377,7 +1376,6 @@ int anv_gem_set_context_param(int fd, int context, uint32_t param,
int anv_gem_get_context_param(int fd, int context, uint32_t param,
uint64_t *value);
int anv_gem_get_param(int fd, uint32_t param);
uint64_t anv_gem_get_drm_cap(int fd, uint32_t capability);
int anv_gem_get_tiling(struct anv_device *device, uint32_t gem_handle);
int anv_gem_context_get_reset_stats(int fd, int context,
uint32_t *active, uint32_t *pending);