[PATCH 01/10] drm/etnaviv: add uapi for register read feature

Thierry Reding thierry.reding at gmail.com
Mon Jan 30 20:18:25 UTC 2017


On Fri, Dec 09, 2016 at 12:21:22PM +0100, Christian Gmeiner wrote:
> We need to readout some registers _after_ the submited command
> buffer got executed in order to support perf counters.
> There is no way to read register via command stream - even the
> Vivante kernel driver does it via a special ioctl.
> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  include/uapi/drm/etnaviv_drm.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h
> index 2584c1c..0d30604 100644
> --- a/include/uapi/drm/etnaviv_drm.h
> +++ b/include/uapi/drm/etnaviv_drm.h
> @@ -150,6 +150,13 @@ struct drm_etnaviv_gem_submit_bo {
>  	__u64 presumed;       /* in/out, presumed buffer address */
>  };
>  
> +struct drm_etnaviv_gem_submit_readback {
> +	__u32 readback_offset;/* in, offset from readback_bo */
> +	__u32 readback_idx;   /* in, index of readback_bo buffer */
> +	__u32 reg;            /* in, register to read */
> +	__u32 flags;          /* in, needs to be 0 */
> +};
> +
>  /* Each cmdstream submit consists of a table of buffers involved, and
>   * one or more cmdstream buffers.  This allows for conditional execution
>   * (context-restore), and IB buffers needed for per tile/bin draw cmds.
> @@ -167,6 +174,9 @@ struct drm_etnaviv_gem_submit {
>  	__u64 bos;            /* in, ptr to array of submit_bo's */
>  	__u64 relocs;         /* in, ptr to array of submit_reloc's */
>  	__u64 stream;         /* in, ptr to cmdstream */
> +	__u64 readbacks;      /* in, ptr to array of submit_readback's */
> +	__u32 nr_readbacks;   /* in, number of submit_readback's */
> +	__u32 padding;
>  };

What about ABI stability? How's this going to work when userspace uses
old headers but runs against a new kernel? What about userspace using
newer headers than the kernel?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170130/f83bb252/attachment.sig>


More information about the dri-devel mailing list