Skip to content

Commit cf26f67

Browse files
ideakgregkh
authored andcommitted
drm/i915/ddi: Fix eDP VDD handling during booting and suspend/resume
commit 5eaa60c7109b40f17ac81090bc8b90482da76cd1 upstream. The driver's VDD on/off logic assumes that whenever the VDD is on we also hold an AUX power domain reference. Since BIOS can leave the VDD on during booting and resuming and on DDI platforms we won't take a corresponding power reference, the above assumption won't hold on those platforms and an eventual delayed VDD off work will do an extraneous AUX power domain put resulting in a refcount underflow. Fix this the same way we did this for non-DDI DP encoders: commit 6d93c0c ("drm/i915: fix VDD state tracking after system resume") At the same time call the DP encoder suspend handler the same way as the non-DDI DP encoders do to flush any pending VDD off work. Leaving the work running may cause a HW access where we don't expect this (at a point where power domains are suspended already). While at it remove an unnecessary function call indirection. This fixed for me AUX refcount underflow problems on BXT during suspend/resume. CC: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1460963062-13211-4-git-send-email-imre.deak@intel.com (cherry picked from commit bf93ba67e9c05882f05b7ca2d773cfc8bf462c2a) Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6b5f7a6 commit cf26f67

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

drivers/gpu/drm/i915/intel_ddi.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,12 +3188,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
31883188
intel_ddi_clock_get(encoder, pipe_config);
31893189
}
31903190

3191-
static void intel_ddi_destroy(struct drm_encoder *encoder)
3192-
{
3193-
/* HDMI has nothing special to destroy, so we can go with this. */
3194-
intel_dp_encoder_destroy(encoder);
3195-
}
3196-
31973191
static bool intel_ddi_compute_config(struct intel_encoder *encoder,
31983192
struct intel_crtc_state *pipe_config)
31993193
{
@@ -3212,7 +3206,8 @@ static bool intel_ddi_compute_config(struct intel_encoder *encoder,
32123206
}
32133207

32143208
static const struct drm_encoder_funcs intel_ddi_funcs = {
3215-
.destroy = intel_ddi_destroy,
3209+
.reset = intel_dp_encoder_reset,
3210+
.destroy = intel_dp_encoder_destroy,
32163211
};
32173212

32183213
static struct intel_connector *
@@ -3284,6 +3279,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
32843279
intel_encoder->post_disable = intel_ddi_post_disable;
32853280
intel_encoder->get_hw_state = intel_ddi_get_hw_state;
32863281
intel_encoder->get_config = intel_ddi_get_config;
3282+
intel_encoder->suspend = intel_dp_encoder_suspend;
32873283

32883284
intel_dig_port->port = port;
32893285
intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5035,7 +5035,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
50355035
kfree(intel_dig_port);
50365036
}
50375037

5038-
static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
5038+
void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
50395039
{
50405040
struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
50415041

@@ -5077,7 +5077,7 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
50775077
edp_panel_vdd_schedule_off(intel_dp);
50785078
}
50795079

5080-
static void intel_dp_encoder_reset(struct drm_encoder *encoder)
5080+
void intel_dp_encoder_reset(struct drm_encoder *encoder)
50815081
{
50825082
struct intel_dp *intel_dp;
50835083

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,8 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
12041204
void intel_dp_start_link_train(struct intel_dp *intel_dp);
12051205
void intel_dp_stop_link_train(struct intel_dp *intel_dp);
12061206
void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
1207+
void intel_dp_encoder_reset(struct drm_encoder *encoder);
1208+
void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
12071209
void intel_dp_encoder_destroy(struct drm_encoder *encoder);
12081210
int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
12091211
bool intel_dp_compute_config(struct intel_encoder *encoder,

0 commit comments

Comments
 (0)