Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Maíra Canal and committed by
Maíra Canal
25c0e406 4636c4a5

+8 -18
+8 -18
drivers/gpu/drm/v3d/v3d_gem.c
··· 397 397 } 398 398 399 399 static int 400 - v3d_job_add_deps(struct drm_file *file_priv, struct v3d_job *job, 401 - u32 in_sync, u32 point) 402 - { 403 - struct dma_fence *in_fence = NULL; 404 - int ret; 405 - 406 - ret = drm_syncobj_find_fence(file_priv, in_sync, point, 0, &in_fence); 407 - if (ret == -EINVAL) 408 - return ret; 409 - 410 - return drm_sched_job_add_dependency(&job->base, in_fence); 411 - } 412 - 413 - static int 414 400 v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, 415 401 void **container, size_t size, void (*free)(struct kref *ref), 416 402 u32 in_sync, struct v3d_submit_ext *se, enum v3d_queue queue) ··· 433 447 DRM_DEBUG("Failed to copy wait dep handle.\n"); 434 448 goto fail_deps; 435 449 } 436 - ret = v3d_job_add_deps(file_priv, job, in.handle, 0); 437 - if (ret) 450 + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in.handle, 0); 451 + 452 + // TODO: Investigate why this was filtered out for the IOCTL. 453 + if (ret && ret != -ENOENT) 438 454 goto fail_deps; 439 455 } 440 456 } 441 457 } else { 442 - ret = v3d_job_add_deps(file_priv, job, in_sync, 0); 443 - if (ret) 458 + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in_sync, 0); 459 + 460 + // TODO: Investigate why this was filtered out for the IOCTL. 461 + if (ret && ret != -ENOENT) 444 462 goto fail_deps; 445 463 } 446 464