All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 4/8] drm/i915: simplify setting DSPCNTR inside ironlake_crtc_mode_set
Date: Wed, 12 Sep 2012 10:06:32 -0300	[thread overview]
Message-ID: <1347455196-5167-5-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1347455196-5167-1-git-send-email-przanoni@gmail.com>

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Because declaring a variable in the beginning of the function, then
initializing it 100 lines later, then using it 100 lines later does
not make our code look good IMHO.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5a4e363..b657416 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4748,7 +4748,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 	int plane = intel_crtc->plane;
 	int refclk, num_connectors = 0;
 	intel_clock_t clock, reduced_clock;
-	u32 dpll, fp = 0, fp2 = 0, dspcntr;
+	u32 dpll, fp = 0, fp2 = 0;
 	bool ok, has_reduced_clock = false, is_sdvo = false;
 	bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false;
 	struct intel_encoder *encoder, *edp_encoder = NULL;
@@ -4950,9 +4950,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 	else
 		dpll |= PLL_REF_INPUT_DREFCLK;
 
-	/* Set up the display plane register */
-	dspcntr = DISPPLANE_GAMMA_ENABLE;
-
 	DRM_DEBUG_KMS("Mode for pipe %d:\n", pipe);
 	drm_mode_debug_printmodeline(mode);
 
@@ -5029,7 +5026,8 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 
 	intel_wait_for_vblank(dev, pipe);
 
-	I915_WRITE(DSPCNTR(plane), dspcntr);
+	/* Set up the display plane register */
+	I915_WRITE(DSPCNTR(plane), DISPPLANE_GAMMA_ENABLE);
 	POSTING_READ(DSPCNTR(plane));
 
 	ret = intel_pipe_set_base(crtc, x, y, fb);
-- 
1.7.10.4

  parent reply	other threads:[~2012-09-12 13:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 13:06 [PATCH 0/8] Rework ironlake_crtc_mode_set Paulo Zanoni
2012-09-12 13:06 ` [PATCH 1/8] drm/i915: extract ironlake_set_pipeconf form ironlake_crtc_mode_set Paulo Zanoni
2012-09-12 14:03   ` Daniel Vetter
2012-09-12 13:06 ` [PATCH 2/8] drm/i915: extract LVDS-specific code from ironlake_crtc_mode_set Paulo Zanoni
2012-09-12 13:56   ` Daniel Vetter
2012-09-12 13:06 ` [PATCH 3/8] drm/i915: extract set_pipe_timings " Paulo Zanoni
2012-09-12 14:11   ` Daniel Vetter
2012-09-19 18:11     ` Paulo Zanoni
2012-09-20  7:32       ` Daniel Vetter
2012-09-12 13:06 ` Paulo Zanoni [this message]
2012-09-12 14:12   ` [PATCH 4/8] drm/i915: simplify setting DSPCNTR inside ironlake_crtc_mode_set Daniel Vetter
2012-09-12 13:06 ` [PATCH 5/8] drm/i915: extract set_m_n from ironlake_crtc_mode_set Paulo Zanoni
2012-09-12 14:20   ` Daniel Vetter
2012-09-12 13:06 ` [PATCH 6/8] drm/i915: extract compute_clocks " Paulo Zanoni
2012-09-12 14:31   ` Daniel Vetter
2012-09-12 14:34     ` Daniel Vetter
2012-09-12 13:06 ` [PATCH 7/8] drm/i915: extract pch_pll_set " Paulo Zanoni
2012-09-12 14:40   ` Daniel Vetter
2012-09-18 20:18     ` Paulo Zanoni
2012-09-19  9:17       ` Daniel Vetter
2012-09-12 13:06 ` [PATCH 8/8] drm/i915: remove unused variables " Paulo Zanoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347455196-5167-5-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.