diff options
author | Jerome Glisse <jglisse@redhat.com> | 2010-07-15 15:43:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-07-15 21:25:02 -0400 |
commit | 9440106b460ddfb7c0ff98beb6a6741f1f67b92b (patch) | |
tree | f5d203d28ae2cf157ce9a0d268146b37672ccf4f /drivers/gpu/drm/drm_crtc_helper.c | |
parent | 86a1b9d1f175e9e9d022c7674d6ba1ede48ee15f (diff) |
drm: unify crtc,connector,encoder,fb debug printing
Unify debug printing so it easier to track what's happening
while debugging.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 774d21e4dcdd..11fe9c870d17 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -86,7 +86,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | |||
86 | int count = 0; | 86 | int count = 0; |
87 | int mode_flags = 0; | 87 | int mode_flags = 0; |
88 | 88 | ||
89 | DRM_DEBUG_KMS("%s\n", drm_get_connector_name(connector)); | 89 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, |
90 | drm_get_connector_name(connector)); | ||
90 | /* set all modes to the unverified state */ | 91 | /* set all modes to the unverified state */ |
91 | list_for_each_entry_safe(mode, t, &connector->modes, head) | 92 | list_for_each_entry_safe(mode, t, &connector->modes, head) |
92 | mode->status = MODE_UNVERIFIED; | 93 | mode->status = MODE_UNVERIFIED; |
@@ -102,8 +103,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | |||
102 | connector->status = connector->funcs->detect(connector); | 103 | connector->status = connector->funcs->detect(connector); |
103 | 104 | ||
104 | if (connector->status == connector_status_disconnected) { | 105 | if (connector->status == connector_status_disconnected) { |
105 | DRM_DEBUG_KMS("%s is disconnected\n", | 106 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", |
106 | drm_get_connector_name(connector)); | 107 | connector->base.id, drm_get_connector_name(connector)); |
107 | drm_mode_connector_update_edid_property(connector, NULL); | 108 | drm_mode_connector_update_edid_property(connector, NULL); |
108 | goto prune; | 109 | goto prune; |
109 | } | 110 | } |
@@ -141,8 +142,8 @@ prune: | |||
141 | 142 | ||
142 | drm_mode_sort(&connector->modes); | 143 | drm_mode_sort(&connector->modes); |
143 | 144 | ||
144 | DRM_DEBUG_KMS("Probed modes for %s\n", | 145 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id, |
145 | drm_get_connector_name(connector)); | 146 | drm_get_connector_name(connector)); |
146 | list_for_each_entry_safe(mode, t, &connector->modes, head) { | 147 | list_for_each_entry_safe(mode, t, &connector->modes, head) { |
147 | mode->vrefresh = drm_mode_vrefresh(mode); | 148 | mode->vrefresh = drm_mode_vrefresh(mode); |
148 | 149 | ||
@@ -374,6 +375,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
374 | if (!(ret = crtc_funcs->mode_fixup(crtc, mode, adjusted_mode))) { | 375 | if (!(ret = crtc_funcs->mode_fixup(crtc, mode, adjusted_mode))) { |
375 | goto done; | 376 | goto done; |
376 | } | 377 | } |
378 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); | ||
377 | 379 | ||
378 | /* Prepare the encoders and CRTCs before setting the mode. */ | 380 | /* Prepare the encoders and CRTCs before setting the mode. */ |
379 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 381 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
@@ -401,8 +403,9 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
401 | if (encoder->crtc != crtc) | 403 | if (encoder->crtc != crtc) |
402 | continue; | 404 | continue; |
403 | 405 | ||
404 | DRM_DEBUG("%s: set mode %s %x\n", drm_get_encoder_name(encoder), | 406 | DRM_DEBUG_KMS("[ENCODER:%d:%s] set [MODE:%d:%s]\n", |
405 | mode->name, mode->base.id); | 407 | encoder->base.id, drm_get_encoder_name(encoder), |
408 | mode->base.id, mode->name); | ||
406 | encoder_funcs = encoder->helper_private; | 409 | encoder_funcs = encoder->helper_private; |
407 | encoder_funcs->mode_set(encoder, mode, adjusted_mode); | 410 | encoder_funcs->mode_set(encoder, mode, adjusted_mode); |
408 | } | 411 | } |
@@ -478,10 +481,15 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
478 | 481 | ||
479 | crtc_funcs = set->crtc->helper_private; | 482 | crtc_funcs = set->crtc->helper_private; |
480 | 483 | ||
481 | DRM_DEBUG_KMS("crtc: %p %d fb: %p connectors: %p num_connectors:" | 484 | if (set->fb) { |
482 | " %d (x, y) (%i, %i)\n", | 485 | DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n", |
483 | set->crtc, set->crtc->base.id, set->fb, set->connectors, | 486 | set->crtc->base.id, set->fb->base.id, |
484 | (int)set->num_connectors, set->x, set->y); | 487 | (int)set->num_connectors, set->x, set->y); |
488 | } else { | ||
489 | DRM_DEBUG_KMS("[CRTC:%d] [NOFB] #connectors=%d (x y) (%i %i)\n", | ||
490 | set->crtc->base.id, (int)set->num_connectors, | ||
491 | set->x, set->y); | ||
492 | } | ||
485 | 493 | ||
486 | dev = set->crtc->dev; | 494 | dev = set->crtc->dev; |
487 | 495 | ||
@@ -610,8 +618,14 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
610 | mode_changed = true; | 618 | mode_changed = true; |
611 | connector->encoder->crtc = new_crtc; | 619 | connector->encoder->crtc = new_crtc; |
612 | } | 620 | } |
613 | DRM_DEBUG_KMS("setting connector %d crtc to %p\n", | 621 | if (new_crtc) { |
614 | connector->base.id, new_crtc); | 622 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [CRTC:%d]\n", |
623 | connector->base.id, drm_get_connector_name(connector), | ||
624 | new_crtc->base.id); | ||
625 | } else { | ||
626 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [NOCRTC]\n", | ||
627 | connector->base.id, drm_get_connector_name(connector)); | ||
628 | } | ||
615 | } | 629 | } |
616 | 630 | ||
617 | /* mode_set_base is not a required function */ | 631 | /* mode_set_base is not a required function */ |
@@ -629,8 +643,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
629 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, | 643 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, |
630 | set->x, set->y, | 644 | set->x, set->y, |
631 | old_fb)) { | 645 | old_fb)) { |
632 | DRM_ERROR("failed to set mode on crtc %p\n", | 646 | DRM_ERROR("failed to set mode on [CRTC:%d]\n", |
633 | set->crtc); | 647 | set->crtc->base.id); |
634 | ret = -EINVAL; | 648 | ret = -EINVAL; |
635 | goto fail; | 649 | goto fail; |
636 | } | 650 | } |