diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-04 11:51:47 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-09-06 02:00:14 -0400 |
commit | 7fad798e16fecddd41c6a91728a09f0b9507e40c (patch) | |
tree | cd048923b124b1ccf0e3c4d4f3cbbb324deac396 /drivers/gpu/drm/i915/intel_display.c | |
parent | 24e804ba9731bf4b05bc17a6702d802e76b3bbc4 (diff) |
drm/i915: ensure the force pipe A quirk is actually followed
Many BIOSen forget to turn on the pipe A after resume (because they
actually don't turn on anything), so we have to do that ourselves when
sanitizing the hw state.
I've discovered this due to the recent addition of a pipe WARN that
takes the force quirk into account.
v2: Actually try to enable the pipe with a proper configuration instead
of simpyl switching it on with whatever random state the bios left it
in after resume.
v3: Fixup rebase conflict - the load_detect functions have lost their
encoder argument.
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index ad03db4b7a5b..090ba2dba696 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7602,6 +7602,33 @@ intel_connector_break_all_links(struct intel_connector *connector) | |||
7602 | connector->encoder->base.crtc = NULL; | 7602 | connector->encoder->base.crtc = NULL; |
7603 | } | 7603 | } |
7604 | 7604 | ||
7605 | static void intel_enable_pipe_a(struct drm_device *dev) | ||
7606 | { | ||
7607 | struct intel_connector *connector; | ||
7608 | struct drm_connector *crt = NULL; | ||
7609 | struct intel_load_detect_pipe load_detect_temp; | ||
7610 | |||
7611 | /* We can't just switch on the pipe A, we need to set things up with a | ||
7612 | * proper mode and output configuration. As a gross hack, enable pipe A | ||
7613 | * by enabling the load detect pipe once. */ | ||
7614 | list_for_each_entry(connector, | ||
7615 | &dev->mode_config.connector_list, | ||
7616 | base.head) { | ||
7617 | if (connector->encoder->type == INTEL_OUTPUT_ANALOG) { | ||
7618 | crt = &connector->base; | ||
7619 | break; | ||
7620 | } | ||
7621 | } | ||
7622 | |||
7623 | if (!crt) | ||
7624 | return; | ||
7625 | |||
7626 | if (intel_get_load_detect_pipe(crt, NULL, &load_detect_temp)) | ||
7627 | intel_release_load_detect_pipe(crt, &load_detect_temp); | ||
7628 | |||
7629 | |||
7630 | } | ||
7631 | |||
7605 | static void intel_sanitize_crtc(struct intel_crtc *crtc) | 7632 | static void intel_sanitize_crtc(struct intel_crtc *crtc) |
7606 | { | 7633 | { |
7607 | struct drm_device *dev = crtc->base.dev; | 7634 | struct drm_device *dev = crtc->base.dev; |
@@ -7650,6 +7677,15 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) | |||
7650 | } | 7677 | } |
7651 | ok: | 7678 | ok: |
7652 | 7679 | ||
7680 | if (dev_priv->quirks & QUIRK_PIPEA_FORCE && | ||
7681 | crtc->pipe == PIPE_A && !crtc->active) { | ||
7682 | /* BIOS forgot to enable pipe A, this mostly happens after | ||
7683 | * resume. Force-enable the pipe to fix this, the update_dpms | ||
7684 | * call below we restore the pipe to the right state, but leave | ||
7685 | * the required bits on. */ | ||
7686 | intel_enable_pipe_a(dev); | ||
7687 | } | ||
7688 | |||
7653 | /* Adjust the state of the output pipe according to whether we | 7689 | /* Adjust the state of the output pipe according to whether we |
7654 | * have active connectors/encoders. */ | 7690 | * have active connectors/encoders. */ |
7655 | intel_crtc_update_dpms(&crtc->base); | 7691 | intel_crtc_update_dpms(&crtc->base); |