Commit 2e938892 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915/crt: explicitly set up HOTPLUG_BITS on resume

... instead of relying on the register save/restore madness to do this.

To extract a bit of code call drm_mode_config_reset both on resume
and boot-up and move the hw state frobbing from the crt_init to the
->reset callback. The crt connector is the only one with a ->reset
callback, hence we can easily do this.
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 912d812e
...@@ -547,7 +547,6 @@ static int i915_drm_thaw(struct drm_device *dev) ...@@ -547,7 +547,6 @@ static int i915_drm_thaw(struct drm_device *dev)
intel_modeset_init_hw(dev); intel_modeset_init_hw(dev);
intel_modeset_setup_hw_state(dev); intel_modeset_setup_hw_state(dev);
drm_mode_config_reset(dev);
drm_irq_install(dev); drm_irq_install(dev);
} }
......
...@@ -662,10 +662,22 @@ static int intel_crt_set_property(struct drm_connector *connector, ...@@ -662,10 +662,22 @@ static int intel_crt_set_property(struct drm_connector *connector,
static void intel_crt_reset(struct drm_connector *connector) static void intel_crt_reset(struct drm_connector *connector)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crt *crt = intel_attached_crt(connector); struct intel_crt *crt = intel_attached_crt(connector);
if (HAS_PCH_SPLIT(dev)) if (HAS_PCH_SPLIT(dev)) {
u32 adpa;
adpa = I915_READ(PCH_ADPA);
adpa &= ~ADPA_CRT_HOTPLUG_MASK;
adpa |= ADPA_HOTPLUG_BITS;
I915_WRITE(PCH_ADPA, adpa);
POSTING_READ(PCH_ADPA);
DRM_DEBUG_KMS("pch crt adpa set to 0x%x\n", adpa);
crt->force_hotplug_required = 1; crt->force_hotplug_required = 1;
}
} }
/* /*
...@@ -784,18 +796,6 @@ void intel_crt_init(struct drm_device *dev) ...@@ -784,18 +796,6 @@ void intel_crt_init(struct drm_device *dev)
* Configure the automatic hotplug detection stuff * Configure the automatic hotplug detection stuff
*/ */
crt->force_hotplug_required = 0; crt->force_hotplug_required = 0;
if (HAS_PCH_SPLIT(dev)) {
u32 adpa;
adpa = I915_READ(PCH_ADPA);
adpa &= ~ADPA_CRT_HOTPLUG_MASK;
adpa |= ADPA_HOTPLUG_BITS;
I915_WRITE(PCH_ADPA, adpa);
POSTING_READ(PCH_ADPA);
DRM_DEBUG_KMS("pch crt adpa set to 0x%x\n", adpa);
crt->force_hotplug_required = 1;
}
dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS; dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS;
} }
...@@ -8598,6 +8598,8 @@ void intel_modeset_setup_hw_state(struct drm_device *dev) ...@@ -8598,6 +8598,8 @@ void intel_modeset_setup_hw_state(struct drm_device *dev)
intel_modeset_update_staged_output_state(dev); intel_modeset_update_staged_output_state(dev);
intel_modeset_check_state(dev); intel_modeset_check_state(dev);
drm_mode_config_reset(dev);
} }
void intel_modeset_gem_init(struct drm_device *dev) void intel_modeset_gem_init(struct drm_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment