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 | |
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')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 44 |
2 files changed, 42 insertions, 22 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 57cea01c4ffb..b5802cf6664e 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -1126,7 +1126,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data, | |||
1126 | if (file_priv->master->minor->type == DRM_MINOR_CONTROL) { | 1126 | if (file_priv->master->minor->type == DRM_MINOR_CONTROL) { |
1127 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, | 1127 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, |
1128 | head) { | 1128 | head) { |
1129 | DRM_DEBUG_KMS("CRTC ID is %d\n", crtc->base.id); | 1129 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); |
1130 | if (put_user(crtc->base.id, crtc_id + copied)) { | 1130 | if (put_user(crtc->base.id, crtc_id + copied)) { |
1131 | ret = -EFAULT; | 1131 | ret = -EFAULT; |
1132 | goto out; | 1132 | goto out; |
@@ -1154,8 +1154,8 @@ int drm_mode_getresources(struct drm_device *dev, void *data, | |||
1154 | list_for_each_entry(encoder, | 1154 | list_for_each_entry(encoder, |
1155 | &dev->mode_config.encoder_list, | 1155 | &dev->mode_config.encoder_list, |
1156 | head) { | 1156 | head) { |
1157 | DRM_DEBUG_KMS("ENCODER ID is %d\n", | 1157 | DRM_DEBUG_KMS("[ENCODER:%d:%s]\n", encoder->base.id, |
1158 | encoder->base.id); | 1158 | drm_get_encoder_name(encoder)); |
1159 | if (put_user(encoder->base.id, encoder_id + | 1159 | if (put_user(encoder->base.id, encoder_id + |
1160 | copied)) { | 1160 | copied)) { |
1161 | ret = -EFAULT; | 1161 | ret = -EFAULT; |
@@ -1185,8 +1185,9 @@ int drm_mode_getresources(struct drm_device *dev, void *data, | |||
1185 | list_for_each_entry(connector, | 1185 | list_for_each_entry(connector, |
1186 | &dev->mode_config.connector_list, | 1186 | &dev->mode_config.connector_list, |
1187 | head) { | 1187 | head) { |
1188 | DRM_DEBUG_KMS("CONNECTOR ID is %d\n", | 1188 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
1189 | connector->base.id); | 1189 | connector->base.id, |
1190 | drm_get_connector_name(connector)); | ||
1190 | if (put_user(connector->base.id, | 1191 | if (put_user(connector->base.id, |
1191 | connector_id + copied)) { | 1192 | connector_id + copied)) { |
1192 | ret = -EFAULT; | 1193 | ret = -EFAULT; |
@@ -1209,7 +1210,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data, | |||
1209 | } | 1210 | } |
1210 | card_res->count_connectors = connector_count; | 1211 | card_res->count_connectors = connector_count; |
1211 | 1212 | ||
1212 | DRM_DEBUG_KMS("Counted %d %d %d\n", card_res->count_crtcs, | 1213 | DRM_DEBUG_KMS("CRTC[%d] CONNECTORS[%d] ENCODERS[%d]\n", card_res->count_crtcs, |
1213 | card_res->count_connectors, card_res->count_encoders); | 1214 | card_res->count_connectors, card_res->count_encoders); |
1214 | 1215 | ||
1215 | out: | 1216 | out: |
@@ -1312,7 +1313,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
1312 | 1313 | ||
1313 | memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo)); | 1314 | memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo)); |
1314 | 1315 | ||
1315 | DRM_DEBUG_KMS("connector id %d:\n", out_resp->connector_id); | 1316 | DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id); |
1316 | 1317 | ||
1317 | mutex_lock(&dev->mode_config.mutex); | 1318 | mutex_lock(&dev->mode_config.mutex); |
1318 | 1319 | ||
@@ -1493,6 +1494,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, | |||
1493 | goto out; | 1494 | goto out; |
1494 | } | 1495 | } |
1495 | crtc = obj_to_crtc(obj); | 1496 | crtc = obj_to_crtc(obj); |
1497 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); | ||
1496 | 1498 | ||
1497 | if (crtc_req->mode_valid) { | 1499 | if (crtc_req->mode_valid) { |
1498 | /* If we have a mode we need a framebuffer. */ | 1500 | /* If we have a mode we need a framebuffer. */ |
@@ -1569,6 +1571,9 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, | |||
1569 | goto out; | 1571 | goto out; |
1570 | } | 1572 | } |
1571 | connector = obj_to_connector(obj); | 1573 | connector = obj_to_connector(obj); |
1574 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", | ||
1575 | connector->base.id, | ||
1576 | drm_get_connector_name(connector)); | ||
1572 | 1577 | ||
1573 | connector_set[i] = connector; | 1578 | connector_set[i] = connector; |
1574 | } | 1579 | } |
@@ -1684,6 +1689,7 @@ int drm_mode_addfb(struct drm_device *dev, | |||
1684 | 1689 | ||
1685 | r->fb_id = fb->base.id; | 1690 | r->fb_id = fb->base.id; |
1686 | list_add(&fb->filp_head, &file_priv->fbs); | 1691 | list_add(&fb->filp_head, &file_priv->fbs); |
1692 | DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id); | ||
1687 | 1693 | ||
1688 | out: | 1694 | out: |
1689 | mutex_unlock(&dev->mode_config.mutex); | 1695 | mutex_unlock(&dev->mode_config.mutex); |
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 | } |