summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharat Masetty <smasetty@codeaurora.org>2017-11-13 18:48:22 +0530
committerSharat Masetty <smasetty@codeaurora.org>2017-11-28 17:23:13 +0530
commit1ff6f9bca64917b406a7ea2b2dccfc3c1da430fb (patch)
treeb6a252a6601738beaabedbb4d7365939773f9c61
parentce488494ce823d2f5bff75c91726a95543bc7c29 (diff)
drm/msm: Add API support for getting GPU hang timeout
Userspace needs to know the GPU timeout value to support Khronos robust GPU timeout extension. The timeout value is returned to the user in millisecond resolution. Change-Id: Iba2ff43fce6d21da240356b392afa7a6e7a618ad Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c3
-rw-r--r--include/uapi/drm/msm_drm.h15
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index d397c44f1203..8986ba6c110b 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -61,6 +61,9 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
case MSM_PARAM_NR_RINGS:
*value = gpu->nr_rings;
return 0;
+ case MSM_PARAM_GPU_HANG_TIMEOUT:
+ *value = DRM_MSM_HANGCHECK_PERIOD;
+ return 0;
default:
DBG("%s: invalid param: %u", gpu->name, param);
return -EINVAL;
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index a852f2a3701f..30ae8c3c1c85 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -112,13 +112,14 @@ struct drm_msm_ext_panel_hdr_properties {
__u32 hdr_min_luminance; /* Min Luminance */
};
-#define MSM_PARAM_GPU_ID 0x01
-#define MSM_PARAM_GMEM_SIZE 0x02
-#define MSM_PARAM_CHIP_ID 0x03
-#define MSM_PARAM_MAX_FREQ 0x04
-#define MSM_PARAM_TIMESTAMP 0x05
-#define MSM_PARAM_GMEM_BASE 0x06
-#define MSM_PARAM_NR_RINGS 0x07
+#define MSM_PARAM_GPU_ID 0x01
+#define MSM_PARAM_GMEM_SIZE 0x02
+#define MSM_PARAM_CHIP_ID 0x03
+#define MSM_PARAM_MAX_FREQ 0x04
+#define MSM_PARAM_TIMESTAMP 0x05
+#define MSM_PARAM_GMEM_BASE 0x06
+#define MSM_PARAM_NR_RINGS 0x07
+#define MSM_PARAM_GPU_HANG_TIMEOUT 0xa0 /* timeout in ms */
struct drm_msm_param {
__u32 pipe; /* in, MSM_PIPE_x */