diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2013-04-14 05:38:37 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2013-04-14 05:38:37 +0000 |
commit | 1d67c54b140884632b8c2d52848bf624ffdb0e8b (patch) | |
tree | 4e2345185d9f7c423b935722a84c31b7fc5aaf68 /sys/dev | |
parent | eed31596591bfe33ee9e2cea7e8c4201c95c6366 (diff) |
Be sure to turn hsync/vsync back on at crt enable (v2)
from linux 3.8.7
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/i915/intel_crt.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/sys/dev/pci/drm/i915/intel_crt.c b/sys/dev/pci/drm/i915/intel_crt.c index 886e12141ee..ec7f4734e9d 100644 --- a/sys/dev/pci/drm/i915/intel_crt.c +++ b/sys/dev/pci/drm/i915/intel_crt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_crt.c,v 1.2 2013/04/12 08:32:53 jsg Exp $ */ +/* $OpenBSD: intel_crt.c,v 1.3 2013/04/14 05:38:36 jsg Exp $ */ /* * Copyright © 2006-2007 Intel Corporation * @@ -43,6 +43,9 @@ struct intel_crt { struct intel_encoder base; + /* DPMS state is stored in the connector, which we need in the + * encoder's enable/disable callbacks */ + struct intel_connector *connector; bool force_hotplug_required; u32 adpa_reg; }; @@ -113,31 +116,6 @@ intel_crt_get_hw_state(struct intel_encoder *encoder, return true; } -void -intel_disable_crt(struct intel_encoder *encoder) -{ - struct inteldrm_softc *dev_priv = encoder->base.dev->dev_private; - struct intel_crt *crt = intel_encoder_to_crt(encoder); - u32 temp; - - temp = I915_READ(crt->adpa_reg); - temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE; - temp &= ~ADPA_DAC_ENABLE; - I915_WRITE(crt->adpa_reg, temp); -} - -void -intel_enable_crt(struct intel_encoder *encoder) -{ - struct inteldrm_softc *dev_priv = encoder->base.dev->dev_private; - struct intel_crt *crt = intel_encoder_to_crt(encoder); - u32 temp; - - temp = I915_READ(crt->adpa_reg); - temp |= ADPA_DAC_ENABLE; - I915_WRITE(crt->adpa_reg, temp); -} - /* Note: The caller is required to filter out dpms modes not supported by the * platform. */ void @@ -171,6 +149,20 @@ intel_crt_set_dpms(struct intel_encoder *encoder, int mode) } void +intel_disable_crt(struct intel_encoder *encoder) +{ + intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF); +} + +void +intel_enable_crt(struct intel_encoder *encoder) +{ + struct intel_crt *crt = intel_encoder_to_crt(encoder); + + intel_crt_set_dpms(encoder, crt->connector->base.dpms); +} + +void intel_crt_dpms(struct drm_connector *connector, int mode) { struct drm_device *dev = connector->dev; @@ -816,6 +808,7 @@ intel_crt_init(struct drm_device *dev) } connector = &intel_connector->base; + crt->connector = intel_connector; drm_connector_init(dev, &intel_connector->base, &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); |