drm/i915: Fix for ringbuf space wait in LRC mode
[deliverable/linux.git] / drivers / gpu / drm / i915 / intel_dvo.c
index d8579510beb018fc92ce0fb2a739b5b4a4d95b9b..f2ed122615ae7ff50d5435b4bed4b6c381774956 100644 (file)
@@ -393,6 +393,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = {
        .fill_modes = drm_helper_probe_single_connector_modes,
        .atomic_get_property = intel_connector_atomic_get_property,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
+       .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
 };
 
 static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs = {
@@ -494,6 +495,8 @@ void intel_dvo_init(struct drm_device *dev)
                struct i2c_adapter *i2c;
                int gpio;
                bool dvoinit;
+               enum pipe pipe;
+               uint32_t dpll[2];
 
                /* Allow the I2C driver info to specify the GPIO to be used in
                 * special cases, but otherwise default to what's defined
@@ -519,8 +522,23 @@ void intel_dvo_init(struct drm_device *dev)
                 */
                intel_gmbus_force_bit(i2c, true);
 
+               /* ns2501 requires the DVO 2x clock before it will
+                * respond to i2c accesses, so make sure we have
+                * have the clock enabled before we attempt to
+                * initialize the device.
+                */
+               for_each_pipe(dev_priv, pipe) {
+                       dpll[pipe] = I915_READ(DPLL(pipe));
+                       I915_WRITE(DPLL(pipe), dpll[pipe] | DPLL_DVO_2X_MODE);
+               }
+
                dvoinit = dvo->dev_ops->init(&intel_dvo->dev, i2c);
 
+               /* restore the DVO 2x clock state to original */
+               for_each_pipe(dev_priv, pipe) {
+                       I915_WRITE(DPLL(pipe), dpll[pipe]);
+               }
+
                intel_gmbus_force_bit(i2c, false);
 
                if (!dvoinit)
This page took 0.039484 seconds and 5 git commands to generate.