Add support for GC 11.0
Subsystems (3)
Alex Deucher
maintainercover Add support for GC 11.0
This patch set adds GFX and KFD support for GC 11.0. GC11 uses MES for engine management and has a new microcontroller, IMU, which handles power management for the block.
Alex Deucher (2):
drm/amdgpu/discovery: handle AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO in SMU drm/amdgpu/discovery: add MES11 support
Chengming Gui (2):
drm/amd/amdgpu: adjust the fw load type list drm/amd/amdgpu: add more fw load type to fit new ASICs
Evan Quan (2):
drm/amdgpu: enable GFX CGCG/CGLS for GC11.0.0
drm/amdgpu: enable fgcg for soc21
Hawking Zhang (2):
drm/amdgpu: add init support for GFX11 (v2) drm/amdgpu: enable GENERIC0_INT for gfx/compute pipes
Jack Xiao (6):
drm/amdgpu: add new CP_MES ucode ids
drm/amdgpu: correct cp doorbell range
drm/amdgpu: add mes unmap legacy queue routine
drm/amdgpu/mes11: initiate mes v11 support
drm/amdgpu/gfx10: enable kiq to map mes ring
drm/amdgpu/gfx11: enable kiq to map mes ring
Likun Gao (14):
drm/amdgpu: support RLCP firmware front door load drm/amdgpu: support RLCV firmware front door load drm/amdgpu: support for new SDMA front door load drm/amdgpu: support IMU front door load
drm/amdgpu: add convert for new gfx type drm/amdgpu: init SDMA v6 microcode with PSP load type drm/amdgpu: extend the show ucode name function drm/amdgpu/gfx: refine fw hdr check fuction drm/amdgpu: skip amdgpu_ucode_create_bo for backdoor autoload drm/amdgpu: fix the fw size for sdma
drm/amdgpu: renovate sdma fw struct
drm/amdgpu: support RS64 CP fw front door load drm/amdgpu: support imu for gfx11 drm/amdgpu/discovery: add GFX 11.0 Support
Mukul Joshi (1):
drm/amdkfd: Add KFD support for soc21 v3
drivers/gpu/drm/amd/amdgpu/Makefile | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 15 +-
.../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 625 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 30 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h | 11 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 17 +
drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h | 51 +
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 335 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 85 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 51 +
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 140 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 35 +-
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 22 +-
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 6342 +++++++++++++++++
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.h | 29 +
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 7 +-
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c | 286 +
drivers/gpu/drm/amd/amdgpu/imu_v11_0.h | 30 +
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 175 +-
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 1181 +++
drivers/gpu/drm/amd/amdgpu/mes_v11_0.h | 29 +
drivers/gpu/drm/amd/amdgpu/nv.c | 4 +
drivers/gpu/drm/amd/amdgpu/soc21.c | 8 +-
drivers/gpu/drm/amd/amdkfd/Makefile | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 8 +
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 24 +-
.../drm/amd/amdkfd/kfd_device_queue_manager.c | 299 +-
.../drm/amd/amdkfd/kfd_device_queue_manager.h | 5 +
.../amd/amdkfd/kfd_device_queue_manager_v11.c | 81 +
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 56 +-
.../gpu/drm/amd/amdkfd/kfd_int_process_v11.c | 383 +
.../gpu/drm/amd/amdkfd/kfd_int_process_v9.c | 8 +-
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 10 +-
.../gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 508 ++
drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 13 +
drivers/gpu/drm/amd/amdkfd/kfd_process.c | 19 +
.../amd/amdkfd/kfd_process_queue_manager.c | 21 +
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +-
drivers/gpu/drm/amd/amdkfd/soc15_int.h | 3 +-
.../gpu/drm/amd/include/kgd_kfd_interface.h | 1 +
.../drm/amd/{amdgpu => include}/mes_api_def.h | 167 +-
drivers/gpu/drm/amd/include/mes_v11_api_def.h | 579 ++
44 files changed, 11417 insertions(+), 302 deletions(-)
create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c
create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h
create mode 100644 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
create mode 100644 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.h
create mode 100644 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
create mode 100644 drivers/gpu/drm/amd/amdgpu/imu_v11_0.h
create mode 100644 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
create mode 100644 drivers/gpu/drm/amd/amdgpu/mes_v11_0.h
create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v11.c
create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c
create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c
rename drivers/gpu/drm/amd/{amdgpu => include}/mes_api_def.h (68%)
create mode 100644 drivers/gpu/drm/amd/include/mes_v11_api_def.hSignature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 1/29 drm/amdgpu: support RLCP firmware front door load
From: Likun Gao <[email protected]>
Support RLCP firmware front door load.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + 3 files changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -2217,6 +2217,9 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_CP_MEC2_JT : *type =GFX_FW_TYPE_CP_MEC_ME2 ;break ; +case AMDGPU_UCODE_ID_RLC_P : + *type =GFX_FW_TYPE_RLC_P ; +break ;case AMDGPU_UCODE_ID_RLC_G : *type =GFX_FW_TYPE_RLC_G ;break ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +4 -0
@@ -701,6 +701,10 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, ucode->ucode_size = adev->gfx.rlc.rlc_dram_ucode_size_bytes; ucode_addr = adev->gfx.rlc.rlc_dram_ucode;break ; +case AMDGPU_UCODE_ID_RLC_P : + ucode->ucode_size = adev->gfx.rlc.rlcp_ucode_size_bytes; + ucode_addr = adev->gfx.rlc.rlcp_ucode; +break ;case AMDGPU_UCODE_ID_CP_MES : ucode->ucode_size =le32_to_cpu (mes_hdr->mes_ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -0
@@ -400,6 +400,7 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM ,AMDGPU_UCODE_ID_RLC_IRAM ,AMDGPU_UCODE_ID_RLC_DRAM , +AMDGPU_UCODE_ID_RLC_P ,AMDGPU_UCODE_ID_RLC_G ,AMDGPU_UCODE_ID_STORAGE , AMDGPU_UCODE_ID_SMC,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 2/29 drm/amdgpu: support RLCV firmware front door load
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Support RLCV firmware front door load.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + 3 files changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -2220,6 +2220,9 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_RLC_P : *type =GFX_FW_TYPE_RLC_P ;break ; +case AMDGPU_UCODE_ID_RLC_V : + *type =GFX_FW_TYPE_RLC_V ; +break ;case AMDGPU_UCODE_ID_RLC_G : *type =GFX_FW_TYPE_RLC_G ;break ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +4 -0
@@ -705,6 +705,10 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, ucode->ucode_size = adev->gfx.rlc.rlcp_ucode_size_bytes; ucode_addr = adev->gfx.rlc.rlcp_ucode;break ; +case AMDGPU_UCODE_ID_RLC_V : + ucode->ucode_size = adev->gfx.rlc.rlcv_ucode_size_bytes; + ucode_addr = adev->gfx.rlc.rlcv_ucode; +break ;case AMDGPU_UCODE_ID_CP_MES : ucode->ucode_size =le32_to_cpu (mes_hdr->mes_ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -0
@@ -401,6 +401,7 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_RLC_IRAM ,AMDGPU_UCODE_ID_RLC_DRAM ,AMDGPU_UCODE_ID_RLC_P , +AMDGPU_UCODE_ID_RLC_V ,AMDGPU_UCODE_ID_RLC_G ,AMDGPU_UCODE_ID_STORAGE , AMDGPU_UCODE_ID_SMC,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 3/29 drm/amdgpu: support for new SDMA front door load
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Support for SDMA v6_0 ucode front door load.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 12 ++++++++++++ 2 files changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -0
@@ -2277,6 +2277,12 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_DMCUB : *type =GFX_FW_TYPE_DMUB ;break ; +case AMDGPU_UCODE_ID_SDMA_UCODE_TH0 : + *type =GFX_FW_TYPE_SDMA_UCODE_TH0 ; +break ; +case AMDGPU_UCODE_ID_SDMA_UCODE_TH1 : + *type =GFX_FW_TYPE_SDMA_UCODE_TH1 ; +break ;case AMDGPU_UCODE_ID_MAXIMUM :default :return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +12 -0
@@ -648,6 +648,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,const struct dmcu_firmware_header_v1_0 *dmcu_hdr =NULL ;const struct dmcub_firmware_header_v1_0 *dmcub_hdr =NULL ;const struct mes_firmware_header_v1_0 *mes_hdr =NULL ; +const struct sdma_firmware_header_v2_0 *sdma_hdr =NULL ;u8 *ucode_addr;if (NULL == ucode->fw)
@@ -664,9 +665,20 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, dmcu_hdr = (const struct dmcu_firmware_header_v1_0 *)ucode->fw->data; dmcub_hdr = (const struct dmcub_firmware_header_v1_0 *)ucode->fw->data; mes_hdr = (const struct mes_firmware_header_v1_0 *)ucode->fw->data; + sdma_hdr = (const struct sdma_firmware_header_v2_0 *)ucode->fw->data;if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) {switch (ucode->ucode_id) { +case AMDGPU_UCODE_ID_SDMA_UCODE_TH0 : + ucode->ucode_size =le32_to_cpu (sdma_hdr->ctx_jt_offset + sdma_hdr->ctx_jt_size); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (sdma_hdr->header.ucode_array_offset_bytes); +break ; +case AMDGPU_UCODE_ID_SDMA_UCODE_TH1 : + ucode->ucode_size =le32_to_cpu (sdma_hdr->ctl_jt_offset + sdma_hdr->ctl_jt_size); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (sdma_hdr->ctl_ucode_offset); +break ;case AMDGPU_UCODE_ID_CP_MEC1 :case AMDGPU_UCODE_ID_CP_MEC2 : ucode->ucode_size = le32_to_cpu(header->ucode_size_bytes) -
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 4/29 drm/amdgpu: add new CP_MES ucode ids
In reply to Alex DeucherFrom: Jack Xiao <[email protected]>
Needed for MES KIQ firmware loading.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +2 -0
@@ -395,6 +395,8 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_CP_MEC2_JT ,AMDGPU_UCODE_ID_CP_MES ,AMDGPU_UCODE_ID_CP_MES_DATA , +AMDGPU_UCODE_ID_CP_MES1 , +AMDGPU_UCODE_ID_CP_MES1_DATA ,AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL ,AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM , AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 5/29 drm/amdgpu: support IMU front door load
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Support for front door to load IMU firmware.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 13 +++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 2 ++ 3 files changed, 21 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -0
@@ -2283,6 +2283,12 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_SDMA_UCODE_TH1 : *type =GFX_FW_TYPE_SDMA_UCODE_TH1 ;break ; +case AMDGPU_UCODE_ID_IMU_I : + *type =GFX_FW_TYPE_IMU_I ; +break ; +case AMDGPU_UCODE_ID_IMU_D : + *type =GFX_FW_TYPE_IMU_D ; +break ;case AMDGPU_UCODE_ID_MAXIMUM :default :return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +13 -0
@@ -649,6 +649,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,const struct dmcub_firmware_header_v1_0 *dmcub_hdr =NULL ;const struct mes_firmware_header_v1_0 *mes_hdr =NULL ;const struct sdma_firmware_header_v2_0 *sdma_hdr =NULL ; +const struct imu_firmware_header_v1_0 *imu_hdr =NULL ;u8 *ucode_addr;if (NULL == ucode->fw)
@@ -666,6 +667,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, dmcub_hdr = (const struct dmcub_firmware_header_v1_0 *)ucode->fw->data; mes_hdr = (const struct mes_firmware_header_v1_0 *)ucode->fw->data; sdma_hdr = (const struct sdma_firmware_header_v2_0 *)ucode->fw->data; + imu_hdr = (const struct imu_firmware_header_v1_0 *)ucode->fw->data;if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) {switch (ucode->ucode_id) {
@@ -762,6 +764,17 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, ucode->ucode_size = ucode->fw->size; ucode_addr = (u8 *)ucode->fw->data;break ; +case AMDGPU_UCODE_ID_IMU_I : + ucode->ucode_size =le32_to_cpu (imu_hdr->imu_iram_ucode_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (imu_hdr->header.ucode_array_offset_bytes); +break ; +case AMDGPU_UCODE_ID_IMU_D : + ucode->ucode_size =le32_to_cpu (imu_hdr->imu_dram_ucode_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (imu_hdr->header.ucode_array_offset_bytes) + +le32_to_cpu (imu_hdr->imu_iram_ucode_size_bytes); +break ;default : ucode->ucode_size =le32_to_cpu (header->ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +2 -0
@@ -397,6 +397,8 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_CP_MES_DATA ,AMDGPU_UCODE_ID_CP_MES1 ,AMDGPU_UCODE_ID_CP_MES1_DATA , +AMDGPU_UCODE_ID_IMU_I , +AMDGPU_UCODE_ID_IMU_D ,AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL ,AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM , AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 6/29 drm/amdgpu: add convert for new gfx type
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Add convert for CP RS64 related gfx ip type.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 33 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 11 ++++++++ 2 files changed, 44 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +33 -0
@@ -2289,6 +2289,39 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,case AMDGPU_UCODE_ID_IMU_D : *type =GFX_FW_TYPE_IMU_D ;break ; +case AMDGPU_UCODE_ID_CP_RS64_PFP : + *type =GFX_FW_TYPE_RS64_PFP ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_ME : + *type =GFX_FW_TYPE_RS64_ME ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC : + *type =GFX_FW_TYPE_RS64_MEC ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK : + *type =GFX_FW_TYPE_RS64_PFP_P0_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_PFP_P1_STACK : + *type =GFX_FW_TYPE_RS64_PFP_P1_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK : + *type =GFX_FW_TYPE_RS64_ME_P0_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_ME_P1_STACK : + *type =GFX_FW_TYPE_RS64_ME_P1_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P0_STACK : + *type =GFX_FW_TYPE_RS64_MEC_P0_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P1_STACK : + *type =GFX_FW_TYPE_RS64_MEC_P1_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P2_STACK : + *type =GFX_FW_TYPE_RS64_MEC_P2_STACK ; +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P3_STACK : + *type =GFX_FW_TYPE_RS64_MEC_P3_STACK ; +break ;case AMDGPU_UCODE_ID_MAXIMUM :default :return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +11 -0
@@ -389,6 +389,17 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_CP_CE ,AMDGPU_UCODE_ID_CP_PFP ,AMDGPU_UCODE_ID_CP_ME , +AMDGPU_UCODE_ID_CP_RS64_PFP , +AMDGPU_UCODE_ID_CP_RS64_ME , +AMDGPU_UCODE_ID_CP_RS64_MEC , +AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK , +AMDGPU_UCODE_ID_CP_RS64_PFP_P1_STACK , +AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK , +AMDGPU_UCODE_ID_CP_RS64_ME_P1_STACK , +AMDGPU_UCODE_ID_CP_RS64_MEC_P0_STACK , +AMDGPU_UCODE_ID_CP_RS64_MEC_P1_STACK , +AMDGPU_UCODE_ID_CP_RS64_MEC_P2_STACK , +AMDGPU_UCODE_ID_CP_RS64_MEC_P3_STACK ,AMDGPU_UCODE_ID_CP_MEC1 ,AMDGPU_UCODE_ID_CP_MEC1_JT , AMDGPU_UCODE_ID_CP_MEC2,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 7/29 drm/amdgpu: init SDMA v6 microcode with PSP load type
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Update to use new SDMA UCODE ID when init sdma microcode for sdma6 with psp front door load type.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +2 -0
@@ -386,6 +386,8 @@ enum AMDGPU_UCODE_ID {AMDGPU_UCODE_ID_SDMA5 ,AMDGPU_UCODE_ID_SDMA6 ,AMDGPU_UCODE_ID_SDMA7 , +AMDGPU_UCODE_ID_SDMA_UCODE_TH0 , +AMDGPU_UCODE_ID_SDMA_UCODE_TH1 ,AMDGPU_UCODE_ID_CP_CE ,AMDGPU_UCODE_ID_CP_PFP , AMDGPU_UCODE_ID_CP_ME,
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 8/29 drm/amdgpu: extend the show ucode name function
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Extend amdgpu_ucode_name function to show SDMA TH0, TH1, IMU, RLCP, RLCV and MES related ucode name via ucode id.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +16 -0
@@ -515,6 +515,10 @@ const char *amdgpu_ucode_name(enum AMDGPU_UCODE_ID ucode_id)return "SDMA6" ;case AMDGPU_UCODE_ID_SDMA7 :return "SDMA7" ; +case AMDGPU_UCODE_ID_SDMA_UCODE_TH0 : +return "SDMA_CTX" ; +case AMDGPU_UCODE_ID_SDMA_UCODE_TH1 : +return "SDMA_CTL" ;case AMDGPU_UCODE_ID_CP_CE :return "CP_CE" ;case AMDGPU_UCODE_ID_CP_PFP :
@@ -533,6 +537,10 @@ const char *amdgpu_ucode_name(enum AMDGPU_UCODE_ID ucode_id)return "CP_MES" ;case AMDGPU_UCODE_ID_CP_MES_DATA :return "CP_MES_DATA" ; +case AMDGPU_UCODE_ID_CP_MES1 : +return "CP_MES_KIQ" ; +case AMDGPU_UCODE_ID_CP_MES1_DATA : +return "CP_MES_KIQ_DATA" ;case AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL :return "RLC_RESTORE_LIST_CNTL" ;case AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM :
@@ -545,6 +553,14 @@ const char *amdgpu_ucode_name(enum AMDGPU_UCODE_ID ucode_id)return "RLC_DRAM" ;case AMDGPU_UCODE_ID_RLC_G :return "RLC_G" ; +case AMDGPU_UCODE_ID_RLC_P : +return "RLC_P" ; +case AMDGPU_UCODE_ID_RLC_V : +return "RLC_V" ; +case AMDGPU_UCODE_ID_IMU_I : +return "IMU_I" ; +case AMDGPU_UCODE_ID_IMU_D : +return "IMU_D" ;case AMDGPU_UCODE_ID_STORAGE :return "STORAGE" ;case AMDGPU_UCODE_ID_SMC :
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 9/29 drm/amdgpu/gfx: refine fw hdr check fuction
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
The return value of function amdgpu_ucode_hdr_version doesn't make sense, so change it to return true when fw header version is match with passed in parameters.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -2
@@ -428,8 +428,8 @@ bool amdgpu_ucode_hdr_version(union amdgpu_firmware_header *hdr, {if ((hdr->common.header_version_major == hdr_major) && (hdr->common.header_version_minor == hdr_minor)) -return false; -return true; +return true; +return false; }enum amdgpu_firmware_load_type
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 10/29 drm/amd/amdgpu: adjust the fw load type list
In reply to Alex DeucherFrom: Chengming Gui <[email protected]>
Use 0 for legacy backdoor and 1 for frontdoor.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -1
@@ -445,8 +445,8 @@ enum AMDGPU_UCODE_STATUS {enum amdgpu_firmware_load_type {AMDGPU_FW_LOAD_DIRECT =0 , -AMDGPU_FW_LOAD_SMU ,AMDGPU_FW_LOAD_PSP , +AMDGPU_FW_LOAD_SMU ,AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO , };
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 11/29 drm/amdgpu: correct cp doorbell range
In reply to Alex DeucherFrom: Jack Xiao <[email protected]>
1. move MES doorbell inside the mec doorbell range, for mes belongs to mec block
2. setting the correct gfx/mec doorbell range, so that fw can correctly detect gfx/compute work load to enter/exit power saving state.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h | 11 ++++++++--- drivers/gpu/drm/amd/amdgpu/nv.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/soc21.c | 4 ++++ 3 files changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h +8 -3
@@ -52,6 +52,8 @@ struct amdgpu_doorbell_index {uint32_t userqueue_end;uint32_t gfx_ring0;uint32_t gfx_ring1; +uint32_t gfx_userqueue_start; +uint32_t gfx_userqueue_end;uint32_t sdma_engine[8 ];uint32_t mes_ring0;uint32_t mes_ring1;
@@ -175,12 +177,15 @@ typedef enum _AMDGPU_NAVI10_DOORBELL_ASSIGNMENTAMDGPU_NAVI10_DOORBELL_MEC_RING5 =0x008 ,AMDGPU_NAVI10_DOORBELL_MEC_RING6 =0x009 ,AMDGPU_NAVI10_DOORBELL_MEC_RING7 =0x00A , -AMDGPU_NAVI10_DOORBELL_USERQUEUE_START =0x00B , +AMDGPU_NAVI10_DOORBELL_MES_RING0 =0x00B , +AMDGPU_NAVI10_DOORBELL_MES_RING1 =0x00C , +AMDGPU_NAVI10_DOORBELL_USERQUEUE_START =0x00D ,AMDGPU_NAVI10_DOORBELL_USERQUEUE_END =0x08A ,AMDGPU_NAVI10_DOORBELL_GFX_RING0 =0x08B ,AMDGPU_NAVI10_DOORBELL_GFX_RING1 =0x08C , -AMDGPU_NAVI10_DOORBELL_MES_RING0 =0x090 , -AMDGPU_NAVI10_DOORBELL_MES_RING1 =0x091 , +AMDGPU_NAVI10_DOORBELL_GFX_USERQUEUE_START =0x08D , +AMDGPU_NAVI10_DOORBELL_GFX_USERQUEUE_END =0x0FF , +/* SDMA:256~335*/ AMDGPU_NAVI10_DOORBELL_sDMA_ENGINE0 =0x100 , AMDGPU_NAVI10_DOORBELL_sDMA_ENGINE1 = 0x10A,
drivers/gpu/drm/amd/amdgpu/nv.c +4 -0
@@ -607,6 +607,10 @@ static void nv_init_doorbell_index(struct amdgpu_device *adev) adev->doorbell_index.userqueue_end =AMDGPU_NAVI10_DOORBELL_USERQUEUE_END ; adev->doorbell_index.gfx_ring0 =AMDGPU_NAVI10_DOORBELL_GFX_RING0 ; adev->doorbell_index.gfx_ring1 =AMDGPU_NAVI10_DOORBELL_GFX_RING1 ; + adev->doorbell_index.gfx_userqueue_start = +AMDGPU_NAVI10_DOORBELL_GFX_USERQUEUE_START ; + adev->doorbell_index.gfx_userqueue_end = +AMDGPU_NAVI10_DOORBELL_GFX_USERQUEUE_END ; adev->doorbell_index.mes_ring0 =AMDGPU_NAVI10_DOORBELL_MES_RING0 ; adev->doorbell_index.mes_ring1 =AMDGPU_NAVI10_DOORBELL_MES_RING1 ; adev->doorbell_index.sdma_engine[0 ] = AMDGPU_NAVI10_DOORBELL_sDMA_ENGINE0;
drivers/gpu/drm/amd/amdgpu/soc21.c +4 -0
@@ -409,6 +409,10 @@ static void soc21_init_doorbell_index(struct amdgpu_device *adev) adev->doorbell_index.userqueue_end =AMDGPU_NAVI10_DOORBELL_USERQUEUE_END ; adev->doorbell_index.gfx_ring0 =AMDGPU_NAVI10_DOORBELL_GFX_RING0 ; adev->doorbell_index.gfx_ring1 =AMDGPU_NAVI10_DOORBELL_GFX_RING1 ; + adev->doorbell_index.gfx_userqueue_start = +AMDGPU_NAVI10_DOORBELL_GFX_USERQUEUE_START ; + adev->doorbell_index.gfx_userqueue_end = +AMDGPU_NAVI10_DOORBELL_GFX_USERQUEUE_END ; adev->doorbell_index.mes_ring0 =AMDGPU_NAVI10_DOORBELL_MES_RING0 ; adev->doorbell_index.mes_ring1 =AMDGPU_NAVI10_DOORBELL_MES_RING1 ; adev->doorbell_index.sdma_engine[0 ] = AMDGPU_NAVI10_DOORBELL_sDMA_ENGINE0;
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 12/29 drm/amd/amdgpu: add more fw load type to fit new ASICs
In reply to Alex DeucherFrom: Chengming Gui <[email protected]>
Align exported fw load types with internal used.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
@@ -307,7 +307,7 @@ module_param_named(dpm, amdgpu_dpm, int, 0444);* to -1 to select the default loading mode for the ASIC, as defined * by the driver. The default is -1 (auto). */ -MODULE_PARM_DESC (fw_load_type,"firmware loading type (0 = force direct if supported, -1 = auto)" ); +MODULE_PARM_DESC (fw_load_type,"firmware loading type (3 = rlc backdoor autoload if supported, 2 = smu load if supported, 1 = psp load, 0 = force direct if supported, -1 = auto)" );module_param_named (fw_load_type, amdgpu_fw_load_type, int,0444 );/**
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 13/29 drm/amdgpu: skip amdgpu_ucode_create_bo for backdoor autoload
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Skip amdgpu_ucode_create_bo for backdoor RLC autoload.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +4 -2
@@ -834,7 +834,8 @@ static int amdgpu_ucode_patch_jt(struct amdgpu_firmware_info *ucode,int amdgpu_ucode_create_bo (struct amdgpu_device *adev) { -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) { +if ((adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) && + (adev->firmware.load_type !=AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO )) { amdgpu_bo_create_kernel(adev, adev->firmware.fw_size, PAGE_SIZE, amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT, &adev->firmware.fw_buf,
@@ -852,7 +853,8 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev)void amdgpu_ucode_free_bo (struct amdgpu_device *adev) { -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) +if ((adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) && + (adev->firmware.load_type !=AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO ))amdgpu_bo_free_kernel (&adev->firmware.fw_buf, &adev->firmware.fw_buf_mc, &adev->firmware.fw_buf_ptr);
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 14/29 drm/amdgpu: fix the fw size for sdma
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
For SDMA, if use the total size of SDMA TH0 and TH1 to allocate fw BO may result to the ucode data overflow when copy ucode to BO as the PAGE alignment.
IMU have the same issue.
Fix the above issue by alignment the fw size per fw ID.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -2
@@ -688,12 +688,12 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) {switch (ucode->ucode_id) {case AMDGPU_UCODE_ID_SDMA_UCODE_TH0 : - ucode->ucode_size =le32_to_cpu (sdma_hdr->ctx_jt_offset + sdma_hdr->ctx_jt_size); + ucode->ucode_size =le32_to_cpu (sdma_hdr->ctx_ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +le32_to_cpu (sdma_hdr->header.ucode_array_offset_bytes);break ;case AMDGPU_UCODE_ID_SDMA_UCODE_TH1 : - ucode->ucode_size =le32_to_cpu (sdma_hdr->ctl_jt_offset + sdma_hdr->ctl_jt_size); + ucode->ucode_size =le32_to_cpu (sdma_hdr->ctl_ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +le32_to_cpu (sdma_hdr->ctl_ucode_offset);break ;
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 15/29 drm/amdgpu/discovery: handle AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO in SMU
In reply to Alex DeucherHandle SMU load ordering when firmware load type is AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO. This works similarly to AMDGPU_FW_LOAD_DIRECT where the SMU load order is different from the standard ordering when front door loading is enabled.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +3 -2
@@ -2292,8 +2292,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)if (r)return r; -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT && - !amdgpu_sriov_vf (adev)) { +if ((adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT && + !amdgpu_sriov_vf (adev)) || + (adev->firmware.load_type ==AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO && amdgpu_dpm ==1 )) { r =amdgpu_discovery_set_smu_ip_blocks (adev);if (r)return r;
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 16/29 drm/amdgpu: renovate sdma fw struct
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Add sdma firmware struct version 2 to support new SDMA v6 and forward firmware version.
v2: squash in fix
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 11 +++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 14 ++++++++++++++ 2 files changed, 25 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +11 -0
@@ -244,6 +244,17 @@ void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr) container_of(sdma_hdr, struct sdma_firmware_header_v1_1, v1_0);DRM_DEBUG ("digest_size: %u\n" ,le32_to_cpu (sdma_v1_1_hdr->digest_size)); } + }else if (version_major ==2 ) { +const struct sdma_firmware_header_v2_0 *sdma_hdr = + container_of(hdr, struct sdma_firmware_header_v2_0, header); + +DRM_DEBUG ("ucode_feature_version: %u\n" , +le32_to_cpu (sdma_hdr->ucode_feature_version)); +DRM_DEBUG ("ctx_jt_offset: %u\n" ,le32_to_cpu (sdma_hdr->ctx_jt_offset)); +DRM_DEBUG ("ctx_jt_size: %u\n" ,le32_to_cpu (sdma_hdr->ctx_jt_size)); +DRM_DEBUG ("ctl_ucode_offset: %u\n" ,le32_to_cpu (sdma_hdr->ctl_ucode_offset)); +DRM_DEBUG ("ctl_jt_offset: %u\n" ,le32_to_cpu (sdma_hdr->ctl_jt_offset)); +DRM_DEBUG ("ctl_jt_size: %u\n" ,le32_to_cpu (sdma_hdr->ctl_jt_size)); }else {DRM_ERROR ("Unknown SDMA ucode version: %u.%u\n" , version_major, version_minor);
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +14 -0
@@ -281,6 +281,19 @@ struct sdma_firmware_header_v1_1 {uint32_t digest_size; }; +/* version_major=2, version_minor=0 */ +struct sdma_firmware_header_v2_0 { +struct common_firmware_header header; +uint32_t ucode_feature_version; +uint32_t ctx_ucode_size_bytes;/* context thread ucode size */ +uint32_t ctx_jt_offset;/* context thread jt location */ +uint32_t ctx_jt_size;/* context thread size of jt */ +uint32_t ctl_ucode_offset; +uint32_t ctl_ucode_size_bytes;/* control thread ucode size */ +uint32_t ctl_jt_offset;/* control thread jt location */ +uint32_t ctl_jt_size;/* control thread size of jt */ +}; +/* gpu info payload */ struct gpu_info_firmware_v1_0 {uint32_t gc_num_se;
@@ -364,6 +377,7 @@ union amdgpu_firmware_header {struct rlc_firmware_header_v2_3 rlc_v2_3;struct sdma_firmware_header_v1_0 sdma;struct sdma_firmware_header_v1_1 sdma_v1_1; +struct sdma_firmware_header_v2_0 sdma_v2_0;struct gpu_info_firmware_header_v1_0 gpu_info;struct dmcu_firmware_header_v1_0 dmcu;struct dmcub_firmware_header_v1_0 dmcub;
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 17/29 drm/amdgpu: support RS64 CP fw front door load
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Support to load RS64 CP firmware front door load.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +57 -0
@@ -672,6 +672,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, {const struct common_firmware_header *header =NULL ;const struct gfx_firmware_header_v1_0 *cp_hdr =NULL ; +const struct gfx_firmware_header_v2_0 *cpv2_hdr =NULL ;const struct dmcu_firmware_header_v1_0 *dmcu_hdr =NULL ;const struct dmcub_firmware_header_v1_0 *dmcub_hdr =NULL ;const struct mes_firmware_header_v1_0 *mes_hdr =NULL ;
@@ -690,6 +691,7 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev, header = (const struct common_firmware_header *)ucode->fw->data; cp_hdr = (const struct gfx_firmware_header_v1_0 *)ucode->fw->data; + cpv2_hdr = (const struct gfx_firmware_header_v2_0 *)ucode->fw->data; dmcu_hdr = (const struct dmcu_firmware_header_v1_0 *)ucode->fw->data; dmcub_hdr = (const struct dmcub_firmware_header_v1_0 *)ucode->fw->data; mes_hdr = (const struct mes_firmware_header_v1_0 *)ucode->fw->data;
@@ -802,6 +804,61 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,le32_to_cpu (imu_hdr->header.ucode_array_offset_bytes) +le32_to_cpu (imu_hdr->imu_iram_ucode_size_bytes);break ; +case AMDGPU_UCODE_ID_CP_RS64_PFP : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->ucode_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (header->ucode_array_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_PFP_P1_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_ME : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->ucode_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (header->ucode_array_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_ME_P1_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->ucode_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (header->ucode_array_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P0_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P1_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P2_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ; +case AMDGPU_UCODE_ID_CP_RS64_MEC_P3_STACK : + ucode->ucode_size =le32_to_cpu (cpv2_hdr->data_size_bytes); + ucode_addr = (u8 *)ucode->fw->data + +le32_to_cpu (cpv2_hdr->data_offset_bytes); +break ;default : ucode->ucode_size =le32_to_cpu (header->ucode_size_bytes); ucode_addr = (u8 *)ucode->fw->data +
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 18/29 drm/amdgpu: add mes unmap legacy queue routine
In reply to Alex DeucherFrom: Jack Xiao <[email protected]>
For mes kiq has been taken over by mes sched, drv can't directly use mes kiq to unmap queues. drv has to use mes sched api to unmap legacy queue.
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 335 +++++++++++-------
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 85 ++++-
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 7 +-
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 69 +++-
.../drm/amd/{amdgpu => include}/mes_api_def.h | 167 +++++++--
7 files changed, 526 insertions(+), 151 deletions(-)
rename drivers/gpu/drm/amd/{amdgpu => include}/mes_api_def.h (68%)drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +5 -3
@@ -367,7 +367,7 @@ int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,/* create MQD for KIQ */ ring = &adev->gfx.kiq.ring; -if (!ring->mqd_obj) { +if (!adev->enable_mes_kiq && !ring->mqd_obj) {/* originaly the KIQ MQD is put in GTT domain, but for SRIOV VRAM domain is a must * otherwise hypervisor trigger SAVE_VF fail after driver unloaded which mean MQD * deallocated and gart_unbind, to strict diverage we decide to use VRAM domain for
@@ -464,7 +464,7 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev) {struct amdgpu_kiq *kiq = &adev->gfx.kiq;struct amdgpu_ring *kiq_ring = &kiq->ring; -int i, r; +int i, r =0 ;if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)return -EINVAL ;
@@ -479,7 +479,9 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev)for (i =0 ; i < adev->gfx.num_compute_rings; i++) kiq->pmf->kiq_unmap_queues (kiq_ring, &adev->gfx.compute_ring[i],RESET_QUEUES ,0 ,0 ); - r =amdgpu_ring_test_helper (kiq_ring); + +if (adev->gfx.kiq.ring.sched.ready) + r =amdgpu_ring_test_helper (kiq_ring);spin_unlock (&adev->gfx.kiq.ring_lock);return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +212 -123
649 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +84 -1
134 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +6 -0
@@ -3551,8 +3551,14 @@ static void gfx10_kiq_unmap_queues(struct amdgpu_ring *kiq_ring,enum amdgpu_unmap_queues_action action, u64 gpu_addr, u64 seq) { + struct amdgpu_device *adev = kiq_ring->adev;uint32_t eng_sel = ring->funcs->type ==AMDGPU_RING_TYPE_GFX ?4 :0 ; +if (!adev->gfx.kiq.ring.sched.ready) { +amdgpu_mes_unmap_legacy_queue (adev, ring, action, gpu_addr, seq); +return ; + } +amdgpu_ring_write (kiq_ring,PACKET3 (PACKET3_UNMAP_QUEUES ,4 )); amdgpu_ring_write(kiq_ring, /* Q_sel: 0, vmid: 0, engine: 0, num_Q: 1 */ PACKET3_UNMAP_QUEUES_ACTION(action) |
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +6 -1
@@ -274,7 +274,7 @@ static void gmc_v11_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,/* For SRIOV run time, driver shouldn't access the register through MMIO * Directly use kiq to do the vm invalidation instead */ -if (adev->gfx.kiq.ring.sched.ready && +if (adev->gfx.kiq.ring.sched.ready && !adev->enable_mes && (amdgpu_sriov_runtime (adev) || !amdgpu_sriov_vf (adev))) {struct amdgpu_vmhub *hub = &adev->vmhub[vmhub];const unsigned eng =17 ;
@@ -411,6 +411,10 @@ static void gmc_v11_0_emit_pasid_mapping(struct amdgpu_ring *ring, unsigned vmidstruct amdgpu_device *adev = ring->adev;uint32_t reg; +/* MES fw manages IH_VMID_x_LUT updating */ +if (ring->is_mes_queue) +return ; +if (ring->funcs->vmhub ==AMDGPU_GFXHUB_0 ) reg =SOC15_REG_OFFSET (OSSSYS ,0 , regIH_VMID_0_LUT) + vmid;else
@@ -803,6 +807,7 @@ static int gmc_v11_0_gart_enable(struct amdgpu_device *adev) }amdgpu_gtt_mgr_recover (&adev->mman.gtt_mgr); + r = adev->mmhub.funcs->gart_enable (adev);if (r)return r;
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +66 -3
113 lines not on this page · raw message
drivers/gpu/drm/amd/include/mes_api_def.h renamed from drivers/gpu/drm/amd/amdgpu/mes_api_def.h +147 -20
273 lines not on this page · raw message
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 19/29 drm/amdgpu: support imu for gfx11
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Add support to initialize imu for gfx v11.
IMU is a new power management block for
gfx which manages gfx power.
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h | 51 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 13 + drivers/gpu/drm/amd/amdgpu/imu_v11_0.c | 286 ++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/imu_v11_0.h | 30 +++ 6 files changed, 386 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h create mode 100644 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/imu_v11_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -130,7 +130,8 @@ amdgpu-y += \ gfx_v9_0.o \ gfx_v9_4.o \ gfx_v9_4_2.o \ - gfx_v10_0.o + gfx_v10_0.o \ + imu_v11_0.o # add async DMA block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +4 -0
@@ -30,6 +30,7 @@#include "clearstate_defs.h" #include "amdgpu_ring.h" #include "amdgpu_rlc.h" +#include "amdgpu_imu.h" #include "soc15.h" #include "amdgpu_ras.h"
@@ -274,6 +275,7 @@ struct amdgpu_gfx {struct amdgpu_me me;struct amdgpu_mec mec;struct amdgpu_kiq kiq; +struct amdgpu_imu imu;struct amdgpu_scratch scratch;const struct firmware *me_fw;/* ME firmware */ uint32_t me_fw_version;
@@ -287,6 +289,8 @@ struct amdgpu_gfx {uint32_t mec_fw_version;const struct firmware *mec2_fw;/* MEC2 firmware */ uint32_t mec2_fw_version; +const struct firmware *imu_fw;/* IMU firmware */ +uint32_t imu_fw_version;uint32_t me_feature_version;uint32_t ce_feature_version;uint32_t pfp_feature_version;
drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h new file +51 -0
51 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +13 -0
@@ -126,6 +126,19 @@ void amdgpu_ucode_print_gfx_hdr(const struct common_firmware_header *hdr) } } +void amdgpu_ucode_print_imu_hdr (const struct common_firmware_header *hdr) +{ +uint16_t version_major =le16_to_cpu (hdr->header_version_major); +uint16_t version_minor =le16_to_cpu (hdr->header_version_minor); + +DRM_DEBUG ("IMU\n" ); +amdgpu_ucode_print_common_hdr (hdr); + +if (version_major !=1 ) { +DRM_ERROR ("Unknown GFX ucode version: %u.%u\n" , version_major, version_minor); + } +} +void amdgpu_ucode_print_rlc_hdr (const struct common_firmware_header *hdr) {uint16_t version_major =le16_to_cpu (hdr->header_version_major);
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c new file +286 -0
286 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/imu_v11_0.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright 2021 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __IMU_V11_0_H__ +#define __IMU_V11_0_H__ + +extern const struct amdgpu_imu_funcs gfx_v11_0_imu_funcs; + +#endif +
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 20/29 drm/amdgpu/mes11: initiate mes v11 support
In reply to Alex DeucherFrom: Jack Xiao <[email protected]>
Initiate mes v11 code base from mes v10, rename function and register names.
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 1204 +++++++++++++++++ drivers/gpu/drm/amd/amdgpu/mes_v11_0.h | 29 + drivers/gpu/drm/amd/include/mes_v11_api_def.h | 579 ++++++++ 4 files changed, 1814 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/mes_v11_0.h create mode 100644 drivers/gpu/drm/amd/include/mes_v11_api_def.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -146,7 +146,8 @@ amdgpu-y += \ # add MES block amdgpu-y += \ amdgpu_mes.o \ - mes_v10_1.o + mes_v10_1.o \ + mes_v11_0.o # add UVD block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c new file +1204 -0
1,204 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/mes_v11_0.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright 2021 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __MES_V11_0_H__ +#define __MES_V11_0_H__ + +extern const struct amdgpu_ip_block_version mes_v11_0_ip_block; + +#endif
drivers/gpu/drm/amd/include/mes_v11_api_def.h new file +579 -0
579 lines not on this page · raw message
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 21/29 drm/amdgpu: add init support for GFX11 (v2)
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Add initial support for GC version 11. GC is
the graphics and compute block on the GPU.
v1: add initial gfx11 support (Wenhui)
v2: switch to new amdgpu_gfx_is_high_priority_compute_queue
interface (Hawking)
v3: fix num_mec (Alex)
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 13 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 6320 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/gfx_v11_0.h | 29 + 4 files changed, 6364 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -131,7 +131,8 @@ amdgpu-y += \ gfx_v9_4.o \ gfx_v9_4_2.o \ gfx_v10_0.o \ - imu_v11_0.o + imu_v11_0.o \ + gfx_v11_0.o # add async DMA block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +13 -0
@@ -57,6 +57,9 @@ struct amdgpu_mec {u64 hpd_eop_gpu_addr;struct amdgpu_bo *mec_fw_obj;u64 mec_fw_gpu_addr; +struct amdgpu_bo *mec_fw_data_obj; +u64 mec_fw_data_gpu_addr; +u32 num_mec;u32 num_pipe_per_mec;u32 num_queue_per_pipe;
@@ -245,6 +248,10 @@ struct amdgpu_pfp {struct amdgpu_bo *pfp_fw_obj;uint64_t pfp_fw_gpu_addr;uint32_t *pfp_fw_ptr; + +struct amdgpu_bo *pfp_fw_data_obj; +uint64_t pfp_fw_data_gpu_addr; +uint32_t *pfp_fw_data_ptr; };struct amdgpu_ce {
@@ -257,6 +264,11 @@ struct amdgpu_me {struct amdgpu_bo *me_fw_obj;uint64_t me_fw_gpu_addr;uint32_t *me_fw_ptr; + +struct amdgpu_bo *me_fw_data_obj; +uint64_t me_fw_data_gpu_addr; +uint32_t *me_fw_data_ptr; +uint32_t num_me;uint32_t num_pipe_per_me;uint32_t num_queue_per_pipe;
@@ -277,6 +289,7 @@ struct amdgpu_gfx {struct amdgpu_kiq kiq;struct amdgpu_imu imu;struct amdgpu_scratch scratch; +bool rs64_enable;/* firmware format */ const struct firmware *me_fw;/* ME firmware */ uint32_t me_fw_version;const struct firmware *pfp_fw;/* PFP firmware */
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c new file +6320 -0
2,954 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.h new file +29 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.35.1
Part of the diff is not shown here. View the raw message.
Alex Deucher
maintainerPATCH 22/29 drm/amdkfd: Add KFD support for soc21 v3
In reply to Alex DeucherFrom: Mukul Joshi <[email protected]>
Add initial support for soc21 in KFD compute driver (Mukul)
- Add new definition for soc21 device.
- Add new file for amdgpu-kfd interface for GFX11 family.
- Add new file for queue management, interrupt handling, mqd management for GFX11 family in KFD driver.
- Related changes/updates for soc21 device in KFD driver.
- Repurpose last 2 entries of SDMA MQD for driver use.
v2: Add an optional argument into update queue operation (Mukul)
v3: Switch to ip version check, replace kgd_dev with
amdgpu_device (Hawking)
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 15 +- .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 625 ++++++++++++++++++ drivers/gpu/drm/amd/amdkfd/Makefile | 3 + drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 8 + drivers/gpu/drm/amd/amdkfd/kfd_device.c | 24 +- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 299 +++++++-- .../drm/amd/amdkfd/kfd_device_queue_manager.h | 5 + .../amd/amdkfd/kfd_device_queue_manager_v11.c | 81 +++ drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 56 +- .../gpu/drm/amd/amdkfd/kfd_int_process_v11.c | 383 +++++++++++ .../gpu/drm/amd/amdkfd/kfd_int_process_v9.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 10 +- .../gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 508 ++++++++++++++ drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 13 + drivers/gpu/drm/amd/amdkfd/kfd_process.c | 19 + .../amd/amdkfd/kfd_process_queue_manager.c | 21 + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +- drivers/gpu/drm/amd/amdkfd/soc15_int.h | 3 +- .../gpu/drm/amd/include/kgd_kfd_interface.h | 1 + 20 files changed, 2024 insertions(+), 64 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v11.c create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -215,7 +215,8 @@ amdgpu-y += \ amdgpu_amdkfd_arcturus.o \ amdgpu_amdkfd_aldebaran.o \ amdgpu_amdkfd_gfx_v10.o \ - amdgpu_amdkfd_gfx_v10_3.o + amdgpu_amdkfd_gfx_v10_3.o \ + amdgpu_amdkfd_gfx_v11.o ifneq ($(CONFIG_DRM_AMDGPU_CIK),) amdgpu-y += amdgpu_amdkfd_gfx_v7.o
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +13 -2
@@ -100,7 +100,18 @@ static void amdgpu_doorbell_get_kfd_info(struct amdgpu_device *adev,* The first num_doorbells are used by amdgpu. * amdkfd takes whatever's left in the aperture. */ -if (adev->doorbell.size > adev->doorbell.num_doorbells *sizeof (u32)) { +if (adev->enable_mes) { +/* +* With MES enabled, we only need to initialize +* the base address. The size and offset are +* not initialized as AMDGPU manages the whole +* doorbell space. +*/ + *aperture_base = adev->doorbell.base; + *aperture_size =0 ; + *start_offset =0 ; + }else if (adev->doorbell.size > adev->doorbell.num_doorbells * +sizeof (u32)) { *aperture_base = adev->doorbell.base; *aperture_size = adev->doorbell.size; *start_offset = adev->doorbell.num_doorbells *sizeof (u32);
@@ -128,7 +139,7 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) AMDGPU_GMC_HOLE_START), .drm_render_minor = adev_to_drm(adev)->render->index, .sdma_doorbell_idx = adev->doorbell_index.sdma_engine, - + .enable_mes = adev->enable_mes, };/* this is going to have a few of the MSBs set that we need to
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c new file +625 -0
625 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/Makefile +3 -0
@@ -37,6 +37,7 @@ AMDKFD_FILES := $(AMDKFD_PATH)/kfd_module.o \ $(AMDKFD_PATH)/kfd_mqd_manager_vi.o \ $(AMDKFD_PATH)/kfd_mqd_manager_v9.o \ $(AMDKFD_PATH)/kfd_mqd_manager_v10.o \ + $(AMDKFD_PATH)/kfd_mqd_manager_v11.o \ $(AMDKFD_PATH)/kfd_kernel_queue.o \ $(AMDKFD_PATH)/kfd_packet_manager.o \ $(AMDKFD_PATH)/kfd_packet_manager_vi.o \
@@ -47,10 +48,12 @@ AMDKFD_FILES := $(AMDKFD_PATH)/kfd_module.o \ $(AMDKFD_PATH)/kfd_device_queue_manager_vi.o \ $(AMDKFD_PATH)/kfd_device_queue_manager_v9.o \ $(AMDKFD_PATH)/kfd_device_queue_manager_v10.o \ + $(AMDKFD_PATH)/kfd_device_queue_manager_v11.o \ $(AMDKFD_PATH)/kfd_interrupt.o \ $(AMDKFD_PATH)/kfd_events.o \ $(AMDKFD_PATH)/cik_event_interrupt.o \ $(AMDKFD_PATH)/kfd_int_process_v9.o \ + $(AMDKFD_PATH)/kfd_int_process_v11.o \ $(AMDKFD_PATH)/kfd_smi_events.o \ $(AMDKFD_PATH)/kfd_crat.o
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +8 -0
@@ -1315,6 +1315,8 @@ static int fill_in_l2_l3_pcache(struct crat_subtype_cache *pcache,return 1 ; } +#define KFD_MAX_CACHE_TYPES 6 +static int kfd_fill_gpu_cache_info_from_gfx_config (struct kfd_dev *kdev,struct kfd_gpu_cache_info *pcache_info) {
@@ -1408,6 +1410,7 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, int *num_of_entries) {struct kfd_gpu_cache_info *pcache_info; +struct kfd_gpu_cache_info cache_info[KFD_MAX_CACHE_TYPES ];int num_of_cache_types =0 ;int i, j, k;int ct =0 ;
@@ -1516,6 +1519,11 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, pcache_info = yellow_carp_cache_info; num_of_cache_types =ARRAY_SIZE (yellow_carp_cache_info);break ; +case IP_VERSION (11 ,0 ,0 ): + pcache_info = cache_info; + num_of_cache_types = +kfd_fill_gpu_cache_info_from_gfx_config (kdev, pcache_info); +break ;default :return -EINVAL ; }
drivers/gpu/drm/amd/amdkfd/kfd_device.c +22 -2
@@ -53,6 +53,7 @@ extern const struct kfd2kgd_calls arcturus_kfd2kgd;extern const struct kfd2kgd_calls aldebaran_kfd2kgd;extern const struct kfd2kgd_calls gfx_v10_kfd2kgd;extern const struct kfd2kgd_calls gfx_v10_3_kfd2kgd; +extern const struct kfd2kgd_calls gfx_v11_kfd2kgd;static int kfd_gtt_sa_init (struct kfd_dev *kfd,unsigned int buf_size,unsigned int chunk_size);
@@ -60,7 +61,7 @@ static void kfd_gtt_sa_fini(struct kfd_dev *kfd);static int kfd_resume (struct kfd_dev *kfd); -static void kfd_device_info_set_sdma_queue_num (struct kfd_dev *kfd) +static void kfd_device_info_set_sdma_info (struct kfd_dev *kfd) {uint32_t sdma_version = kfd->adev->ip_versions[SDMA0_HWIP ][0 ];
@@ -85,6 +86,7 @@ static void kfd_device_info_set_sdma_queue_num(struct kfd_dev *kfd)case IP_VERSION (5 ,2 ,2 ):/* NAVY_FLOUNDER */ case IP_VERSION (5 ,2 ,4 ):/* DIMGREY_CAVEFISH */ case IP_VERSION (5 ,2 ,5 ):/* BEIGE_GOBY */ +case IP_VERSION (6 ,0 ,0 ): kfd->device_info.num_sdma_queues_per_engine =8 ;break ;default :
@@ -93,6 +95,17 @@ static void kfd_device_info_set_sdma_queue_num(struct kfd_dev *kfd) sdma_version); kfd->device_info.num_sdma_queues_per_engine =8 ; } + +switch (sdma_version) { +case IP_VERSION (6 ,0 ,0 ): +/* Reserve 1 for paging and 1 for gfx */ + kfd->device_info.num_reserved_sdma_queues_per_engine =2 ; +/* BIT(0)=engine-0 queue-0; BIT(1)=engine-1 queue-0; BIT(2)=engine-0 queue-1; ... */ + kfd->device_info.reserved_sdma_queues_bitmap =0xFULL ; +break ; +default : +break ; + } }static void kfd_device_info_set_event_interrupt_class (struct kfd_dev *kfd)
@@ -121,6 +134,9 @@ static void kfd_device_info_set_event_interrupt_class(struct kfd_dev *kfd)case IP_VERSION (10 ,3 ,5 ):/* BEIGE_GOBY */ kfd->device_info.event_interrupt_class = &event_interrupt_class_v9;break ; +case IP_VERSION (11 ,0 ,0 ): + kfd->device_info.event_interrupt_class = &event_interrupt_class_v11; +break ;default :dev_warn (kfd_device,"v9 event interrupt handler is set due to " "mismatch of gc ip block(GC_HWIP:0x%x).\n" , gc_version);
@@ -145,7 +161,7 @@ static void kfd_device_info_init(struct kfd_dev *kfd, kfd->device_info.ih_ring_entry_size =8 *sizeof (uint32_t ); kfd->device_info.supports_cwsr = true; -kfd_device_info_set_sdma_queue_num (kfd); +kfd_device_info_set_sdma_info (kfd);kfd_device_info_set_event_interrupt_class (kfd);
@@ -346,6 +362,10 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)if (!vf) f2g = &gfx_v10_3_kfd2kgd;break ; +case IP_VERSION (11 ,0 ,0 ): + gfx_target_version =110000 ; + f2g = &gfx_v11_kfd2kgd; +break ;default :break ; }
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +259 -40
436 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +5 -0
@@ -35,6 +35,9 @@#define VMID_NUM 16 +#define KFD_MES_PROCESS_QUANTUM 100000 +#define KFD_MES_GANG_QUANTUM 10000 +struct device_process_node {struct qcm_process_device *qpd;struct list_head list;
@@ -267,6 +270,8 @@ void device_queue_manager_init_v9( struct device_queue_manager_asic_ops *asic_ops);void device_queue_manager_init_v10_navi10 (struct device_queue_manager_asic_ops *asic_ops); +void device_queue_manager_init_v11 ( +struct device_queue_manager_asic_ops *asic_ops);void program_sh_mem_settings (struct device_queue_manager *dqm,struct qcm_process_device *qpd);unsigned int get_cp_queues_num (struct device_queue_manager *dqm);
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v11.c new file +81 -0
81 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c +45 -11
84 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c new file +383 -0
383 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c +4 -4
@@ -90,7 +90,7 @@ enum SQ_INTERRUPT_ERROR_TYPE {#define KFD_SQ_INT_DATA__ERR_TYPE_MASK 0xF00000#define KFD_SQ_INT_DATA__ERR_TYPE__SHIFT 20 -static void event_interrupt_poison_consumption (struct kfd_dev *dev, +static void event_interrupt_poison_consumption_v9 (struct kfd_dev *dev,uint16_t pasid,uint16_t client_id) {int old_poison, ret = -EINVAL ;
@@ -316,7 +316,7 @@ static void event_interrupt_wq_v9(struct kfd_dev *dev, sq_intr_err);if (sq_intr_err !=SQ_INTERRUPT_ERROR_TYPE_ILLEGAL_INST && sq_intr_err !=SQ_INTERRUPT_ERROR_TYPE_MEMVIOL ) { -event_interrupt_poison_consumption (dev, pasid, client_id); +event_interrupt_poison_consumption_v9 (dev, pasid, client_id);return ; }break ;
@@ -337,7 +337,7 @@ static void event_interrupt_wq_v9(struct kfd_dev *dev,if (source_id ==SOC15_INTSRC_SDMA_TRAP ) {kfd_signal_event_interrupt (pasid, context_id0 &0xfffffff ,28 ); }else if (source_id ==SOC15_INTSRC_SDMA_ECC ) { -event_interrupt_poison_consumption (dev, pasid, client_id); +event_interrupt_poison_consumption_v9 (dev, pasid, client_id);return ; } } else if (client_id == SOC15_IH_CLIENTID_VMC ||
@@ -348,7 +348,7 @@ static void event_interrupt_wq_v9(struct kfd_dev *dev,if (client_id ==SOC15_IH_CLIENTID_UTCL2 &&amdgpu_amdkfd_ras_query_utcl2_poison_status (dev->adev)) { -event_interrupt_poison_consumption (dev, pasid, client_id); +event_interrupt_poison_consumption_v9 (dev, pasid, client_id);return ; }
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c +8 -2
@@ -100,7 +100,7 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm, {struct kfd_cu_info cu_info;uint32_t cu_per_sh[KFD_MAX_NUM_SE ][KFD_MAX_NUM_SH_PER_SE ] = {0 }; -int i, se, sh, cu; +int i, se, sh, cu, cu_bitmap_sh_mul;amdgpu_amdkfd_get_cu_info (mm->dev->adev, &cu_info);
@@ -120,6 +120,10 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm, cu_info.num_shader_arrays_per_engine * cu_info.num_shader_engines);return ; } + + cu_bitmap_sh_mul = (KFD_GC_VERSION (mm->dev) >=IP_VERSION (11 ,0 ,0 ) && +KFD_GC_VERSION (mm->dev) <IP_VERSION (12 ,0 ,0 )) ?2 :1 ; +/* Count active CUs per SH. * * Some CUs in an SH may be disabled. HW expects disabled CUs to be
@@ -129,10 +133,12 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm,* Each half of se_mask must be filled only on bits 0-cu_per_sh[se][sh]-1. * * See note on Arcturus cu_bitmap layout in gfx_v9_0_get_cu_info. +* See note on GFX11 cu_bitmap layout in gfx_v11_0_get_cu_info. */ for (se =0 ; se < cu_info.num_shader_engines; se++)for (sh =0 ; sh < cu_info.num_shader_arrays_per_engine; sh++) - cu_per_sh[se][sh] =hweight32 (cu_info.cu_bitmap[se %4 ][sh + (se /4 )]); + cu_per_sh[se][sh] =hweight32 ( + cu_info.cu_bitmap[se %4 ][sh + (se /4 ) * cu_bitmap_sh_mul]);/* Symmetrically map cu_mask to all SEs & SHs: * se_mask programs up to 2 SH in the upper and lower 16 bits.
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c new file +508 -0
508 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +13 -0
@@ -228,6 +228,8 @@ struct kfd_device_info {bool needs_pci_atomics;uint32_t no_atomic_fw_version;unsigned int num_sdma_queues_per_engine; +unsigned int num_reserved_sdma_queues_per_engine; +uint64_t reserved_sdma_queues_bitmap; };unsigned int kfd_get_num_sdma_engines (struct kfd_dev *kdev);
@@ -564,6 +566,10 @@ struct queue {/* procfs */ struct kobject kobj; + +void *gang_ctx_bo; +uint64_t gang_ctx_gpu_addr; +void *gang_ctx_cpu_ptr; };enum KFD_MQD_TYPE {
@@ -779,6 +785,10 @@ struct kfd_process_device {* checkpointed node to refer to this device. */ uint32_t user_gpu_id; + +void *proc_ctx_bo; +uint64_t proc_ctx_gpu_addr; +void *proc_ctx_cpu_ptr; };#define qpd_to_pdd (x) container_of(x, struct kfd_process_device, qpd)
@@ -1170,6 +1180,8 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type, struct kfd_dev *dev);struct mqd_manager *mqd_manager_init_v10 (enum KFD_MQD_TYPE type,struct kfd_dev *dev); +struct mqd_manager *mqd_manager_init_v11 (enum KFD_MQD_TYPE type, +struct kfd_dev *dev);struct device_queue_manager *device_queue_manager_init (struct kfd_dev *dev);void device_queue_manager_uninit (struct device_queue_manager *dqm); struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
@@ -1292,6 +1304,7 @@ uint64_t kfd_get_number_elems(struct kfd_dev *kfd);/* Events */ extern const struct kfd_event_interrupt_class event_interrupt_class_cik;extern const struct kfd_event_interrupt_class event_interrupt_class_v9; +extern const struct kfd_event_interrupt_class event_interrupt_class_v11;extern const struct kfd_device_global_init_class device_global_init_class_cik;
drivers/gpu/drm/amd/amdkfd/kfd_process.c +19 -0
@@ -1041,6 +1041,9 @@ static void kfd_process_destroy_pdds(struct kfd_process *p)kfd_free_process_doorbells (pdd->dev, pdd->doorbell_index); +if (pdd->dev->shared_resources.enable_mes) +amdgpu_amdkfd_free_gtt_mem (pdd->dev->adev, + pdd->proc_ctx_bo);/* * before destroying pdd, make sure to report availability * for auto suspend
@@ -1484,6 +1487,7 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev, struct kfd_process *p) {struct kfd_process_device *pdd =NULL ; +int retval =0 ;if (WARN_ON_ONCE (p->n_pdds >=MAX_GPU_INSTANCE ))return NULL ;
@@ -1516,6 +1520,21 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev, pdd->sdma_past_activity_counter =0 ; pdd->user_gpu_id = dev->id;atomic64_set (&pdd->evict_duration_counter,0 ); + +if (dev->shared_resources.enable_mes) { + retval =amdgpu_amdkfd_alloc_gtt_mem (dev->adev, +AMDGPU_MES_PROC_CTX_SIZE , + &pdd->proc_ctx_bo, + &pdd->proc_ctx_gpu_addr, + &pdd->proc_ctx_cpu_ptr, + false); +if (retval) { +pr_err ("failed to allocate process context bo\n" ); + goto err_free_pdd; + } +memset (pdd->proc_ctx_cpu_ptr,0 ,AMDGPU_MES_PROC_CTX_SIZE ); + } + p->pdds[p->n_pdds++] = pdd;/* Init idr used for memory handle translation */
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +21 -0
@@ -198,8 +198,26 @@ static int init_user_queue(struct process_queue_manager *pqm, (*q)->device = dev; (*q)->process = pqm->process; +if (dev->shared_resources.enable_mes) { + retval =amdgpu_amdkfd_alloc_gtt_mem (dev->adev, +AMDGPU_MES_GANG_CTX_SIZE , + &(*q)->gang_ctx_bo, + &(*q)->gang_ctx_gpu_addr, + &(*q)->gang_ctx_cpu_ptr, + false); +if (retval) { +pr_err ("failed to allocate gang context bo\n" ); + goto cleanup; + } +memset ((*q)->gang_ctx_cpu_ptr,0 ,AMDGPU_MES_GANG_CTX_SIZE ); + } +pr_debug ("PQM After init queue" ); +return 0 ; +cleanup: +if (dev->shared_resources.enable_mes) +uninit_queue (*q);return retval; }
@@ -418,6 +436,9 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid) pdd->qpd.num_gws =0 ; } +if (dev->shared_resources.enable_mes) +amdgpu_amdkfd_free_gtt_mem (dev->adev, + pqn->q->gang_ctx_bo);uninit_queue (pqn->q); }
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +2 -1
@@ -1412,7 +1412,8 @@ int kfd_topology_add_device(struct kfd_dev *gpu) dev->node_props.num_sdma_xgmi_engines =kfd_get_num_xgmi_sdma_engines (gpu); dev->node_props.num_sdma_queues_per_engine = - gpu->device_info.num_sdma_queues_per_engine; + gpu->device_info.num_sdma_queues_per_engine - + gpu->device_info.num_reserved_sdma_queues_per_engine; dev->node_props.num_gws = (dev->gpu->gws && dev->gpu->dqm->sched_policy !=KFD_SCHED_POLICY_NO_HWS ) ? dev->gpu->adev->gds.gws_size :0 ;
drivers/gpu/drm/amd/amdkfd/soc15_int.h +2 -1
@@ -31,7 +31,8 @@#define SOC15_INTSRC_VMC_FAULT 0#define SOC15_INTSRC_SDMA_TRAP 224#define SOC15_INTSRC_SDMA_ECC 220 - +#define SOC21_INTSRC_SDMA_TRAP 49 +#define SOC21_INTSRC_SDMA_ECC 62#define SOC15_CLIENT_ID_FROM_IH_ENTRY (entry) (le32_to_cpu(entry[0]) & 0xff)#define SOC15_SOURCE_ID_FROM_IH_ENTRY (entry) (le32_to_cpu(entry[0]) >> 8 & 0xff)
drivers/gpu/drm/amd/include/kgd_kfd_interface.h +1 -0
@@ -152,6 +152,7 @@ struct kgd2kfd_shared_resources {/* Minor device number of the render node */ int drm_render_minor; +bool enable_mes; };struct tile_config {
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 23/29 drm/amdgpu: enable GFX CGCG/CGLS for GC11.0.0
In reply to Alex DeucherFrom: Evan Quan <[email protected]>
Enable GFX CGCG (coarse grained clockgating) and CGLS (coarse grained light sleep) for GC11.0.0.
--- drivers/gpu/drm/amd/amdgpu/soc21.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc21.c +2 -1
@@ -480,7 +480,8 @@ static int soc21_common_early_init(void *handle) adev->external_rev_id =0xff ;switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (11 ,0 ,0 ): - adev->cg_flags =0 ; + adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG | +AMD_CG_SUPPORT_GFX_CGLS ; adev->pg_flags =AMD_PG_SUPPORT_ATHUB |AMD_PG_SUPPORT_MMHUB ; adev->external_rev_id = adev->rev_id +0x1 ;// TODO: need update
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 24/29 drm/amdgpu: enable fgcg for soc21
In reply to Alex DeucherFrom: Evan Quan <[email protected]>
Enable Fine Grained Clock Gating on soc21 asics.
--- drivers/gpu/drm/amd/amdgpu/soc21.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc21.c +2 -1
@@ -481,7 +481,8 @@ static int soc21_common_early_init(void *handle)switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (11 ,0 ,0 ): adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG | -AMD_CG_SUPPORT_GFX_CGLS ; +AMD_CG_SUPPORT_GFX_CGLS | +AMD_CG_SUPPORT_REPEATER_FGCG ; adev->pg_flags =AMD_PG_SUPPORT_ATHUB |AMD_PG_SUPPORT_MMHUB ; adev->external_rev_id = adev->rev_id +0x1 ;// TODO: need update
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 25/29 drm/amdgpu: enable GENERIC0_INT for gfx/compute pipes
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
To generate an interrupt to RLC for accessing indirect registers that CP can not access directly
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +8 -0
@@ -5689,12 +5689,16 @@ gfx_v11_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, cp_int_cntl =RREG32_SOC15_IP (GC , cp_int_cntl_reg); cp_int_cntl =REG_SET_FIELD (cp_int_cntl,CP_INT_CNTL_RING0 ,TIME_STAMP_INT_ENABLE ,0 ); + cp_int_cntl =REG_SET_FIELD (cp_int_cntl,CP_INT_CNTL_RING0 , +GENERIC0_INT_ENABLE ,0 );WREG32_SOC15_IP (GC , cp_int_cntl_reg, cp_int_cntl);break ;case AMDGPU_IRQ_STATE_ENABLE : cp_int_cntl =RREG32_SOC15_IP (GC , cp_int_cntl_reg); cp_int_cntl =REG_SET_FIELD (cp_int_cntl,CP_INT_CNTL_RING0 ,TIME_STAMP_INT_ENABLE ,1 ); + cp_int_cntl =REG_SET_FIELD (cp_int_cntl,CP_INT_CNTL_RING0 , +GENERIC0_INT_ENABLE ,1 );WREG32_SOC15_IP (GC , cp_int_cntl_reg, cp_int_cntl);break ;default :
@@ -5742,12 +5746,16 @@ static void gfx_v11_0_set_compute_eop_interrupt_state(struct amdgpu_device *adev mec_int_cntl =RREG32_SOC15_IP (GC , mec_int_cntl_reg); mec_int_cntl =REG_SET_FIELD (mec_int_cntl,CP_ME1_PIPE0_INT_CNTL ,TIME_STAMP_INT_ENABLE ,0 ); + mec_int_cntl =REG_SET_FIELD (mec_int_cntl,CP_ME1_PIPE0_INT_CNTL , +GENERIC0_INT_ENABLE ,0 );WREG32_SOC15_IP (GC , mec_int_cntl_reg, mec_int_cntl);break ;case AMDGPU_IRQ_STATE_ENABLE : mec_int_cntl =RREG32_SOC15_IP (GC , mec_int_cntl_reg); mec_int_cntl =REG_SET_FIELD (mec_int_cntl,CP_ME1_PIPE0_INT_CNTL ,TIME_STAMP_INT_ENABLE ,1 ); + mec_int_cntl =REG_SET_FIELD (mec_int_cntl,CP_ME1_PIPE0_INT_CNTL , +GENERIC0_INT_ENABLE ,1 );WREG32_SOC15_IP (GC , mec_int_cntl_reg, mec_int_cntl);break ;default :
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 26/29 drm/amdgpu/gfx10: enable kiq to map mes ring
In reply to Alex DeucherFrom: Jack Xiao <[email protected]>
Enable KIQ to map MES ring:
1). add MES queue mapping support in MAP_QUEUES packet. 2). use correct MQD settings for MES queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 16 +++- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 106 ++++++++++--------------- 2 files changed, 55 insertions(+), 67 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +15 -1
@@ -3525,7 +3525,21 @@ static void gfx10_kiq_map_queues(struct amdgpu_ring *kiq_ring, {uint64_t mqd_addr =amdgpu_bo_gpu_offset (ring->mqd_obj);uint64_t wptr_addr = ring->wptr_gpu_addr; -uint32_t eng_sel = ring->funcs->type ==AMDGPU_RING_TYPE_GFX ?4 :0 ; +uint32_t eng_sel =0 ; + +switch (ring->funcs->type) { +case AMDGPU_RING_TYPE_COMPUTE : + eng_sel =0 ; +break ; +case AMDGPU_RING_TYPE_GFX : + eng_sel =4 ; +break ; +case AMDGPU_RING_TYPE_MES : + eng_sel =5 ; +break ; +default : +WARN_ON (1 ); + }amdgpu_ring_write (kiq_ring,PACKET3 (PACKET3_MAP_QUEUES ,5 ));/* Q_sel:0, vmid:0, vidmem: 1, engine:0, num_Q:1*/
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +40 -66
211 lines not on this page · raw message
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 27/29 drm/amdgpu/gfx11: enable kiq to map mes ring
In reply to Alex DeucherFrom: Jack Xiao <[email protected]>
Enable KIQ to map MES ring:
1). add MES queue mapping support in MAP_QUEUES packet. 2). use correct MQD settings for MES queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 16 +++- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 107 ++++++++++--------------- 2 files changed, 57 insertions(+), 66 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +15 -1
@@ -121,7 +121,21 @@ static void gfx11_kiq_map_queues(struct amdgpu_ring *kiq_ring, {uint64_t mqd_addr =amdgpu_bo_gpu_offset (ring->mqd_obj);uint64_t wptr_addr = ring->wptr_gpu_addr; -uint32_t eng_sel = ring->funcs->type ==AMDGPU_RING_TYPE_GFX ?4 :0 ; +uint32_t eng_sel =0 ; + +switch (ring->funcs->type) { +case AMDGPU_RING_TYPE_COMPUTE : + eng_sel =0 ; +break ; +case AMDGPU_RING_TYPE_GFX : + eng_sel =4 ; +break ; +case AMDGPU_RING_TYPE_MES : + eng_sel =5 ; +break ; +default : +WARN_ON (1 ); + }amdgpu_ring_write (kiq_ring,PACKET3 (PACKET3_MAP_QUEUES ,5 ));/* Q_sel:0, vmid:0, vidmem: 1, engine:0, num_Q:1*/
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +42 -65
201 lines not on this page · raw message
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 28/29 drm/amdgpu/discovery: add GFX 11.0 Support
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Enable GFX 11.0 on asics where it is present.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 -0
@@ -60,6 +60,7 @@#include "navi10_ih.h" #include "ih_v6_0.h" #include "gfx_v10_0.h" +#include "gfx_v11_0.h" #include "sdma_v5_0.h" #include "sdma_v5_2.h" #include "vcn_v2_0.h"
@@ -1732,6 +1733,9 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)case IP_VERSION (10 ,3 ,7 ):amdgpu_device_ip_block_add (adev, &gfx_v10_0_ip_block);break ; +case IP_VERSION (11 ,0 ,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",
Signature · 1 line
2.35.1
Alex Deucher
maintainerPATCH 29/29 drm/amdgpu/discovery: add MES11 support
In reply to Alex Deucher--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +15 -6
@@ -69,6 +69,7 @@#include "jpeg_v3_0.h" #include "amdgpu_vkms.h" #include "mes_v10_1.h" +#include "mes_v11_0.h" #include "smuio_v11_0.h" #include "smuio_v11_0_6.h" #include "smuio_v13_0.h"
@@ -1873,7 +1874,17 @@ static int amdgpu_discovery_set_mes_ip_blocks(struct amdgpu_device *adev)case IP_VERSION (10 ,3 ,4 ):case IP_VERSION (10 ,3 ,5 ):case IP_VERSION (10 ,3 ,6 ): -amdgpu_device_ip_block_add (adev, &mes_v10_1_ip_block); +if (amdgpu_mes) { +amdgpu_device_ip_block_add (adev, &mes_v10_1_ip_block); + adev->enable_mes = true; +if (amdgpu_mes_kiq) + adev->enable_mes_kiq = true; + } +break ; +case IP_VERSION (11 ,0 ,0 ): +amdgpu_device_ip_block_add (adev, &mes_v11_0_ip_block); + adev->enable_mes = true; + adev->enable_mes_kiq = true;break ;default :break ;
@@ -2308,11 +2319,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)if (r)return r; -if (adev->enable_mes) { - r =amdgpu_discovery_set_mes_ip_blocks (adev); -if (r) -return r; - } + r =amdgpu_discovery_set_mes_ip_blocks (adev); +if (r) +return r;return 0 ; }
Signature · 1 line
2.35.1