diff mbox series

[3/3] drm/atomic-helper: Improve drm_atomic_helper_check_plane_state() debugs

Message ID 20190919141904.15840-3-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/rect: Return scaling factor and error code separately | expand

Commit Message

Ville Syrjala Sept. 19, 2019, 2:19 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Dump out the plane/crtc id/name in the failure debug messages.
Makes a bit easier to figure out which plane exactly has failed
when you have tons of them.

Cc: Sean Paul <sean@poorly.run>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 9de39da54c48..86a2839dbfdd 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -761,6 +761,7 @@  int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
 					bool can_update_disabled)
 {
 	struct drm_plane *plane = plane_state->plane;
+	struct drm_crtc *crtc = crtc_state->crtc;
 	struct drm_framebuffer *fb = plane_state->fb;
 	struct drm_rect *src = &plane_state->src;
 	struct drm_rect *dst = &plane_state->dst;
@@ -785,7 +786,9 @@  int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
 	}
 
 	if (!crtc_state->enable && !can_update_disabled) {
-		DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n");
+		DRM_DEBUG_KMS("Cannot update [PLANE:%d:%s] of disabled [CRTC:%d:%s].\n",
+			      plane->base.id, plane->name,
+			      crtc->base.id, crtc->name);
 		return -EINVAL;
 	}
 
@@ -831,7 +834,9 @@  int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
 		return 0;
 
 	if (!can_position && !drm_rect_equals(dst, &clip)) {
-		DRM_DEBUG_KMS("Plane must cover entire CRTC\n");
+		DRM_DEBUG_KMS("[PLANE:%d:%s] must cover entire [CRTC:%d:%s]\n",
+			      plane->base.id, plane->name,
+			      crtc->base.id, crtc->name);
 		drm_rect_debug_print("dst: ", dst, false);
 		drm_rect_debug_print("clip: ", &clip, false);
 		return -EINVAL;