dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Brian Starkey <Brian.Starkey@arm.com>
Cc: Marek Vasut <marex@denx.de>, Simon Shields <simon@lineageos.org>,
	"lima@lists.freedesktop.org" <lima@lists.freedesktop.org>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	David Airlie <airlied@linux.ie>, Qiang Yu <yuq825@gmail.com>,
	nd <nd@arm.com>, Sean Paul <sean@poorly.run>,
	Andreas Baierl <ichgeh@imkreisrum.de>,
	Erico Nunes <nunes.erico@gmail.com>
Subject: Re: [PATCH 1/2] drm/fourcc: add ARM tiled format modifier
Date: Thu, 14 Feb 2019 16:34:55 +0100	[thread overview]
Message-ID: <20190214153455.GG2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190214152700.e7f42dfeniu2oirn@DESKTOP-E1NTVVP.localdomain>

On Thu, Feb 14, 2019 at 03:26:59PM +0000, Brian Starkey wrote:
> Hi,
> 
> On Wed, Feb 06, 2019 at 09:14:56PM +0800, Qiang Yu wrote:
> > Signed-off-by: Qiang Yu <yuq825@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).
> 
> 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.

Modifiers are also used in dri2/3 and wayland protocols, plus for buffer
sharing on the gl side. And for render drivers it's pretty common to not
validate at all what userspace is doing with it's buffers, as long as you
can make sure it can't escape it's sandbox (iommu pagetables generally
considered good enough, better if per-process).
-Daniel

> 
> Thanks,
> -Brian
> 
> >  #if defined(__cplusplus)
> >  }
> >  #endif
> > -- 
> > 2.17.1
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-02-14 15:35 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 13:14 [PATCH 0/2] Lima DRM driver Qiang Yu
2019-02-06 13:14 ` [PATCH 1/2] drm/fourcc: add ARM tiled format modifier Qiang Yu
2019-02-14 15:26   ` Brian Starkey
2019-02-14 15:34     ` Daniel Vetter [this message]
2019-02-15  1:48     ` Qiang Yu via dri-devel
2019-02-15 11:30       ` Brian Starkey
2019-02-06 13:14 ` [PATCH 2/2] drm/lima: driver for ARM Mali4xx GPUs Qiang Yu
2019-02-06 19:17   ` Eric Anholt
2019-02-07  8:27     ` Qiang Yu
2019-02-07 19:38       ` Eric Anholt
2019-02-12 15:46   ` Rob Herring via dri-devel
2019-02-12 16:23     ` Alex Deucher via dri-devel
2019-02-12 20:04       ` Rob Herring via dri-devel
2019-02-13  1:13         ` Qiang Yu via dri-devel
2019-02-14  2:52         ` Alex Deucher via dri-devel
2019-02-14  9:12           ` Christian König via dri-devel
2019-02-14 10:15             ` Daniel Vetter
2019-03-14 20:44             ` Dave Airlie
2019-03-14 21:44               ` Rob Herring
2019-03-14 22:28                 ` Eric Anholt
2019-03-15  8:06                   ` Koenig, Christian
2019-03-15 16:05                     ` Eric Anholt
2019-03-15 16:19                       ` Koenig, Christian
2019-02-13  0:56     ` Qiang Yu via dri-devel
2019-02-13  1:46       ` Rob Herring via dri-devel
2019-02-07  9:09 ` [PATCH 0/2] Lima DRM driver Daniel Vetter
2019-02-07  9:39   ` Christian König
2019-02-07 15:33     ` Qiang Yu
2019-02-07 19:14       ` Koenig, Christian
2019-02-07 15:21   ` Qiang Yu
2019-02-07 15:44     ` Alyssa Rosenzweig
2019-02-07 15:51     ` Daniel Vetter
2019-02-11 18:11       ` Rob Herring
2019-02-13  1:00         ` Eric Anholt
2019-02-13  1:44           ` Rob Herring via dri-devel
2019-02-13  7:59             ` Daniel Vetter
2019-02-13  8:35               ` Christian König via dri-devel
2019-02-13  9:38                 ` Daniel Vetter
2019-02-13 10:09                   ` Christian König via dri-devel
2019-02-26 15:58                 ` Daniel Vetter
2019-02-26 16:23                   ` Christian König
2019-02-14 21:15             ` Noralf Trønnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190214153455.GG2665@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Brian.Starkey@arm.com \
    --cc=airlied@linux.ie \
    --cc=anarsoul@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ichgeh@imkreisrum.de \
    --cc=lima@lists.freedesktop.org \
    --cc=marex@denx.de \
    --cc=maxime.ripard@bootlin.com \
    --cc=narmstrong@baylibre.com \
    --cc=nd@arm.com \
    --cc=nunes.erico@gmail.com \
    --cc=sean@poorly.run \
    --cc=simon@lineageos.org \
    --cc=yuq825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).