mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 11:02:31 -04:00
Merge tag 'amd-drm-next-6.7-2023-10-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.7-2023-10-13: amdgpu: - DC replay fixes - Misc code cleanups and spelling fixes - Documentation updates - RAS EEPROM Updates - FRU EEPROM Updates - IP discovery updates - SR-IOV fixes - RAS updates - DC PQ fixes - SMU 13.0.6 updates - GC 11.5 Support - NBIO 7.11 Support - GMC 11 Updates - Reset fixes - SMU 11.5 Updates - SMU 13.0 OD support - Use flexible arrays for bo list handling - W=1 Fixes - SubVP fixes - DPIA fixes - DCN 3.5 Support - Devcoredump fixes - VPE 6.1 support - VCN 4.0 Updates - S/G display fixes - DML fixes - DML2 Support - MST fixes - VRR fixes - Enable seamless boot in more cases - Enable content type property for HDMI - OLED fixes - Rework and clean up GPUVM TLB flushing - DC ODM fixes - DP 2.x fixes - AGP aperture fixes - SDMA firmware loading cleanups - Cyan Skillfish GPU clock counter fix - GC 11 GART fix - Cache GPU fault info for userspace queries - DC cursor check fixes - eDP fixes - DC FP handling fixes - Variable sized array fixes - SMU 13.0.x fixes - IB start and size alignment fixes for VCN - SMU 14 Support - Suspend and resume sequence rework - vkms fix amdkfd: - GC 11 fixes - GC 10 fixes - Doorbell fixes - CWSR fixes - SVM fixes - Clean up GC info enumeration - Rework memory limit handling - Coherent memory handling fixes - Use partial migrations in GPU faults - TLB flush fixes - DMA unmap fixes - GC 9.4.3 fixes - SQ interrupt fix - GTT mapping fix - GC 11.5 Support radeon: - Misc code cleanups - W=1 Fixes - Fix possible buffer overflow - Fix possible NULL pointer dereference UAPI: - Add EXT_COHERENT memory allocation flags. These allow for system scope atomics. Proposed userspace: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/88 - Add support for new VPE engine. This is a memory to memory copy engine with advanced scaling, CSC, and color management features Proposed mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713 - Add INFO IOCTL interface to query GPU faults Proposed Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238 Proposed libdrm MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/298 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231013175758.1735031-1-alexander.deucher@amd.com
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include "nbio_v7_0.h"
|
||||
#include "nbio_v7_4.h"
|
||||
#include "nbio_v7_9.h"
|
||||
#include "nbio_v7_11.h"
|
||||
#include "hdp_v4_0.h"
|
||||
#include "vega10_ih.h"
|
||||
#include "vega20_ih.h"
|
||||
@@ -80,6 +81,8 @@
|
||||
#include "jpeg_v4_0.h"
|
||||
#include "vcn_v4_0_3.h"
|
||||
#include "jpeg_v4_0_3.h"
|
||||
#include "vcn_v4_0_5.h"
|
||||
#include "jpeg_v4_0_5.h"
|
||||
#include "amdgpu_vkms.h"
|
||||
#include "mes_v10_1.h"
|
||||
#include "mes_v11_0.h"
|
||||
@@ -89,6 +92,8 @@
|
||||
#include "smuio_v13_0_3.h"
|
||||
#include "smuio_v13_0_6.h"
|
||||
|
||||
#include "amdgpu_vpe.h"
|
||||
|
||||
#define FIRMWARE_IP_DISCOVERY "amdgpu/ip_discovery.bin"
|
||||
MODULE_FIRMWARE(FIRMWARE_IP_DISCOVERY);
|
||||
|
||||
@@ -174,6 +179,7 @@ static const char *hw_id_names[HW_ID_MAX] = {
|
||||
[XGMI_HWID] = "XGMI",
|
||||
[XGBE_HWID] = "XGBE",
|
||||
[MP0_HWID] = "MP0",
|
||||
[VPE_HWID] = "VPE",
|
||||
};
|
||||
|
||||
static int hw_id_map[MAX_HWIP] = {
|
||||
@@ -203,6 +209,7 @@ static int hw_id_map[MAX_HWIP] = {
|
||||
[XGMI_HWIP] = XGMI_HWID,
|
||||
[DCI_HWIP] = DCI_HWID,
|
||||
[PCIE_HWIP] = PCIE_HWID,
|
||||
[VPE_HWIP] = VPE_HWID,
|
||||
};
|
||||
|
||||
static int amdgpu_discovery_read_binary_from_sysmem(struct amdgpu_device *adev, uint8_t *binary)
|
||||
@@ -304,8 +311,8 @@ static void amdgpu_discovery_harvest_config_quirk(struct amdgpu_device *adev)
|
||||
* So far, apply this quirk only on those Navy Flounder boards which
|
||||
* have a bad harvest table of VCN config.
|
||||
*/
|
||||
if ((adev->ip_versions[UVD_HWIP][1] == IP_VERSION(3, 0, 1)) &&
|
||||
(adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 2))) {
|
||||
if ((amdgpu_ip_version(adev, UVD_HWIP, 1) == IP_VERSION(3, 0, 1)) &&
|
||||
(amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(10, 3, 2))) {
|
||||
switch (adev->pdev->revision) {
|
||||
case 0xC1:
|
||||
case 0xC2:
|
||||
@@ -1184,6 +1191,7 @@ static void amdgpu_discovery_sysfs_fini(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
|
||||
{
|
||||
uint8_t num_base_address, subrev, variant;
|
||||
struct binary_header *bhdr;
|
||||
struct ip_discovery_header *ihdr;
|
||||
struct die_header *dhdr;
|
||||
@@ -1192,7 +1200,6 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
|
||||
uint16_t ip_offset;
|
||||
uint16_t num_dies;
|
||||
uint16_t num_ips;
|
||||
uint8_t num_base_address;
|
||||
int hw_ip;
|
||||
int i, j, k;
|
||||
int r;
|
||||
@@ -1330,8 +1337,22 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
|
||||
* example. On most chips there are multiple instances
|
||||
* with the same HWID.
|
||||
*/
|
||||
adev->ip_versions[hw_ip][ip->instance_number] =
|
||||
IP_VERSION(ip->major, ip->minor, ip->revision);
|
||||
|
||||
if (ihdr->version < 3) {
|
||||
subrev = 0;
|
||||
variant = 0;
|
||||
} else {
|
||||
subrev = ip->sub_revision;
|
||||
variant = ip->variant;
|
||||
}
|
||||
|
||||
adev->ip_versions[hw_ip]
|
||||
[ip->instance_number] =
|
||||
IP_VERSION_FULL(ip->major,
|
||||
ip->minor,
|
||||
ip->revision,
|
||||
variant,
|
||||
subrev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1356,8 +1377,8 @@ static void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
|
||||
* so read harvest bit per IP data structure to set
|
||||
* harvest configuration.
|
||||
*/
|
||||
if (adev->ip_versions[GC_HWIP][0] < IP_VERSION(10, 2, 0) &&
|
||||
adev->ip_versions[GC_HWIP][0] != IP_VERSION(9, 4, 3)) {
|
||||
if (amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(10, 2, 0) &&
|
||||
amdgpu_ip_version(adev, GC_HWIP, 0) != IP_VERSION(9, 4, 3)) {
|
||||
if ((adev->pdev->device == 0x731E &&
|
||||
(adev->pdev->revision == 0xC6 ||
|
||||
adev->pdev->revision == 0xC7)) ||
|
||||
@@ -1432,12 +1453,12 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
|
||||
adev->gfx.config.num_sc_per_sh = le32_to_cpu(gc_info->v1.gc_num_sc_per_se) /
|
||||
le32_to_cpu(gc_info->v1.gc_num_sa_per_se);
|
||||
adev->gfx.config.num_packer_per_sc = le32_to_cpu(gc_info->v1.gc_num_packer_per_sc);
|
||||
if (gc_info->v1.header.version_minor >= 1) {
|
||||
if (le16_to_cpu(gc_info->v1.header.version_minor) >= 1) {
|
||||
adev->gfx.config.gc_num_tcp_per_sa = le32_to_cpu(gc_info->v1_1.gc_num_tcp_per_sa);
|
||||
adev->gfx.config.gc_num_sdp_interface = le32_to_cpu(gc_info->v1_1.gc_num_sdp_interface);
|
||||
adev->gfx.config.gc_num_tcps = le32_to_cpu(gc_info->v1_1.gc_num_tcps);
|
||||
}
|
||||
if (gc_info->v1.header.version_minor >= 2) {
|
||||
if (le16_to_cpu(gc_info->v1.header.version_minor) >= 2) {
|
||||
adev->gfx.config.gc_num_tcp_per_wpg = le32_to_cpu(gc_info->v1_2.gc_num_tcp_per_wpg);
|
||||
adev->gfx.config.gc_tcp_l1_size = le32_to_cpu(gc_info->v1_2.gc_tcp_l1_size);
|
||||
adev->gfx.config.gc_num_sqc_per_wgp = le32_to_cpu(gc_info->v1_2.gc_num_sqc_per_wgp);
|
||||
@@ -1466,7 +1487,7 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
|
||||
adev->gfx.config.num_sc_per_sh = le32_to_cpu(gc_info->v2.gc_num_sc_per_se) /
|
||||
le32_to_cpu(gc_info->v2.gc_num_sh_per_se);
|
||||
adev->gfx.config.num_packer_per_sc = le32_to_cpu(gc_info->v2.gc_num_packer_per_sc);
|
||||
if (gc_info->v2.header.version_minor == 1) {
|
||||
if (le16_to_cpu(gc_info->v2.header.version_minor == 1)) {
|
||||
adev->gfx.config.gc_num_tcp_per_sa = le32_to_cpu(gc_info->v2_1.gc_num_tcp_per_sh);
|
||||
adev->gfx.config.gc_tcp_size_per_cu = le32_to_cpu(gc_info->v2_1.gc_tcp_size_per_cu);
|
||||
adev->gfx.config.gc_num_sdp_interface = le32_to_cpu(gc_info->v2_1.gc_num_sdp_interface); /* per XCD */
|
||||
@@ -1600,7 +1621,7 @@ static int amdgpu_discovery_get_vcn_info(struct amdgpu_device *adev)
|
||||
static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
/* what IP to use for this? */
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 1):
|
||||
case IP_VERSION(9, 1, 0):
|
||||
case IP_VERSION(9, 2, 1):
|
||||
@@ -1632,12 +1653,13 @@ static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(11, 0, 2):
|
||||
case IP_VERSION(11, 0, 3):
|
||||
case IP_VERSION(11, 0, 4):
|
||||
case IP_VERSION(11, 5, 0):
|
||||
amdgpu_device_ip_block_add(adev, &soc21_common_ip_block);
|
||||
break;
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add common ip block(GC_HWIP:0x%x)\n",
|
||||
adev->ip_versions[GC_HWIP][0]);
|
||||
amdgpu_ip_version(adev, GC_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -1646,7 +1668,7 @@ static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev)
|
||||
static int amdgpu_discovery_set_gmc_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
/* use GC or MMHUB IP version */
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 1):
|
||||
case IP_VERSION(9, 1, 0):
|
||||
case IP_VERSION(9, 2, 1):
|
||||
@@ -1678,12 +1700,12 @@ static int amdgpu_discovery_set_gmc_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(11, 0, 2):
|
||||
case IP_VERSION(11, 0, 3):
|
||||
case IP_VERSION(11, 0, 4):
|
||||
case IP_VERSION(11, 5, 0):
|
||||
amdgpu_device_ip_block_add(adev, &gmc_v11_0_ip_block);
|
||||
break;
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add gmc ip block(GC_HWIP:0x%x)\n",
|
||||
adev->ip_versions[GC_HWIP][0]);
|
||||
dev_err(adev->dev, "Failed to add gmc ip block(GC_HWIP:0x%x)\n",
|
||||
amdgpu_ip_version(adev, GC_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -1691,7 +1713,7 @@ static int amdgpu_discovery_set_gmc_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_ih_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[OSSSYS_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, OSSSYS_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 0):
|
||||
case IP_VERSION(4, 0, 1):
|
||||
case IP_VERSION(4, 1, 0):
|
||||
@@ -1724,7 +1746,7 @@ static int amdgpu_discovery_set_ih_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add ih ip block(OSSSYS_HWIP:0x%x)\n",
|
||||
adev->ip_versions[OSSSYS_HWIP][0]);
|
||||
amdgpu_ip_version(adev, OSSSYS_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -1732,7 +1754,7 @@ static int amdgpu_discovery_set_ih_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[MP0_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 0):
|
||||
amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block);
|
||||
break;
|
||||
@@ -1778,7 +1800,7 @@ static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add psp ip block(MP0_HWIP:0x%x)\n",
|
||||
adev->ip_versions[MP0_HWIP][0]);
|
||||
amdgpu_ip_version(adev, MP0_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -1786,7 +1808,7 @@ static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[MP1_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 0):
|
||||
case IP_VERSION(10, 0, 0):
|
||||
case IP_VERSION(10, 0, 1):
|
||||
@@ -1824,10 +1846,13 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(13, 0, 11):
|
||||
amdgpu_device_ip_block_add(adev, &smu_v13_0_ip_block);
|
||||
break;
|
||||
case IP_VERSION(14, 0, 0):
|
||||
amdgpu_device_ip_block_add(adev, &smu_v14_0_ip_block);
|
||||
break;
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add smu ip block(MP1_HWIP:0x%x)\n",
|
||||
adev->ip_versions[MP1_HWIP][0]);
|
||||
amdgpu_ip_version(adev, MP1_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -1852,8 +1877,8 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_DC)
|
||||
if (adev->ip_versions[DCE_HWIP][0]) {
|
||||
switch (adev->ip_versions[DCE_HWIP][0]) {
|
||||
if (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
|
||||
switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
|
||||
case IP_VERSION(1, 0, 0):
|
||||
case IP_VERSION(1, 0, 1):
|
||||
case IP_VERSION(2, 0, 2):
|
||||
@@ -1871,6 +1896,7 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(3, 1, 6):
|
||||
case IP_VERSION(3, 2, 0):
|
||||
case IP_VERSION(3, 2, 1):
|
||||
case IP_VERSION(3, 5, 0):
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
amdgpu_discovery_set_sriov_display(adev);
|
||||
else
|
||||
@@ -1879,11 +1905,11 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add dm ip block(DCE_HWIP:0x%x)\n",
|
||||
adev->ip_versions[DCE_HWIP][0]);
|
||||
amdgpu_ip_version(adev, DCE_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
} else if (adev->ip_versions[DCI_HWIP][0]) {
|
||||
switch (adev->ip_versions[DCI_HWIP][0]) {
|
||||
} else if (amdgpu_ip_version(adev, DCI_HWIP, 0)) {
|
||||
switch (amdgpu_ip_version(adev, DCI_HWIP, 0)) {
|
||||
case IP_VERSION(12, 0, 0):
|
||||
case IP_VERSION(12, 0, 1):
|
||||
case IP_VERSION(12, 1, 0):
|
||||
@@ -1895,7 +1921,7 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add dm ip block(DCI_HWIP:0x%x)\n",
|
||||
adev->ip_versions[DCI_HWIP][0]);
|
||||
amdgpu_ip_version(adev, DCI_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -1905,7 +1931,7 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 1):
|
||||
case IP_VERSION(9, 1, 0):
|
||||
case IP_VERSION(9, 2, 1):
|
||||
@@ -1941,12 +1967,12 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(11, 0, 2):
|
||||
case IP_VERSION(11, 0, 3):
|
||||
case IP_VERSION(11, 0, 4):
|
||||
case IP_VERSION(11, 5, 0):
|
||||
amdgpu_device_ip_block_add(adev, &gfx_v11_0_ip_block);
|
||||
break;
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add gfx ip block(GC_HWIP:0x%x)\n",
|
||||
adev->ip_versions[GC_HWIP][0]);
|
||||
dev_err(adev->dev, "Failed to add gfx ip block(GC_HWIP:0x%x)\n",
|
||||
amdgpu_ip_version(adev, GC_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -1954,7 +1980,7 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[SDMA0_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, SDMA0_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 0):
|
||||
case IP_VERSION(4, 0, 1):
|
||||
case IP_VERSION(4, 1, 0):
|
||||
@@ -1994,7 +2020,7 @@ static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add sdma ip block(SDMA0_HWIP:0x%x)\n",
|
||||
adev->ip_versions[SDMA0_HWIP][0]);
|
||||
amdgpu_ip_version(adev, SDMA0_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -2002,8 +2028,8 @@ static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
if (adev->ip_versions[VCE_HWIP][0]) {
|
||||
switch (adev->ip_versions[UVD_HWIP][0]) {
|
||||
if (amdgpu_ip_version(adev, VCE_HWIP, 0)) {
|
||||
switch (amdgpu_ip_version(adev, UVD_HWIP, 0)) {
|
||||
case IP_VERSION(7, 0, 0):
|
||||
case IP_VERSION(7, 2, 0):
|
||||
/* UVD is not supported on vega20 SR-IOV */
|
||||
@@ -2013,10 +2039,10 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add uvd v7 ip block(UVD_HWIP:0x%x)\n",
|
||||
adev->ip_versions[UVD_HWIP][0]);
|
||||
amdgpu_ip_version(adev, UVD_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
switch (adev->ip_versions[VCE_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, VCE_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 0):
|
||||
case IP_VERSION(4, 1, 0):
|
||||
/* VCE is not supported on vega20 SR-IOV */
|
||||
@@ -2026,11 +2052,11 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add VCE v4 ip block(VCE_HWIP:0x%x)\n",
|
||||
adev->ip_versions[VCE_HWIP][0]);
|
||||
amdgpu_ip_version(adev, VCE_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
switch (adev->ip_versions[UVD_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, UVD_HWIP, 0)) {
|
||||
case IP_VERSION(1, 0, 0):
|
||||
case IP_VERSION(1, 0, 1):
|
||||
amdgpu_device_ip_block_add(adev, &vcn_v1_0_ip_block);
|
||||
@@ -2074,10 +2100,14 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
|
||||
amdgpu_device_ip_block_add(adev, &vcn_v4_0_3_ip_block);
|
||||
amdgpu_device_ip_block_add(adev, &jpeg_v4_0_3_ip_block);
|
||||
break;
|
||||
case IP_VERSION(4, 0, 5):
|
||||
amdgpu_device_ip_block_add(adev, &vcn_v4_0_5_ip_block);
|
||||
amdgpu_device_ip_block_add(adev, &jpeg_v4_0_5_ip_block);
|
||||
break;
|
||||
default:
|
||||
dev_err(adev->dev,
|
||||
"Failed to add vcn/jpeg ip block(UVD_HWIP:0x%x)\n",
|
||||
adev->ip_versions[UVD_HWIP][0]);
|
||||
amdgpu_ip_version(adev, UVD_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -2086,7 +2116,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static int amdgpu_discovery_set_mes_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(10, 1, 10):
|
||||
case IP_VERSION(10, 1, 1):
|
||||
case IP_VERSION(10, 1, 2):
|
||||
@@ -2111,6 +2141,7 @@ static int amdgpu_discovery_set_mes_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(11, 0, 2):
|
||||
case IP_VERSION(11, 0, 3):
|
||||
case IP_VERSION(11, 0, 4):
|
||||
case IP_VERSION(11, 5, 0):
|
||||
amdgpu_device_ip_block_add(adev, &mes_v11_0_ip_block);
|
||||
adev->enable_mes = true;
|
||||
adev->enable_mes_kiq = true;
|
||||
@@ -2123,7 +2154,7 @@ static int amdgpu_discovery_set_mes_ip_blocks(struct amdgpu_device *adev)
|
||||
|
||||
static void amdgpu_discovery_init_soc_config(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(9, 4, 3):
|
||||
aqua_vanjaram_init_soc_config(adev);
|
||||
break;
|
||||
@@ -2132,6 +2163,35 @@ static void amdgpu_discovery_init_soc_config(struct amdgpu_device *adev)
|
||||
}
|
||||
}
|
||||
|
||||
static int amdgpu_discovery_set_vpe_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {
|
||||
case IP_VERSION(6, 1, 0):
|
||||
amdgpu_device_ip_block_add(adev, &vpe_v6_1_ip_block);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 5):
|
||||
if (amdgpu_umsch_mm & 0x1) {
|
||||
amdgpu_device_ip_block_add(adev, &umsch_mm_v4_0_ip_block);
|
||||
adev->enable_umsch_mm = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
int r;
|
||||
@@ -2312,7 +2372,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
amdgpu_discovery_init_soc_config(adev);
|
||||
amdgpu_discovery_sysfs_init(adev);
|
||||
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 1):
|
||||
case IP_VERSION(9, 2, 1):
|
||||
case IP_VERSION(9, 4, 0):
|
||||
@@ -2359,11 +2419,14 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(11, 0, 4):
|
||||
adev->family = AMDGPU_FAMILY_GC_11_0_1;
|
||||
break;
|
||||
case IP_VERSION(11, 5, 0):
|
||||
adev->family = AMDGPU_FAMILY_GC_11_5_0;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
|
||||
case IP_VERSION(9, 1, 0):
|
||||
case IP_VERSION(9, 2, 2):
|
||||
case IP_VERSION(9, 3, 0):
|
||||
@@ -2375,17 +2438,18 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
case IP_VERSION(10, 3, 7):
|
||||
case IP_VERSION(11, 0, 1):
|
||||
case IP_VERSION(11, 0, 4):
|
||||
case IP_VERSION(11, 5, 0):
|
||||
adev->flags |= AMD_IS_APU;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (adev->ip_versions[XGMI_HWIP][0] == IP_VERSION(4, 8, 0))
|
||||
if (amdgpu_ip_version(adev, XGMI_HWIP, 0) == IP_VERSION(4, 8, 0))
|
||||
adev->gmc.xgmi.supported = true;
|
||||
|
||||
/* set NBIO version */
|
||||
switch (adev->ip_versions[NBIO_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, NBIO_HWIP, 0)) {
|
||||
case IP_VERSION(6, 1, 0):
|
||||
case IP_VERSION(6, 2, 0):
|
||||
adev->nbio.funcs = &nbio_v6_1_funcs;
|
||||
@@ -2407,6 +2471,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
adev->nbio.funcs = &nbio_v7_9_funcs;
|
||||
adev->nbio.hdp_flush_reg = &nbio_v7_9_hdp_flush_reg;
|
||||
break;
|
||||
case IP_VERSION(7, 11, 0):
|
||||
adev->nbio.funcs = &nbio_v7_11_funcs;
|
||||
adev->nbio.hdp_flush_reg = &nbio_v7_11_hdp_flush_reg;
|
||||
break;
|
||||
case IP_VERSION(7, 2, 0):
|
||||
case IP_VERSION(7, 2, 1):
|
||||
case IP_VERSION(7, 3, 0):
|
||||
@@ -2443,7 +2511,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (adev->ip_versions[HDP_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, HDP_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 0):
|
||||
case IP_VERSION(4, 0, 1):
|
||||
case IP_VERSION(4, 1, 0):
|
||||
@@ -2475,7 +2543,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (adev->ip_versions[DF_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, DF_HWIP, 0)) {
|
||||
case IP_VERSION(3, 6, 0):
|
||||
case IP_VERSION(3, 6, 1):
|
||||
case IP_VERSION(3, 6, 2):
|
||||
@@ -2495,7 +2563,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (adev->ip_versions[SMUIO_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, SMUIO_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 0):
|
||||
case IP_VERSION(9, 0, 1):
|
||||
case IP_VERSION(10, 0, 0):
|
||||
@@ -2538,7 +2606,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (adev->ip_versions[LSDMA_HWIP][0]) {
|
||||
switch (amdgpu_ip_version(adev, LSDMA_HWIP, 0)) {
|
||||
case IP_VERSION(6, 0, 0):
|
||||
case IP_VERSION(6, 0, 1):
|
||||
case IP_VERSION(6, 0, 2):
|
||||
@@ -2611,6 +2679,14 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = amdgpu_discovery_set_vpe_ip_blocks(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = amdgpu_discovery_set_umsch_mm_ip_blocks(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user