summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c16
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_winsys.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index b3e3cb29429..a6f847f6bd5 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -582,6 +582,21 @@ static uint64_t radeon_query_value(struct radeon_winsys *rws,
return 0;
}
+static void radeon_read_registers(struct radeon_winsys *rws,
+ unsigned reg_offset,
+ unsigned num_registers, uint32_t *out)
+{
+ struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws;
+ unsigned i;
+
+ for (i = 0; i < num_registers; i++) {
+ uint32_t reg = reg_offset + i*4;
+
+ radeon_get_drm_value(ws->fd, RADEON_INFO_READ_REG, "read-reg", &reg);
+ out[i] = reg;
+ }
+}
+
static unsigned hash_fd(void *key)
{
int fd = pointer_to_intptr(key);
@@ -728,6 +743,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
ws->base.surface_init = radeon_drm_winsys_surface_init;
ws->base.surface_best = radeon_drm_winsys_surface_best;
ws->base.query_value = radeon_query_value;
+ ws->base.read_registers = radeon_read_registers;
radeon_bomgr_init_functions(ws);
radeon_drm_cs_init_functions(ws);
diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h
index 996a2017b07..ee0a9040709 100644
--- a/src/gallium/winsys/radeon/drm/radeon_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h
@@ -589,6 +589,9 @@ struct radeon_winsys {
uint64_t (*query_value)(struct radeon_winsys *ws,
enum radeon_value_id value);
+
+ void (*read_registers)(struct radeon_winsys *ws, unsigned reg_offset,
+ unsigned num_registers, uint32_t *out);
};