All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Cc: Egbert Eich <eich@suse.com>
Subject: Re: [PATCH 2/7] drm/i915: Remove I915_HAS_HOTPLUG() check	from i915_hpd_irq_setup()
Date: Fri, 09 Jan 2015 16:52:03 +0200	[thread overview]
Message-ID: <87ppaoxazw.fsf@intel.com> (raw)
In-Reply-To: <1420806078-20507-3-git-send-email-ville.syrjala@linux.intel.com>

On Fri, 09 Jan 2015, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The dev_priv->display.hpd_irq_setup hook is optional, so we can move the
> I915_HAS_HOTPLUG() check out of i915_hpd_irq_setup() and only set up the
> hook when hotplug support is present.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_irq.c | 42 ++++++++++++++++++++---------------------
>  1 file changed, 20 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 1d52ae9..8fe5a87 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -4145,26 +4145,24 @@ static void i915_hpd_irq_setup(struct drm_device *dev)
>  
>  	assert_spin_locked(&dev_priv->irq_lock);
>  
> -	if (I915_HAS_HOTPLUG(dev)) {
> -		hotplug_en = I915_READ(PORT_HOTPLUG_EN);
> -		hotplug_en &= ~HOTPLUG_INT_EN_MASK;
> -		/* Note HDMI and DP share hotplug bits */
> -		/* enable bits are the same for all generations */
> -		for_each_intel_encoder(dev, intel_encoder)
> -			if (dev_priv->hpd_stats[intel_encoder->hpd_pin].hpd_mark == HPD_ENABLED)
> -				hotplug_en |= hpd_mask_i915[intel_encoder->hpd_pin];
> -		/* Programming the CRT detection parameters tends
> -		   to generate a spurious hotplug event about three
> -		   seconds later.  So just do it once.
> -		*/
> -		if (IS_G4X(dev))
> -			hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
> -		hotplug_en &= ~CRT_HOTPLUG_VOLTAGE_COMPARE_MASK;
> -		hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
> -
> -		/* Ignore TV since it's buggy */
> -		I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
> -	}
> +	hotplug_en = I915_READ(PORT_HOTPLUG_EN);
> +	hotplug_en &= ~HOTPLUG_INT_EN_MASK;
> +	/* Note HDMI and DP share hotplug bits */
> +	/* enable bits are the same for all generations */
> +	for_each_intel_encoder(dev, intel_encoder)
> +		if (dev_priv->hpd_stats[intel_encoder->hpd_pin].hpd_mark == HPD_ENABLED)
> +			hotplug_en |= hpd_mask_i915[intel_encoder->hpd_pin];
> +	/* Programming the CRT detection parameters tends
> +	   to generate a spurious hotplug event about three
> +	   seconds later.  So just do it once.
> +	*/
> +	if (IS_G4X(dev))
> +		hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
> +	hotplug_en &= ~CRT_HOTPLUG_VOLTAGE_COMPARE_MASK;
> +	hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
> +
> +	/* Ignore TV since it's buggy */
> +	I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
>  }
>  
>  static irqreturn_t i965_irq_handler(int irq, void *arg)
> @@ -4428,14 +4426,14 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
>  			dev->driver->irq_postinstall = i915_irq_postinstall;
>  			dev->driver->irq_uninstall = i915_irq_uninstall;
>  			dev->driver->irq_handler = i915_irq_handler;
> -			dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
>  		} else {
>  			dev->driver->irq_preinstall = i965_irq_preinstall;
>  			dev->driver->irq_postinstall = i965_irq_postinstall;
>  			dev->driver->irq_uninstall = i965_irq_uninstall;
>  			dev->driver->irq_handler = i965_irq_handler;
> -			dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
>  		}
> +		if (I915_HAS_HOTPLUG(dev_priv))
> +			dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
>  		dev->driver->enable_vblank = i915_enable_vblank;
>  		dev->driver->disable_vblank = i915_disable_vblank;
>  	}
> -- 
> 2.0.5
>
> _______________________________________________
> 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

  reply	other threads:[~2015-01-09 14:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 12:21 [PATCH 0/7] drm/i915: Disable hpd for disabled eDP ports ville.syrjala
2015-01-09 12:21 ` [PATCH 1/7] drm/i915: Make hpd arrays big enough to avoid out of bounds access ville.syrjala
2015-01-09 14:41   ` [Intel-gfx] " Jani Nikula
2015-01-09 15:27     ` Ville Syrjälä
2015-01-09 12:21 ` [PATCH 2/7] drm/i915: Remove I915_HAS_HOTPLUG() check from i915_hpd_irq_setup() ville.syrjala
2015-01-09 14:52   ` Jani Nikula [this message]
2015-01-09 12:21 ` [PATCH 3/7] drm/i915: Don't register HDMI connectors for eDP ports on VLV/CHV ville.syrjala
2015-01-09 15:02   ` Jani Nikula
2015-01-12 23:48     ` Daniel Vetter
2015-01-09 12:21 ` [PATCH 4/7] drm/i915: Don't pretend SDVO hotplug works on 915 ville.syrjala
2015-01-09 15:04   ` Jani Nikula
2015-01-12 23:48   ` Daniel Vetter
2015-01-16 10:57     ` Ville Syrjälä
2015-01-09 12:21 ` [PATCH 5/7] drm/i915: Set intel_connector->polled to DRM_CONNECTOR_POLL_HPD when appropriate ville.syrjala
2015-01-09 12:21 ` [PATCH 6/7] drm/i915: Unify hpd setup between init and hpd storm handling ville.syrjala
2015-01-09 12:21 ` [PATCH 7/7] drm/i915: Disable HPD for disabled eDP ports ville.syrjala
2015-01-09 17:47   ` shuang.he
2015-01-13  0:46 ` [PATCH 0/7] drm/i915: Disable hpd " Sean V Kelley
2015-01-13  9:36   ` Ville Syrjälä

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=87ppaoxazw.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=eich@suse.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.