Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gil Dekel <gildekel@chromium.org>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: seanpaul@chromium.org, Gil Dekel <gildekel@chromium.org>
Subject: [Intel-gfx] [PATCH v2 6/6] drm/i915/dp_link_training: Emit a link-status=Bad uevent with trigger property
Date: Thu, 24 Aug 2023 00:31:09 -0400	[thread overview]
Message-ID: <20230824043240.323564-7-gildekel@chromium.org> (raw)
In-Reply-To: <20230824043240.323564-1-gildekel@chromium.org>

When a link-training attempt fails, emit a uevent to user space that
includes the trigger property, which in this case will be
link-statue=Bad.

This will allow userspace to parse the uevent property and better
understand the reason for the previous modeset failure.

Signed-off-by: Gil Dekel <gildekel@chromium.org>

V2:
  - init link_status_property inline.
---
 drivers/gpu/drm/i915/display/intel_dp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index e8b10f59e141..328e9f030033 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -42,6 +42,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_sysfs.h>

 #include "g4x_dp.h"
 #include "i915_drv.h"
@@ -5995,6 +5996,8 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	struct intel_dp *intel_dp =
 		container_of(work, typeof(*intel_dp), modeset_retry_work);
 	struct drm_connector *connector = &intel_dp->attached_connector->base;
+	struct drm_property *link_status_property =
+		connector->dev->mode_config.link_status_property;

 	/* Set the connector's (and possibly all its downstream MST ports') link
 	 * status to BAD.
@@ -6011,7 +6014,7 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	}
 	mutex_unlock(&connector->dev->mode_config.mutex);
 	/* Send Hotplug uevent so userspace can reprobe */
-	drm_kms_helper_connector_hotplug_event(connector);
+	drm_sysfs_connector_property_event(connector, link_status_property);
 }

 bool
--
Gil Dekel, Software Engineer, Google / ChromeOS Display and Graphics

  parent reply	other threads:[~2023-08-24  4:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 16:59 [Intel-gfx] [PATCH 0/3] Define a final failure state when link training fails Gil Dekel
2023-08-18 16:59 ` [Intel-gfx] [PATCH 1/3] drm/i915/dp_link_training: Add a final failing state to link training fallback Gil Dekel
2023-08-18 18:25   ` Manasi Navare
2023-08-18 16:59 ` [Intel-gfx] [PATCH 2/3] drm/i915/dp_link_training: Add a final failing state to link training fallback for MST Gil Dekel
2023-08-18 16:59 ` [Intel-gfx] [PATCH 3/3] drm/i915/dp_link_training: Emit a link-status=Bad uevent with trigger property Gil Dekel
2023-08-18 18:09 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Define a final failure state when link training fails Patchwork
2023-08-18 18:09 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-18 18:27 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-08-24  4:31 ` [Intel-gfx] [PATCH v2 0/6] drm/i915/dp_link_training: " Gil Dekel
2023-08-24  4:31   ` [Intel-gfx] [PATCH v2 1/6] drm/i915/dp_link_training: Add a final failing state to link training fallback Gil Dekel
2023-08-24  4:31   ` [Intel-gfx] [PATCH v2 2/6] drm/i915/dp_link_training: Add a final failing state to link training fallback for MST Gil Dekel
2023-08-24  4:31   ` [Intel-gfx] [PATCH v2 3/6] drm/dp_mst: Add drm_dp_set_mst_topology_link_status() Gil Dekel
2023-08-24  4:31   ` [Intel-gfx] [PATCH v2 4/6] drm/i915: Move DP modeset_retry_work into intel_dp Gil Dekel
2023-08-24  4:31   ` [Intel-gfx] [PATCH v2 5/6] drm/i915/dp_link_training: Set all downstream MST ports to BAD before retrying Gil Dekel
2023-08-24  4:31   ` Gil Dekel [this message]
2023-08-24  9:56   ` [Intel-gfx] [PATCH v2 0/6] drm/i915/dp_link_training: Define a final failure state when link training fails Jani Nikula
2023-08-24  6:24 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork

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=20230824043240.323564-7-gildekel@chromium.org \
    --to=gildekel@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=seanpaul@chromium.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