[PATCH 1/2] drm/fourcc: add ARM tiled format modifier

Qiang Yu yuq825 at gmail.com
Fri Feb 15 01:48:47 UTC 2019


On Thu, Feb 14, 2019 at 11:27 PM Brian Starkey <Brian.Starkey at arm.com> wrote:
>
> Hi,
>
> On Wed, Feb 06, 2019 at 09:14:56PM +0800, Qiang Yu wrote:
> > Signed-off-by: Qiang Yu <yuq825 at gmail.com>
> > ---
> >  include/uapi/drm/drm_fourcc.h | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> > index 0b44260a5ee9..953b59eb3fd2 100644
> > --- a/include/uapi/drm/drm_fourcc.h
> > +++ b/include/uapi/drm/drm_fourcc.h
> > @@ -644,6 +644,15 @@ extern "C" {
> >   */
> >  #define AFBC_FORMAT_MOD_SC      (1ULL <<  9)
> >
> > +/*
> > + * ARM tiled format
> > + *
> > + * This is used by ARM Mali Utgard/Midgard GPU. It divides buffer into
> > + * 16x16 pixel blocks. Blocks are stored linearly in order, but pixels
> > + * in the block are reordered.
> > + */
> > +#define DRM_FORMAT_MOD_ARM_TILED fourcc_mod_code(ARM, 1)
> > +
>
> This conflicts with the already-defined AFBC modifiers. It has the
> same value as:
>
> DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_16x16);
>
> I would suggest we use the top bit(s) to namespace between the
> different types of tiling formats Arm has (e.g. AFBC vs
> non-compressed).
Just for conformation, is the non-compressed tile format + BLOCK_SIZE_16x16
super block format same as mali gpu used tile format?

So what name would you suggest to name this mali gpu tile format?
Or maybe it's better that you can send out a patch to add the tile
format (better also other ones) and how it's assembled with super block
format in the modifier, as I don't have a whole picture of this.

>
> I think this would be an internal-only layout though. Do we need
> modifiers for internal-only formats? I thought they were mainly for
> sharing cross-device. I also didn't see this macro getting used
> anywhere in the driver; I suppose at a minimum you should validate the
> modifier value provided by userspace.
>
Yes we need it. It's used in the userspace mesa driver and applications
which need to share mali driver allocated buffers across process. So
that one process can tell another process which format to interpret the
passed buffer.

Thanks,
Qiang


More information about the dri-devel mailing list