From 9ea90ffb98fbb5eac4cec5660a1ca2253c3a3e25 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 11 Jan 2018 10:22:04 +0100 Subject: 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 Signed-off-by: Eric Anholt --- src/gallium/drivers/vc4/vc4_screen.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/drivers/vc4/vc4_screen.c') 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: -- cgit v1.2.3