[PATCH RFCv2 3/4] staging: etnaviv: add drm driver

Lucas Stach l.stach at pengutronix.de
Wed Sep 16 08:30:59 PDT 2015


Am Mittwoch, den 16.09.2015, 08:11 +0200 schrieb Christian Gmeiner:
> Hi Lucas
> 
> 
> 2015-09-11 16:10 GMT+02:00 Lucas Stach <l.stach at pengutronix.de>:
> > From: Christian Gmeiner <christian.gmeiner at gmail.com>
> > 
> > This is a squashed commit of the complete etnaviv DRM driver in
> > order
> > to make it easy for people to review the code by seeing the driver
> > as a
> > whole and is not intended for merging in this form.
> > 
> > If you are interested in the history of individual commits:
> > git://git.pengutronix.de/git/lst/linux.git etnaviv-for-upstream
> > 
> > Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> > Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > ---

[...]

> > +/*
> > + * Cmdstream Submission:
> > + */
> > +
> > +/* The value written into the cmdstream is logically:
> > + * relocbuf->gpuaddr + reloc_offset
> > + *
> > + * NOTE that reloc's must be sorted by order of increasing
> > submit_offset,
> > + * otherwise EINVAL.
> > + */
> > +struct drm_etnaviv_gem_submit_reloc {
> > +       __u32 submit_offset;  /* in, offset from submit_bo */
> > +       __u32 reloc_idx;      /* in, index of reloc_bo buffer */
> > +       __u64 reloc_offset;   /* in, offset from start of reloc_bo
> > */
> > +};
> > +
> > +/* Each buffer referenced elsewhere in the cmdstream submit (ie.
> > the
> > + * cmdstream buffer(s) themselves or reloc entries) has one (and
> > only
> > + * one) entry in the submit->bos[] table.
> > + *
> > + * As a optimization, the current buffer (gpu virtual address) can
> > be
> > + * passed back through the 'presumed' field.  If on a subsequent
> > reloc,
> > + * userspace passes back a 'presumed' address that is still valid,
> > + * then patching the cmdstream for this entry is skipped.  This
> > can
> > + * avoid kernel needing to map/access the cmdstream bo in the
> > common
> > + * case.
> > + */
> > +#define ETNA_SUBMIT_BO_READ             0x0001
> > +#define ETNA_SUBMIT_BO_WRITE            0x0002
> > +struct drm_etnaviv_gem_submit_bo {
> > +       __u32 flags;          /* in, mask of ETNA_SUBMIT_BO_x */
> > +       __u32 handle;         /* in, GEM handle */
> > +       __u64 presumed;       /* in/out, presumed buffer address */
> > +};
> > +=
> 
> As presumed never gets used in the driver itself and I am not a big
> fan of it,
> can we remove it? Do you see any usecase for it?
> 
I think it could be useful to skip cmdstream patching on MMUv2. But to
be honest I don't know how much of a difference this will make, now
that we are operating on cached memory for the command stream as long
as possible. I'll try to get some performance profile, but at this
point I think it makes sense to get rid of it.

Regards
Lucas


More information about the dri-devel mailing list