diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index ee121ec2917b..17d1fb12128a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -252,7 +252,7 @@ uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring, | |||
252 | unsigned idx = 0; | 252 | unsigned idx = 0; |
253 | struct fence *other = NULL; | 253 | struct fence *other = NULL; |
254 | 254 | ||
255 | idx = seq % amdgpu_sched_jobs; | 255 | idx = seq & (amdgpu_sched_jobs - 1); |
256 | other = cring->fences[idx]; | 256 | other = cring->fences[idx]; |
257 | if (other) { | 257 | if (other) { |
258 | signed long r; | 258 | signed long r; |
@@ -292,7 +292,7 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx, | |||
292 | return NULL; | 292 | return NULL; |
293 | } | 293 | } |
294 | 294 | ||
295 | fence = fence_get(cring->fences[seq % amdgpu_sched_jobs]); | 295 | fence = fence_get(cring->fences[seq & (amdgpu_sched_jobs - 1)]); |
296 | spin_unlock(&ctx->ring_lock); | 296 | spin_unlock(&ctx->ring_lock); |
297 | 297 | ||
298 | return fence; | 298 | return fence; |