From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/8] drm/i915: s/int i/enum hpd_pin pin/
Date: Mon, 9 Jul 2018 14:28:03 -0700 [thread overview]
Message-ID: <20180709212803.GL28253@intel.com> (raw)
In-Reply-To: <20180705164357.28512-6-ville.syrjala@linux.intel.com>
On Thu, Jul 05, 2018 at 07:43:54PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Use the enum hpd_pin type when talking about HPD pins, and rename the
> variable from a very nondescript 'i' to 'pin', a name we already
> use in other parts of the code.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 12 ++++++------
> drivers/gpu/drm/i915/intel_hotplug.c | 28 ++++++++++++++--------------
> 2 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 2fcc00b06915..1c3ff07d9f2d 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1712,20 +1712,20 @@ static void intel_get_hpd_pins(struct drm_i915_private *dev_priv,
> bool long_pulse_detect(enum port port, u32 val))
> {
> enum port port;
> - int i;
> + enum hpd_pin pin;
>
> - for_each_hpd_pin(i) {
> - if ((hpd[i] & hotplug_trigger) == 0)
> + for_each_hpd_pin(pin) {
> + if ((hpd[pin] & hotplug_trigger) == 0)
> continue;
>
> - *pin_mask |= BIT(i);
> + *pin_mask |= BIT(pin);
>
> - port = intel_hpd_pin_to_port(dev_priv, i);
> + port = intel_hpd_pin_to_port(dev_priv, pin);
> if (port == PORT_NONE)
> continue;
>
> if (long_pulse_detect(port, dig_hotplug_reg))
> - *long_mask |= BIT(i);
> + *long_mask |= BIT(pin);
> }
>
> DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x\n",
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index f862441158e1..d9d61d11dd2b 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -241,25 +241,25 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> container_of(work, typeof(*dev_priv),
> hotplug.reenable_work.work);
> struct drm_device *dev = &dev_priv->drm;
> - int i;
> + enum hpd_pin pin;
>
> intel_runtime_pm_get(dev_priv);
>
> spin_lock_irq(&dev_priv->irq_lock);
> - for_each_hpd_pin(i) {
> + for_each_hpd_pin(pin) {
> struct drm_connector *connector;
> struct drm_connector_list_iter conn_iter;
>
> - if (dev_priv->hotplug.stats[i].state != HPD_DISABLED)
> + if (dev_priv->hotplug.stats[pin].state != HPD_DISABLED)
> continue;
>
> - dev_priv->hotplug.stats[i].state = HPD_ENABLED;
> + dev_priv->hotplug.stats[pin].state = HPD_ENABLED;
>
> drm_connector_list_iter_begin(dev, &conn_iter);
> drm_for_each_connector_iter(connector, &conn_iter) {
> struct intel_connector *intel_connector = to_intel_connector(connector);
>
> - if (intel_connector->encoder->hpd_pin == i) {
> + if (intel_connector->encoder->hpd_pin == pin) {
> if (connector->polled != intel_connector->polled)
> DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
> connector->name);
> @@ -432,14 +432,14 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
>
> spin_lock(&dev_priv->irq_lock);
> for_each_intel_encoder(&dev_priv->drm, encoder) {
> - enum hpd_pin i = encoder->hpd_pin;
> + enum hpd_pin pin = encoder->hpd_pin;
> bool has_hpd_pulse = intel_encoder_has_hpd_pulse(encoder);
>
> - if (!(BIT(i) & pin_mask))
> + if (!(BIT(pin) & pin_mask))
> continue;
>
> if (has_hpd_pulse) {
> - bool long_hpd = long_mask & BIT(i);
> + bool long_hpd = long_mask & BIT(pin);
> enum port port = encoder->port;
>
> DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", port_name(port),
> @@ -458,7 +458,7 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
> }
> }
>
> - if (dev_priv->hotplug.stats[i].state == HPD_DISABLED) {
> + if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) {
> /*
> * On GMCH platforms the interrupt mask bits only
> * prevent irq generation, not the setting of the
> @@ -466,20 +466,20 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
> * interrupts on saner platforms.
> */
> WARN_ONCE(!HAS_GMCH_DISPLAY(dev_priv),
> - "Received HPD interrupt on pin %d although disabled\n", i);
> + "Received HPD interrupt on pin %d although disabled\n", pin);
> continue;
> }
>
> - if (dev_priv->hotplug.stats[i].state != HPD_ENABLED)
> + if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED)
> continue;
>
> if (!has_hpd_pulse) {
> - dev_priv->hotplug.event_bits |= BIT(i);
> + dev_priv->hotplug.event_bits |= BIT(pin);
> queue_hp = true;
> }
>
> - if (intel_hpd_irq_storm_detect(dev_priv, i)) {
> - dev_priv->hotplug.event_bits &= ~BIT(i);
> + if (intel_hpd_irq_storm_detect(dev_priv, pin)) {
> + dev_priv->hotplug.event_bits &= ~BIT(pin);
> storm_detected = true;
> }
> }
> --
> 2.16.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-07-09 21:28 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 16:43 [PATCH 0/8] drm/i915: Hotplug cleanups and whanot Ville Syrjala
2018-07-05 16:43 ` [PATCH 1/8] drm/i915: Introduce for_each_intel_dp() Ville Syrjala
2018-07-05 21:17 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 2/8] drm/i915: Introduce intel_encoder_is_dig_port() Ville Syrjala
2018-07-06 17:01 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 3/8] drm/i915: Rewrite mst suspend/resume in terms of encoders Ville Syrjala
2018-07-05 21:29 ` Rodrigo Vivi
2018-07-06 10:42 ` Ville Syrjälä
2018-07-06 17:00 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 4/8] drm/i915: Nuke dev_priv->irq_port[] Ville Syrjala
2018-07-09 21:27 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 5/8] drm/i915: s/int i/enum hpd_pin pin/ Ville Syrjala
2018-07-09 21:28 ` Rodrigo Vivi [this message]
2018-07-05 16:43 ` [PATCH 6/8] drm/i915: Pass hpd_pin to long_pulse_detect() Ville Syrjala
2018-07-05 21:14 ` Rodrigo Vivi
2018-07-05 16:43 ` [PATCH 7/8] drm/i915: Assert that our hpd pin bitmasks don't overflow Ville Syrjala
2018-07-05 16:52 ` Chris Wilson
2018-07-05 17:51 ` Ville Syrjälä
2018-07-05 17:57 ` Chris Wilson
2018-07-05 16:43 ` [PATCH 8/8] drm/i915: Print the long_mask alongside the pin_mask Ville Syrjala
2018-07-05 18:00 ` Chris Wilson
2018-07-05 20:55 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Hotplug cleanups and whanot Patchwork
2018-07-05 20:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-05 21:14 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-06 11:05 ` ✓ Fi.CI.IGT: " Patchwork
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=20180709212803.GL28253@intel.com \
--to=rodrigo.vivi@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.