From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v2 4/5] drm/i915: Don't change the status of forced connectors during hotplug detect
Date: Thu, 20 Jul 2023 15:54:17 +0300 [thread overview]
Message-ID: <20230720125418.236140-5-imre.deak@intel.com> (raw)
In-Reply-To: <20230720125418.236140-1-imre.deak@intel.com>
DRM display connectors forced to a connected/disconnected state via the
drm_connector::force member shouldn't change their status. Atm, this can
still happen in the connector's detect function when called to handle a
hotplug event. This in turn may lead to the GETCONNECTOR ioctl to report
the incorrect state if it's called to return the connector properties
without doing an actual detection (by calling the ioctl with a non-zero
drm_mode_get_connector::count_modes).
Fix the above by updating the connector state during hotplug detect only
if the connector state is not forced.
Testcase: igt@kms_force_connector_basic@force-connector-state
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_hotplug.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
index d9f0ab1d953b9..1f6fa3f994feb 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
@@ -267,14 +267,16 @@ intel_encoder_hotplug(struct intel_encoder *encoder,
struct drm_device *dev = connector->base.dev;
enum drm_connector_status old_status;
u64 old_epoch_counter;
+ int status;
bool ret = false;
drm_WARN_ON(dev, !mutex_is_locked(&dev->mode_config.mutex));
old_status = connector->base.status;
old_epoch_counter = connector->base.epoch_counter;
- connector->base.status =
- drm_helper_probe_detect(&connector->base, NULL, false);
+ status = drm_helper_probe_detect(&connector->base, NULL, false);
+ if (!connector->base.force)
+ connector->base.status = status;
if (old_epoch_counter != connector->base.epoch_counter)
ret = true;
--
2.37.2
next prev parent reply other threads:[~2023-07-20 12:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 12:54 [Intel-gfx] [PATCH v2 0/5] drm/i915: Fix connector HPD polling Imre Deak
2023-07-20 12:54 ` [Intel-gfx] [PATCH v2 1/5] drm/i915: Avoid endless HPD poll detect loop via runtime suspend/resume Imre Deak
2023-07-20 12:54 ` [Intel-gfx] [PATCH v2 2/5] drm: Add an HPD poll helper to reschedule the poll work Imre Deak
2023-08-15 9:34 ` Dmitry Baryshkov
2023-07-20 12:54 ` [Intel-gfx] [PATCH v2 3/5] drm/i915: Fix HPD polling, reenabling the output poll work as needed Imre Deak
2023-07-20 12:54 ` Imre Deak [this message]
2023-07-20 12:54 ` [Intel-gfx] [PATCH v2 5/5] drm/i915: Don't change the status of forced connectors during HPD poll detect Imre Deak
2023-07-20 17:29 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix connector HPD polling Patchwork
2023-07-20 17:29 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-07-20 17:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-07-21 0:03 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-21 12:30 ` Imre Deak
2023-08-04 12:28 ` [Intel-gfx] [PATCH v2 0/5] " Hogander, Jouni
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=20230720125418.236140-5-imre.deak@intel.com \
--to=imre.deak@intel.com \
--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