From: Ander Conselvan de Oliveira <conselvan2@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Subject: [PATCH 1/4] drm/i915: Replace some loop through encoders with intel_pipe_has_type()
Date: Wed, 8 Oct 2014 18:32:20 +0300 [thread overview]
Message-ID: <1412782343-28836-2-git-send-email-conselvan2@gmail.com> (raw)
In-Reply-To: <1412782343-28836-1-git-send-email-conselvan2@gmail.com>
From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
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 7b5639d..3a06c3d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7110,18 +7110,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);
@@ -7261,23 +7254,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.8.3.2
next prev parent reply other threads:[~2014-10-08 15:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 15:32 [PATCH 0/4] [RFC] Stage shared dpll configs Ander Conselvan de Oliveira
2014-10-08 15:32 ` Ander Conselvan de Oliveira [this message]
2014-10-08 15:32 ` [PATCH 2/4] drm/i915: Make *_crtc_mode_set work on new_config Ander Conselvan de Oliveira
2014-10-09 8:28 ` Daniel Vetter
2014-10-09 9:11 ` Daniel Vetter
2014-10-09 12:18 ` Ander Conselvan de Oliveira
2014-10-19 14:28 ` Daniel Vetter
2014-10-19 14:30 ` Daniel Vetter
2014-10-20 10:49 ` Ander Conselvan de Oliveira
2014-10-08 15:32 ` [PATCH 3/4] drm/i915: Convert shared dpll reference count to a crtc mask Ander Conselvan de Oliveira
2014-10-08 15:32 ` [PATCH 4/4] drm/i915: Compute clocks and choose DPLLs before disabling crtcs Ander Conselvan de Oliveira
2014-10-09 8:34 ` Daniel Vetter
2014-10-09 8:52 ` Jani Nikula
-- strict thread matches above, loose matches on Subject: below --
2014-10-20 10:46 [PATCH 1/4] drm/i915: Replace some loop through encoders with intel_pipe_has_type() Ander Conselvan de Oliveira
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=1412782343-28836-2-git-send-email-conselvan2@gmail.com \
--to=conselvan2@gmail.com \
--cc=ander.conselvan.de.oliveira@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.