All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Add missing NULL check before calling initial_watermarks
Date: Mon, 29 Feb 2016 23:35:44 +0200	[thread overview]
Message-ID: <1456781744.30042.2.camel@intel.com> (raw)
In-Reply-To: <20160229210626.GD4175@intel.com>

On Mon, 2016-02-29 at 13:06 -0800, Matt Roper wrote:
> On Mon, Feb 29, 2016 at 10:10:33PM +0200, Imre Deak wrote:
> > Not all platforms set this callback, so NULL check it before
> > calling it.
> > 
> > v2:
> > - Call intel_update_watermarks() on HSW+ where the callback is not
> > set.
> >   (Matt)
> > 
> > CC: Matt Roper <matthew.d.roper@intel.com>
> > Fixes: commit ed4a6a7c ("drm/i915: Add two-stage ILK-style
> > watermark programming (v11)")
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
> 
> Technically the change in ironlake_crtc_enable() shouldn't be
> necessary
> since all platforms that use that do have atomic watermarks, but
> adding
> the check certainly doesn't hurt anything.

The callback is set only conditionally even on those platforms,
depending on whether the WM readout succeeded, so I thought it's safer
this way.

--Imre

> Matt
> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > index 79bf527..d4b0ad0 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -4957,7 +4957,8 @@ static void ironlake_crtc_enable(struct
> > drm_crtc *crtc)
> >  	 */
> >  	intel_crtc_load_lut(crtc);
> >  
> > -	dev_priv->display.initial_watermarks(intel_crtc->config);
> > +	if (dev_priv->display.initial_watermarks != NULL)
> > +		dev_priv->display.initial_watermarks(intel_crtc-
> > >config);
> >  	intel_enable_pipe(intel_crtc);
> >  
> >  	if (intel_crtc->config->has_pch_encoder)
> > @@ -5056,7 +5057,10 @@ static void haswell_crtc_enable(struct
> > drm_crtc *crtc)
> >  	if (!intel_crtc->config->has_dsi_encoder)
> >  		intel_ddi_enable_transcoder_func(crtc);
> >  
> > -	dev_priv->display.initial_watermarks(pipe_config);
> > +	if (dev_priv->display.initial_watermarks != NULL)
> > +		dev_priv->display.initial_watermarks(pipe_config);
> > +	else
> > +		intel_update_watermarks(crtc);
> >  	intel_enable_pipe(intel_crtc);
> >  
> >  	if (intel_crtc->config->has_pch_encoder)
> > -- 
> > 2.5.0
> > 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-02-29 21:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 19:20 [PATCH] drm/i915: Add missing NULL check before calling initial_watermarks Imre Deak
2016-02-29 19:49 ` Matt Roper
2016-02-29 20:10 ` [PATCH v2] " Imre Deak
2016-02-29 21:06   ` Matt Roper
2016-02-29 21:35     ` Imre Deak [this message]
2016-03-01  7:24 ` ✗ Fi.CI.BAT: failure for drm/i915: Add missing NULL check before calling initial_watermarks (rev2) Patchwork
2016-03-01 10:32   ` Imre Deak
2016-03-01 10:42     ` Imre Deak
2016-03-01 10:45     ` Ville Syrjälä
2016-03-01 11:30       ` Imre Deak

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=1456781744.30042.2.camel@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    /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.