Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b25ea02d authored by Jordan Crouse's avatar Jordan Crouse
Browse files

drm/msm: Add a submit queue flag to disable the QoS timer



Allow priviliged (CAP_SYS_ADMIN) processes to disable the
hangcheck / quality of service timer to allow individual
submits to run for as long as they need.

Change-Id: Ic0dedbad1399ebe7c6db74ba374bfa3a6f72917a
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent b674857b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1707,6 +1707,13 @@ static int msm_ioctl_submitqueue_new(struct drm_device *dev, void *data,
		return -EPERM;
	}

	if (args->flags & MSM_SUBMITQUEUE_BYPASS_QOS_TIMEOUT &&
		!capable(CAP_SYS_ADMIN)) {
		DRM_ERROR(
			"Only CAP_SYS_ADMIN processes can bypass the timer\n");
		return -EPERM;
	}

	return msm_submitqueue_create(file->driver_priv, args->prio,
		args->flags, &args->id);
}
+16 −1
Original line number Diff line number Diff line
@@ -353,8 +353,22 @@ static void hangcheck_handler(unsigned long data)
		/* some progress has been made.. ya! */
		gpu->hangcheck_fence[ring->id] = fence;
	} else if (fence < submitted) {
		/* no progress and not done.. hung! */
		struct msm_gem_submit *submit;

		gpu->hangcheck_fence[ring->id] = fence;

		/*
		 * No progress done, but see if the current submit is
		 * intentionally skipping the hangcheck
		 */
		submit = list_first_entry_or_null(&ring->submits,
			struct msm_gem_submit, node);

		if (!submit || (submit->queue->flags &
			MSM_SUBMITQUEUE_BYPASS_QOS_TIMEOUT))
			goto out;

		/* no progress and not done and not special .. hung! */
		dev_err(dev->dev, "%s: hangcheck detected gpu lockup rb %d!\n",
				gpu->name, ring->id);
		dev_err(dev->dev, "%s:     completed fence: %u\n",
@@ -365,6 +379,7 @@ static void hangcheck_handler(unsigned long data)
		queue_work(priv->wq, &gpu->recover_work);
	}

out:
	/* if still more pending work, reset the hangcheck timer: */
	if (submitted > gpu->hangcheck_fence[ring->id])
		hangcheck_timer_reset(gpu);
+7 −1
Original line number Diff line number Diff line
@@ -362,7 +362,13 @@ struct drm_msm_gem_sync {
 * use and query 0 but cannot destroy it.
 */

#define MSM_SUBMITQUEUE_FLAGS (0)
/*
 * Allows a process to bypass the 2 second quality of service timeout.
 * Only CAP_SYS_ADMIN capable processes can set this flag.
 */
#define MSM_SUBMITQUEUE_BYPASS_QOS_TIMEOUT 0x00000001

#define MSM_SUBMITQUEUE_FLAGS (MSM_SUBMITQUEUE_BYPASS_QOS_TIMEOUT)

struct drm_msm_submitqueue {
	__u32 flags;   /* in, MSM_SUBMITQUEUE_x */