1. 29 Jun, 2022 8 commits
  2. 28 Jun, 2022 12 commits
  3. 23 Jun, 2022 12 commits
  4. 22 Jun, 2022 5 commits
    • Ruijing Dong's avatar
      drm/amdgpu/vcn: fix no previous prototype warning · f12d07d6
      Ruijing Dong authored
      Declare 'static', as the function is not intended to be used
      outside of this translation unit.
      
      Fixes: 4ed49c95 ("drm/amdgpu/vcn: add unified queue ib test")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reviewed-by: default avatarJames Zhu <James.Zhu@amd.com>
      Signed-off-by: default avatarRuijing Dong <ruijing.dong@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      f12d07d6
    • Darren Powell's avatar
      amdgpu/pm: Fix possible array out-of-bounds if SCLK levels != 2 · ceb18036
      Darren Powell authored
       [v2]
      simplified fix after Lijo's feedback
       removed clocks.num_levels from calculation of loop count
         removed unsafe accesses to shim table freq_values
       retained corner case output only min,now if
         clocks.num_levels == 1 && now > min
      
       [v1]
      added a check to populate and use SCLK shim table freq_values only
         if using dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL or
                               AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM
      removed clocks.num_levels from calculation of shim table size
      removed unsafe accesses to shim table freq_values
         output gfx_table values if using other dpm levels
      added check for freq_match when using freq_values for when now == min_clk
      
      == Test ==
      LOGFILE=aldebaran-sclk.test.log
      AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1`
      AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'`
      HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON}
      
      lspci -nn | grep "VGA\|Display"  > $LOGFILE
      FILES="pp_od_clk_voltage
      pp_dpm_sclk"
      
      for f in $FILES
      do
        echo === $f === >> $LOGFILE
        cat $HWMON_DIR/device/$f >> $LOGFILE
      done
      cat $LOGFILE
      Signed-off-by: default avatarDarren Powell <darren.powell@amd.com>
      Reviewed-by: default avatarKenneth Feng <kenneth.feng@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      ceb18036
    • Darren Powell's avatar
      amdgpu/pm: Fix incorrect variable for size of clocks array · 543faf57
      Darren Powell authored
       [v2]
      No Changes, added RB
       [v1]
      Size of pp_clock_levels_with_latency is PP_MAX_CLOCK_LEVELS, not MAX_NUM_CLOCKS.
      Both are currently defined as 16, modifying in case one value is modified in future
      Changed code in both arcturus and aldabaran.
      
      Also removed unneeded var count, and used min_t function
      Signed-off-by: default avatarDarren Powell <darren.powell@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      543faf57
    • Philip Yang's avatar
      drm/amdkfd: Free queue after unmap queue success · ab8529b0
      Philip Yang authored
      After queue unmap or remove from MES successfully, free queue sysfs
      entries, doorbell and remove from queue list. Otherwise, application may
      destroy queue again, cause below kernel warning or crash backtrace.
      
      For outstanding queues, either application forget to destroy or failed
      to destroy, kfd_process_notifier_release will remove queue sysfs
      entries, kfd_process_wq_release will free queue doorbell.
      
      v2: decrement_queue_count for MES queue
      
       refcount_t: underflow; use-after-free.
       WARNING: CPU: 7 PID: 3053 at lib/refcount.c:28
        Call Trace:
         kobject_put+0xd6/0x1a0
         kfd_procfs_del_queue+0x27/0x30 [amdgpu]
         pqm_destroy_queue+0xeb/0x240 [amdgpu]
         kfd_ioctl_destroy_queue+0x32/0x70 [amdgpu]
         kfd_ioctl+0x27d/0x500 [amdgpu]
         do_syscall_64+0x35/0x80
      
       WARNING: CPU: 2 PID: 3053 at drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c:400
        Call Trace:
         deallocate_doorbell.isra.0+0x39/0x40 [amdgpu]
         destroy_queue_cpsch+0xb3/0x270 [amdgpu]
         pqm_destroy_queue+0x108/0x240 [amdgpu]
         kfd_ioctl_destroy_queue+0x32/0x70 [amdgpu]
         kfd_ioctl+0x27d/0x500 [amdgpu]
      
       general protection fault, probably for non-canonical address
      0xdead000000000108:
       Call Trace:
        pqm_destroy_queue+0xf0/0x200 [amdgpu]
        kfd_ioctl_destroy_queue+0x2f/0x60 [amdgpu]
        kfd_ioctl+0x19b/0x600 [amdgpu]
      Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: default avatarGraham Sider <Graham.Sider@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      ab8529b0
    • Philip Yang's avatar
      drm/amdkfd: Add queue to MES if it becomes active · f4f9b827
      Philip Yang authored
      We remove the user queue from MES scheduler to update queue properties.
      If the queue becomes active after updating, add the user queue to MES
      scheduler, to be able to handle command packet submission.
      
      v2: don't break pqm_set_gws
      Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: default avatarGraham Sider <Graham.Sider@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      f4f9b827
  5. 21 Jun, 2022 3 commits
    • Aurabindo Pillai's avatar
      drm/amd/display: fix incorrect comparison in DML · eec53143
      Aurabindo Pillai authored
      [Why&How]
      GCC 12 catches the following incorrect comparison in the if arm
      
      drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/dcn32/display_mode_vba_32.c: In function ‘dml32_ModeSupportAndSystemConfigurationFull’:
      drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/dcn32/display_mode_vba_32.c:3740:33: error: the comparison will always evaluate as ‘true’ for the address of ‘USRRetrainingSupport’ will never be NULL [-Werror=address]
      3740 | || &mode_lib->vba.USRRetrainingSupport[i][j])) {
      | ^~
      In file included from ./drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/display_mode_lib.h:32,
      from ./drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dc.h:45,
      from drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/dcn32/display_mode_vba_32.c:30:
      ./drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/display_mode_vba.h:1175:14: note: ‘USRRetrainingSupport’ declared here
      1175 | bool USRRetrainingSupport[DC__VOLTAGE_STATES][2];
      |
      
      Fix this by remove preceding & so that value is compared instead of
      address
      
      Fixes: dda4fb85 ("drm/amd/display: DML changes for DCN32/321")
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      eec53143
    • Aurabindo Pillai's avatar
      drm/amd/display: fix array index in DML · c85c623a
      Aurabindo Pillai authored
      [Why&How]
      When the a 3d array is used by indexing with only one dimension in an if
      condition, the addresses get compared instead of the intended value stored in the
      array. GCC 12.1 caught this error:
      
      drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/dcn32/display_mode_vba_32.c: In function ‘DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation’:
      drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/dcn32/display_mode_vba_32.c:1007:45: error: the comparison will always evaluate as ‘true’ for the address of ‘use_one_row_for_frame_flip’ will never be NULL [-Werror=address]
      1007 | if (v->use_one_row_for_frame_flip[k]) {
      | ^
      In file included from ./drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/display_mode_lib.h:32,
      from ./drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dc.h:45,
      from drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/dcn32/display_mode_vba_32.c:30:
      ./drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml/display_mode_vba.h:605:14: note: ‘use_one_row_for_frame_flip’ declared here
      605 | bool use_one_row_for_frame_flip[DC__VOLTAGE_STATES][2][DC__NUM_DPP__MAX];
      |
      
      Fix this by explicitly specifying the last two indices.
      
      Fixes: dda4fb85 ("drm/amd/display: DML changes for DCN32/321")
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      c85c623a
    • Jiang Jian's avatar
      drm/amdgpu: vm - drop unexpected word "the" in the comments · fd6ae969
      Jiang Jian authored
      there is an unexpected word "the" in the comments that need to be dropped
      
      file: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
      line: 57
        * the kernel tells the the ring what VMID to use for that command
      changed to
        * the kernel tells the ring what VMID to use for that command
      Signed-off-by: default avatarJiang Jian <jiangjian@cdjrlc.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      fd6ae969