Skip to content

Commit

Permalink
drm/msm: Docs and misc cleanup
Browse files Browse the repository at this point in the history
Fix a couple incorrect or misspelt comments, and add submitqueue doc
comment.

Signed-off-by: Rob Clark <[email protected]>
Acked-by: Christian König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Clark <[email protected]>
  • Loading branch information
robclark committed Jul 28, 2021
1 parent 9bc9557 commit 375f9a6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/msm/msm_gem.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ void msm_gem_vunmap(struct drm_gem_object *obj);

/* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,
* associated with the cmdstream submission for synchronization (and
* make it easier to unwind when things go wrong, etc). This only
* lasts for the duration of the submit-ioctl.
* make it easier to unwind when things go wrong, etc).
*/
struct msm_gem_submit {
struct kref ref;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/msm/msm_gem_submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
bool has_ww_ticket = false;
unsigned i;
int ret, submitid;

if (!gpu)
return -ENXIO;

Expand Down
15 changes: 15 additions & 0 deletions drivers/gpu/drm/msm/msm_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,21 @@ struct msm_gpu_perfcntr {
const char *name;
};

/**
* A submitqueue is associated with a gl context or vk queue (or equiv)
* in userspace.
*
* @id: userspace id for the submitqueue, unique within the drm_file
* @flags: userspace flags for the submitqueue, specified at creation
* (currently unusued)
* @prio: the submitqueue priority
* @faults: the number of GPU hangs associated with this submitqueue
* @ctx: the per-drm_file context associated with the submitqueue (ie.
* which set of pgtables do submits jobs associated with the
* submitqueue use)
* @node: node in the context's list of submitqueues
* @ref: reference count
*/
struct msm_gpu_submitqueue {
int id;
u32 flags;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id,

if (IS_ERR(ring->start)) {
ret = PTR_ERR(ring->start);
ring->start = 0;
ring->start = NULL;
goto fail;
}

Expand Down
9 changes: 5 additions & 4 deletions drivers/gpu/drm/msm/msm_submitqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,18 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx,
return 0;
}

/*
* Create the default submit-queue (id==0), used for backwards compatibility
* for userspace that pre-dates the introduction of submitqueues.
*/
int msm_submitqueue_init(struct drm_device *drm, struct msm_file_private *ctx)
{
struct msm_drm_private *priv = drm->dev_private;
int default_prio;

if (!ctx)
return 0;

/*
* Select priority 2 as the "default priority" unless nr_rings is less
* than 2 and then pick the lowest pirority
* than 2 and then pick the lowest priority
*/
default_prio = priv->gpu ?
clamp_t(uint32_t, 2, 0, priv->gpu->nr_rings - 1) : 0;
Expand Down

0 comments on commit 375f9a6

Please sign in to comment.