Commit a7f08496 authored by David M Nieto's avatar David M Nieto Committed by Alex Deucher

drm/amdgpu: free resources on fence usage query

Free the resources if the fence needs to be ignored
during the ratio calculation
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDavid M Nieto <david.nieto@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210513174539.27409-1-david.nieto@amd.com
parent 0ff9bf9f
...@@ -669,11 +669,15 @@ void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cen ...@@ -669,11 +669,15 @@ void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cen
if (!fence) if (!fence)
continue; continue;
s_fence = to_drm_sched_fence(fence); s_fence = to_drm_sched_fence(fence);
if (!dma_fence_is_signaled(&s_fence->scheduled)) if (!dma_fence_is_signaled(&s_fence->scheduled)) {
dma_fence_put(fence);
continue; continue;
}
t1 = s_fence->scheduled.timestamp; t1 = s_fence->scheduled.timestamp;
if (t1 >= now) if (!ktime_before(t1, now)) {
dma_fence_put(fence);
continue; continue;
}
if (dma_fence_is_signaled(&s_fence->finished) && if (dma_fence_is_signaled(&s_fence->finished) &&
s_fence->finished.timestamp < now) s_fence->finished.timestamp < now)
*total += ktime_sub(s_fence->finished.timestamp, t1); *total += ktime_sub(s_fence->finished.timestamp, t1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment