Skip to content

Commit fca0971

Browse files
committed
Merge tag 'drm-intel-fixes-2016-05-02' of git://anongit.freedesktop.org/drm-intel into drm-fixes
i915 fixes for 4.6. A bit more than I'd like at this stage, but OTOH they're all stable material. * tag 'drm-intel-fixes-2016-05-02' of git://anongit.freedesktop.org/drm-intel: drm/i915: Make RPS EI/thresholds multiple of 25 on SNB-BDW drm/i915: Fake HDMI live status drm/i915: Fix eDP low vswing for Broadwell drm/i915/ddi: Fix eDP VDD handling during booting and suspend/resume drm/i915: Fix system resume if PCI device remained enabled drm/i915: Avoid stalling on pending flips for legacy cursor updates
2 parents 80623de + 4ea3959 commit fca0971

File tree

7 files changed

+69
-15
lines changed

7 files changed

+69
-15
lines changed

drivers/gpu/drm/i915/i915_drv.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ static int i915_drm_resume(struct drm_device *dev)
792792
static int i915_drm_resume_early(struct drm_device *dev)
793793
{
794794
struct drm_i915_private *dev_priv = dev->dev_private;
795-
int ret = 0;
795+
int ret;
796796

797797
/*
798798
* We have a resume ordering issue with the snd-hda driver also
@@ -803,6 +803,36 @@ static int i915_drm_resume_early(struct drm_device *dev)
803803
* FIXME: This should be solved with a special hdmi sink device or
804804
* similar so that power domains can be employed.
805805
*/
806+
807+
/*
808+
* Note that we need to set the power state explicitly, since we
809+
* powered off the device during freeze and the PCI core won't power
810+
* it back up for us during thaw. Powering off the device during
811+
* freeze is not a hard requirement though, and during the
812+
* suspend/resume phases the PCI core makes sure we get here with the
813+
* device powered on. So in case we change our freeze logic and keep
814+
* the device powered we can also remove the following set power state
815+
* call.
816+
*/
817+
ret = pci_set_power_state(dev->pdev, PCI_D0);
818+
if (ret) {
819+
DRM_ERROR("failed to set PCI D0 power state (%d)\n", ret);
820+
goto out;
821+
}
822+
823+
/*
824+
* Note that pci_enable_device() first enables any parent bridge
825+
* device and only then sets the power state for this device. The
826+
* bridge enabling is a nop though, since bridge devices are resumed
827+
* first. The order of enabling power and enabling the device is
828+
* imposed by the PCI core as described above, so here we preserve the
829+
* same order for the freeze/thaw phases.
830+
*
831+
* TODO: eventually we should remove pci_disable_device() /
832+
* pci_enable_enable_device() from suspend/resume. Due to how they
833+
* depend on the device enable refcount we can't anyway depend on them
834+
* disabling/enabling the device.
835+
*/
806836
if (pci_enable_device(dev->pdev)) {
807837
ret = -EIO;
808838
goto out;

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,14 @@ enum skl_disp_power_wells {
29072907
#define GEN6_RP_STATE_CAP _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998)
29082908
#define BXT_RP_STATE_CAP _MMIO(0x138170)
29092909

2910-
#define INTERVAL_1_28_US(us) (((us) * 100) >> 7)
2910+
/*
2911+
* Make these a multiple of magic 25 to avoid SNB (eg. Dell XPS
2912+
* 8300) freezing up around GPU hangs. Looks as if even
2913+
* scheduling/timer interrupts start misbehaving if the RPS
2914+
* EI/thresholds are "bad", leading to a very sluggish or even
2915+
* frozen machine.
2916+
*/
2917+
#define INTERVAL_1_28_US(us) roundup(((us) * 100) >> 7, 25)
29112918
#define INTERVAL_1_33_US(us) (((us) * 3) >> 2)
29122919
#define INTERVAL_0_833_US(us) (((us) * 6) / 5)
29132920
#define GT_INTERVAL_FROM_US(dev_priv, us) (IS_GEN9(dev_priv) ? \

drivers/gpu/drm/i915/intel_ddi.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,17 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
443443
} else if (IS_BROADWELL(dev_priv)) {
444444
ddi_translations_fdi = bdw_ddi_translations_fdi;
445445
ddi_translations_dp = bdw_ddi_translations_dp;
446-
ddi_translations_edp = bdw_ddi_translations_edp;
446+
447+
if (dev_priv->edp_low_vswing) {
448+
ddi_translations_edp = bdw_ddi_translations_edp;
449+
n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
450+
} else {
451+
ddi_translations_edp = bdw_ddi_translations_dp;
452+
n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
453+
}
454+
447455
ddi_translations_hdmi = bdw_ddi_translations_hdmi;
448-
n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
456+
449457
n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
450458
n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
451459
hdmi_default_entry = 7;
@@ -3201,12 +3209,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
32013209
intel_ddi_clock_get(encoder, pipe_config);
32023210
}
32033211

3204-
static void intel_ddi_destroy(struct drm_encoder *encoder)
3205-
{
3206-
/* HDMI has nothing special to destroy, so we can go with this. */
3207-
intel_dp_encoder_destroy(encoder);
3208-
}
3209-
32103212
static bool intel_ddi_compute_config(struct intel_encoder *encoder,
32113213
struct intel_crtc_state *pipe_config)
32123214
{
@@ -3225,7 +3227,8 @@ static bool intel_ddi_compute_config(struct intel_encoder *encoder,
32253227
}
32263228

32273229
static const struct drm_encoder_funcs intel_ddi_funcs = {
3228-
.destroy = intel_ddi_destroy,
3230+
.reset = intel_dp_encoder_reset,
3231+
.destroy = intel_dp_encoder_destroy,
32293232
};
32303233

32313234
static struct intel_connector *
@@ -3324,6 +3327,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
33243327
intel_encoder->post_disable = intel_ddi_post_disable;
33253328
intel_encoder->get_hw_state = intel_ddi_get_hw_state;
33263329
intel_encoder->get_config = intel_ddi_get_config;
3330+
intel_encoder->suspend = intel_dp_encoder_suspend;
33273331

33283332
intel_dig_port->port = port;
33293333
intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &

drivers/gpu/drm/i915/intel_display.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13351,6 +13351,9 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
1335113351
}
1335213352

1335313353
for_each_crtc_in_state(state, crtc, crtc_state, i) {
13354+
if (state->legacy_cursor_update)
13355+
continue;
13356+
1335413357
ret = intel_crtc_wait_for_pending_flips(crtc);
1335513358
if (ret)
1335613359
return ret;

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4898,7 +4898,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
48984898
kfree(intel_dig_port);
48994899
}
49004900

4901-
static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
4901+
void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
49024902
{
49034903
struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
49044904

@@ -4940,7 +4940,7 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
49404940
edp_panel_vdd_schedule_off(intel_dp);
49414941
}
49424942

4943-
static void intel_dp_encoder_reset(struct drm_encoder *encoder)
4943+
void intel_dp_encoder_reset(struct drm_encoder *encoder)
49444944
{
49454945
struct intel_dp *intel_dp;
49464946

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,8 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
12381238
void intel_dp_start_link_train(struct intel_dp *intel_dp);
12391239
void intel_dp_stop_link_train(struct intel_dp *intel_dp);
12401240
void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
1241+
void intel_dp_encoder_reset(struct drm_encoder *encoder);
1242+
void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
12411243
void intel_dp_encoder_destroy(struct drm_encoder *encoder);
12421244
int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
12431245
bool intel_dp_compute_config(struct intel_encoder *encoder,

drivers/gpu/drm/i915/intel_hdmi.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,8 +1415,16 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
14151415
hdmi_to_dig_port(intel_hdmi));
14161416
}
14171417

1418-
if (!live_status)
1419-
DRM_DEBUG_KMS("Live status not up!");
1418+
if (!live_status) {
1419+
DRM_DEBUG_KMS("HDMI live status down\n");
1420+
/*
1421+
* Live status register is not reliable on all intel platforms.
1422+
* So consider live_status only for certain platforms, for
1423+
* others, read EDID to determine presence of sink.
1424+
*/
1425+
if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv))
1426+
live_status = true;
1427+
}
14201428

14211429
intel_hdmi_unset_edid(connector);
14221430

0 commit comments

Comments
 (0)