diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-10-27 01:05:50 +0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-12 02:51:07 +0400 |
commit | 174edf1f867dc573439675f9b4c2211012d4b563 (patch) | |
tree | 975070236c6673d9ceeea043163e1e28fc10129a /drivers/gpu/drm/i915/intel_ddi.c | |
parent | d63885da964ee15c4ae0b348b00a1ce43b104032 (diff) | |
download | linux-174edf1f867dc573439675f9b4c2211012d4b563.tar.xz |
drm/i915: add port field to intel_digital_port
Both "intel_dp" and "intel_hdmi" structs had a "port" field, which
always had the same value. It makes more sense to move this to
intel_digital_port, so we can know the port independently of the
connector type.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 408d6b053744..a8eda963f2bd 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c @@ -63,13 +63,11 @@ static enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder) struct drm_encoder *encoder = &intel_encoder->base; int type = intel_encoder->type; - if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { - struct intel_dp *intel_dp = enc_to_intel_dp(encoder); - return intel_dp->port; - - } else if (type == INTEL_OUTPUT_HDMI) { - struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); - return intel_hdmi->ddi_port; + if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP || + type == INTEL_OUTPUT_HDMI) { + struct intel_digital_port *intel_dig_port = + enc_to_dig_port(encoder); + return intel_dig_port->port; } else if (type == INTEL_OUTPUT_ANALOG) { return PORT_E; @@ -925,11 +923,13 @@ void intel_ddi_enable_pipe_func(struct drm_crtc *crtc) struct drm_i915_private *dev_priv = crtc->dev->dev_private; enum pipe pipe = intel_crtc->pipe; enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder; + enum port port = intel_ddi_get_encoder_port(intel_encoder); int type = intel_encoder->type; uint32_t temp; /* Enable TRANS_DDI_FUNC_CTL for the pipe to work in HDMI mode */ temp = TRANS_DDI_FUNC_ENABLE; + temp |= TRANS_DDI_SELECT_PORT(port); switch (intel_crtc->bpp) { case 18: @@ -979,18 +979,14 @@ void intel_ddi_enable_pipe_func(struct drm_crtc *crtc) else temp |= TRANS_DDI_MODE_SELECT_DVI; - temp |= TRANS_DDI_SELECT_PORT(intel_hdmi->ddi_port); - } else if (type == INTEL_OUTPUT_ANALOG) { temp |= TRANS_DDI_MODE_SELECT_FDI; - temp |= TRANS_DDI_SELECT_PORT(PORT_E); } else if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); temp |= TRANS_DDI_MODE_SELECT_DP_SST; - temp |= TRANS_DDI_SELECT_PORT(intel_dp->port); switch (intel_dp->lane_count) { case 1: @@ -1297,9 +1293,10 @@ void intel_ddi_pll_init(struct drm_device *dev) void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder) { - struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); + struct intel_dp *intel_dp = &intel_dig_port->dp; struct drm_i915_private *dev_priv = encoder->dev->dev_private; - enum port port = intel_dp->port; + enum port port = intel_dig_port->port; bool wait; uint32_t val; |