Lines Matching refs:mm_stats
265 if (us <= 0 || !adev->mm_stats.log2_max_MBps) in us_to_bytes()
271 return us << adev->mm_stats.log2_max_MBps; in us_to_bytes()
276 if (!adev->mm_stats.log2_max_MBps) in bytes_to_us()
279 return bytes >> adev->mm_stats.log2_max_MBps; in bytes_to_us()
311 if (!adev->mm_stats.log2_max_MBps) { in amdgpu_cs_get_threshold_for_moves()
321 spin_lock(&adev->mm_stats.lock); in amdgpu_cs_get_threshold_for_moves()
325 increment_us = time_us - adev->mm_stats.last_update_us; in amdgpu_cs_get_threshold_for_moves()
326 adev->mm_stats.last_update_us = time_us; in amdgpu_cs_get_threshold_for_moves()
327 adev->mm_stats.accum_us = min(adev->mm_stats.accum_us + increment_us, in amdgpu_cs_get_threshold_for_moves()
353 adev->mm_stats.accum_us = max(min_us, adev->mm_stats.accum_us); in amdgpu_cs_get_threshold_for_moves()
359 *max_bytes = us_to_bytes(adev, adev->mm_stats.accum_us); in amdgpu_cs_get_threshold_for_moves()
369 adev->mm_stats.accum_us_vis = min(adev->mm_stats.accum_us_vis + in amdgpu_cs_get_threshold_for_moves()
373 adev->mm_stats.accum_us_vis = in amdgpu_cs_get_threshold_for_moves()
375 adev->mm_stats.accum_us_vis); in amdgpu_cs_get_threshold_for_moves()
378 *max_vis_bytes = us_to_bytes(adev, adev->mm_stats.accum_us_vis); in amdgpu_cs_get_threshold_for_moves()
383 spin_unlock(&adev->mm_stats.lock); in amdgpu_cs_get_threshold_for_moves()
393 spin_lock(&adev->mm_stats.lock); in amdgpu_cs_report_moved_bytes()
394 adev->mm_stats.accum_us -= bytes_to_us(adev, num_bytes); in amdgpu_cs_report_moved_bytes()
395 adev->mm_stats.accum_us_vis -= bytes_to_us(adev, num_vis_bytes); in amdgpu_cs_report_moved_bytes()
396 spin_unlock(&adev->mm_stats.lock); in amdgpu_cs_report_moved_bytes()