public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/i915: Don't populate pipe_src_{w, h} multiple times
Date: Tue, 1 Oct 2013 22:14:08 +0300	[thread overview]
Message-ID: <20131001191408.GS9395@intel.com> (raw)
In-Reply-To: <20131001190352.GR26592@phenom.ffwll.local>

On Tue, Oct 01, 2013 at 09:03:52PM +0200, Daniel Vetter wrote:
> On Tue, Oct 01, 2013 at 04:13:28PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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}.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a91f20a..a695888 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -8472,6 +8472,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
> >  	if (plane_bpp < 0)
> >  		goto fail;
> >  
> > +	/* Determine the real pipe dimensions */
> 
> I think it'll benefit clarity a bit if we'd use the requested mode
> here (even though we never really care about it's crtc timings anywhere
> else).

Yeah that could be more clear.

> 
> This needs more comment imo. What about the following instead?
> 
> "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."
> 

Sure. I'll slap that on and send a v2.

> Cheers, Daniel
> 
> > +	drm_mode_set_crtcinfo(&pipe_config->adjusted_mode, CRTC_STEREO_DOUBLE);
> > +	pipe_config->pipe_src_w = pipe_config->adjusted_mode.crtc_hdisplay;
> > +	pipe_config->pipe_src_h = pipe_config->adjusted_mode.crtc_vdisplay;
> > +
> >  encoder_retry:
> >  	/* Ensure the port clock defaults are reset when retrying. */
> >  	pipe_config->port_clock = 0;
> > @@ -8480,10 +8485,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 = pipe_config->adjusted_mode.crtc_hdisplay;
> > -	pipe_config->pipe_src_h = 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
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-10-01 19:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 13:13 [PATCH 0/4] drm/i915: Some sanity checks for modes ville.syrjala
2013-10-01 13:13 ` [PATCH 1/4] drm/i915: Don't populate pipe_src_{w, h} multiple times ville.syrjala
2013-10-01 19:03   ` Daniel Vetter
2013-10-01 19:14     ` Ville Syrjälä [this message]
2013-10-01 19:52     ` [PATCH v2 " ville.syrjala
2013-10-01 20:03       ` Daniel Vetter
2013-10-01 13:13 ` [PATCH 2/4] drm/i915: Reject modes where hdisplay or vdisplay is too small ville.syrjala
2013-10-01 20:08   ` Rodrigo Vivi
2013-10-01 20:55     ` Ville Syrjälä
2013-10-01 21:08       ` Rodrigo Vivi
2013-10-01 13:13 ` [PATCH 3/4] drm/915: Make sure pipe source size isn't zero ville.syrjala
2013-10-01 13:13 ` [PATCH 4/4] drm/i915: Do some basic sanity adjustments on the user provided mode ville.syrjala
2013-10-01 19:06   ` Daniel Vetter
2013-10-01 19:12     ` Ville Syrjälä

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=20131001191408.GS9395@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --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