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

Emil Velikov emil.l.velikov at gmail.com
Fri Jun 9 12:12:15 UTC 2017


Hi Christian,

On 9 June 2017 at 11:27, Christian Gmeiner <christian.gmeiner at gmail.com> wrote:
> Import the etnaviv header changes from kernel commits xxxxx
>
Looks good. Please be careful that this does not land before the kernel bits.
I think I've spotted a few compat 32/64bit issues, although I'm not
that familiar with the hardware to know if (when actually) this might
come to bite.
Simply following danvet's writeup [1].


> 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.
>
> 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 */
AFAICT sizeof(struct .) is not multiple of 64bits, where it should be.


> +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 */
For these two [barring the sizeof() mentioned above] offsetof(name)
will differ across 32 and 64bit builds, wouldn't it?

Thanks
Emil

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ioctl/botching-up-ioctls.txt


More information about the etnaviv mailing list