mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
amd: validate and expose VPE 2.0.0
Define VPE 2.0.0 version identifiers in amd_family.h. In ac_gpu_info.c, assign vpe_version only when the detected version is supported. This ensures userspace only sees a valid VPE version. Signed-off-by: Peyton Lee <peytolee@amd.com>
This commit is contained in:
parent
597fe16e87
commit
b4dde2ee02
2 changed files with 21 additions and 9 deletions
|
|
@ -861,11 +861,24 @@ ac_identify_chip(struct radeon_info *info, const struct drm_amdgpu_info_device *
|
|||
break;
|
||||
}
|
||||
|
||||
if (info->ip[AMD_IP_VPE].num_queues)
|
||||
info->vpe_ip_version = (enum vpe_version)VPE_VERSION_VALUE(
|
||||
info->ip[AMD_IP_VPE].ver_major,
|
||||
info->ip[AMD_IP_VPE].ver_minor,
|
||||
info->ip[AMD_IP_VPE].ver_rev);
|
||||
switch(VPE_VERSION_VALUE(info->ip[AMD_IP_VPE].ver_major,
|
||||
info->ip[AMD_IP_VPE].ver_minor,
|
||||
info->ip[AMD_IP_VPE].ver_rev)) {
|
||||
case VPE_VERSION_VALUE(6, 1, 0):
|
||||
case VPE_VERSION_VALUE(6, 1, 3):
|
||||
info->vpe_ip_version = VPE_1_0;
|
||||
break;
|
||||
case VPE_VERSION_VALUE(6, 1, 1):
|
||||
case VPE_VERSION_VALUE(6, 1, 2):
|
||||
info->vpe_ip_version = VPE_1_1;
|
||||
break;
|
||||
case VPE_VERSION_VALUE(2, 0, 0):
|
||||
info->vpe_ip_version = VPE_2_0;
|
||||
break;
|
||||
default:
|
||||
info->vpe_ip_version = VPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Convert the SDMA version in the current GPU to an enum. */
|
||||
info->sdma_ip_version =
|
||||
|
|
|
|||
|
|
@ -230,10 +230,9 @@ enum vcn_version{
|
|||
|
||||
enum vpe_version {
|
||||
VPE_UNKNOWN = 0,
|
||||
VPE_6_1_0 = VPE_VERSION_VALUE(6, 1, 0),
|
||||
VPE_6_1_1 = VPE_VERSION_VALUE(6, 1, 1),
|
||||
VPE_6_1_2 = VPE_VERSION_VALUE(6, 1, 2),
|
||||
VPE_6_1_3 = VPE_VERSION_VALUE(6, 1, 3),
|
||||
VPE_1_0,
|
||||
VPE_1_1,
|
||||
VPE_2_0,
|
||||
};
|
||||
|
||||
#define SDMA_VERSION_VALUE(major, minor) (((major) << 8) | (minor))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue