drm/v3d: decouple adding job dependencies steps from job init
Prep work to enable a job to wait for more than one syncobj before start. Also get rid of old checkpatch warnings in the v3d_gem file. No functional changes. Signed-off-by: Melissa Wen <mwen@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/825f5fdd540b0aa2eb57bd5ff93c0777808b108c.1633016479.git.mwen@igalia.com
This commit is contained in:
parent
77d40e0176
commit
223583dd00
|
@ -434,12 +434,25 @@ 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,
|
||||||
struct v3d_job *job, void (*free)(struct kref *ref),
|
struct v3d_job *job, void (*free)(struct kref *ref),
|
||||||
u32 in_sync, enum v3d_queue queue)
|
u32 in_sync, enum v3d_queue queue)
|
||||||
{
|
{
|
||||||
struct dma_fence *in_fence = NULL;
|
|
||||||
struct v3d_file_priv *v3d_priv = file_priv->driver_priv;
|
struct v3d_file_priv *v3d_priv = file_priv->driver_priv;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -455,11 +468,7 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
ret = drm_syncobj_find_fence(file_priv, in_sync, 0, 0, &in_fence);
|
ret = v3d_job_add_deps(file_priv, job, in_sync, 0);
|
||||||
if (ret == -EINVAL)
|
|
||||||
goto fail_job;
|
|
||||||
|
|
||||||
ret = drm_sched_job_add_dependency(&job->base, in_fence);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail_job;
|
goto fail_job;
|
||||||
|
|
||||||
|
@ -903,8 +912,7 @@ v3d_gem_init(struct drm_device *dev)
|
||||||
if (!v3d->pt) {
|
if (!v3d->pt) {
|
||||||
drm_mm_takedown(&v3d->mm);
|
drm_mm_takedown(&v3d->mm);
|
||||||
dev_err(v3d->drm.dev,
|
dev_err(v3d->drm.dev,
|
||||||
"Failed to allocate page tables. "
|
"Failed to allocate page tables. Please ensure you have CMA enabled.\n");
|
||||||
"Please ensure you have CMA enabled.\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue