Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

drm/vc4: hdmi: vc4_hdmi_hpd_irq_thread() checks !force_hotplug globally instead of per-connector bitmask

Ouverte Adaptée aux débutants
#7,724 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@popcornmix y travaille déjà.

Depuis le 28/10/2026.

  • #7727 par @popcornmix — ouverte

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
c, linux

Piste de recherche

Lisez drivers/gpu/drm/vc4/vc4_hdmi.c, en vous concentrant sur vc4_hdmi_hpd_irq_thread() et sur la vérification par connecteur dans vc4_hdmi_connector_detect_ctx(). Mettez à jour le gestionnaire IRQ pour qu’il applique le bit du connecteur correspondant, puis vérifiez que le forçage d’un connecteur HDMI permet toujours les événements de connexion à chaud sur l’autre.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Describe the bug

In drivers/gpu/drm/vc4/vc4_hdmi.c, vc4.force_hotplug is defined as a per-connector bitfield (bit0 = HDMI0 / HDMI-A-1, bit1 = HDMI1 / HDMI-A-2), and vc4_hdmi_connector_detect_ctx() (added in c96c9d87f8bd / #5052) checks the per-connector bit:

/* bit field to force hotplug detection. bit0 = HDMI0 */
static int force_hotplug;
module_param(force_hotplug, int, 0644);
...
	if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0))
		status = connector_status_connected;

However, vc4_hdmi_hpd_irq_thread() (modified in cb7db28b9e17 / #6123) checks !force_hotplug globally instead of checking only the connector's corresponding bit:

static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv)
{
	struct vc4_hdmi *vc4_hdmi = priv;
	struct drm_connector *connector = &vc4_hdmi->connector;
	struct drm_device *dev = connector->dev;

	if (dev && dev->registered && !force_hotplug)
		drm_connector_helper_hpd_irq_event(connector);

	return IRQ_HANDLED;
}

Because vc4_hdmi_bind() sets connector->polled = DRM_CONNECTOR_POLL_HPD whenever HPD IRQs are registered, drm_kms_helper's periodic polling (output_poll_execute) also skips both HDMI connectors.

As a result, setting vc4.force_hotplug=1 (to force only HDMI-A-1) inadvertently disables HPD interrupts on HDMI-A-2, and setting vc4.force_hotplug=2 (to force only HDMI-A-2, e.g. for an internal laptop panel on CM5 / Argon ONE UP where HDMI-A-2 is internal and HDMI-A-1 is the external HDMI port) completely disables hotplug/unplug interrupt detection on HDMI-A-1.

Steps to reproduce the behaviour
  1. Boot a Raspberry Pi 5 / CM5 with vc4.force_hotplug=2 (forcing only HDMI-A-2, leaving HDMI-A-1 unforced).
  2. Connect an external monitor to HDMI-A-1 (or boot with it connected) and then unplug HDMI-A-1 while the system is running.
  3. Observe /sys/class/drm/card*-HDMI-A-1/status: it remains stuck at connected (or disconnected if plugged in later) until echo detect > /sys/class/drm/card*-HDMI-A-1/status is manually triggered, because vc4_hdmi_hpd_irq_thread() ignores the HPD interrupt whenever force_hotplug != 0.
Device (s)

Raspberry Pi 5, Raspberry Pi CM5, Raspberry Pi 4 Mod. B, Raspberry Pi CM4

System
  • OS: Raspberry Pi OS Trixie (64-bit)
  • Kernel: Linux 6.18.59+rpt-rpi-2712 (also affects rpi-6.12.y and rpi-6.18.y)
Proposed Fix / Patch

Check the per-connector bit in vc4_hdmi_hpd_irq_thread() matching vc4_hdmi_connector_detect_ctx():

--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -2480,7 +2480,8 @@ static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv)
 	struct drm_connector *connector = &vc4_hdmi->connector;
 	struct drm_device *dev = connector->dev;
 
-	if (dev && dev->registered && !force_hotplug)
+	if (dev && dev->registered &&
+	    !(force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0)))
 		drm_connector_helper_hpd_irq_event(connector);
 
 	return IRQ_HANDLED;
Langage dominant
C
Étoiles
13.3k
Forks
5.5k
Merge moyen
1 j 12 h
PR mergées (30 j)
24

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de raspberrypi/linux

Toutes les issues de raspberrypi/linux

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.