Skip to content

Commit

Permalink
drm/lima: guilty should be shared by all context of a fd
Browse files Browse the repository at this point in the history
Signed-off-by: Qiang Yu <yuq825@gmail.com>
  • Loading branch information
yuq authored and anarsoul committed Apr 5, 2018
1 parent e2819a9 commit f0c7fb5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/lima/lima.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct lima_device {
struct lima_drm_priv {
struct lima_vm *vm;
struct lima_sched_context context[LIMA_MAX_PIPE];
atomic_t guilty;
};

struct lima_bo_va_mapping {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/lima/lima_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static int lima_drm_driver_open(struct drm_device *dev, struct drm_file *file)
}

for (i = 0; i < LIMA_MAX_PIPE; i++) {
err = lima_sched_context_init(ldev->pipe[i], priv->context + i);
err = lima_sched_context_init(ldev->pipe[i], priv->context + i, &priv->guilty);
if (err)
goto err_out1;
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/gpu/drm/lima/lima_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ int lima_sched_task_add_dep(struct lima_sched_task *task, struct dma_fence *fenc
}

int lima_sched_context_init(struct lima_sched_pipe *pipe,
struct lima_sched_context *context)
struct lima_sched_context *context,
atomic_t *guilty)
{
struct drm_sched_rq *rq = pipe->base.sched_rq + DRM_SCHED_PRIORITY_NORMAL;
int err;
Expand All @@ -191,7 +192,7 @@ int lima_sched_context_init(struct lima_sched_pipe *pipe,

spin_lock_init(&context->lock);
err = drm_sched_entity_init(&pipe->base, &context->base, rq,
lima_sched_max_tasks, &context->guilty);
lima_sched_max_tasks, guilty);
if (err) {
kfree(context->fences);
context->fences = NULL;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/lima/lima_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct lima_sched_context {
spinlock_t lock;
struct dma_fence **fences;
uint32_t sequence;
atomic_t guilty;
};

#define LIMA_SCHED_PIPE_MAX_MMU 4
Expand Down Expand Up @@ -75,7 +74,8 @@ void lima_sched_task_delete(struct lima_sched_task *task);
int lima_sched_task_add_dep(struct lima_sched_task *task, struct dma_fence *fence);

int lima_sched_context_init(struct lima_sched_pipe *pipe,
struct lima_sched_context *context);
struct lima_sched_context *context,
atomic_t *guilty);
void lima_sched_context_fini(struct lima_sched_pipe *pipe,
struct lima_sched_context *context);
uint32_t lima_sched_context_queue_task(struct lima_sched_context *context,
Expand Down

0 comments on commit f0c7fb5

Please sign in to comment.