drm/msm: add max-freq gpu param to uapi
authorRob Clark <robdclark@gmail.com>
Tue, 9 Feb 2016 17:05:30 +0000 (12:05 -0500)
committerDave Airlie <airlied@redhat.com>
Wed, 10 Feb 2016 20:25:54 +0000 (06:25 +1000)
We need this in userspace for interpreting some of the perf ctrs.

Note possibly not quite sufficient if we had some frequency mgmt
approach other than race-to-idle.  Not really sure what the best
thing to do if we did.  Although displaying results as a percentage
of max frequence seems sensible(ish) if we did.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/msm/adreno/adreno_gpu.c
include/uapi/drm/msm_drm.h

index a3b54cc7649531c987ed9bd18ba6d2b7087bbe6f..0e1d0c57cd3d10e7a745e67df24adb0a09a3f2d5 100644 (file)
@@ -41,6 +41,9 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
                                (adreno_gpu->rev.major << 16) |
                                (adreno_gpu->rev.core << 24);
                return 0;
+       case MSM_PARAM_MAX_FREQ:
+               *value = adreno_gpu->base.fast_rate;
+               return 0;
        default:
                DBG("%s: invalid param: %u", gpu->name, param);
                return -EINVAL;
index 81e6e0d1d3600c8a90d83ce8f444a8106d28e546..0e3c4c48b326ff6a694e2d2fb197f1b4b22494f2 100644 (file)
@@ -50,6 +50,7 @@ struct drm_msm_timespec {
 #define MSM_PARAM_GPU_ID     0x01
 #define MSM_PARAM_GMEM_SIZE  0x02
 #define MSM_PARAM_CHIP_ID    0x03
+#define MSM_PARAM_MAX_FREQ   0x04
 
 struct drm_msm_param {
        __u32 pipe;           /* in, MSM_PIPE_x */