Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
"i915, tda998x and vmwgfx fixes,

The main one is i915 fix for missing VGA connectors, along with some
fixes for the tda998x from Russell fixing some modesetting problems.

(still on holidays, but got a spare moment to find these)"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/vmwgfx: Fix incorrect write to read-only register v2:
drm/i915: Drop early VLV WA to fix Voltage not getting dropped to Vmin
drm/i915: only apply crt_present check on VLV
drm/i915: Wait for vblank after enabling the primary plane on BDW
drm/i2c: tda998x: add some basic mode validation
drm/i2c: tda998x: faster polling for edid
drm/i2c: tda998x: move drm_i2c_encoder_destroy call

+51 -5
+9 -3
drivers/gpu/drm/i2c/tda998x_drv.c
··· 810 tda998x_encoder_mode_valid(struct drm_encoder *encoder, 811 struct drm_display_mode *mode) 812 { 813 return MODE_OK; 814 } 815 ··· 1054 return i; 1055 } 1056 } else { 1057 - for (i = 10; i > 0; i--) { 1058 - msleep(10); 1059 ret = reg_read(priv, REG_INT_FLAGS_2); 1060 if (ret < 0) 1061 return ret; ··· 1189 tda998x_encoder_destroy(struct drm_encoder *encoder) 1190 { 1191 struct tda998x_priv *priv = to_tda998x_priv(encoder); 1192 - drm_i2c_encoder_destroy(encoder); 1193 1194 /* disable all IRQs and free the IRQ handler */ 1195 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); ··· 1198 1199 if (priv->cec) 1200 i2c_unregister_device(priv->cec); 1201 kfree(priv); 1202 } 1203
··· 810 tda998x_encoder_mode_valid(struct drm_encoder *encoder, 811 struct drm_display_mode *mode) 812 { 813 + if (mode->clock > 150000) 814 + return MODE_CLOCK_HIGH; 815 + if (mode->htotal >= BIT(13)) 816 + return MODE_BAD_HVALUE; 817 + if (mode->vtotal >= BIT(11)) 818 + return MODE_BAD_VVALUE; 819 return MODE_OK; 820 } 821 ··· 1048 return i; 1049 } 1050 } else { 1051 + for (i = 100; i > 0; i--) { 1052 + msleep(1); 1053 ret = reg_read(priv, REG_INT_FLAGS_2); 1054 if (ret < 0) 1055 return ret; ··· 1183 tda998x_encoder_destroy(struct drm_encoder *encoder) 1184 { 1185 struct tda998x_priv *priv = to_tda998x_priv(encoder); 1186 1187 /* disable all IRQs and free the IRQ handler */ 1188 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); ··· 1193 1194 if (priv->cec) 1195 i2c_unregister_device(priv->cec); 1196 + drm_i2c_encoder_destroy(encoder); 1197 kfree(priv); 1198 } 1199
+26 -1
drivers/gpu/drm/i915/intel_display.c
··· 2087 static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv, 2088 enum plane plane, enum pipe pipe) 2089 { 2090 struct intel_crtc *intel_crtc = 2091 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 2092 int reg; ··· 2107 2108 I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); 2109 intel_flush_primary_plane(dev_priv, plane); 2110 } 2111 2112 /** ··· 11097 return names[output]; 11098 } 11099 11100 static void intel_setup_outputs(struct drm_device *dev) 11101 { 11102 struct drm_i915_private *dev_priv = dev->dev_private; ··· 11121 11122 intel_lvds_init(dev); 11123 11124 - if (!IS_ULT(dev) && !IS_CHERRYVIEW(dev) && dev_priv->vbt.int_crt_support) 11125 intel_crt_init(dev); 11126 11127 if (HAS_DDI(dev)) {
··· 2087 static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv, 2088 enum plane plane, enum pipe pipe) 2089 { 2090 + struct drm_device *dev = dev_priv->dev; 2091 struct intel_crtc *intel_crtc = 2092 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 2093 int reg; ··· 2106 2107 I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); 2108 intel_flush_primary_plane(dev_priv, plane); 2109 + 2110 + /* 2111 + * BDW signals flip done immediately if the plane 2112 + * is disabled, even if the plane enable is already 2113 + * armed to occur at the next vblank :( 2114 + */ 2115 + if (IS_BROADWELL(dev)) 2116 + intel_wait_for_vblank(dev, intel_crtc->pipe); 2117 } 2118 2119 /** ··· 11088 return names[output]; 11089 } 11090 11091 + static bool intel_crt_present(struct drm_device *dev) 11092 + { 11093 + struct drm_i915_private *dev_priv = dev->dev_private; 11094 + 11095 + if (IS_ULT(dev)) 11096 + return false; 11097 + 11098 + if (IS_CHERRYVIEW(dev)) 11099 + return false; 11100 + 11101 + if (IS_VALLEYVIEW(dev) && !dev_priv->vbt.int_crt_support) 11102 + return false; 11103 + 11104 + return true; 11105 + } 11106 + 11107 static void intel_setup_outputs(struct drm_device *dev) 11108 { 11109 struct drm_i915_private *dev_priv = dev->dev_private; ··· 11096 11097 intel_lvds_init(dev); 11098 11099 + if (intel_crt_present(dev)) 11100 intel_crt_init(dev); 11101 11102 if (HAS_DDI(dev)) {
+8
drivers/gpu/drm/i915/intel_pm.c
··· 3209 */ 3210 static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) 3211 { 3212 /* 3213 * When we are idle. Drop to min voltage state. 3214 */
··· 3209 */ 3210 static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) 3211 { 3212 + struct drm_device *dev = dev_priv->dev; 3213 + 3214 + /* Latest VLV doesn't need to force the gfx clock */ 3215 + if (dev->pdev->revision >= 0xd) { 3216 + valleyview_set_rps(dev_priv->dev, dev_priv->rps.min_freq_softlimit); 3217 + return; 3218 + } 3219 + 3220 /* 3221 * When we are idle. Drop to min voltage state. 3222 */
+8
drivers/gpu/drm/i915/intel_sprite.c
··· 691 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 692 693 /* 694 * FIXME IPS should be fine as long as one plane is 695 * enabled, but in practice it seems to have problems 696 * when going from primary only to sprite only and vice
··· 691 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 692 693 /* 694 + * BDW signals flip done immediately if the plane 695 + * is disabled, even if the plane enable is already 696 + * armed to occur at the next vblank :( 697 + */ 698 + if (IS_BROADWELL(dev)) 699 + intel_wait_for_vblank(dev, intel_crtc->pipe); 700 + 701 + /* 702 * FIXME IPS should be fine as long as one plane is 703 * enabled, but in practice it seems to have problems 704 * when going from primary only to sprite only and vice
-1
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
··· 179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); 180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); 181 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); 182 - vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length); 183 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); 184 } 185
··· 179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); 180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); 181 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); 182 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); 183 } 184