[PATCH 04/09] drm/i915: Add "port" field to struct intel_dp

Paulo Zanoni
2012-06-29T19:04:39Z

From: Shobhit Kumar <shobhit.kumar@intel.com>

Useful for Haswell, it has a lot of DP registers that have one
instance per port.

Changes from Paulo:
- Completely change the commit message
- Rename "ddi_port" to "port"

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 10 +++++++---
drivers/gpu/drm/i915/intel_drv.h | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)

I believe "port" is better than "ddi_port" since the "port" variable can be
used in the previous gens too...

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index be5c47e..a5aee26 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2477,12 +2477,16 @@ intel_dp_init(struct drm_device *dev, int output_reg)

connector->polled = DRM_CONNECTOR_POLL_HPD;

- if (output_reg == DP_B || output_reg == PCH_DP_B)
+ if (output_reg == DP_B || output_reg == PCH_DP_B) {
intel_encoder->clone_mask = (1 << INTEL_DP_B_CLONE_BIT);
- else if (output_reg == DP_C || output_reg == PCH_DP_C)
+ intel_dp->port = PORT_B;
+ } else if (output_reg == DP_C || output_reg == PCH_DP_C) {
intel_encoder->clone_mask = (1 << INTEL_DP_C_CLONE_BIT);
- else if (output_reg == DP_D || output_reg == PCH_DP_D)
+ intel_dp->port = PORT_C;
+ } else if (output_reg == DP_D || output_reg == PCH_DP_D) {
intel_encoder->clone_mask = (1 << INTEL_DP_D_CLONE_BIT);
+ intel_dp->port = PORT_D;
+ }

if (is_edp(intel_dp)) {
intel_encoder->clone_mask = (1 << INTEL_EDP_CLONE_BIT);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 48a0fcb..1145403 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -316,6 +316,7 @@ struct intel_dp {
uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE];
bool has_audio;
enum hdmi_force_audio force_audio;
+ int port;
uint32_t color_range;
int dpms_mode;
uint8_t link_bw;
--
1.7.10.2