Skip to content

Commit 7fad798

Browse files
committed
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>
1 parent 24e804b commit 7fad798

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7602,6 +7602,33 @@ intel_connector_break_all_links(struct intel_connector *connector)
76027602
connector->encoder->base.crtc = NULL;
76037603
}
76047604

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+
76057632
static void intel_sanitize_crtc(struct intel_crtc *crtc)
76067633
{
76077634
struct drm_device *dev = crtc->base.dev;
@@ -7650,6 +7677,15 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
76507677
}
76517678
ok:
76527679

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+
76537689
/* Adjust the state of the output pipe according to whether we
76547690
* have active connectors/encoders. */
76557691
intel_crtc_update_dpms(&crtc->base);

0 commit comments

Comments
 (0)