Commit 375f9a63 authored by Rob Clark's avatar Rob Clark
Browse files

drm/msm: Docs and misc cleanup



Fix a couple incorrect or misspelt comments, and add submitqueue doc
comment.

Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20210728010632.2633470-2-robdclark@gmail.com


Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 9bc95570
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -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,
/* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,
 * associated with the cmdstream submission for synchronization (and
 * associated with the cmdstream submission for synchronization (and
 * make it easier to unwind when things go wrong, etc).  This only
 * make it easier to unwind when things go wrong, etc).
 * lasts for the duration of the submit-ioctl.
 */
 */
struct msm_gem_submit {
struct msm_gem_submit {
	struct kref ref;
	struct kref ref;
+1 −0
Original line number Original line Diff line number Diff line
@@ -655,6 +655,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
	bool has_ww_ticket = false;
	bool has_ww_ticket = false;
	unsigned i;
	unsigned i;
	int ret, submitid;
	int ret, submitid;

	if (!gpu)
	if (!gpu)
		return -ENXIO;
		return -ENXIO;


+15 −0
Original line number Original line Diff line number Diff line
@@ -250,6 +250,21 @@ struct msm_gpu_perfcntr {
	const char *name;
	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 {
struct msm_gpu_submitqueue {
	int id;
	int id;
	u32 flags;
	u32 flags;
+1 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id,


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


+5 −4
Original line number Original line Diff line number Diff line
@@ -98,17 +98,18 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx,
	return 0;
	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)
int msm_submitqueue_init(struct drm_device *drm, struct msm_file_private *ctx)
{
{
	struct msm_drm_private *priv = drm->dev_private;
	struct msm_drm_private *priv = drm->dev_private;
	int default_prio;
	int default_prio;


	if (!ctx)
		return 0;

	/*
	/*
	 * Select priority 2 as the "default priority" unless nr_rings is less
	 * 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 ?
	default_prio = priv->gpu ?
		clamp_t(uint32_t, 2, 0, priv->gpu->nr_rings - 1) : 0;
		clamp_t(uint32_t, 2, 0, priv->gpu->nr_rings - 1) : 0;