summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.h
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_context.h
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_context.h')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
index cd404d42c3b..e0317a0e0c0 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -219,6 +219,13 @@ struct vc4_job_key {
struct pipe_surface *zsbuf;
};
+struct vc4_hwperfmon {
+ uint32_t id;
+ uint64_t last_seqno;
+ uint8_t events[DRM_VC4_MAX_PERF_COUNTERS];
+ uint64_t counters[DRM_VC4_MAX_PERF_COUNTERS];
+};
+
/**
* A complete bin/render job.
*
@@ -309,6 +316,9 @@ struct vc4_job {
/** Any flags to be passed in drm_vc4_submit_cl.flags. */
uint32_t flags;
+ /* Performance monitor attached to this job. */
+ struct vc4_hwperfmon *perfmon;
+
struct vc4_job_key key;
};
@@ -390,6 +400,8 @@ struct vc4_context {
struct pipe_viewport_state viewport;
struct vc4_constbuf_stateobj constbuf[PIPE_SHADER_TYPES];
struct vc4_vertexbuf_stateobj vertexbuf;
+
+ struct vc4_hwperfmon *perfmon;
/** @} */
};
@@ -447,6 +459,12 @@ vc4_sampler_state(struct pipe_sampler_state *psampler)
return (struct vc4_sampler_state *)psampler;
}
+int vc4_get_driver_query_group_info(struct pipe_screen *pscreen,
+ unsigned index,
+ struct pipe_driver_query_group_info *info);
+int vc4_get_driver_query_info(struct pipe_screen *pscreen, unsigned index,
+ struct pipe_driver_query_info *info);
+
struct pipe_context *vc4_context_create(struct pipe_screen *pscreen,
void *priv, unsigned flags);
void vc4_draw_init(struct pipe_context *pctx);