From: Daniel Vetter Subject: Re: [Intel-gfx] [PATCH 10/12] drm: Don't allow multiple buffers fb with stereo modes Date: Tue, 17 Sep 2013 12:37:48 +0200 Message-ID: <20130917103748.GM32145@phenom.ffwll.local> References: <1379353735-4472-1-git-send-email-damien.lespiau@intel.com> <1379353735-4472-11-git-send-email-damien.lespiau@intel.com> <20130917082046.GP4531@intel.com> <20130917090312.GG29268@strange.amr.corp.intel.com> <20130917095409.GR4531@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by gabe.freedesktop.org (Postfix) with ESMTP id B6076E725F for ; Tue, 17 Sep 2013 03:37:33 -0700 (PDT) Received: by mail-ea0-f173.google.com with SMTP id g10so2625324eak.32 for ; Tue, 17 Sep 2013 03:37:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130917095409.GR4531@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Sep 17, 2013 at 12:54:09PM +0300, Ville Syrj=E4l=E4 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=E4l=E4 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 =3D -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, doub= les 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. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch