diff options
author | Egbert Eich <eich@suse.de> | 2013-02-25 12:06:49 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-03-26 16:50:22 -0400 |
commit | 1d843f9de4e6dc6a899b6f07f106c00da09925e6 (patch) | |
tree | 29c979eae847b62f3406547253c370bdee86348a | |
parent | fa00abe00e379a0e9b070616baee58692576f29e (diff) |
DRM/I915: Add enum hpd_pin to intel_encoder.
To clean up hotplug support we add a new enum to intel_encoder:
enum hpd_pin. It allows the encoder to request a hpd line but leave
the details which IRQ is responsible on which chipset generation
to i915_irq.c.
This way requesting hotplug support will become really simple on
the encoder/connector level.
Signed-off-by: Egbert Eich <eich@suse.de>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 3 |
6 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 7f6452b592aa..cda598d89f17 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -86,6 +86,19 @@ enum port { | |||
86 | }; | 86 | }; |
87 | #define port_name(p) ((p) + 'A') | 87 | #define port_name(p) ((p) + 'A') |
88 | 88 | ||
89 | enum hpd_pin { | ||
90 | HPD_NONE = 0, | ||
91 | HPD_PORT_A = HPD_NONE, /* PORT_A is internal */ | ||
92 | HPD_TV = HPD_NONE, /* TV is known to be unreliable */ | ||
93 | HPD_CRT, | ||
94 | HPD_SDVO_B, | ||
95 | HPD_SDVO_C, | ||
96 | HPD_PORT_B, | ||
97 | HPD_PORT_C, | ||
98 | HPD_PORT_D, | ||
99 | HPD_NUM_PINS | ||
100 | }; | ||
101 | |||
89 | #define I915_GEM_GPU_DOMAINS \ | 102 | #define I915_GEM_GPU_DOMAINS \ |
90 | (I915_GEM_DOMAIN_RENDER | \ | 103 | (I915_GEM_DOMAIN_RENDER | \ |
91 | I915_GEM_DOMAIN_SAMPLER | \ | 104 | I915_GEM_DOMAIN_SAMPLER | \ |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 32a3693905ec..a4b3e4e01e65 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -776,6 +776,8 @@ void intel_crt_init(struct drm_device *dev) | |||
776 | 776 | ||
777 | crt->base.disable = intel_disable_crt; | 777 | crt->base.disable = intel_disable_crt; |
778 | crt->base.enable = intel_enable_crt; | 778 | crt->base.enable = intel_enable_crt; |
779 | if (I915_HAS_HOTPLUG(dev)) | ||
780 | crt->base.hpd_pin = HPD_CRT; | ||
779 | if (HAS_DDI(dev)) | 781 | if (HAS_DDI(dev)) |
780 | crt->base.get_hw_state = intel_ddi_get_hw_state; | 782 | crt->base.get_hw_state = intel_ddi_get_hw_state; |
781 | else | 783 | else |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 2f2ec42a417a..c7c5635f06e0 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -2821,18 +2821,22 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, | |||
2821 | /* Set up the DDC bus. */ | 2821 | /* Set up the DDC bus. */ |
2822 | switch (port) { | 2822 | switch (port) { |
2823 | case PORT_A: | 2823 | case PORT_A: |
2824 | intel_encoder->hpd_pin = HPD_PORT_A; | ||
2824 | name = "DPDDC-A"; | 2825 | name = "DPDDC-A"; |
2825 | break; | 2826 | break; |
2826 | case PORT_B: | 2827 | case PORT_B: |
2827 | dev_priv->hotplug_supported_mask |= PORTB_HOTPLUG_INT_STATUS; | 2828 | dev_priv->hotplug_supported_mask |= PORTB_HOTPLUG_INT_STATUS; |
2829 | intel_encoder->hpd_pin = HPD_PORT_B; | ||
2828 | name = "DPDDC-B"; | 2830 | name = "DPDDC-B"; |
2829 | break; | 2831 | break; |
2830 | case PORT_C: | 2832 | case PORT_C: |
2831 | dev_priv->hotplug_supported_mask |= PORTC_HOTPLUG_INT_STATUS; | 2833 | dev_priv->hotplug_supported_mask |= PORTC_HOTPLUG_INT_STATUS; |
2834 | intel_encoder->hpd_pin = HPD_PORT_C; | ||
2832 | name = "DPDDC-C"; | 2835 | name = "DPDDC-C"; |
2833 | break; | 2836 | break; |
2834 | case PORT_D: | 2837 | case PORT_D: |
2835 | dev_priv->hotplug_supported_mask |= PORTD_HOTPLUG_INT_STATUS; | 2838 | dev_priv->hotplug_supported_mask |= PORTD_HOTPLUG_INT_STATUS; |
2839 | intel_encoder->hpd_pin = HPD_PORT_D; | ||
2836 | name = "DPDDC-D"; | 2840 | name = "DPDDC-D"; |
2837 | break; | 2841 | break; |
2838 | default: | 2842 | default: |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 276f6651dcc3..54bc2ea61fa9 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -168,6 +168,7 @@ struct intel_encoder { | |||
168 | * it is connected to in the pipe parameter. */ | 168 | * it is connected to in the pipe parameter. */ |
169 | bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe); | 169 | bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe); |
170 | int crtc_mask; | 170 | int crtc_mask; |
171 | enum hpd_pin hpd_pin; | ||
171 | }; | 172 | }; |
172 | 173 | ||
173 | struct intel_panel { | 174 | struct intel_panel { |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 2474b1b6de61..6d92aebadfc3 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -988,17 +988,21 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | |||
988 | switch (port) { | 988 | switch (port) { |
989 | case PORT_B: | 989 | case PORT_B: |
990 | intel_hdmi->ddc_bus = GMBUS_PORT_DPB; | 990 | intel_hdmi->ddc_bus = GMBUS_PORT_DPB; |
991 | intel_encoder->hpd_pin = HPD_PORT_B; | ||
991 | dev_priv->hotplug_supported_mask |= PORTB_HOTPLUG_INT_STATUS; | 992 | dev_priv->hotplug_supported_mask |= PORTB_HOTPLUG_INT_STATUS; |
992 | break; | 993 | break; |
993 | case PORT_C: | 994 | case PORT_C: |
994 | intel_hdmi->ddc_bus = GMBUS_PORT_DPC; | 995 | intel_hdmi->ddc_bus = GMBUS_PORT_DPC; |
996 | intel_encoder->hpd_pin = HPD_PORT_C; | ||
995 | dev_priv->hotplug_supported_mask |= PORTC_HOTPLUG_INT_STATUS; | 997 | dev_priv->hotplug_supported_mask |= PORTC_HOTPLUG_INT_STATUS; |
996 | break; | 998 | break; |
997 | case PORT_D: | 999 | case PORT_D: |
998 | intel_hdmi->ddc_bus = GMBUS_PORT_DPD; | 1000 | intel_hdmi->ddc_bus = GMBUS_PORT_DPD; |
1001 | intel_encoder->hpd_pin = HPD_PORT_D; | ||
999 | dev_priv->hotplug_supported_mask |= PORTD_HOTPLUG_INT_STATUS; | 1002 | dev_priv->hotplug_supported_mask |= PORTD_HOTPLUG_INT_STATUS; |
1000 | break; | 1003 | break; |
1001 | case PORT_A: | 1004 | case PORT_A: |
1005 | intel_encoder->hpd_pin = HPD_PORT_A; | ||
1002 | /* Internal port only for eDP. */ | 1006 | /* Internal port only for eDP. */ |
1003 | default: | 1007 | default: |
1004 | BUG(); | 1008 | BUG(); |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 678c47cac72b..0ff557fe2f60 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -2779,6 +2779,9 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | |||
2779 | SDVOB_HOTPLUG_INT_STATUS_I915 : SDVOC_HOTPLUG_INT_STATUS_I915; | 2779 | SDVOB_HOTPLUG_INT_STATUS_I915 : SDVOC_HOTPLUG_INT_STATUS_I915; |
2780 | } | 2780 | } |
2781 | 2781 | ||
2782 | if (intel_sdvo->hotplug_active) | ||
2783 | intel_encoder->hpd_pin = HPD_SDVO_B ? HPD_SDVO_B : HPD_SDVO_C; | ||
2784 | |||
2782 | drm_encoder_helper_add(&intel_encoder->base, &intel_sdvo_helper_funcs); | 2785 | drm_encoder_helper_add(&intel_encoder->base, &intel_sdvo_helper_funcs); |
2783 | 2786 | ||
2784 | intel_encoder->disable = intel_disable_sdvo; | 2787 | intel_encoder->disable = intel_disable_sdvo; |