diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-12 11:53:01 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-12 11:53:01 -0700 | 
| commit | ea6ec774372740b024a6c27caac0d0af8960ea15 (patch) | |
| tree | aa24ebc983065d65abb8ffc1fb25e4a1c402cb34 /drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |
| parent | 9ad57f6dfc2345ed5d3a8bf4dabac0a34069c54c (diff) | |
| parent | 62975d27d647a40c58d3b96c29b911fc4f33c310 (diff) | |
Merge tag 'drm-next-2020-08-12' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie:
 "This has a few vmwgfx regression fixes we hit from the merge window
  (one in TTM), it also has a bunch of amdgpu fixes along with a
  scattering everywhere else.
  core:
   - Fix drm_dp_mst_port refcount leaks in drm_dp_mst_allocate_vcpi
   - Remove null check for kfree in drm_dev_release.
   - Fix DRM_FORMAT_MOD_AMLOGIC_FBC definition.
   - re-added docs for drm_gem_flink_ioctl()
   - add orientation quirk for ASUS T103HAF
  ttm:
   - ttm: fix page-offset calculation within TTM
   - revert patch causing vmwgfx regressions
  fbcon:
   - Fix a fbcon OOB read in fbdev, found by syzbot.
  vga:
   - Mark vga_tryget static as it's not used elsewhere.
  amdgpu:
   - Re-add spelling typo fix
   - Sienna Cichlid fixes
   - Navy Flounder fixes
   - DC fixes
   - SMU i2c fix
   - Power fixes
  vmwgfx:
   - regression fixes for modesetting crashes
   - misc fixes
  xlnx:
   - Small fixes to xlnx.
  omap:
   - Fix mode initialization in omap_connector_mode_valid().
   - force runtime PM suspend on system suspend
  tidss:
   - fix modeset init for DPI panels"
* tag 'drm-next-2020-08-12' of git://anongit.freedesktop.org/drm/drm: (70 commits)
  drm/ttm: revert "drm/ttm: make TT creation purely optional v3"
  drm/vmwgfx: fix spelling mistake "Cant" -> "Can't"
  drm/vmwgfx: fix spelling mistake "Cound" -> "Could"
  drm/vmwgfx/ldu: Use drm_mode_config_reset
  drm/vmwgfx/sou: Use drm_mode_config_reset
  drm/vmwgfx/stdu: Use drm_mode_config_reset
  drm/vmwgfx: Fix two list_for_each loop exit tests
  drm/vmwgfx: Use correct vmw_legacy_display_unit pointer
  drm/vmwgfx: Use struct_size() helper
  drm/amdgpu: Fix bug where DPM is not enabled after hibernate and resume
  drm/amd/powerplay: put VCN/JPEG into PG ungate state before dpm table setup(V3)
  drm/amd/powerplay: update swSMU VCN/JPEG PG logics
  drm/amdgpu: use mode1 reset by default for sienna_cichlid
  drm/amdgpu/smu: rework i2c adpater registration
  drm/amd/display: Display goes blank after inst
  drm/amd/display: Change null plane state swizzle mode to 4kb_s
  drm/amd/display: Use helper function to check for HDMI signal
  drm/amd/display: AMD OUI (DPCD 0x00300) skipped on some sink
  drm/amd/display: Fix logger context
  drm/amd/display: populate new dml variable
  ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 37 | 
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index fe7d39bb975d..7fe564275457 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -193,12 +193,18 @@ static int psp_sw_fini(void *handle)  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;  	psp_memory_training_fini(&adev->psp); -	release_firmware(adev->psp.sos_fw); -	adev->psp.sos_fw = NULL; -	release_firmware(adev->psp.asd_fw); -	adev->psp.asd_fw = NULL; -	release_firmware(adev->psp.ta_fw); -	adev->psp.ta_fw = NULL; +	if (adev->psp.sos_fw) { +		release_firmware(adev->psp.sos_fw); +		adev->psp.sos_fw = NULL; +	} +	if (adev->psp.asd_fw) { +		release_firmware(adev->psp.asd_fw); +		adev->psp.asd_fw = NULL; +	} +	if (adev->psp.ta_fw) { +		release_firmware(adev->psp.ta_fw); +		adev->psp.ta_fw = NULL; +	}  	if (adev->asic_type == CHIP_NAVI10)  		psp_sysfs_fini(adev); @@ -409,11 +415,28 @@ static int psp_clear_vf_fw(struct psp_context *psp)  	return ret;  } +static bool psp_skip_tmr(struct psp_context *psp) +{ +	switch (psp->adev->asic_type) { +	case CHIP_NAVI12: +	case CHIP_SIENNA_CICHLID: +		return true; +	default: +		return false; +	} +} +  static int psp_tmr_load(struct psp_context *psp)  {  	int ret;  	struct psp_gfx_cmd_resp *cmd; +	/* For Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR. +	 * Already set up by host driver. +	 */ +	if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp)) +		return 0; +  	cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);  	if (!cmd)  		return -ENOMEM; @@ -1987,7 +2010,7 @@ static int psp_suspend(void *handle)  	ret = psp_tmr_terminate(psp);  	if (ret) { -		DRM_ERROR("Falied to terminate tmr\n"); +		DRM_ERROR("Failed to terminate tmr\n");  		return ret;  	}  | 
