public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/i915: reduce line width in {pch, i9xx}_get_hpd_pins()
Date: Mon, 22 Jun 2015 15:05:08 +0200	[thread overview]
Message-ID: <20150622130508.GZ25769@phenom.ffwll.local> (raw)
In-Reply-To: <fa209e00936701801da2973ecb3c3ee2f64803b8.1434621691.git.jani.nikula@intel.com>

On Thu, Jun 18, 2015 at 01:06:17PM +0300, Jani Nikula wrote:
> Make Paulo happier.

Cc'ing Paulo next time around would help for him to appreciate this
properly ;-)
-Daniel

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 29 ++++++++++++++++++-----------
>  1 file changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 2d3b2ccf9ce4..a6fbe6443d63 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1257,8 +1257,10 @@ static bool i9xx_port_hotplug_long_detect(enum port port, u32 val)
>  
>  /* Get a bit mask of pins that have triggered, and which ones may be long. */
>  static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask,
> -			     u32 hotplug_trigger, u32 dig_hotplug_reg, const u32 hpd[HPD_NUM_PINS])
> +			     u32 hotplug_trigger, u32 dig_hotplug_reg,
> +			     const u32 hpd[HPD_NUM_PINS])
>  {
> +	enum port port;
>  	int i;
>  
>  	*pin_mask = 0;
> @@ -1268,12 +1270,14 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask,
>  		return;
>  
>  	for_each_hpd_pin(i) {
> -		if (hpd[i] & hotplug_trigger) {
> -			*pin_mask |= BIT(i);
> +		if ((hpd[i] & hotplug_trigger) == 0)
> +			continue;
>  
> -			if (pch_port_hotplug_long_detect(intel_hpd_pin_to_port(i), dig_hotplug_reg))
> -				*long_mask |= BIT(i);
> -		}
> +		*pin_mask |= BIT(i);
> +
> +		port = intel_hpd_pin_to_port(i);
> +		if (pch_port_hotplug_long_detect(port, dig_hotplug_reg))
> +			*long_mask |= BIT(i);
>  	}
>  
>  	DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x\n",
> @@ -1285,6 +1289,7 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask,
>  static void i9xx_get_hpd_pins(u32 *pin_mask, u32 *long_mask,
>  			      u32 hotplug_trigger, const u32 hpd[HPD_NUM_PINS])
>  {
> +	enum port port;
>  	int i;
>  
>  	*pin_mask = 0;
> @@ -1294,12 +1299,14 @@ static void i9xx_get_hpd_pins(u32 *pin_mask, u32 *long_mask,
>  		return;
>  
>  	for_each_hpd_pin(i) {
> -		if (hpd[i] & hotplug_trigger) {
> -			*pin_mask |= BIT(i);
> +		if ((hpd[i] & hotplug_trigger) == 0)
> +			continue;
>  
> -			if (i9xx_port_hotplug_long_detect(intel_hpd_pin_to_port(i), hotplug_trigger))
> -				*long_mask |= BIT(i);
> -		}
> +		*pin_mask |= BIT(i);
> +
> +		port = intel_hpd_pin_to_port(i);
> +		if (i9xx_port_hotplug_long_detect(port, hotplug_trigger))
> +			*long_mask |= BIT(i);
>  	}
>  
>  	DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, pins 0x%08x\n",
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-06-22 13:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 10:06 [PATCH 0/5] drm/i915: hotplug cleanup saga continues Jani Nikula
2015-06-18 10:06 ` [PATCH 1/5] drm/i915/irq: move hotplug even debug print to second connector loop Jani Nikula
2015-06-18 10:21   ` Chris Wilson
2015-06-18 10:43     ` Jani Nikula
2015-06-18 10:52       ` Chris Wilson
2015-06-18 10:06 ` [PATCH 2/5] drm/i915/irq: abstract irq storm hotplug disabling Jani Nikula
2015-06-22 13:02   ` [Intel-gfx] " Daniel Vetter
2015-06-23  0:29     ` Dave Airlie
2015-06-23  6:36       ` Daniel Vetter
2015-06-18 10:06 ` [PATCH 3/5] drm/i915/irq: clarify irq storm related function naming Jani Nikula
2015-06-18 10:06 ` [PATCH 4/5] drm/i915: move generic hotplug code into new intel_hotplug.c file Jani Nikula
2015-06-18 10:06 ` [PATCH 5/5] drm/i915: reduce line width in {pch, i9xx}_get_hpd_pins() Jani Nikula
2015-06-22 13:05   ` Daniel Vetter [this message]
2015-06-22 13:06 ` [PATCH 0/5] drm/i915: hotplug cleanup saga continues Daniel Vetter

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=20150622130508.GZ25769@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox