summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_screen.c
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2018-01-11 10:22:04 +0100
committerEric Anholt <[email protected]>2018-03-05 15:54:04 -0800
commit9ea90ffb98fbb5eac4cec5660a1ca2253c3a3e25 (patch)
tree80cc4bd7fe6cece8bb1383c050b07c686133fb4b /src/gallium/drivers/vc4/vc4_screen.c
parent5924379a587aa654a0a8bfd68a815b5bc906c1e9 (diff)
broadcom/vc4: Add support for HW perfmon
The V3D engine provides several perf counters. Implement ->get_driver_query_[group_]info() so that these counters are exposed through the GL_AMD_performance_monitor extension. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_screen.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 5b944bf030b..397be545d9a 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -680,6 +680,8 @@ vc4_screen_create(int fd, struct renderonly *ro)
vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_THREADED_FS);
screen->has_madvise =
vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_MADVISE);
+ screen->has_perfmon_ioctl =
+ vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_PERFMON);
if (!vc4_get_chip_info(screen))
goto fail;
@@ -706,6 +708,11 @@ vc4_screen_create(int fd, struct renderonly *ro)
pscreen->get_compiler_options = vc4_screen_get_compiler_options;
pscreen->query_dmabuf_modifiers = vc4_screen_query_dmabuf_modifiers;
+ if (screen->has_perfmon_ioctl) {
+ pscreen->get_driver_query_group_info = vc4_get_driver_query_group_info;
+ pscreen->get_driver_query_info = vc4_get_driver_query_info;
+ }
+
return pscreen;
fail: