From: Damien Lespiau <damien.lespiau@intel.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 6/9] drm: Add a DRM_CAP_STEREO_3D capability for SET_CAP ioctl
Date: Sun, 8 Sep 2013 15:49:51 +0100 [thread overview]
Message-ID: <20130908144951.GA1175@strange.config> (raw)
In-Reply-To: <CANq1E4TbgCXdPhmDhFZQxGBb+szRCAcAGnMKZfe+oKXCOn5jew@mail.gmail.com>
On Sun, Sep 08, 2013 at 03:50:29PM +0200, David Herrmann wrote:
> Hi
>
> On Fri, Sep 6, 2013 at 8:57 PM, Damien Lespiau <damien.lespiau@intel.com> wrote:
> > This capability allows user space to control the delivery of modes with
> > the 3D flags set. This is to not play games with current user space
> > users not knowing anything about stereo 3D flags and that could try
> > to set a mode with one or several of those bits set.
> >
> > So, the plan is to remove the stereo 3D flags from the user mode
> > modeinfo structure by default, and let them through if we are being told
> > otherwise.
> >
> > stereo_allowed is bound to the drm_file structure to make it a
> > per-client setting, not a global one.
> >
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> > drivers/gpu/drm/drm_crtc.c | 16 +++++++++++++---
> > drivers/gpu/drm/drm_ioctl.c | 14 +++++++++++++-
> > include/drm/drmP.h | 3 +++
> > include/uapi/drm/drm.h | 9 +++++++++
> > 4 files changed, 38 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index a691764..ff9646f 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -1257,12 +1257,14 @@ EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
> > * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo
> > * @out: drm_mode_modeinfo struct to return to the user
> > * @in: drm_display_mode to use
> > + * @file_priv: drm file from the ioctl call
> > *
> > * Convert a drm_display_mode into a drm_mode_modeinfo structure to return to
> > * the user.
> > */
> > static void drm_crtc_convert_to_umode(struct drm_mode_modeinfo *out,
> > - const struct drm_display_mode *in)
> > + const struct drm_display_mode *in,
> > + const struct drm_file *file_priv)
> > {
> > WARN(in->hdisplay > USHRT_MAX || in->hsync_start > USHRT_MAX ||
> > in->hsync_end > USHRT_MAX || in->htotal > USHRT_MAX ||
> > @@ -1287,6 +1289,13 @@ static void drm_crtc_convert_to_umode(struct drm_mode_modeinfo *out,
> > out->type = in->type;
> > strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
> > out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
> > +
> > + /*
> > + * If user-space hasn't configured the driver to expose the stereo 3D
> > + * flags, clear them.
> > + */
> > + if (!file_priv->stereo_allowed)
> > + out->flags &= ~DRM_MODE_FLAG_3D_MASK;
>
> So just to be clear: Whenever a mode is present with 3D flags, it is
> also a valid non-3D mode? Is this guaranteed? Don't you want to add a
> mode twice, once without 3D flags and once with? You could then just
> skip all 3D modes for clients that don't support it.
>
> I have no idea how the 3D flags are specified, just want to go sure
> this doesn't break. So whenever a mode with 3D flags is present on a
> device, it can be set by a client dropping the 3D flags and it will be
> a valid mono-mode?
So yes, that's exactly what happens right now. I was actually thinking
about a v4 of the series with what you said in the first paragraph: just
add the 3D modes to the list, one mode per 3D layout, and drop those
modes from the list given back to userspace when the stereo_allowed
isn't set. That seems quite a bit better than the convoluted approach
here.
--
Damien
next prev parent reply other threads:[~2013-09-08 14:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 18:57 Stereo 3D v3 Damien Lespiau
2013-09-06 18:57 ` [PATCH 1/9] drm: Move the GET_CAP macros next to the corresponding ioctl structure Damien Lespiau
2013-09-08 13:20 ` David Herrmann
2013-09-06 18:57 ` [PATCH 2/9] drm: Sort userspace typedefs by ioctl number Damien Lespiau
2013-09-06 18:57 ` [PATCH 3/9] drm: Make sure every ioctl structure has a typedef Damien Lespiau
2013-09-08 11:58 ` Daniel Vetter
2013-09-08 19:36 ` Damien Lespiau
2013-09-08 20:04 ` Daniel Vetter
2013-09-06 18:57 ` [PATCH 4/9] drm: Add a SET_CAP ioctl Damien Lespiau
2013-09-06 18:57 ` [PATCH 5/9] drm: Add HDMI stereo 3D flags to struct drm_mode_modeinfo Damien Lespiau
2013-09-06 18:57 ` [PATCH 6/9] drm: Add a DRM_CAP_STEREO_3D capability for SET_CAP ioctl Damien Lespiau
2013-09-08 13:50 ` David Herrmann
2013-09-08 14:49 ` Damien Lespiau [this message]
2013-09-13 16:04 ` Joakim Plate
2013-09-16 17:39 ` [PATCH 6/9] drm: Add a DRM_CAP_STEREO_3D capability for SET_CAP?ioctl Damien Lespiau
2013-09-06 18:57 ` [PATCH 7/9] drm/edid: Expose mandatory stereo modes for HDMI sinks Damien Lespiau
2013-09-13 16:10 ` Joakim Plate
2013-09-13 16:31 ` Daniel Vetter
2013-09-16 17:35 ` Damien Lespiau
2013-09-16 17:56 ` Ville Syrjälä
2013-09-16 18:20 ` Daniel Vetter
2013-09-16 18:04 ` Daniel Vetter
2013-09-17 9:22 ` Damien Lespiau
2013-09-06 18:57 ` [PATCH 8/9] drm: Reject modes with more than 1 stereo flags set Damien Lespiau
2013-09-06 18:57 ` [PATCH 9/9] drm: Set the relevant infoframe field when scanning out a 3D mode Damien Lespiau
2013-09-06 19:11 ` Stereo 3D v3 Chris Wilson
2013-09-08 11:59 ` Daniel Vetter
2013-09-08 13:46 ` David Herrmann
2013-09-08 15:03 ` Damien Lespiau
2013-09-08 20:05 ` Daniel Vetter
2013-09-10 14:14 ` Chris Wilson
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=20130908144951.GA1175@strange.config \
--to=damien.lespiau@intel.com \
--cc=dh.herrmann@gmail.com \
--cc=dri-devel@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 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.