Commit 1d843f9de4e6dc6a899b6f07f106c00da09925e6

Authored by Egbert Eich
Committed by Daniel Vetter
1 parent fa00abe00e

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>

Showing 6 changed files with 27 additions and 0 deletions Side-by-side Diff

drivers/gpu/drm/i915/i915_drv.h
... ... @@ -86,6 +86,19 @@
86 86 };
87 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 102 #define I915_GEM_GPU_DOMAINS \
90 103 (I915_GEM_DOMAIN_RENDER | \
91 104 I915_GEM_DOMAIN_SAMPLER | \
drivers/gpu/drm/i915/intel_crt.c
... ... @@ -776,6 +776,8 @@
776 776  
777 777 crt->base.disable = intel_disable_crt;
778 778 crt->base.enable = intel_enable_crt;
  779 + if (I915_HAS_HOTPLUG(dev))
  780 + crt->base.hpd_pin = HPD_CRT;
779 781 if (HAS_DDI(dev))
780 782 crt->base.get_hw_state = intel_ddi_get_hw_state;
781 783 else
drivers/gpu/drm/i915/intel_dp.c
... ... @@ -2821,18 +2821,22 @@
2821 2821 /* Set up the DDC bus. */
2822 2822 switch (port) {
2823 2823 case PORT_A:
  2824 + intel_encoder->hpd_pin = HPD_PORT_A;
2824 2825 name = "DPDDC-A";
2825 2826 break;
2826 2827 case PORT_B:
2827 2828 dev_priv->hotplug_supported_mask |= PORTB_HOTPLUG_INT_STATUS;
  2829 + intel_encoder->hpd_pin = HPD_PORT_B;
2828 2830 name = "DPDDC-B";
2829 2831 break;
2830 2832 case PORT_C:
2831 2833 dev_priv->hotplug_supported_mask |= PORTC_HOTPLUG_INT_STATUS;
  2834 + intel_encoder->hpd_pin = HPD_PORT_C;
2832 2835 name = "DPDDC-C";
2833 2836 break;
2834 2837 case PORT_D:
2835 2838 dev_priv->hotplug_supported_mask |= PORTD_HOTPLUG_INT_STATUS;
  2839 + intel_encoder->hpd_pin = HPD_PORT_D;
2836 2840 name = "DPDDC-D";
2837 2841 break;
2838 2842 default:
drivers/gpu/drm/i915/intel_drv.h
... ... @@ -168,6 +168,7 @@
168 168 * it is connected to in the pipe parameter. */
169 169 bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe);
170 170 int crtc_mask;
  171 + enum hpd_pin hpd_pin;
171 172 };
172 173  
173 174 struct intel_panel {
drivers/gpu/drm/i915/intel_hdmi.c
... ... @@ -988,17 +988,21 @@
988 988 switch (port) {
989 989 case PORT_B:
990 990 intel_hdmi->ddc_bus = GMBUS_PORT_DPB;
  991 + intel_encoder->hpd_pin = HPD_PORT_B;
991 992 dev_priv->hotplug_supported_mask |= PORTB_HOTPLUG_INT_STATUS;
992 993 break;
993 994 case PORT_C:
994 995 intel_hdmi->ddc_bus = GMBUS_PORT_DPC;
  996 + intel_encoder->hpd_pin = HPD_PORT_C;
995 997 dev_priv->hotplug_supported_mask |= PORTC_HOTPLUG_INT_STATUS;
996 998 break;
997 999 case PORT_D:
998 1000 intel_hdmi->ddc_bus = GMBUS_PORT_DPD;
  1001 + intel_encoder->hpd_pin = HPD_PORT_D;
999 1002 dev_priv->hotplug_supported_mask |= PORTD_HOTPLUG_INT_STATUS;
1000 1003 break;
1001 1004 case PORT_A:
  1005 + intel_encoder->hpd_pin = HPD_PORT_A;
1002 1006 /* Internal port only for eDP. */
1003 1007 default:
1004 1008 BUG();
drivers/gpu/drm/i915/intel_sdvo.c
... ... @@ -2779,6 +2779,9 @@
2779 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 2785 drm_encoder_helper_add(&intel_encoder->base, &intel_sdvo_helper_funcs);
2783 2786  
2784 2787 intel_encoder->disable = intel_disable_sdvo;