drm/msm: Add a parameter query for the number of ringbuffers
authorJordan Crouse <jcrouse@codeaurora.org>
Fri, 20 Oct 2017 17:06:58 +0000 (11:06 -0600)
committerRob Clark <robdclark@gmail.com>
Sat, 28 Oct 2017 15:01:37 +0000 (11:01 -0400)
In order to manage ringbuffer priority to its fullest userspace
should know how many ringbuffers it has to work with. Add a
parameter to return the number of active rings.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/adreno_gpu.c
include/uapi/drm/msm_drm.h

index fd0fb0568dd3364174bbffcd61ff5c073bae2858..4e9caf97b20fe86da954bc8f6ed69f18e41f7f1f 100644 (file)
@@ -57,6 +57,9 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
                        return ret;
                }
                return -EINVAL;
+       case MSM_PARAM_NR_RINGS:
+               *value = gpu->nr_rings;
+               return 0;
        default:
                DBG("%s: invalid param: %u", gpu->name, param);
                return -EINVAL;
index 12d7619afa222e79e52dff9a82c3fab3e95de75d..bbbaffad772d3330907425879d2d03ba2a392fdc 100644 (file)
@@ -73,6 +73,7 @@ struct drm_msm_timespec {
 #define MSM_PARAM_MAX_FREQ   0x04
 #define MSM_PARAM_TIMESTAMP  0x05
 #define MSM_PARAM_GMEM_BASE  0x06
+#define MSM_PARAM_NR_RINGS   0x07
 
 struct drm_msm_param {
        __u32 pipe;           /* in, MSM_PIPE_x */