summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>2026-09-01 21:50:30 +0300
committerCristian Ciocaltea <cristian.ciocaltea@collabora.com>2026-09-19 23:03:44 +0300
commit9d1e2ae7196dacc90acc00a73b92c11662eb90ca (patch)
tree85d57f1d4bc07b81ad503b63005622da985c9dc2 /drivers
parentcc6d8b2f87b97477ae25dcc1adb8e6e5a0088e4a (diff)
drm/probe-helper: Introduce .force_ctx() connector callback
The .force() connector callback is invoked by drm_helper_probe_single_connector_modes() while the modeset acquire context it created is live, but the hook signature provides no way to pass it down, e.g. to support implementations needing to lock further objects. Add a .force_ctx() variant to drm_connector_helper_funcs, taking the acquire context and returning an error code, so that -EDEADLK propagates into the existing retry path. When provided, it takes precedence over drm_connector_funcs' .force(), which is kept for existing users. This is a prerequisite for SCDC status synchronization in the HDMI connector framework. Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260901-dw-hdmi-qp-scramb-v11-6-bc12954a0688@collabora.com Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_probe_helper.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index e26ead5b5e58..856b40fdaac4 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -559,6 +559,7 @@ static int __drm_helper_update_and_validate(struct drm_connector *connector,
int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
uint32_t maxX, uint32_t maxY)
{
+ const struct drm_connector_helper_funcs *funcs = connector->helper_private;
struct drm_device *dev = connector->dev;
struct drm_display_mode *mode;
int count = 0, ret;
@@ -592,8 +593,20 @@ retry:
connector->status = connector_status_connected;
else
connector->status = connector_status_disconnected;
- if (connector->funcs->force)
+
+ if (funcs && funcs->force_ctx) {
+ ret = funcs->force_ctx(connector, &ctx);
+ if (ret == -EDEADLK) {
+ connector->status = old_status;
+ drm_modeset_backoff(&ctx);
+ goto retry;
+ } else if (ret < 0) {
+ drm_dbg_kms(dev, "[CONNECTOR:%d:%s] force_ctx failed: %d\n",
+ connector->base.id, connector->name, ret);
+ }
+ } else if (connector->funcs->force) {
connector->funcs->force(connector);
+ }
} else {
ret = drm_helper_probe_detect(connector, &ctx, true);