Commit 25c0e406 authored by Maíra Canal's avatar Maíra Canal Committed by Maíra Canal

drm/v3d: Use drm_sched_job_add_syncobj_dependency()

As v3d_job_add_deps() performs the same steps as
drm_sched_job_add_syncobj_dependency(), replace the open-coded
implementation in v3d in order to simply use the DRM function.
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230209124447.467867-6-mcanal@igalia.com
parent 4636c4a5
...@@ -396,20 +396,6 @@ v3d_wait_bo_ioctl(struct drm_device *dev, void *data, ...@@ -396,20 +396,6 @@ v3d_wait_bo_ioctl(struct drm_device *dev, void *data,
return ret; return ret;
} }
static int
v3d_job_add_deps(struct drm_file *file_priv, struct v3d_job *job,
u32 in_sync, u32 point)
{
struct dma_fence *in_fence = NULL;
int ret;
ret = drm_syncobj_find_fence(file_priv, in_sync, point, 0, &in_fence);
if (ret == -EINVAL)
return ret;
return drm_sched_job_add_dependency(&job->base, in_fence);
}
static int static int
v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
void **container, size_t size, void (*free)(struct kref *ref), void **container, size_t size, void (*free)(struct kref *ref),
...@@ -447,14 +433,18 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, ...@@ -447,14 +433,18 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
DRM_DEBUG("Failed to copy wait dep handle.\n"); DRM_DEBUG("Failed to copy wait dep handle.\n");
goto fail_deps; goto fail_deps;
} }
ret = v3d_job_add_deps(file_priv, job, in.handle, 0); ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in.handle, 0);
if (ret)
// TODO: Investigate why this was filtered out for the IOCTL.
if (ret && ret != -ENOENT)
goto fail_deps; goto fail_deps;
} }
} }
} else { } else {
ret = v3d_job_add_deps(file_priv, job, in_sync, 0); ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in_sync, 0);
if (ret)
// TODO: Investigate why this was filtered out for the IOCTL.
if (ret && ret != -ENOENT)
goto fail_deps; goto fail_deps;
} }
......
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