From 6b9fcb01930c80436bb492f2f0b37ba65405a1ea Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Wed, 21 Apr 2021 12:22:33 +0200 Subject: [PATCH] v3d: check if device supports performance monitors Reviewed-by: Iago Toral Quiroga Signed-off-by: Juan A. Suarez Romero Part-of: --- src/broadcom/simulator/v3dx_simulator.c | 3 +++ src/gallium/drivers/v3d/v3d_screen.c | 1 + src/gallium/drivers/v3d/v3d_screen.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/broadcom/simulator/v3dx_simulator.c b/src/broadcom/simulator/v3dx_simulator.c index f00f1b0ed5a..0fd090d5788 100644 --- a/src/broadcom/simulator/v3dx_simulator.c +++ b/src/broadcom/simulator/v3dx_simulator.c @@ -266,6 +266,9 @@ v3dX(simulator_get_param_ioctl)(struct v3d_hw *v3d, case DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH: args->value = 1; return 0; + case DRM_V3D_PARAM_SUPPORTS_PERFMON: + args->value = 0; + return 0; } if (args->param < ARRAY_SIZE(reg_map) && reg_map[args->param]) { diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index dee8a983671..4d3ff0c7f56 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -809,6 +809,7 @@ v3d_screen_create(int fd, const struct pipe_screen_config *config, screen->has_csd = v3d_has_feature(screen, DRM_V3D_PARAM_SUPPORTS_CSD); screen->has_cache_flush = v3d_has_feature(screen, DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH); + screen->has_perfmon = v3d_has_feature(screen, DRM_V3D_PARAM_SUPPORTS_PERFMON); v3d_fence_init(screen); diff --git a/src/gallium/drivers/v3d/v3d_screen.h b/src/gallium/drivers/v3d/v3d_screen.h index 32848a4a700..3469731a2df 100644 --- a/src/gallium/drivers/v3d/v3d_screen.h +++ b/src/gallium/drivers/v3d/v3d_screen.h @@ -79,6 +79,7 @@ struct v3d_screen { bool has_csd; bool has_cache_flush; + bool has_perfmon; bool nonmsaa_texture_size_limit; struct v3d_simulator_file *sim_file;