From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <rob.clark@linaro.org>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/11] drm: add plane support
Date: Tue, 25 Oct 2011 21:41:17 +0200 [thread overview]
Message-ID: <20111025194117.GG2894@phenom.ffwll.local> (raw)
In-Reply-To: <CAF6AEGvb6TANU895KC_6AscBP3KVotbhbE94HJzwzGEZDhqE=w@mail.gmail.com>
On Tue, Oct 25, 2011 at 11:43:09AM -0500, Rob Clark wrote:
> On Tue, Oct 25, 2011 at 9:09 AM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
> > index 34a0d22..dafe8df 100644
> > --- a/include/drm/drm_mode.h
> > +++ b/include/drm/drm_mode.h
> > @@ -272,8 +272,9 @@ struct drm_mode_fb_cmd2 {
> > __u32 bpp;
> > __u32 depth;
> > __u32 pixel_format; /* fourcc code from videodev2.h */
> > - /* driver specific handle */
> > - __u32 handle;
> > + __u32 handle_count;
> > + /* driver specific buffer object handle array */
> > + __u64 handles;
> > };
>
>
> Ok, after a bit of discussion with Jakob on IRC, this is what we arrived at:
>
> 1) It would be nice to have the option for multi-planar formats to be
> able to use one single buffer object, or one buffer object per plane.
> In the case of one buffer per plane, the order is dictated by the
> fourcc.
>
> 2) We do need per-plane stride for some formats, in particular I420
> which is a bit ambiguous otherwise (ie. is the stride of the U and V
> planes half the stride as the Y plane, or the same?)
>
> 3) Maybe we need per-plane offsets, but I think this case could be
> handled by just using one bo per plane, so left it out
>
> 4) bpp/depth are redundant w/ the pixel_format. Just in case, as a
> future placeholder, and inspired by 'struct v4l2_pix_format', add a
> priv field. Although making the field big enough to hold a pointer if
> absolutely really needed.
>
> struct drm_mode_fb_cmd2 {
> __u32 fb_id;
> __u32 width, height;
> __u32 pixel_format; /* fourcc code from videodev2.h */
> __u64 priv; /* private data, depends on pixelformat */
>
> /* in case of planar formats, either one buffer object,
> * or one buffer object per plane, is allowed. In the
> * case per-plane bo's, the order is dictated by the
> * fourcc.. ie. NV12 (http://fourcc.org/yuv.php#NV12)
> * is described as:
> *
> * YUV 4:2:0 image with a plane of 8 bit Y samples
> * followed by an interleaved U/V plane containing
> * 8 bit 2x2 subsampled colour difference samples.
> *
> * So it would consist of Y as first buffer and UV as
> * second buffer. In the case that only a single bo
> * is used then buffer[1].handle should be zero. (But
> * a plane specific pitch could still be specified.)
> */
> struct {
> __u32 pitch;
> /* driver specific handle */
> __u32 handle;
Why not just add a
__u32 offset;
__u32 rsvd;
and call it a day. This thing is pretty big already, so that bloat doesn't
matter that much. Maybe spec that buffer[0].offset must be zero. With that
you can also do I420 with the following layout
+-------+
|YYYYYYY|
|YYYYYYY|
|YYYYYYY|
|YYYYYYY|
+---+---+
|UUU|VVV|
|UUU|VVV|
+---+---+
i.e. stride_U == stride_V, with their lines meshed into one line.
-Daniel
> } buffer[16];
> };
>
>
> BR,
> -R
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2011-10-25 19:41 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 9:46 DRM planes and new fb creation ioctl Jesse Barnes
2011-10-25 9:46 ` [PATCH 01/11] drm: add plane support Jesse Barnes
2011-10-25 10:53 ` Joonyoung Shim
2011-10-25 11:18 ` Jesse Barnes
2011-10-26 0:19 ` Joonyoung Shim
2011-10-25 11:58 ` Daniel Vetter
2011-10-25 12:26 ` Jesse Barnes
2011-10-25 13:26 ` Alan Cox
2011-10-25 13:32 ` Jesse Barnes
2011-10-25 13:42 ` Daniel Vetter
2011-10-25 14:09 ` Jesse Barnes
2011-10-25 16:43 ` Rob Clark
2011-10-25 19:41 ` Daniel Vetter [this message]
2011-10-25 20:14 ` Rob Clark
2011-10-27 14:05 ` SW Kim
2011-10-31 11:40 ` Inki Dae
2011-10-31 16:52 ` Jesse Barnes
2011-11-02 2:20 ` Inki Dae
2011-11-02 15:57 ` Jesse Barnes
2011-10-26 5:40 ` Joonyoung Shim
2011-10-27 15:31 ` Jesse Barnes
2011-10-25 9:46 ` [PATCH 02/11] drm: add an fb creation ioctl that takes a pixel format Jesse Barnes
2011-10-25 9:46 ` [PATCH 03/11] drm/i915: rename existing overlay support to "legacy" Jesse Barnes
2011-10-25 9:46 ` [PATCH 04/11] drm/i915: add SNB video sprite support Jesse Barnes
2011-11-02 5:56 ` Inki Dae
2011-11-02 15:58 ` Jesse Barnes
2011-10-25 9:47 ` [PATCH 05/11] drm/i915: move pin & fence for plane past potential error paths Jesse Barnes
2011-10-25 9:47 ` [PATCH 06/11] drm/i915: plane teardown fixes Jesse Barnes
2011-10-25 9:47 ` [PATCH 07/11] drm/i915: enable new overlay code on IVB too Jesse Barnes
2011-10-25 9:47 ` [PATCH 08/11] drm/i915: overlay watermark hack Jesse Barnes
2011-10-25 9:47 ` [PATCH 09/11] drm/i915: fix overlay fb object handling Jesse Barnes
2011-10-25 9:47 ` [PATCH 10/11] drm/i915: clamp sprite to viewable area Jesse Barnes
2011-10-25 9:47 ` [PATCH 11/11] drm/i915: add sprite scaling support Jesse Barnes
2011-10-25 10:47 ` DRM planes and new fb creation ioctl Joonyoung Shim
2011-10-25 11:13 ` Jesse Barnes
2011-10-26 1:04 ` Joonyoung Shim
2011-10-25 11:20 ` Jesse Barnes
2011-10-25 11:22 ` [PATCH] drm/i915: add SNB video sprite support Jesse Barnes
2011-10-25 11:30 ` Jesse Barnes
2011-11-01 14:11 ` Lan, Hai
2011-11-03 18:44 ` [Intel-gfx] " Jesse Barnes
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=20111025194117.GG2894@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rob.clark@linaro.org \
/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