Skip to content

Commit d20e1ae

Browse files
lema1-devalexdeucher
authored andcommitted
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 <le.ma@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 6c5683b commit d20e1ae

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@ struct amdgpu_device {
11441144
bool debug_vm;
11451145
bool debug_largebar;
11461146
bool debug_disable_soft_recovery;
1147+
bool debug_use_vram_fw_buf;
11471148
};
11481149

11491150
static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ enum AMDGPU_DEBUG_MASK {
128128
AMDGPU_DEBUG_VM = BIT(0),
129129
AMDGPU_DEBUG_LARGEBAR = BIT(1),
130130
AMDGPU_DEBUG_DISABLE_GPU_SOFT_RECOVERY = BIT(2),
131+
AMDGPU_DEBUG_USE_VRAM_FW_BUF = BIT(3),
131132
};
132133

133134
unsigned int amdgpu_vram_limit = UINT_MAX;
@@ -2117,6 +2118,11 @@ static void amdgpu_init_debug_options(struct amdgpu_device *adev)
21172118
pr_info("debug: soft reset for GPU recovery disabled\n");
21182119
adev->debug_disable_soft_recovery = true;
21192120
}
2121+
2122+
if (amdgpu_debug_mask & AMDGPU_DEBUG_USE_VRAM_FW_BUF) {
2123+
pr_info("debug: place fw in vram for frontdoor loading\n");
2124+
adev->debug_use_vram_fw_buf = true;
2125+
}
21202126
}
21212127

21222128
static unsigned long amdgpu_fix_asic_type(struct pci_dev *pdev, unsigned long flags)

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ static int psp_sw_init(void *handle)
466466
}
467467

468468
ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
469-
amdgpu_sriov_vf(adev) ?
469+
(amdgpu_sriov_vf(adev) || adev->debug_use_vram_fw_buf) ?
470470
AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
471471
&psp->fw_pri_bo,
472472
&psp->fw_pri_mc_addr,

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,8 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev)
10621062
{
10631063
if (adev->firmware.load_type != AMDGPU_FW_LOAD_DIRECT) {
10641064
amdgpu_bo_create_kernel(adev, adev->firmware.fw_size, PAGE_SIZE,
1065-
amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
1065+
(amdgpu_sriov_vf(adev) || adev->debug_use_vram_fw_buf) ?
1066+
AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
10661067
&adev->firmware.fw_buf,
10671068
&adev->firmware.fw_buf_mc,
10681069
&adev->firmware.fw_buf_ptr);

0 commit comments

Comments
 (0)