From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/2] drm/i915: Factor out intel_crtc_has_encoders()
Date: Thu, 27 Aug 2015 10:29:13 +0300 [thread overview]
Message-ID: <87a8tdxk8m.fsf@intel.com> (raw)
In-Reply-To: <1440607159-14453-2-git-send-email-ville.syrjala@linux.intel.com>
On Wed, 26 Aug 2015, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make the code mode readable by pulling the "does this crtc have any
> encoders?" deduction into a separate function.
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 22 +++++++++++++---------
> 1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9e92915..ac2c2f1 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14855,13 +14855,22 @@ intel_check_plane_mapping(struct intel_crtc *crtc)
> return true;
> }
>
> +static bool intel_crtc_has_encoders(struct intel_crtc *crtc)
> +{
> + struct drm_device *dev = crtc->base.dev;
> + struct intel_encoder *encoder;
> +
> + for_each_encoder_on_crtc(dev, &crtc->base, encoder)
> + return true;
> +
> + return false;
> +}
> +
> static void intel_sanitize_crtc(struct intel_crtc *crtc)
> {
> struct drm_device *dev = crtc->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> - struct intel_encoder *encoder;
> u32 reg;
> - bool enable;
>
> /* Clear any frame start delays used for debugging left by the BIOS */
> reg = PIPECONF(crtc->config->cpu_transcoder);
> @@ -14905,16 +14914,11 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
>
> /* Adjust the state of the output pipe according to whether we
> * have active connectors/encoders. */
> - enable = false;
> - for_each_encoder_on_crtc(dev, &crtc->base, encoder) {
> - enable = true;
> - break;
> - }
> -
> - if (!enable)
> + if (!intel_crtc_has_encoders(crtc))
> intel_crtc_disable_noatomic(&crtc->base);
>
> if (crtc->active != crtc->base.state->active) {
> + struct intel_encoder *encoder;
>
> /* This can happen either due to bugs in the get_hw_state
> * functions or because of calls to intel_crtc_disable_noatomic,
> --
> 2.4.6
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-08-27 7:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 17:31 [PATCH 1/2] drm/i915: Assign hwmode after encoder state readout ville.syrjala
2015-08-13 17:31 ` [PATCH 2/2] drm/i915: Fix clock readout when pipes are enabld w/o ports ville.syrjala
2015-08-26 16:39 ` [PATCH v2 2/2] drm/i915: Fix clock readout when pipes are enabled " ville.syrjala
2015-08-26 16:39 ` [PATCH 3/2] drm/i915: Factor out intel_crtc_has_encoders() ville.syrjala
2015-08-27 7:29 ` Jani Nikula [this message]
2015-09-01 10:03 ` Daniel Vetter
2015-08-27 13:11 ` [PATCH v2 2/2] drm/i915: Fix clock readout when pipes are enabled w/o ports Maarten Lankhorst
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=87a8tdxk8m.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.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.