Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+69 -15
+31 -1
drivers/gpu/drm/i915/i915_drv.c
··· 792 792 static int i915_drm_resume_early(struct drm_device *dev) 793 793 { 794 794 struct drm_i915_private *dev_priv = dev->dev_private; 795 - int ret = 0; 795 + int ret; 796 796 797 797 /* 798 798 * We have a resume ordering issue with the snd-hda driver also ··· 802 802 * 803 803 * FIXME: This should be solved with a special hdmi sink device or 804 804 * similar so that power domains can be employed. 805 + */ 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. 805 835 */ 806 836 if (pci_enable_device(dev->pdev)) { 807 837 ret = -EIO;
+8 -1
drivers/gpu/drm/i915/i915_reg.h
··· 2907 2907 #define GEN6_RP_STATE_CAP _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998) 2908 2908 #define BXT_RP_STATE_CAP _MMIO(0x138170) 2909 2909 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) 2911 2918 #define INTERVAL_1_33_US(us) (((us) * 3) >> 2) 2912 2919 #define INTERVAL_0_833_US(us) (((us) * 6) / 5) 2913 2920 #define GT_INTERVAL_FROM_US(dev_priv, us) (IS_GEN9(dev_priv) ? \
+13 -9
drivers/gpu/drm/i915/intel_ddi.c
··· 443 443 } else if (IS_BROADWELL(dev_priv)) { 444 444 ddi_translations_fdi = bdw_ddi_translations_fdi; 445 445 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 + 447 455 ddi_translations_hdmi = bdw_ddi_translations_hdmi; 448 - n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp); 456 + 449 457 n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp); 450 458 n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi); 451 459 hdmi_default_entry = 7; ··· 3209 3201 intel_ddi_clock_get(encoder, pipe_config); 3210 3202 } 3211 3203 3212 - static void intel_ddi_destroy(struct drm_encoder *encoder) 3213 - { 3214 - /* HDMI has nothing special to destroy, so we can go with this. */ 3215 - intel_dp_encoder_destroy(encoder); 3216 - } 3217 - 3218 3204 static bool intel_ddi_compute_config(struct intel_encoder *encoder, 3219 3205 struct intel_crtc_state *pipe_config) 3220 3206 { ··· 3227 3225 } 3228 3226 3229 3227 static const struct drm_encoder_funcs intel_ddi_funcs = { 3230 - .destroy = intel_ddi_destroy, 3228 + .reset = intel_dp_encoder_reset, 3229 + .destroy = intel_dp_encoder_destroy, 3231 3230 }; 3232 3231 3233 3232 static struct intel_connector * ··· 3327 3324 intel_encoder->post_disable = intel_ddi_post_disable; 3328 3325 intel_encoder->get_hw_state = intel_ddi_get_hw_state; 3329 3326 intel_encoder->get_config = intel_ddi_get_config; 3327 + intel_encoder->suspend = intel_dp_encoder_suspend; 3330 3328 3331 3329 intel_dig_port->port = port; 3332 3330 intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
+3
drivers/gpu/drm/i915/intel_display.c
··· 13351 13351 } 13352 13352 13353 13353 for_each_crtc_in_state(state, crtc, crtc_state, i) { 13354 + if (state->legacy_cursor_update) 13355 + continue; 13356 + 13354 13357 ret = intel_crtc_wait_for_pending_flips(crtc); 13355 13358 if (ret) 13356 13359 return ret;
+2 -2
drivers/gpu/drm/i915/intel_dp.c
··· 4898 4898 kfree(intel_dig_port); 4899 4899 } 4900 4900 4901 - static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) 4901 + void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) 4902 4902 { 4903 4903 struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base); 4904 4904 ··· 4940 4940 edp_panel_vdd_schedule_off(intel_dp); 4941 4941 } 4942 4942 4943 - static void intel_dp_encoder_reset(struct drm_encoder *encoder) 4943 + void intel_dp_encoder_reset(struct drm_encoder *encoder) 4944 4944 { 4945 4945 struct intel_dp *intel_dp; 4946 4946
+2
drivers/gpu/drm/i915/intel_drv.h
··· 1238 1238 void intel_dp_start_link_train(struct intel_dp *intel_dp); 1239 1239 void intel_dp_stop_link_train(struct intel_dp *intel_dp); 1240 1240 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); 1241 1243 void intel_dp_encoder_destroy(struct drm_encoder *encoder); 1242 1244 int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc); 1243 1245 bool intel_dp_compute_config(struct intel_encoder *encoder,
+10 -2
drivers/gpu/drm/i915/intel_hdmi.c
··· 1415 1415 hdmi_to_dig_port(intel_hdmi)); 1416 1416 } 1417 1417 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 + } 1420 1428 1421 1429 intel_hdmi_unset_edid(connector); 1422 1430