Skip to content

Commit c572abf

Browse files
Le Maalexdeucher
authored andcommitted
drm/amdgpu: add param to specify fw bo location for front-door loading
This param can help isolating data path issues on new systems in early phase. Signed-off-by: Le Ma <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8e317a8 commit c572abf

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ extern int amdgpu_agp;
254254

255255
extern int amdgpu_wbrf;
256256

257+
extern int fw_bo_location;
258+
257259
#define AMDGPU_VM_MAX_NUM_CTX 4096
258260
#define AMDGPU_SG_THRESHOLD (256*1024*1024)
259261
#define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ int amdgpu_seamless = -1; /* auto */
210210
uint amdgpu_debug_mask;
211211
int amdgpu_agp = -1; /* auto */
212212
int amdgpu_wbrf = -1;
213+
int fw_bo_location = -1;
213214

214215
static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
215216

@@ -989,6 +990,10 @@ MODULE_PARM_DESC(wbrf,
989990
"Enable Wifi RFI interference mitigation (0 = disabled, 1 = enabled, -1 = auto(default)");
990991
module_param_named(wbrf, amdgpu_wbrf, int, 0444);
991992

993+
MODULE_PARM_DESC(fw_bo_location,
994+
"location to put firmware bo for frontdoor loading (-1 = auto (default), 0 = on ram, 1 = on vram");
995+
module_param(fw_bo_location, int, 0644);
996+
992997
/* These devices are not supported by amdgpu.
993998
* They are supported by the mach64, r128, radeon drivers
994999
*/

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) || fw_bo_location == 1) ?
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) || fw_bo_location == 1) ?
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)