drm/amdgpu: add debug flag to place fw bo on vram for frontdoor loading
Subsystems (2)
PATCH v2 2/3 drm/amdgpu: add debug flag to place fw bo on vram for frontdoor loading
Use debug_mask=0x8 param to help isolating data path issues on new systems in early phase.
v2: rename the flag for explicitness (lijo)
Signed-off-by Le Ma <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -1144,6 +1144,7 @@ struct amdgpu_device {bool debug_vm;bool debug_largebar;bool debug_disable_soft_recovery; +bool debug_use_vram_fw_buf; }; static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6 -0
@@ -128,6 +128,7 @@ enum AMDGPU_DEBUG_MASK {AMDGPU_DEBUG_VM =BIT (0 ),AMDGPU_DEBUG_LARGEBAR =BIT (1 ),AMDGPU_DEBUG_DISABLE_GPU_SOFT_RECOVERY =BIT (2 ), + AMDGPU_DEBUG_USE_VRAM_FW_BUF = BIT(3), };unsigned int amdgpu_vram_limit =UINT_MAX ;
@@ -2117,6 +2118,11 @@ static void amdgpu_init_debug_options(struct amdgpu_device *adev)pr_info ("debug: soft reset for GPU recovery disabled\n" ); adev->debug_disable_soft_recovery = true; } + +if (amdgpu_debug_mask &AMDGPU_DEBUG_USE_VRAM_FW_BUF ) { +pr_info ("debug: place fw in vram for frontdoor loading\n" ); + adev->debug_use_vram_fw_buf = true; + } }static unsigned long amdgpu_fix_asic_type (struct pci_dev *pdev,unsigned long flags)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
@@ -467,7 +467,7 @@ static int psp_sw_init(void *handle) } ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG, - amdgpu_sriov_vf(adev) ? + (amdgpu_sriov_vf(adev) || adev->debug_use_vram_fw_buf) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT, &psp->fw_pri_bo, &psp->fw_pri_mc_addr,
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
@@ -1062,7 +1062,8 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) {if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) {amdgpu_bo_create_kernel (adev, adev->firmware.fw_size,PAGE_SIZE , -amdgpu_sriov_vf (adev) ?AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT , + (amdgpu_sriov_vf (adev) || adev->debug_use_vram_fw_buf) ? +AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT , &adev->firmware.fw_buf, &adev->firmware.fw_buf_mc, &adev->firmware.fw_buf_ptr);
Signature · 1 line
2.38.1
Quoted 6 lines · On 1/9/2024 6:30 PM, Le Ma wrote:
Use debug_mask=0x8 param to help isolating data path issues on new systems in early phase.
v2: rename the flag for explicitness (lijo)
Signed-off-by Le Ma <[email protected]>
Series is
Reviewed-by Lijo Lazar <[email protected]>
Thanks,
Lijo
Quoted 70 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-0@@ -1144,6 +1144,7 @@ struct amdgpu_device {bool debug_vm;bool debug_largebar;bool debug_disable_soft_recovery; +bool debug_use_vram_fw_buf; }; static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev,drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6
-0@@ -128,6 +128,7 @@ enum AMDGPU_DEBUG_MASK {AMDGPU_DEBUG_VM =BIT (0 ),AMDGPU_DEBUG_LARGEBAR =BIT (1 ),AMDGPU_DEBUG_DISABLE_GPU_SOFT_RECOVERY =BIT (2 ), + AMDGPU_DEBUG_USE_VRAM_FW_BUF = BIT(3), };unsigned int amdgpu_vram_limit =UINT_MAX ;@@ -2117,6 +2118,11 @@ static void amdgpu_init_debug_options(struct amdgpu_device *adev)pr_info ("debug: soft reset for GPU recovery disabled\n" ); adev->debug_disable_soft_recovery = true; } + +if (amdgpu_debug_mask &AMDGPU_DEBUG_USE_VRAM_FW_BUF ) { +pr_info ("debug: place fw in vram for frontdoor loading\n" ); + adev->debug_use_vram_fw_buf = true; + } }static unsigned long amdgpu_fix_asic_type (struct pci_dev *pdev,unsigned long flags)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-1@@ -467,7 +467,7 @@ static int psp_sw_init(void *handle) } ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG, - amdgpu_sriov_vf(adev) ? + (amdgpu_sriov_vf(adev) || adev->debug_use_vram_fw_buf) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT, &psp->fw_pri_bo, &psp->fw_pri_mc_addr,drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2
-1@@ -1062,7 +1062,8 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) {if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) {amdgpu_bo_create_kernel (adev, adev->firmware.fw_size,PAGE_SIZE , -amdgpu_sriov_vf (adev) ?AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT , + (amdgpu_sriov_vf (adev) || adev->debug_use_vram_fw_buf) ? +AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT , &adev->firmware.fw_buf, &adev->firmware.fw_buf_mc, &adev->firmware.fw_buf_ptr);
Am 09.01.24 um 14:00 schrieb Le Ma:
Quoted 6 lines
Use debug_mask=0x8 param to help isolating data path issues on new systems in early phase.
v2: rename the flag for explicitness (lijo)
Signed-off-by Le Ma <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 70 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-0@@ -1144,6 +1144,7 @@ struct amdgpu_device {bool debug_vm;bool debug_largebar;bool debug_disable_soft_recovery; +bool debug_use_vram_fw_buf; }; static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev,drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6
-0@@ -128,6 +128,7 @@ enum AMDGPU_DEBUG_MASK {AMDGPU_DEBUG_VM =BIT (0 ),AMDGPU_DEBUG_LARGEBAR =BIT (1 ),AMDGPU_DEBUG_DISABLE_GPU_SOFT_RECOVERY =BIT (2 ), + AMDGPU_DEBUG_USE_VRAM_FW_BUF = BIT(3), };unsigned int amdgpu_vram_limit =UINT_MAX ;@@ -2117,6 +2118,11 @@ static void amdgpu_init_debug_options(struct amdgpu_device *adev)pr_info ("debug: soft reset for GPU recovery disabled\n" ); adev->debug_disable_soft_recovery = true; } + +if (amdgpu_debug_mask &AMDGPU_DEBUG_USE_VRAM_FW_BUF ) { +pr_info ("debug: place fw in vram for frontdoor loading\n" ); + adev->debug_use_vram_fw_buf = true; + } }static unsigned long amdgpu_fix_asic_type (struct pci_dev *pdev,unsigned long flags)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-1@@ -467,7 +467,7 @@ static int psp_sw_init(void *handle) } ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG, - amdgpu_sriov_vf(adev) ? + (amdgpu_sriov_vf(adev) || adev->debug_use_vram_fw_buf) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT, &psp->fw_pri_bo, &psp->fw_pri_mc_addr,drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2
-1@@ -1062,7 +1062,8 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) {if (adev->firmware.load_type !=AMDGPU_FW_LOAD_DIRECT ) {amdgpu_bo_create_kernel (adev, adev->firmware.fw_size,PAGE_SIZE , -amdgpu_sriov_vf (adev) ?AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT , + (amdgpu_sriov_vf (adev) || adev->debug_use_vram_fw_buf) ? +AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT , &adev->firmware.fw_buf, &adev->firmware.fw_buf_mc, &adev->firmware.fw_buf_ptr);