Lines Matching refs:mm_stats
644 if (us <= 0 || !adev->mm_stats.log2_max_MBps) in us_to_bytes()
650 return us << adev->mm_stats.log2_max_MBps; in us_to_bytes()
655 if (!adev->mm_stats.log2_max_MBps) in bytes_to_us()
658 return bytes >> adev->mm_stats.log2_max_MBps; in bytes_to_us()
689 if (!adev->mm_stats.log2_max_MBps) { in amdgpu_cs_get_threshold_for_moves()
699 spin_lock(&adev->mm_stats.lock); in amdgpu_cs_get_threshold_for_moves()
703 increment_us = time_us - adev->mm_stats.last_update_us; in amdgpu_cs_get_threshold_for_moves()
704 adev->mm_stats.last_update_us = time_us; in amdgpu_cs_get_threshold_for_moves()
705 adev->mm_stats.accum_us = min(adev->mm_stats.accum_us + increment_us, in amdgpu_cs_get_threshold_for_moves()
731 adev->mm_stats.accum_us = max(min_us, adev->mm_stats.accum_us); in amdgpu_cs_get_threshold_for_moves()
737 *max_bytes = us_to_bytes(adev, adev->mm_stats.accum_us); in amdgpu_cs_get_threshold_for_moves()
748 adev->mm_stats.accum_us_vis = min(adev->mm_stats.accum_us_vis + in amdgpu_cs_get_threshold_for_moves()
752 adev->mm_stats.accum_us_vis = in amdgpu_cs_get_threshold_for_moves()
754 adev->mm_stats.accum_us_vis); in amdgpu_cs_get_threshold_for_moves()
757 *max_vis_bytes = us_to_bytes(adev, adev->mm_stats.accum_us_vis); in amdgpu_cs_get_threshold_for_moves()
762 spin_unlock(&adev->mm_stats.lock); in amdgpu_cs_get_threshold_for_moves()
772 spin_lock(&adev->mm_stats.lock); in amdgpu_cs_report_moved_bytes()
773 adev->mm_stats.accum_us -= bytes_to_us(adev, num_bytes); in amdgpu_cs_report_moved_bytes()
774 adev->mm_stats.accum_us_vis -= bytes_to_us(adev, num_vis_bytes); in amdgpu_cs_report_moved_bytes()
775 spin_unlock(&adev->mm_stats.lock); in amdgpu_cs_report_moved_bytes()