1. 14 Jul, 2020 16 commits
  2. 10 Jul, 2020 21 commits
  3. 08 Jul, 2020 3 commits
    • Tom Rix's avatar
      drm/radeon: fix double free · 99010fac
      Tom Rix authored
      clang static analysis flags this error
      
      drivers/gpu/drm/radeon/ci_dpm.c:5652:9: warning: Use of memory after it is freed [unix.Malloc]
                      kfree(rdev->pm.dpm.ps[i].ps_priv);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/radeon/ci_dpm.c:5654:2: warning: Attempt to free released memory [unix.Malloc]
              kfree(rdev->pm.dpm.ps);
              ^~~~~~~~~~~~~~~~~~~~~~
      
      problem is reported in ci_dpm_fini, with these code blocks.
      
      	for (i = 0; i < rdev->pm.dpm.num_ps; i++) {
      		kfree(rdev->pm.dpm.ps[i].ps_priv);
      	}
      	kfree(rdev->pm.dpm.ps);
      
      The first free happens in ci_parse_power_table where it cleans up locally
      on a failure.  ci_dpm_fini also does a cleanup.
      
      	ret = ci_parse_power_table(rdev);
      	if (ret) {
      		ci_dpm_fini(rdev);
      		return ret;
      	}
      
      So remove the cleanup in ci_parse_power_table and
      move the num_ps calculation to inside the loop so ci_dpm_fini
      will know how many array elements to free.
      
      Fixes: cc8dbbb4 ("drm/radeon: add dpm support for CI dGPUs (v2)")
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      99010fac
    • Tiezhu Yang's avatar
      gpu/drm: Remove debug info about CPU address · e241df69
      Tiezhu Yang authored
      When I update the latest kernel, I see the following "____ptrval____" boot
      messages.
      
      [    1.872600] radeon 0000:01:05.0: fence driver on ring 0 use gpu addr 0x0000000048000c00 and cpu addr 0x(____ptrval____)
      [    1.879095] radeon 0000:01:05.0: fence driver on ring 5 use gpu addr 0x0000000040056038 and cpu addr 0x(____ptrval____)
      
      Both radeon_fence_driver_start_ring() and amdgpu_fence_driver_start_ring()
      have the similar issue, there exists the following two methods to solve it:
      (1) Use "%pK" instead of "%p" so that the CPU address can be printed when
      the kptr_restrict sysctl is set to 1.
      (2) Just completely drop the CPU address suggested by Christian, because
      the CPU address was useful in the past, but isn't any more. We now have a
      debugfs file to read the current fence values.
      
      Since the CPU address is not much useful, just remove the debug info about
      CPU address.
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      e241df69
    • Nicholas Kazlauskas's avatar
      drm/amd/display: Add missing CW4 programming for DCN30 · 497f15f2
      Nicholas Kazlauskas authored
      [Why]
      To support inbox1 in CW4 we need to actually program CW4 instead of
      region 4 for newer firmware.
      
      This is done correctly on DCN20/DCN21 but this code wasn't added to
      DCN30.
      
      [How]
      Copy over the missing code. It doesn't need address translation since
      DCN30 uses virtual addressing.
      Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      497f15f2