From: Jani Nikula <jani.nikula@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Egbert Eich <eich@suse.de>, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v2] drm/i915: Only reprobe display on encoder which has received an HPD event (v2)
Date: Thu, 11 Apr 2013 18:06:23 +0300 [thread overview]
Message-ID: <87obdlcdjk.fsf@intel.com> (raw)
In-Reply-To: <1365688826-13794-1-git-send-email-eich@suse.de>
On Thu, 11 Apr 2013, Egbert Eich <eich@suse.de> wrote:
> Instead of calling into the DRM helper layer to poll all connectors for
> changes in connected displays probe only those connectors which have
> received a hotplug event.
>
> Signed-off-by: Egbert Eich <eich@suse.de>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Yup.
>
> v2: Resolved conflicts with changes in previous commits.
> Renamed function and and added a WARN_ON() to warn of
> intel_hpd_irq_event() from being called without
> mode_config.mutex held - suggested by Jani Nikula.
> ---
> drivers/gpu/drm/i915/i915_irq.c | 34 ++++++++++++++++++++++++++++------
> 1 file changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 6e643d7..54eca33 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -334,6 +334,21 @@ static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
> crtc);
> }
>
> +static int intel_hpd_irq_event(struct drm_device *dev, struct drm_connector *connector)
> +{
> + enum drm_connector_status old_status;
> +
> + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> + old_status = connector->status;
> +
> + connector->status = connector->funcs->detect(connector, false);
> + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
> + connector->base.id,
> + drm_get_connector_name(connector),
> + old_status, connector->status);
> + return (old_status != connector->status);
> +}
> +
> /*
> * Handle hotplug events outside the interrupt handler proper.
> */
> @@ -350,6 +365,7 @@ static void i915_hotplug_work_func(struct work_struct *work)
> struct drm_connector *connector;
> unsigned long irqflags;
> bool hpd_disabled = false;
> + bool changed = false;
> u32 hpd_event_bits;
>
> /* HPD irq before everything is fully set up. */
> @@ -395,14 +411,20 @@ static void i915_hotplug_work_func(struct work_struct *work)
>
> spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
>
> - list_for_each_entry(intel_encoder, &mode_config->encoder_list, base.head)
> - if (intel_encoder->hot_plug)
> - intel_encoder->hot_plug(intel_encoder);
> -
> + list_for_each_entry(connector, &mode_config->connector_list, head) {
> + intel_connector = to_intel_connector(connector);
> + intel_encoder = intel_connector->encoder;
> + if (hpd_event_bits & (1 << intel_encoder->hpd_pin)) {
> + if (intel_encoder->hot_plug)
> + intel_encoder->hot_plug(intel_encoder);
> + if (intel_hpd_irq_event(dev, connector))
> + changed = true;
> + }
> + }
> mutex_unlock(&mode_config->mutex);
>
> - /* Just fire off a uevent and let userspace tell us what to do */
> - drm_helper_hpd_irq_event(dev);
> + if (changed)
> + drm_kms_helper_hotplug_event(dev);
> }
>
> static void ironlake_handle_rps_change(struct drm_device *dev)
> --
> 1.8.1.4
next prev parent reply other threads:[~2013-04-11 15:07 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Message-ID: <87wqs9nqbb.fsf@intel.com>
2013-04-11 14:00 ` [PATCH v2] drm/i915: Only reprobe display on encoder which has received an HPD event (v2) Egbert Eich
2013-04-11 15:06 ` Jani Nikula [this message]
2013-04-23 12:26 ` Daniel Vetter
2013-04-09 9:24 [PATCH v3 0/7] Add HPD interrupt storm detection Egbert Eich
2013-04-09 9:24 ` [PATCH v3 1/7] drm/i915: Add HPD IRQ storm detection (v4) Egbert Eich
2013-04-11 9:32 ` Jani Nikula
2013-04-11 10:46 ` Daniel Vetter
2013-04-16 9:50 ` Egbert Eich
2013-04-16 11:34 ` Egbert Eich
2013-04-16 11:36 ` [PATCH 1/7] drm/i915: Add HPD IRQ storm detection (v5) Egbert Eich
2013-04-16 11:36 ` [PATCH 2/7] drm/i915: (re)init HPD interrupt storm statistics Egbert Eich
2013-04-16 11:36 ` [PATCH 3/7] drm/i915: Mask out the HPD irq bits before setting them individually Egbert Eich
2013-04-16 11:36 ` [PATCH 4/7] drm/i915: Disable HPD interrupt on pin when irq storm is detected (v3) Egbert Eich
2013-04-16 11:36 ` [PATCH 5/7] drm/i915: Add Reenable Timer to turn Hotplug Detection back on (v4) Egbert Eich
2013-04-16 18:07 ` Daniel Vetter
2013-04-16 20:22 ` Egbert Eich
2013-04-16 20:26 ` Daniel Vetter
2013-04-16 11:36 ` [PATCH 6/7] drm/i915: Add bit field to record which pins have received HPD events (v3) Egbert Eich
2013-04-16 11:37 ` [PATCH 7/7] drm/i915: Only reprobe display on encoder which has received an HPD event (v2) Egbert Eich
2013-04-09 9:24 ` [PATCH v3 2/7] drm/i915: (re)init HPD interrupt storm statistics Egbert Eich
2013-04-11 9:54 ` Jani Nikula
2013-04-09 9:24 ` [PATCH v3 3/7] drm/i915: Mask out the HPD irq bits before setting them individually Egbert Eich
2013-04-11 9:56 ` Jani Nikula
2013-04-09 9:24 ` [PATCH v3 4/7] drm/i915: Disable HPD interrupt on pin when irq storm is detected (v2) Egbert Eich
2013-04-11 10:13 ` Jani Nikula
2013-04-11 13:25 ` [PATCH v3] drm/i915: Disable HPD interrupt on pin when irq storm is detected (v3) Egbert Eich
2013-04-11 14:20 ` Jani Nikula
2013-04-09 9:24 ` [PATCH v3 5/7] drm/i915: Add Reenable Timer to turn Hotplug Detection back on (v3) Egbert Eich
2013-04-11 10:44 ` Jani Nikula
2013-04-11 13:10 ` Egbert Eich
2013-04-11 14:48 ` Jani Nikula
2013-04-11 13:28 ` [PATCH v4] drm/i915: Add Reenable Timer to turn Hotplug Detection back on (v4) Egbert Eich
2013-04-11 14:30 ` Jani Nikula
2013-04-09 9:24 ` [PATCH v3 6/7] drm/i915: Add bit field to record which pins have received HPD events (v2) Egbert Eich
2013-04-11 13:21 ` Jani Nikula
2013-04-11 13:34 ` Egbert Eich
2013-04-11 13:57 ` [PATCH v3] drm/i915: Add bit field to record which pins have received HPD events (v3) Egbert Eich
2013-04-11 14:03 ` [PATCH v3 Update] " Egbert Eich
2013-04-11 15:00 ` Jani Nikula
2013-04-09 9:24 ` [PATCH v3 7/7] drm/i915: Only reprobe display on encoder which has received an HPD event Egbert Eich
2013-04-11 13:35 ` Jani Nikula
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=87obdlcdjk.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=daniel.vetter@intel.com \
--cc=eich@suse.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox