mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
amd/common: Use cap to test kernel modifier support.
Turns out both kernel v5.10 and v5.11 have the same amdgpu driver version and only one has modifiers ... In addition the version check is kinda annoying for backports. So lets use the cap. Since the cap is technically about ADDFB2 I tested that this works on rendernodes (and reading the code there is no distinction from what kind of node this is called). Fixes:9a937330ef("radeonsi: Only set modifier creation function for GFX9+ & with kernel support.") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10337> (cherry picked from commit9da4590df8)
This commit is contained in:
parent
3ed9152fd1
commit
c835bfc52a
2 changed files with 11 additions and 2 deletions
|
|
@ -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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue