diff options
author | Maíra Canal <mcanal@igalia.com> | 2023-02-09 09:44:48 -0300 |
---|---|---|
committer | Maíra Canal <mairacanal@riseup.net> | 2023-02-24 17:23:43 -0300 |
commit | 25c0e4062db43b790fbecf14d7cce6fc75fb3b26 (patch) | |
tree | d1d7a9f6343a60ff63262df79747ad9ca97fb434 /drivers/gpu/drm/v3d/v3d_gem.c | |
parent | 4636c4a5ea4258c34e44487798c83d5c79db4660 (diff) | |
download | lwn-25c0e4062db43b790fbecf14d7cce6fc75fb3b26.tar.gz lwn-25c0e4062db43b790fbecf14d7cce6fc75fb3b26.zip |
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: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230209124447.467867-6-mcanal@igalia.com
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_gem.c')
-rw-r--r-- | drivers/gpu/drm/v3d/v3d_gem.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 5da1806f3969..2e94ce788c71 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -397,20 +397,6 @@ v3d_wait_bo_ioctl(struct drm_device *dev, void *data, } 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 v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, void **container, size_t size, void (*free)(struct kref *ref), u32 in_sync, struct v3d_submit_ext *se, enum v3d_queue queue) @@ -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"); goto fail_deps; } - ret = v3d_job_add_deps(file_priv, job, in.handle, 0); - if (ret) + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in.handle, 0); + + // TODO: Investigate why this was filtered out for the IOCTL. + if (ret && ret != -ENOENT) goto fail_deps; } } } else { - ret = v3d_job_add_deps(file_priv, job, in_sync, 0); - if (ret) + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in_sync, 0); + + // TODO: Investigate why this was filtered out for the IOCTL. + if (ret && ret != -ENOENT) goto fail_deps; } |