[Mesa-dev] [libdrm 2/4] etnaviv: sync uapi header

Wladimir J. van der Laan laanwj at gmail.com
Tue Jun 20 13:20:18 UTC 2017


On Fri, Jun 09, 2017 at 12:27:35PM +0200, Christian Gmeiner wrote:
> Import the etnaviv header changes from kernel commits xxxxx
> 
> The drm_etnaviv_gem_submit structure was extended to include performance
> monitor requests. Also two new ioctls got added to readout performance
> monitor domains and their signals.

Looks straightforward.

Cannot find the associated kernel patch, so I could not check if the interface
matches.

Reviewed-By: Wladimir J. van der Laan <laanwj at gmail.com>

> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  etnaviv/etnaviv_drm.h | 35 ++++++++++++++++++++++++++++++++++-
>  1 file changed, 34 insertions(+), 1 deletion(-)
> 
> diff --git a/etnaviv/etnaviv_drm.h b/etnaviv/etnaviv_drm.h
> index 76f6f78..7c1db88 100644
> --- a/etnaviv/etnaviv_drm.h
> +++ b/etnaviv/etnaviv_drm.h
> @@ -150,6 +150,18 @@ struct drm_etnaviv_gem_submit_bo {
>  	__u64 presumed;       /* in/out, presumed buffer address */
>  };
>  
> +#define ETNA_PM_PROCESS_PRE             0x0001
> +#define ETNA_PM_PROCESS_POST            0x0002
> +struct drm_etnaviv_gem_submit_pmr {
> +	__u32 flags;          /* in, when to process request (ETNA_PM_PROCESS_x) */
> +	__u8  domain;         /* in, pm domain */
> +	__u8  signal;         /* in, pm signal */
> +	__u16 pad[3];
> +	__u32 sequence;       /* in, sequence number used for sync */
> +	__u32 read_offset;    /* in, offset from read_bo */
> +	__u32 read_idx;       /* in, index of read_bo buffer */
> +};
> +
>  /* 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.
> @@ -175,6 +187,9 @@ struct drm_etnaviv_gem_submit {
>  	__u64 stream;         /* in, ptr to cmdstream */
>  	__u32 flags;          /* in, mask of ETNA_SUBMIT_x */
>  	__s32 fence_fd;       /* in/out, fence fd (see ETNA_SUBMIT_FENCE_FD_x) */
> +	__u64 pmrs;           /* in, ptr to array of submit_pm's */
> +	__u32 nr_pmrs;        /* in, number of submit_pm's */
> +	__u32 padding;
>  };
>  
>  /* The normal way to synchronize with the GPU is just to CPU_PREP on
> @@ -210,6 +225,20 @@ struct drm_etnaviv_gem_wait {
>  	struct drm_etnaviv_timespec timeout;	/* in */
>  };
>  
> +struct drm_etnaviv_pm_domain {
> +	__u32 pipe;       /* in */
> +	__u8  iter;       /* in/out, select pm domain at index iter */
> +	__u8  nr_signals; /* out, how many signals does this domain provide */
> +	char  name[64];   /* out, name of domain */
> +};
> +
> +struct drm_etnaviv_pm_signal {
> +	__u32 pipe;       /* in */
> +	__u8  domain;     /* in, pm domain index */
> +	__u8  iter;       /* in/out, select pm source at index iter */
> +	char  name[64];   /* out, name of domain */
> +};
> +
>  #define DRM_ETNAVIV_GET_PARAM          0x00
>  /* placeholder:
>  #define DRM_ETNAVIV_SET_PARAM          0x01
> @@ -222,7 +251,9 @@ struct drm_etnaviv_gem_wait {
>  #define DRM_ETNAVIV_WAIT_FENCE         0x07
>  #define DRM_ETNAVIV_GEM_USERPTR        0x08
>  #define DRM_ETNAVIV_GEM_WAIT           0x09
> -#define DRM_ETNAVIV_NUM_IOCTLS         0x0a
> +#define DRM_ETNAVIV_PM_QUERY_DOM       0x0a
> +#define DRM_ETNAVIV_PM_QUERY_SIG       0x0b
> +#define DRM_ETNAVIV_NUM_IOCTLS         0x0c
>  
>  #define DRM_IOCTL_ETNAVIV_GET_PARAM    DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GET_PARAM, struct drm_etnaviv_param)
>  #define DRM_IOCTL_ETNAVIV_GEM_NEW      DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_NEW, struct drm_etnaviv_gem_new)
> @@ -233,6 +264,8 @@ struct drm_etnaviv_gem_wait {
>  #define DRM_IOCTL_ETNAVIV_WAIT_FENCE   DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_WAIT_FENCE, struct drm_etnaviv_wait_fence)
>  #define DRM_IOCTL_ETNAVIV_GEM_USERPTR  DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_USERPTR, struct drm_etnaviv_gem_userptr)
>  #define DRM_IOCTL_ETNAVIV_GEM_WAIT     DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_WAIT, struct drm_etnaviv_gem_wait)
> +#define DRM_IOCTL_ETNAVIV_QUERY_DOM    DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain)
> +#define DRM_IOCTL_ETNAVIV_QUERY_SIG    DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal)
>  
>  #if defined(__cplusplus)
>  }
> -- 
> 2.9.4
> 
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv


More information about the mesa-dev mailing list