summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_drv.c
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2017-06-29 09:55:11 -0600
committerJordan Crouse <jcrouse@codeaurora.org>2017-07-03 13:40:28 -0600
commit747d4d00dbe749de4a910f9e867ad2407c48df1e (patch)
tree37cdc3283e9666aa10e7ab1d0a904bc09f20e4be /drivers/gpu/drm/msm/msm_drv.c
parent9d7874731a1df1bda90575174e2c1821e80b269a (diff)
drm/msm: Change the priority order of the ringbuffers
When we first did preemption the priority was set at submission time. In order to be properly backwards compatible we made ring id 0 the lowest priority ring so that when a legacy app made a submission it didn't get itself onto the highest priority ring by accident. Now that we set the priority with submitqueues this is no longer a concern and ordering priorities this way goes against long standing convention in similar GPU drivers. Declare a flag day and invert the priority algorithm so that priority '0' is the highest priority and it descends from there. The lowest prority ring is 'number of rings - 1' where the number of active rings can be acquired through a parameter query of MSM_PARAM_NR_RINGS. This change also ensures that the legacy submitqueue id '0' will use the next-to-lowest ring buffer by default for legacy submissions. Change-Id: Ic0dedbadeea522e4f07babc4395cbf5fb7143fe3 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 367e701b59cb..ad9813488f60 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1760,7 +1760,8 @@ static int msm_ioctl_submitqueue_new(struct drm_device *dev, void *data,
if (args->flags & ~MSM_SUBMITQUEUE_FLAGS)
return -EINVAL;
- if (!file->is_master && args->prio >= gpu->nr_rings - 1) {
+ if ((gpu->nr_rings > 1) &&
+ (!file->is_master && args->prio == 0)) {
DRM_ERROR("Only DRM master can set highest priority ringbuffer\n");
return -EPERM;
}