summaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_drm.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-12-21 14:49:30 +0100
committerChia-I Wu <[email protected]>2019-03-11 10:01:41 -0700
commit6401ad389e9cec6f523e4e4e989c190fb25a8dfc (patch)
treedb6fb8a7ca0b9bcb46b30aa65b87b4f17b1bbda3 /src/freedreno/vulkan/tu_drm.c
parentb0562e272f8a2a41d0639b65a5158b0c3b2dfd3b (diff)
turnip: Implement pipe-less param query.
Diffstat (limited to 'src/freedreno/vulkan/tu_drm.c')
-rw-r--r--src/freedreno/vulkan/tu_drm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c
index b8a4c6f8a98..11c3b008155 100644
--- a/src/freedreno/vulkan/tu_drm.c
+++ b/src/freedreno/vulkan/tu_drm.c
@@ -92,3 +92,24 @@ tu_gem_info_iova(struct tu_device *dev, uint32_t gem_handle)
{
return tu_gem_info(dev, gem_handle, MSM_INFO_IOVA);
}
+
+
+int
+tu_drm_query_param(struct tu_physical_device *dev, uint32_t param, uint64_t *value)
+{
+ /* Technically this requires a pipe, but the kernel only supports one pipe anyway
+ * at the time of writing and most of these are clearly pipe independent. */
+ struct drm_msm_param req = {
+ .pipe = MSM_PIPE_3D0,
+ .param = param,
+ };
+
+ int ret = drmCommandWriteRead(dev->local_fd, DRM_MSM_GET_PARAM,
+ &req, sizeof(req));
+ if (ret)
+ return ret;
+
+ *value = req.value;
+
+ return 0;
+}