All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915: Replace some loop through encoders with intel_pipe_has_type()
@ 2014-10-20 10:46 Ander Conselvan de Oliveira
  2014-10-20 10:46 ` [PATCH 2/4] drm/i915: Make *_find_best_dpll() take an intel_crtc insted of drm_crtc Ander Conselvan de Oliveira
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ander Conselvan de Oliveira @ 2014-10-20 10:46 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ander Conselvan de Oliveira, shuang.he

In the ironlake mode set code, there was two instances of a loop through
encoders to find out if one of them has INTEL_OUTPUT_LVDS type. Simplify
the code by deleting some lines and use intel_pipe_has_type() instead.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b5476dc..f81444e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7108,18 +7108,11 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
 {
 	struct drm_device *dev = crtc->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct intel_encoder *intel_encoder;
 	int refclk;
 	const intel_limit_t *limit;
 	bool ret, is_lvds = false;
 
-	for_each_encoder_on_crtc(dev, crtc, intel_encoder) {
-		switch (intel_encoder->type) {
-		case INTEL_OUTPUT_LVDS:
-			is_lvds = true;
-			break;
-		}
-	}
+	is_lvds = intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS);
 
 	refclk = ironlake_get_refclk(crtc);
 
@@ -7259,23 +7252,13 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 {
 	struct drm_device *dev = crtc->dev;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	int num_connectors = 0;
 	intel_clock_t clock, reduced_clock;
 	u32 dpll = 0, fp = 0, fp2 = 0;
 	bool ok, has_reduced_clock = false;
 	bool is_lvds = false;
-	struct intel_encoder *encoder;
 	struct intel_shared_dpll *pll;
 
-	for_each_encoder_on_crtc(dev, crtc, encoder) {
-		switch (encoder->type) {
-		case INTEL_OUTPUT_LVDS:
-			is_lvds = true;
-			break;
-		}
-
-		num_connectors++;
-	}
+	is_lvds = intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS);
 
 	WARN(!(HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)),
 	     "Unexpected PCH type %d\n", INTEL_PCH_TYPE(dev));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-22  1:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-20 10:46 [PATCH 1/4] drm/i915: Replace some loop through encoders with intel_pipe_has_type() Ander Conselvan de Oliveira
2014-10-20 10:46 ` [PATCH 2/4] drm/i915: Make *_find_best_dpll() take an intel_crtc insted of drm_crtc Ander Conselvan de Oliveira
2014-10-20 10:46 ` [PATCH 3/4] drm/i915: Make *_crtc_mode_set() " Ander Conselvan de Oliveira
2014-10-20 10:46 ` [PATCH 4/4] drm/i915: Make intel_pipe_has_type() and some callers take intel_crtc Ander Conselvan de Oliveira
2014-10-20 14:14   ` [PATCH 4/4] drm/i915: Make intel_pipe_has_type() and shuang.he
2014-10-20 14:33     ` He, Shuang
2014-10-20 20:29     ` Daniel Vetter
2014-10-20 20:35       ` Chris Wilson
2014-10-22  1:20       ` He, Shuang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.