Skip to content

Commit

Permalink
drm/i915: Add missing NULL check before calling initial_watermarks
Browse files Browse the repository at this point in the history
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 ed4a6a7 ("drm/i915: Add two-stage ILK-style watermark programming (v11)")
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1456776633-3401-1-git-send-email-imre.deak@intel.com
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
  • Loading branch information
Imre Deak committed Mar 1, 2016
1 parent c6a2ac7 commit 1d5bf5d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1d5bf5d

Please sign in to comment.