From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
rob.clark@linaro.org
Subject: Re: [PATCH] DRM planes
Date: Thu, 3 Nov 2011 15:11:55 +0100 [thread overview]
Message-ID: <20111103141155.GA3124@phenom.ffwll.local> (raw)
In-Reply-To: <1320264203-18715-1-git-send-email-jbarnes@virtuousgeek.org>
On Wed, Nov 02, 2011 at 01:03:18PM -0700, Jesse Barnes wrote:
> In response to feedback, I've adjusted the new addfb2 ioctl to take per
> component pitch and offset args. Generally, the offset[0] field will be
> 0, but it's conceivable that some metadata could be stored at the start
> of a given buffer, and an offset[0] allows the client to skip past that.
> Similarly, pitch[0] will typically describe the whole buffer, but it's
> possible to simply string together several planes into a single object
> where individual pitch components matter.
>
> Userland patches are available in the drm-overlays branches of my
> personal libdrm and xf86-video-intel trees at freedesktop.org. The
> xf86-video-intel side works well enough to handle clipping (using a new
> i915 specific ioctl for setting a destination color key) and play
> videos, albeit without nice flipping.
>
> Assuming no major objections, I think this is finally ready for
> drm-next.
Well, the fool I am I've attempted to write a nice little drm plane
wrapper for the legacy intel overlay code. Code is totally untested, but I
like what it looks like - the drm plane interfaces are a quite natural fit
to the existing code. There's one thing though which is imo a bloody mess
(and I've given up writing the code for it), namely planar yuv handling
with fourcc pixelformats. The current implementation for snb+ doesn't
stumble over that rock because it only supports packed yuv.
So here goes the rant: The legacy overlay (and my ioctl) accept a set off
offset for Y, U and V planes (i.e. it could even accept different bos, but
the current ioctl designed for Xv doesn't). The hw has the restriction
that the strides for the U and V planes need to be identical, but that's
it. Pixelformat is just an enumeration of YUV422,420,411,410 to specify
the subsampling ratio of the U/V planes.
Now fourcc specifies all these offset implicitly in the pixelformat (at
least that's what I've figured out, I might be wrong though):
- Some formats have the YUV planes in a special, fixed arrangement, no
additional offset needs to be passed in and strides are implicit from
the width.
- Some have a separate offset somewhere for UV planes, but the UV planes
are again in a fixed layout (either interleaved or one after another).
- Some fourcc have all three planes independant, i.e. you need an offset
for the U and the V plane. No clue what that implies for the stride.
In short decoding these fourcc values with all their implicit assumptions
about offset, strides and whatnotelse will be one giant switch mess. Not
my idea of a nice kernel interface. Also practically guaranteed to result
in slightly different behaviour in each driver.
So here's the new radical proposal (and yep, I expect heat for this):
- Ditch fourcc. Afaics this wheel is square and no amount of sharpening
the corners will make it round.
- Ditch addfb support for planar yuv formats, at least for the moment.
Until we have more than one kms driver for this I don't think we can
come up with any sane interface.
In conclusion: Ditch the addfb2ioctl and just add a few more kms pixel
formats for the new packed yuv layouts that the snb+ sprite code needs.
Cheers, Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2011-11-03 14:11 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 20:03 [PATCH] DRM planes Jesse Barnes
2011-11-02 20:03 ` [PATCH 1/5] drm: add plane support Jesse Barnes
2011-11-02 22:33 ` Jesse Barnes
2011-11-03 18:21 ` Jesse Barnes
2011-11-03 22:48 ` Jesse Barnes
2011-11-03 22:56 ` Daniel Vetter
2011-11-04 2:22 ` Joonyoung Shim
2011-11-04 14:10 ` Jesse Barnes
2011-11-02 20:03 ` [PATCH 2/5] drm: add an fb creation ioctl that takes a pixel format Jesse Barnes
2011-11-03 18:22 ` Jesse Barnes
2011-11-04 7:34 ` Joonyoung Shim
2011-11-04 14:13 ` Jesse Barnes
[not found] ` <CAAQKjZPhqYdMAUkbCbc68muPLN7azuVr0yod7hFC=i+MigwNhw@mail.gmail.com>
2011-11-07 16:12 ` Jesse Barnes
2011-11-07 17:02 ` Rob Clark
2011-11-02 20:03 ` [PATCH 3/5] drm/i915: rename existing overlay support to "legacy" Jesse Barnes
2011-11-03 18:22 ` Jesse Barnes
2011-11-02 20:03 ` [PATCH 4/5] drm/i915: add SNB and IVB video sprite support Jesse Barnes
2011-11-03 18:22 ` Jesse Barnes
2011-11-04 2:29 ` [Intel-gfx] " Lan, Hai
2011-11-02 20:03 ` [PATCH 5/5] drm/i915: add destination color key support Jesse Barnes
2011-11-03 18:23 ` Jesse Barnes
2011-11-03 14:11 ` Daniel Vetter [this message]
2011-11-03 15:12 ` [PATCH] DRM planes Jesse Barnes
2011-11-03 17:29 ` Daniel Vetter
2011-11-03 17:36 ` Jesse Barnes
2011-11-03 18:55 ` Rob Clark
2011-11-03 19:14 ` Jesse Barnes
2011-11-03 17:47 ` Alan Cox
2011-11-03 18:58 ` Daniel Vetter
2011-11-03 22:20 ` Alan Cox
2011-11-03 22:24 ` Jesse Barnes
-- strict thread matches above, loose matches on Subject: below --
2011-11-07 18:02 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=20111103141155.GA3124@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.