Skip to content

Commit

Permalink
drm: ensure atomic messages consistently include the name of the comp…
Browse files Browse the repository at this point in the history
…onent

Most DRM messages include three pieces of information: the type of the
component (CRTC, ENCODER, CONNECTOR etc), the DRM object ID of the
component, and the component name.  However, there are some messages
which omit the last piece of identifying information.  This makes it
harder to debug failures when these messages are printed, because the
DRM object ID doesn't supply enough information to know which piece of
hardware had a problem.

Update the atomic modeset code to always print the component name along
with the type and DRM object ID.

Fixes: 4cba685 ("drm/atomic-helper: Reject legacy flips on a disabled pipe")
Fixes: 8d4d0d7 ("drm/atomic-helper: Print an error if vblank wait times out")
Fixes: 5481c8f ("drm/atomic-helper: Check encoder/crtc constraints")
Fixes: 99cf4a2 ("drm/atomic: Add current-mode blob to CRTC state")
Fixes: cc4ceb4 ("drm: Global atomic state handling")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
[danvet: Wiggle in conflicting hunk.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Russell King authored and Daniel Vetter committed Feb 14, 2017
1 parent cd57b48 commit 6ac7c54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ static int drm_atomic_crtc_check(struct drm_crtc *crtc,
* pipe.
*/
if (state->event && !state->active && !crtc->state->active) {
DRM_DEBUG_ATOMIC("[CRTC:%d] requesting event but off\n",
crtc->base.id);
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] requesting event but off\n",
crtc->base.id, crtc->name);
return -EINVAL;
}

Expand Down Expand Up @@ -1037,8 +1037,9 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state,
state->connectors[index].ptr = connector;
connector_state->state = state;

DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d] %p state to %p\n",
connector->base.id, connector_state, state);
DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d:%s] %p state to %p\n",
connector->base.id, connector->name,
connector_state, state);

if (connector_state->crtc) {
struct drm_crtc_state *crtc_state;
Expand Down
12 changes: 7 additions & 5 deletions drivers/gpu/drm/drm_atomic_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ update_connector_routing(struct drm_atomic_state *state,
}

if (!drm_encoder_crtc_ok(new_encoder, connector_state->crtc)) {
DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] incompatible with [CRTC:%d]\n",
DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] incompatible with [CRTC:%d:%s]\n",
new_encoder->base.id,
new_encoder->name,
connector_state->crtc->base.id);
connector_state->crtc->base.id,
connector_state->crtc->name);
return -EINVAL;
}

Expand Down Expand Up @@ -1119,7 +1120,8 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
drm_crtc_vblank_count(crtc),
msecs_to_jiffies(50));

WARN(!ret, "[CRTC:%d] vblank wait timed out\n", crtc->base.id);
WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n",
crtc->base.id, crtc->name);

drm_crtc_vblank_put(crtc);
}
Expand Down Expand Up @@ -2792,8 +2794,8 @@ static int page_flip_common(
/* Make sure we don't accidentally do a full modeset. */
state->allow_modeset = false;
if (!crtc_state->active) {
DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n",
crtc->base.id);
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] disabled, rejecting legacy flip\n",
crtc->base.id, crtc->name);
return -EINVAL;
}

Expand Down

0 comments on commit 6ac7c54

Please sign in to comment.