diff --git a/.pick_status.json b/.pick_status.json index 56c6fe69c70..84222a82364 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -94,7 +94,7 @@ "description": "amd/common: Use cap to test kernel modifier support.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "9a937330efbc21de64a85a4e80d1e3e92ef2a750" }, diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index b1b950d1d15..ec574bd854d 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -34,6 +34,7 @@ #include #ifdef _WIN32 +#define DRM_CAP_ADDFB2_MODIFIERS 0x10 #define DRM_CAP_SYNCOBJ 0x13 #define DRM_CAP_SYNCOBJ_TIMELINE 0x14 #define AMDGPU_GEM_DOMAIN_GTT 0x2 @@ -278,6 +279,14 @@ static bool has_timeline_syncobj(int fd) return value ? true : false; } +static bool has_modifiers(int fd) +{ + uint64_t value; + if (drmGetCap(fd, DRM_CAP_ADDFB2_MODIFIERS, &value)) + return false; + return value ? true : false; +} + static uint64_t fix_vram_size(uint64_t size) { /* The VRAM size is underreported, so we need to fix it, because @@ -705,7 +714,7 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, info->has_scheduled_fence_dependency = info->drm_minor >= 28; info->mid_command_buffer_preemption_enabled = amdinfo->ids_flags & AMDGPU_IDS_FLAGS_PREEMPTION; info->has_tmz_support = has_tmz_support(dev, info, amdinfo); - info->kernel_has_modifiers = info->chip_class >= GFX9 && info->drm_minor >= 40; + info->kernel_has_modifiers = has_modifiers(fd); info->has_graphics = gfx.available_rings > 0; info->pa_sc_tile_steering_override = device_info.pa_sc_tile_steering_override;