summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2014-06-21 05:38:28 +0000
committerjsg <jsg@openbsd.org>2014-06-21 05:38:28 +0000
commit260781fa97a5acadc939da1529b646849027231f (patch)
tree301fc0de09ce27c9ed3aaa479c8d62da813c1945
parentdrm/radeon/si: make sure mc ucode is loaded before checking the size (diff)
downloadwireguard-openbsd-260781fa97a5acadc939da1529b646849027231f.tar.xz
wireguard-openbsd-260781fa97a5acadc939da1529b646849027231f.zip
drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()
From Egbert Eich 9e68a1156da093385f057b9e4576652203f1248e in ubuntu 3.8 7f1950fbb989e8fc5463b307e062b4529d51c862 in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/intel_display.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/pci/drm/i915/intel_display.c b/sys/dev/pci/drm/i915/intel_display.c
index 54b5b2ff83f..5c5a4d9e94d 100644
--- a/sys/dev/pci/drm/i915/intel_display.c
+++ b/sys/dev/pci/drm/i915/intel_display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_display.c,v 1.35 2014/05/03 05:11:30 jsg Exp $ */
+/* $OpenBSD: intel_display.c,v 1.36 2014/06/21 05:38:28 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
@@ -9168,15 +9168,6 @@ void intel_modeset_init(struct drm_device *dev)
intel_setup_outputs(dev);
}
-static void
-intel_connector_break_all_links(struct intel_connector *connector)
-{
- connector->base.dpms = DRM_MODE_DPMS_OFF;
- connector->base.encoder = NULL;
- connector->encoder->connectors_active = false;
- connector->encoder->base.crtc = NULL;
-}
-
static void intel_enable_pipe_a(struct drm_device *dev)
{
struct intel_connector *connector;
@@ -9258,8 +9249,17 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
if (connector->encoder->base.crtc != &crtc->base)
continue;
- intel_connector_break_all_links(connector);
+ connector->base.dpms = DRM_MODE_DPMS_OFF;
+ connector->base.encoder = NULL;
}
+ /* multiple connectors may have the same encoder:
+ * handle them and break crtc link separately */
+ list_for_each_entry(connector, &dev->mode_config.connector_list,
+ base.head)
+ if (connector->encoder->base.crtc == &crtc->base) {
+ connector->encoder->base.crtc = NULL;
+ connector->encoder->connectors_active = false;
+ }
WARN_ON(crtc->active);
crtc->base.enabled = false;
@@ -9330,6 +9330,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
drm_get_encoder_name(&encoder->base));
encoder->disable(encoder);
}
+ encoder->base.crtc = NULL;
+ encoder->connectors_active = false;
/* Inconsistent output/port/pipe state happens presumably due to
* a bug in one of the get_hw_state functions. Or someplace else
@@ -9340,8 +9342,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
base.head) {
if (connector->encoder != encoder)
continue;
-
- intel_connector_break_all_links(connector);
+ connector->base.dpms = DRM_MODE_DPMS_OFF;
+ connector->base.encoder = NULL;
}
}
/* Enabled encoders without active connectors will be fixed in