From 6c73c9bb16f1a35aa4ee908c9a8255b05e7e7c63 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 23 Apr 2024 10:06:53 +0200 Subject: [PATCH] v3d/simulator: size counter_values array correctly on V3D 7.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sim_state.perfcnt_total provides the total number of counters supported by the underlying simulated platform and is what we use when we create a perform to validate that the counters requested are valid, so we should use this. V3D_PERFCNT_NUM is a fixed enum value that is only valid for V3D 4.2 at present and is not sufficiently large for all the counters available in V3D 7.x. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/simulator/v3d_simulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/broadcom/simulator/v3d_simulator.c b/src/broadcom/simulator/v3d_simulator.c index 7e5c97e33f4..1d78d7205f1 100644 --- a/src/broadcom/simulator/v3d_simulator.c +++ b/src/broadcom/simulator/v3d_simulator.c @@ -854,7 +854,7 @@ v3d_write_performance_query_result(int fd, { struct v3d_simulator_file *file = v3d_get_simulator_file_for_fd(fd); struct v3d_simulator_perfmon *perfmon; - uint64_t counter_values[V3D_PERFCNT_NUM]; + uint64_t counter_values[sim_state.perfcnt_total]; for (uint32_t i = 0; i < copy->nperfmons; i++) { mtx_lock(&sim_state.submit_lock);