summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/v3d
diff options
context:
space:
mode:
authorMelissa Wen <mwen@igalia.com>2023-11-30 17:40:27 +0100
committerMaíra Canal <mcanal@igalia.com>2023-12-01 13:34:08 +0100
commit8288faaa8b3817c2fcdbacc720527bb8df2b57b1 (patch)
treec38cd367a358cea654c100b750be1619ccc2e3fa /drivers/gpu/drm/v3d
parentdrm/v3d: Detach job submissions IOCTLs to a new specific file (diff)
downloadlinux-8288faaa8b3817c2fcdbacc720527bb8df2b57b1.tar.xz
linux-8288faaa8b3817c2fcdbacc720527bb8df2b57b1.zip
drm/v3d: Simplify job refcount handling
Instead of checking if the job is NULL every time we call the function, check it inside the function. Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231130164420.932823-6-mcanal@igalia.com
Diffstat (limited to 'drivers/gpu/drm/v3d')
-rw-r--r--drivers/gpu/drm/v3d/v3d_submit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c
index f36214002f37..a0caf9c499bb 100644
--- a/drivers/gpu/drm/v3d/v3d_submit.c
+++ b/drivers/gpu/drm/v3d/v3d_submit.c
@@ -129,6 +129,9 @@ void v3d_job_cleanup(struct v3d_job *job)
void v3d_job_put(struct v3d_job *job)
{
+ if (!job)
+ return;
+
kref_put(&job->refcount, job->free);
}
@@ -517,11 +520,9 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
&se,
last_job->done_fence);
- if (bin)
- v3d_job_put(&bin->base);
+ v3d_job_put(&bin->base);
v3d_job_put(&render->base);
- if (clean_job)
- v3d_job_put(clean_job);
+ v3d_job_put(clean_job);
return 0;