diff mbox series

[v2,3/3] drm/bridge: log message on atomic_check() and mode_fixup() failure

Message ID 20220829151451.152114-3-contact@emersion.fr (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] drm/atomic-helper: print message on driver connector check failure | expand

Commit Message

Simon Ser Aug. 29, 2022, 3:15 p.m. UTC
This helps user-space understand why an atomic commit fails.

v2: new patch

Signed-off-by: Simon Ser <contact@emersion.fr>
---
 drivers/gpu/drm/drm_bridge.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 1545c50fd1c8..c41c728b0c28 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -830,12 +830,26 @@  static int drm_atomic_bridge_check(struct drm_bridge *bridge,
 
 		ret = bridge->funcs->atomic_check(bridge, bridge_state,
 						  crtc_state, conn_state);
-		if (ret)
+		if (ret) {
+			drm_dbg_atomic(bridge->dev,
+				       "bridge driver check failed for [CRTC:%d:%s] and [CONNECTOR:%d:%s]\n",
+				       crtc_state->crtc->base.id,
+				       crtc_state->crtc->name,
+				       conn_state->connector->base.id,
+				       conn_state->connector->name);
 			return ret;
+		}
 	} else if (bridge->funcs->mode_fixup) {
 		if (!bridge->funcs->mode_fixup(bridge, &crtc_state->mode,
-					       &crtc_state->adjusted_mode))
+					       &crtc_state->adjusted_mode)) {
+			drm_dbg_atomic(bridge->dev,
+				       "bridge mode fixup failed for [CRTC:%d:%s] and [CONNECTOR:%d:%s]\n",
+				       crtc_state->crtc->base.id,
+				       crtc_state->crtc->name,
+				       conn_state->connector->base.id,
+				       conn_state->connector->name);
 			return -EINVAL;
+		}
 	}
 
 	return 0;