[PATCH] drm/i915: Get rid of hardcoded pipes

Mika Kahola mika.kahola at intel.com
Fri Oct 13 07:26:13 UTC 2017


Favor for_each_pipe() macro when looping through pipes.

This patch is related to miscellenous fixes to reduce dependency on
I915_MAX_PIPES.

https://patchwork.freedesktop.org/series/30336/

Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
 drivers/gpu/drm/i915/intel_dp_mst.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 3c131e2..f253101 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -454,9 +454,10 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 	struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr);
 	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = intel_dig_port->base.base.dev;
+	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct intel_connector *intel_connector;
 	struct drm_connector *connector;
-	int i;
+	enum pipe pipe;
 
 	intel_connector = intel_connector_alloc();
 	if (!intel_connector)
@@ -470,9 +471,9 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 	intel_connector->mst_port = intel_dp;
 	intel_connector->port = port;
 
-	for (i = PIPE_A; i <= PIPE_C; i++) {
+	for_each_pipe(dev_priv, pipe) {
 		drm_mode_connector_attach_encoder(&intel_connector->base,
-						  &intel_dp->mst_encoders[i]->base.base);
+						  &intel_dp->mst_encoders[pipe]->base.base);
 	}
 
 	drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0);
-- 
2.7.4



More information about the Intel-gfx-trybot mailing list