[PATCH 00/10] drm/etnaviv: add readout support

Christian Gmeiner christian.gmeiner at gmail.com
Fri Dec 9 11:21:21 UTC 2016


In a perfect world we would be able to read GPU registers of interest
via the command stream with a 'read-register' command/package. For perf counters
it is a must to read them synchronized with the GPU to put the values in
relation to a draw command. As Vivante GPUs do not provide this functionality
we need to emulate it via software and do the reading of registers in the isr.

With the help of this patch series it is possible to read back register values
and store them in a defined bo at defined offsets. As we want to readback such
values within the context of the submit the struct drm_etnaviv_gem_submit gets
extend with the number of readbacks and a pointer to the readbacks array.

We are also in the lucky situation that we can not write every register via the
command stream - perf counter mux configuration - that there is a need for two
different types of readbacks:
 - normal ones
   Only read the defined register and store its value in the bo.
   
 - perf ones
   Provide an extra register/value pair to configure the mux before the register
   gets read. It is possible to reset all perf counters of a mux by selecting
   the 16 mux input. For this case we need to do a dummy read at the moment.

A very simple usage demo can be found here:
https://github.com/austriancoder/libdrm/tree/readback_v1

I am currently getting the mesa part for hw queries ready for review.

Christian Gmeiner (10):
  drm/etnaviv: add uapi for register read feature
  drm/etnaviv: add internal representation of readback
  drm/etnaviv: rework error handling
  drm/etnaviv: extend etnaviv_gpu_cmdbuf_new(..) with nr_readbacks
  drm/etnaviv: copy readbacks from userspace
  drm/etnaviv: store readback data in struct etnaviv_event
  drm/etnaviv: process readbacks in interrupt handler
  drm/etnaviv: make it possible to reconfigure perf counter
  drm/etnaviv: validate readback register address
  drm/etnaviv: add readout param

 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 82 +++++++++++++++++++++++++++-
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c        | 54 +++++++++++++++---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.h        | 16 +++++-
 include/uapi/drm/etnaviv_drm.h               | 16 ++++++
 4 files changed, 158 insertions(+), 10 deletions(-)

-- 
2.9.3



More information about the dri-devel mailing list