Commit 8288faaa authored by Melissa Wen's avatar Melissa Wen Committed by Maíra Canal

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: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarIago Toral Quiroga <itoral@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231130164420.932823-6-mcanal@igalia.com
parent 9032d5f6
...@@ -129,6 +129,9 @@ void v3d_job_cleanup(struct v3d_job *job) ...@@ -129,6 +129,9 @@ void v3d_job_cleanup(struct v3d_job *job)
void v3d_job_put(struct v3d_job *job) void v3d_job_put(struct v3d_job *job)
{ {
if (!job)
return;
kref_put(&job->refcount, job->free); kref_put(&job->refcount, job->free);
} }
...@@ -517,11 +520,9 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, ...@@ -517,11 +520,9 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
&se, &se,
last_job->done_fence); last_job->done_fence);
if (bin) v3d_job_put(&bin->base);
v3d_job_put(&bin->base);
v3d_job_put(&render->base); v3d_job_put(&render->base);
if (clean_job) v3d_job_put(clean_job);
v3d_job_put(clean_job);
return 0; return 0;
......
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