From: Daniel Vetter Subject: Re: [PATCH v2 1/4] drm/i915: Don't populate pipe_src_{w, h} multiple times Date: Tue, 1 Oct 2013 22:03:13 +0200 Message-ID: <20131001200313.GX26592@phenom.ffwll.local> References: <20131001190352.GR26592@phenom.ffwll.local> <1380657134-22871-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by gabe.freedesktop.org (Postfix) with ESMTP id BD064E66A0 for ; Tue, 1 Oct 2013 13:02:58 -0700 (PDT) Received: by mail-ee0-f52.google.com with SMTP id c41so3610355eek.25 for ; Tue, 01 Oct 2013 13:02:55 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1380657134-22871-1-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Oct 01, 2013 at 10:52:14PM +0300, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > If we ever end up doing the retry loop due to bandwidth constraints, we > would rewrite pipe_src_{w,n} based on adjusted_mode timings. But by that > time the encoder may have already replaced the adjusted_mode with a > fixed panel mode, which would then corrupt pipe_src_{w,h}. > = > v2: Use requested_mode and slap on a big comment from Daniel > = > Signed-off-by: Ville Syrj=E4l=E4 Queued for -next, thanks for the patch. I'll wait for Rodrigo to sanity check the next patch, and the third one doesn't apply right away (and I'm lazy). -Daniel > --- > drivers/gpu/drm/i915/intel_display.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/= intel_display.c > index a91f20a..4fa97a5 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -8472,6 +8472,18 @@ intel_modeset_pipe_config(struct drm_crtc *crtc, > if (plane_bpp < 0) > goto fail; > = > + /* > + * Determine the real pipe dimensions. Note that stereo modes can > + * increase the actual pipe size due to the frame doubling and > + * insertion of additional space for blanks between the frame. This > + * is stored in the crtc timings. We use the requested mode to do this > + * computation to clearly distinguish it from the adjusted mode, which > + * can be changed by the connectors in the below retry loop. > + */ > + drm_mode_set_crtcinfo(&pipe_config->requested_mode, CRTC_STEREO_DOUBLE); > + pipe_config->pipe_src_w =3D pipe_config->requested_mode.crtc_hdisplay; > + pipe_config->pipe_src_h =3D pipe_config->requested_mode.crtc_vdisplay; > + > encoder_retry: > /* Ensure the port clock defaults are reset when retrying. */ > pipe_config->port_clock =3D 0; > @@ -8480,10 +8492,6 @@ encoder_retry: > /* Fill in default crtc timings, allow encoders to overwrite them. */ > drm_mode_set_crtcinfo(&pipe_config->adjusted_mode, CRTC_STEREO_DOUBLE); > = > - /* set_crtcinfo() may have adjusted hdisplay/vdisplay */ > - pipe_config->pipe_src_w =3D pipe_config->adjusted_mode.crtc_hdisplay; > - pipe_config->pipe_src_h =3D pipe_config->adjusted_mode.crtc_vdisplay; > - > /* Pass our mode to the connectors and the CRTC to give them a chance to > * adjust it according to limitations or connector properties, and also > * a chance to reject the mode entirely. > -- = > 1.8.1.5 > = -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch