drm/msm: add chip-id param
authorRob Clark <robdclark@gmail.com>
Tue, 4 Feb 2014 19:16:04 +0000 (14:16 -0500)
committerRob Clark <robdclark@gmail.com>
Mon, 31 Mar 2014 14:27:46 +0000 (10:27 -0400)
Some of the w/a or different behavior of userspace blob driver seem to
be keyed to gpu patch revision, rather than gpu-id.  So expose the full
chip-id to userspace so it can DTRT.

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

index 7a11563379b8eb05d1141583d4399a69cf1beb52..28ca8cd8b09ed11766796b1dd12665cde74b8ea3 100644 (file)
@@ -73,6 +73,12 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
        case MSM_PARAM_GMEM_SIZE:
                *value = adreno_gpu->gmem;
                return 0;
+       case MSM_PARAM_CHIP_ID:
+               *value = adreno_gpu->rev.patchid |
+                               (adreno_gpu->rev.minor << 8) |
+                               (adreno_gpu->rev.major << 16) |
+                               (adreno_gpu->rev.core << 24);
+               return 0;
        default:
                DBG("%s: invalid param: %u", gpu->name, param);
                return -EINVAL;
index d3c62074016ded5c99c7dfd045469b3519227485..bf91a78a0b0e2ac06afd53cf17bfe92b3e914e2f 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
 
 struct drm_msm_param {
        uint32_t pipe;           /* in, MSM_PIPE_x */