From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 10/12] drm: Don't allow multiple buffers fb with stereo modes
Date: Tue, 17 Sep 2013 14:02:34 +0300 [thread overview]
Message-ID: <20130917110234.GT4531@intel.com> (raw)
In-Reply-To: <20130917103748.GM32145@phenom.ffwll.local>
On Tue, Sep 17, 2013 at 12:37:48PM +0200, Daniel Vetter wrote:
> On Tue, Sep 17, 2013 at 12:54:09PM +0300, Ville Syrjälä wrote:
> > On Tue, Sep 17, 2013 at 10:03:12AM +0100, Damien Lespiau wrote:
> > > On Tue, Sep 17, 2013 at 11:20:46AM +0300, Ville Syrjälä wrote:
> > > > +++ b/drivers/gpu/drm/drm_crtc.c
> > > > > @@ -2131,6 +2131,17 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
> > > > > goto out;
> > > > > }
> > > > >
> > > > > + /*
> > > > > + * Do not allow the use of framebuffers consisting of multiple
> > > > > + * buffers with stereo modes until all the details API details
> > > > > + * are fleshed out (eg. interaction with drm_planes, switch
> > > > > + * between a 1 buffers and a 2 buffers fb, ...)
> > > > > + */
> > > > > + if (fb->num_buffers > 1 && drm_mode_is_stereo(mode)) {
> > > > > + ret = -EINVAL;
> > > > > + goto out;
> > > > > + }
> > > >
> > > > This would prevent planar buffers in stereo modes. I'm think we just
> > > > ignore the matter for now and let drivers deal with it. We don't have
> > > > enough handles anyway for planar stereo, so maybe we even want to add
> > > > separate left/right fb attachment properties to the planes instead of
> > > > tying it up in inside a single fb. Or we cook up addfb3 when we hit
> > > > this problem for real. I think we'd anyway need some kind of flag for
> > > > the fb if it contains both left and right buffers.
> > >
> > > I'm quite happy to ignore 3 planes YUV stereo fbs for now :) (2 planes
> > > YUV stereo fbs still fit!).
> > >
> > > Are you fine with this test though, or do you mean ignore the whole
> > > matter of forbidding this case (or just the multiplane stereo fb case)?
> > > I was just thinking that I missed the addition of this check in the page
> > > flip ioctl.
> >
> > Yeah, I was thinking we that we can ignore this issue for now, and so we
> > wouldn't need the check. Currently for non-stereo cases the only thing
> > we check is that there is a valid handle for each plane. If userspace
> > passes more handles, we simply ignore the extra ones.
>
> I guess we should start to check that. For 3d framebuffers with 2
> separate buffer handles for each plane I think we need to add another flag
> to addfb2, e.g.
>
> #define DRM_MODE_FB_3D_2_FRAMES (1<<1) /* separate left/right buffers, doubles plane count */
>
> and then also throw in the respective check code into the core that
> userspace supplies sufficient amounts of buffers in framebuffer_check()
> by adjusting drM_format_num_planes and drm_format_plane_cpp.
Well, we shouldn't mix the plane vs. buffers/handles/whatever concepts. The
number of planes is clearly defined by the pixel format. But yes, we should
probably add a drm_format_num_buffers() function to figure out how many buffers
are required.
But the problem is that addfb2 can't supply more than 4. So we need a new
ioctl if we want to collect all that information inside a single drm_fb
object. If we do add another ioctl then I think we should go at least to
16, since we might also want to have separate buffers for each field in
interlaced framebuffers. And then we need to clearly define which handle
is which plane/field/eye. Something like this for example:
eye=left field=top plane=0 [plane=1 ...] [field=bottom plane=0 [plane=1 ...]]
[eye=right field=top plane=0 [plane=1 ...] [field=bottom plane=0 [plane=1 ...]]]
so you first have all the planes for left/top, then all planes for
left/bottom, then right/top, and finally right/bottom.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2013-09-17 11:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 17:48 HDMI stereo support v4 Damien Lespiau
2013-09-16 17:48 ` [PATCH 01/12] drm: Move the GET_CAP macros next to the corresponding ioctl structure Damien Lespiau
2013-09-16 17:48 ` [PATCH 02/12] drm: Add a SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-16 17:48 ` [PATCH 03/12] drm: Add HDMI stereo 3D flags to struct drm_mode_modeinfo Damien Lespiau
2013-09-16 17:48 ` [PATCH 04/12] drm: Add a STEREO_3D capability to the SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-16 17:48 ` [PATCH 05/12] drm/edid: Expose mandatory stereo modes for HDMI sinks Damien Lespiau
2013-09-16 18:29 ` Ville Syrjälä
2013-09-16 21:28 ` Damien Lespiau
2013-09-17 13:48 ` Damien Lespiau
2013-09-16 17:48 ` [PATCH 06/12] drm: Extract add_hdmi_mode() out of do_hdmi_vsdb_modes() Damien Lespiau
2013-09-16 17:48 ` [PATCH 07/12] drm: Reject modes with more than 1 stereo flags set Damien Lespiau
2013-09-16 17:48 ` [PATCH 08/12] drm: Set the relevant infoframe field when scanning out a 3D mode Damien Lespiau
2013-09-16 18:59 ` Ville Syrjälä
2013-09-16 17:48 ` [PATCH 09/12] drm: Track the number of buffers that compose a framebuffer Damien Lespiau
2013-09-16 17:48 ` [PATCH 10/12] drm: Don't allow multiple buffers fb with stereo modes Damien Lespiau
2013-09-17 8:20 ` [Intel-gfx] " Ville Syrjälä
2013-09-17 9:03 ` Damien Lespiau
2013-09-17 9:54 ` Ville Syrjälä
2013-09-17 10:37 ` [Intel-gfx] " Daniel Vetter
2013-09-17 11:02 ` Ville Syrjälä [this message]
2013-09-17 13:34 ` Daniel Vetter
2013-09-17 13:20 ` Damien Lespiau
2013-09-17 13:32 ` Ville Syrjälä
2013-09-17 13:33 ` [Intel-gfx] " Daniel Vetter
2013-09-16 17:48 ` [PATCH 11/12] drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes Damien Lespiau
2013-09-17 8:22 ` Ville Syrjälä
2013-09-17 8:52 ` [Intel-gfx] " Damien Lespiau
2013-09-16 17:48 ` [PATCH 12/12] drm: Carry over the stereo flags when adding the alternate mode Damien Lespiau
2013-09-17 9:17 ` HDMI stereo support v4 Damien Lespiau
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=20130917110234.GT4531@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.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