projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ff9bf9
)
drm/amdgpu: free resources on fence usage query
author
David M Nieto
<david.nieto@amd.com>
Thu, 13 May 2021 17:45:38 +0000
(10:45 -0700)
committer
Alex Deucher
<alexander.deucher@amd.com>
Thu, 13 May 2021 18:02:24 +0000
(14:02 -0400)
Free the resources if the fence needs to be ignored
during the ratio calculation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: David M Nieto <david.nieto@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link:
https://patchwork.freedesktop.org/patch/msgid/20210513174539.27409-1-david.nieto@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 01fe60fedcbe484e5cf653dcdb8234b82250a38a..9036c93b4a0c67bd1eb22e2aea8b2be820b8b2c6 100644
(file)
--- a/
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@
-669,11
+669,15
@@
void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cen
if (!fence)
continue;
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;
+ }
t1 = s_fence->scheduled.timestamp;
- if (t1 >= now)
+ if (!ktime_before(t1, now)) {
+ dma_fence_put(fence);
continue;
+ }
if (dma_fence_is_signaled(&s_fence->finished) &&
s_fence->finished.timestamp < now)
*total += ktime_sub(s_fence->finished.timestamp, t1);