Skip to content

Commit

Permalink
drm/nouveau/flcn/cmdq: cmd_queue_close always commits, simplify it
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jan 15, 2020
1 parent 2baafff commit c2c9b24
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,9 @@ cmd_queue_open(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
}

static void
cmd_queue_close(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
bool commit)
cmd_queue_close(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue)
{
struct nvkm_falcon *falcon = priv->falcon;

if (commit)
nvkm_falcon_wr32(falcon, queue->head_reg, queue->position);

nvkm_falcon_wr32(queue->qmgr->falcon, queue->head_reg, queue->position);
mutex_unlock(&queue->mutex);
}

Expand All @@ -116,7 +111,6 @@ cmd_write(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_hdr *cmd,
static unsigned timeout = 2000;
unsigned long end_jiffies = jiffies + msecs_to_jiffies(timeout);
int ret = -EAGAIN;
bool commit = true;

while (ret == -EAGAIN && time_before(jiffies, end_jiffies))
ret = cmd_queue_open(priv, queue, cmd->size);
Expand All @@ -126,7 +120,7 @@ cmd_write(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_hdr *cmd,
}

cmd_queue_push(priv, queue, cmd, cmd->size);
cmd_queue_close(priv, queue, commit);
cmd_queue_close(priv, queue);
return ret;
}

Expand Down

0 comments on commit c2c9b24

Please sign in to comment.