aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/drm/msm_pipe.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-04-16 10:10:05 -0700
committerRob Clark <[email protected]>2019-04-25 14:13:07 -0700
commit650391868935ce047b7108f1c4f25f97323f8031 (patch)
treea67a6399d8a6ace40f683bde7e9e5242ee587ab4 /src/freedreno/drm/msm_pipe.c
parent77d091d0c5dc1f1b174668cb1da5f00ad391d76d (diff)
freedreno/drm: update for robustness
Update UABI header and add FD_PP_PGTABLE and FD_NR_FAULTS params. Robustness can be supported by a kernel which provides the new ABI if it also indicates that per-process pagetables are in use. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/drm/msm_pipe.c')
-rw-r--r--src/freedreno/drm/msm_pipe.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/freedreno/drm/msm_pipe.c b/src/freedreno/drm/msm_pipe.c
index 7d5b9fcd76f..faad1f6d35d 100644
--- a/src/freedreno/drm/msm_pipe.c
+++ b/src/freedreno/drm/msm_pipe.c
@@ -48,6 +48,26 @@ static int query_param(struct fd_pipe *pipe, uint32_t param,
return 0;
}
+static int query_queue_param(struct fd_pipe *pipe, uint32_t param,
+ uint64_t *value)
+{
+ struct msm_pipe *msm_pipe = to_msm_pipe(pipe);
+ struct drm_msm_submitqueue_query req = {
+ .data = value,
+ .id = msm_pipe->queue_id,
+ .param = param,
+ .len = sizeof(*value),
+ };
+ int ret;
+
+ ret = drmCommandWriteRead(pipe->dev->fd, DRM_MSM_SUBMITQUEUE_QUERY,
+ &req, sizeof(req));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
static int msm_pipe_get_param(struct fd_pipe *pipe,
enum fd_param_id param, uint64_t *value)
{
@@ -69,6 +89,12 @@ static int msm_pipe_get_param(struct fd_pipe *pipe,
return query_param(pipe, MSM_PARAM_TIMESTAMP, value);
case FD_NR_RINGS:
return query_param(pipe, MSM_PARAM_NR_RINGS, value);
+ case FD_PP_PGTABLE:
+ return query_param(pipe, MSM_PARAM_PP_PGTABLE, value);
+ case FD_CTX_FAULTS:
+ return query_queue_param(pipe, MSM_SUBMITQUEUE_PARAM_FAULTS, value);
+ case FD_GLOBAL_FAULTS:
+ return query_param(pipe, MSM_PARAM_FAULTS, value);
default:
ERROR_MSG("invalid param id: %d", param);
return -1;