From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 01/10] drm/etnaviv: add uapi for register read feature Date: Mon, 30 Jan 2017 21:18:25 +0100 Message-ID: <20170130201825.GA18745@ulmo.ba.sec> References: <20161209112131.3924-1-christian.gmeiner@gmail.com> <20161209112131.3924-2-christian.gmeiner@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1570372956==" Return-path: Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 933E16E592 for ; Mon, 30 Jan 2017 20:18:29 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id r18so7963656wmd.3 for ; Mon, 30 Jan 2017 12:18:29 -0800 (PST) In-Reply-To: <20161209112131.3924-2-christian.gmeiner@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Christian Gmeiner Cc: cphealy@gmail.com, dri-devel@lists.freedesktop.org, linux+etnaviv@armlinux.org.uk List-Id: dri-devel@lists.freedesktop.org --===============1570372956== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Christian Gmeiner > --- > include/uapi/drm/etnaviv_drm.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_dr= m.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 */ > }; > =20 > +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 --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAliPn5EACgkQ3SOs138+ s6GDNRAAnArKbUoaGdFuIGVEoIiCgTQlqFwN1mvIoa+QIxFBMrF6VcrN48qPd8g0 qFmCyNQ91laGxjvALZJ0CNZavvV7Y6UsOY1Z1LAMpyCd3H4Dlzc5D+i6PDxKOtE5 GwDrmyUKqfng5VpZkL3PvUJ7tUebp7GPj6aY52PO4KRJckTGrndkdqf+r7Z9+9nB glguST8OVbQ6F+sVTjHbd2ASECnYddHC+j0sLWJZYvhp0Bpdca62ZeZ+LVrXjTSC MLfgYmB6cmgawhFlqaEKBmMW/1aQPbBiEpQRuHXGtgSoWT+sHW/1IfMcxAP3Y8E9 yaq+7ZdqvSrCOGpoUYq8VW8EMPxM37A4zF7ab2OmG0C8HrkoBAKB1/64EFPJ2sWP /StuTVDh+ucmMh4VI618QNC2rxRiaQaJM2fGItFUo7Rvsjsn12oFAUbDcbwpMIHJ e1iX0Ndfpeed5fSKajBPH0ZD7rkQGjq+kJmVZFd9m07knmguJRDpSR/nLsa7m1Sb 8cxzXiyXDIzxuBPZcAVV1fZk/u2ZcOWBkFaeDzoQHA+VXi0547Y8tz63juK5qcuH 6uFp/qeVWGGGTJQKtUJiCqxeTAEOHtomtPAGsFaVOoBU8/P/gF9wlVsYSVpml/rj sz7Z8p2Yrc0fVxhL6lkKHvyrAXvWApGcugB2KrLbh381rinFmKs= =aeOU -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh-- --===============1570372956== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1570372956==--