From: Jani Nikula <jani.nikula@intel.com>
To: Simon Ser <contact@emersion.fr>, intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH] i915/display/hotplug: use drm_kms_helper_connector_hotplug_event()
Date: Wed, 21 Jun 2023 15:05:05 +0300 [thread overview]
Message-ID: <87ilbh2f7y.fsf@intel.com> (raw)
In-Reply-To: <20230620181203.272076-1-contact@emersion.fr>
On Tue, 20 Jun 2023, Simon Ser <contact@emersion.fr> wrote:
> This adds more information to the hotplug uevent and lets user-space
> know that it's about a particular connector only.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Gustavo Sousa <gustavo.sousa@intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_hotplug.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> index 1160fa20433b..605c6e05a169 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> @@ -376,6 +376,7 @@ static void i915_hotplug_work_func(struct work_struct *work)
> u32 changed = 0, retry = 0;
> u32 hpd_event_bits;
> u32 hpd_retry_bits;
> + struct drm_connector *first_changed_connector = NULL;
>
> mutex_lock(&dev_priv->drm.mode_config.mutex);
> drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n");
> @@ -428,6 +429,10 @@ static void i915_hotplug_work_func(struct work_struct *work)
> break;
> case INTEL_HOTPLUG_CHANGED:
> changed |= hpd_bit;
> + if (!first_changed_connector) {
> + drm_connector_get(&connector->base);
> + first_changed_connector = &connector->base;
> + }
> break;
> case INTEL_HOTPLUG_RETRY:
> retry |= hpd_bit;
> @@ -438,9 +443,14 @@ static void i915_hotplug_work_func(struct work_struct *work)
> drm_connector_list_iter_end(&conn_iter);
> mutex_unlock(&dev_priv->drm.mode_config.mutex);
>
> - if (changed)
> + if (hweight32(changed) == 1)
> + drm_kms_helper_connector_hotplug_event(first_changed_connector);
What if more than one connector share the same hpd pin?
BR,
Jani.
> + else if (changed)
> drm_kms_helper_hotplug_event(&dev_priv->drm);
>
> + if (first_changed_connector)
> + drm_connector_put(first_changed_connector);
> +
> /* Remove shared HPD pins that have changed */
> retry &= ~changed;
> if (retry) {
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-06-21 12:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 18:12 [Intel-gfx] [PATCH] i915/display/hotplug: use drm_kms_helper_connector_hotplug_event() Simon Ser
2023-06-21 0:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-21 9:17 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-06-21 12:05 ` Jani Nikula [this message]
2023-06-21 12:07 ` [Intel-gfx] [PATCH] " Simon Ser
2023-06-21 12:11 ` Jani Nikula
2023-06-21 12:14 ` Simon Ser
2023-06-21 12:26 ` Jani Nikula
2023-06-23 8:36 ` Simon Ser
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=87ilbh2f7y.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=contact@emersion.fr \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=rodrigo.vivi@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