aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2009-07-20 01:48:07 -0400
committerDave Airlie <airlied@redhat.com>2009-08-04 00:02:51 -0400
commit58367ed65f30128d8b763bf4c1fb942da49ade15 (patch)
tree3fe8fd947ac82480d914aedc5191ee28d640d631 /drivers/gpu/drm/drm_crtc_helper.c
parent87fdff81cd2d770f0adc742e21eb5e062ad20def (diff)
drm: Add the debug info in generic drm mode by using DRM_DEBUG_KMS
Add the debug info in generic drm mode by using DRM_DEBUG_KMS Signed-off-by: Zhao Yakui <yakui.zhao@intel.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.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 3da9cfa31848..9cd845132580 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -94,7 +94,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
94 int count = 0; 94 int count = 0;
95 int mode_flags = 0; 95 int mode_flags = 0;
96 96
97 DRM_DEBUG("%s\n", drm_get_connector_name(connector)); 97 DRM_DEBUG_KMS("%s\n", drm_get_connector_name(connector));
98 /* set all modes to the unverified state */ 98 /* set all modes to the unverified state */
99 list_for_each_entry_safe(mode, t, &connector->modes, head) 99 list_for_each_entry_safe(mode, t, &connector->modes, head)
100 mode->status = MODE_UNVERIFIED; 100 mode->status = MODE_UNVERIFIED;
@@ -102,7 +102,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
102 connector->status = connector->funcs->detect(connector); 102 connector->status = connector->funcs->detect(connector);
103 103
104 if (connector->status == connector_status_disconnected) { 104 if (connector->status == connector_status_disconnected) {
105 DRM_DEBUG("%s is disconnected\n", 105 DRM_DEBUG_KMS("%s is disconnected\n",
106 drm_get_connector_name(connector)); 106 drm_get_connector_name(connector));
107 /* TODO set EDID to NULL */ 107 /* TODO set EDID to NULL */
108 return 0; 108 return 0;
@@ -138,7 +138,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
138 138
139 drm_mode_sort(&connector->modes); 139 drm_mode_sort(&connector->modes);
140 140
141 DRM_DEBUG("Probed modes for %s\n", drm_get_connector_name(connector)); 141 DRM_DEBUG_KMS("Probed modes for %s\n",
142 drm_get_connector_name(connector));
142 list_for_each_entry_safe(mode, t, &connector->modes, head) { 143 list_for_each_entry_safe(mode, t, &connector->modes, head) {
143 mode->vrefresh = drm_mode_vrefresh(mode); 144 mode->vrefresh = drm_mode_vrefresh(mode);
144 145
@@ -184,12 +185,13 @@ static void drm_helper_add_std_modes(struct drm_device *dev,
184 drm_mode_list_concat(&connector->probed_modes, 185 drm_mode_list_concat(&connector->probed_modes,
185 &connector->modes); 186 &connector->modes);
186 187
187 DRM_DEBUG("Adding mode %s to %s\n", stdmode->name, 188 DRM_DEBUG_KMS("Adding mode %s to %s\n", stdmode->name,
188 drm_get_connector_name(connector)); 189 drm_get_connector_name(connector));
189 } 190 }
190 drm_mode_sort(&connector->modes); 191 drm_mode_sort(&connector->modes);
191 192
192 DRM_DEBUG("Added std modes on %s\n", drm_get_connector_name(connector)); 193 DRM_DEBUG_KMS("Added std modes on %s\n",
194 drm_get_connector_name(connector));
193 list_for_each_entry_safe(mode, t, &connector->modes, head) { 195 list_for_each_entry_safe(mode, t, &connector->modes, head) {
194 mode->vrefresh = drm_mode_vrefresh(mode); 196 mode->vrefresh = drm_mode_vrefresh(mode);
195 197
@@ -312,7 +314,7 @@ static void drm_enable_connectors(struct drm_device *dev, bool *enabled)
312 314
313 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 315 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
314 enabled[i] = drm_connector_enabled(connector, true); 316 enabled[i] = drm_connector_enabled(connector, true);
315 DRM_DEBUG("connector %d enabled? %s\n", connector->base.id, 317 DRM_DEBUG_KMS("connector %d enabled? %s\n", connector->base.id,
316 enabled[i] ? "yes" : "no"); 318 enabled[i] ? "yes" : "no");
317 any_enabled |= enabled[i]; 319 any_enabled |= enabled[i];
318 i++; 320 i++;
@@ -342,7 +344,7 @@ static bool drm_target_preferred(struct drm_device *dev,
342 continue; 344 continue;
343 } 345 }
344 346
345 DRM_DEBUG("looking for preferred mode on connector %d\n", 347 DRM_DEBUG_KMS("looking for preferred mode on connector %d\n",
346 connector->base.id); 348 connector->base.id);
347 349
348 modes[i] = drm_has_preferred_mode(connector, width, height); 350 modes[i] = drm_has_preferred_mode(connector, width, height);
@@ -351,7 +353,7 @@ static bool drm_target_preferred(struct drm_device *dev,
351 list_for_each_entry(modes[i], &connector->modes, head) 353 list_for_each_entry(modes[i], &connector->modes, head)
352 break; 354 break;
353 } 355 }
354 DRM_DEBUG("found mode %s\n", modes[i] ? modes[i]->name : 356 DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name :
355 "none"); 357 "none");
356 i++; 358 i++;
357 } 359 }
@@ -452,7 +454,7 @@ static void drm_setup_crtcs(struct drm_device *dev)
452 int width, height; 454 int width, height;
453 int i, ret; 455 int i, ret;
454 456
455 DRM_DEBUG("\n"); 457 DRM_DEBUG_KMS("\n");
456 458
457 width = dev->mode_config.max_width; 459 width = dev->mode_config.max_width;
458 height = dev->mode_config.max_height; 460 height = dev->mode_config.max_height;
@@ -475,7 +477,7 @@ static void drm_setup_crtcs(struct drm_device *dev)
475 if (!ret) 477 if (!ret)
476 DRM_ERROR("Unable to find initial modes\n"); 478 DRM_ERROR("Unable to find initial modes\n");
477 479
478 DRM_DEBUG("picking CRTCs for %dx%d config\n", width, height); 480 DRM_DEBUG_KMS("picking CRTCs for %dx%d config\n", width, height);
479 481
480 drm_pick_crtcs(dev, crtcs, modes, 0, width, height); 482 drm_pick_crtcs(dev, crtcs, modes, 0, width, height);
481 483
@@ -490,7 +492,7 @@ static void drm_setup_crtcs(struct drm_device *dev)
490 } 492 }
491 493
492 if (mode && crtc) { 494 if (mode && crtc) {
493 DRM_DEBUG("desired mode %s set on crtc %d\n", 495 DRM_DEBUG_KMS("desired mode %s set on crtc %d\n",
494 mode->name, crtc->base.id); 496 mode->name, crtc->base.id);
495 crtc->desired_mode = mode; 497 crtc->desired_mode = mode;
496 connector->encoder->crtc = crtc; 498 connector->encoder->crtc = crtc;
@@ -713,7 +715,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
713 struct drm_crtc_helper_funcs *crtc_funcs; 715 struct drm_crtc_helper_funcs *crtc_funcs;
714 int ret = 0; 716 int ret = 0;
715 717
716 DRM_DEBUG("\n"); 718 DRM_DEBUG_KMS("\n");
717 719
718 if (!set) 720 if (!set)
719 return -EINVAL; 721 return -EINVAL;
@@ -726,7 +728,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
726 728
727 crtc_funcs = set->crtc->helper_private; 729 crtc_funcs = set->crtc->helper_private;
728 730
729 DRM_DEBUG("crtc: %p %d fb: %p connectors: %p num_connectors: %d (x, y) (%i, %i)\n", 731 DRM_DEBUG_KMS("crtc: %p %d fb: %p connectors: %p num_connectors:"
732 " %d (x, y) (%i, %i)\n",
730 set->crtc, set->crtc->base.id, set->fb, set->connectors, 733 set->crtc, set->crtc->base.id, set->fb, set->connectors,
731 (int)set->num_connectors, set->x, set->y); 734 (int)set->num_connectors, set->x, set->y);
732 735
@@ -756,7 +759,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
756 if (set->crtc->fb != set->fb) { 759 if (set->crtc->fb != set->fb) {
757 /* If we have no fb then treat it as a full mode set */ 760 /* If we have no fb then treat it as a full mode set */
758 if (set->crtc->fb == NULL) { 761 if (set->crtc->fb == NULL) {
759 DRM_DEBUG("crtc has no fb, full mode set\n"); 762 DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
760 mode_changed = true; 763 mode_changed = true;
761 } else if ((set->fb->bits_per_pixel != 764 } else if ((set->fb->bits_per_pixel !=
762 set->crtc->fb->bits_per_pixel) || 765 set->crtc->fb->bits_per_pixel) ||
@@ -770,7 +773,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
770 fb_changed = true; 773 fb_changed = true;
771 774
772 if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) { 775 if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
773 DRM_DEBUG("modes are different, full mode set\n"); 776 DRM_DEBUG_KMS("modes are different, full mode set\n");
774 drm_mode_debug_printmodeline(&set->crtc->mode); 777 drm_mode_debug_printmodeline(&set->crtc->mode);
775 drm_mode_debug_printmodeline(set->mode); 778 drm_mode_debug_printmodeline(set->mode);
776 mode_changed = true; 779 mode_changed = true;
@@ -796,7 +799,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
796 } 799 }
797 800
798 if (new_encoder != connector->encoder) { 801 if (new_encoder != connector->encoder) {
799 DRM_DEBUG("encoder changed, full mode switch\n"); 802 DRM_DEBUG_KMS("encoder changed, full mode switch\n");
800 mode_changed = true; 803 mode_changed = true;
801 connector->encoder = new_encoder; 804 connector->encoder = new_encoder;
802 } 805 }
@@ -831,11 +834,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
831 goto fail_set_mode; 834 goto fail_set_mode;
832 } 835 }
833 if (new_crtc != connector->encoder->crtc) { 836 if (new_crtc != connector->encoder->crtc) {
834 DRM_DEBUG("crtc changed, full mode switch\n"); 837 DRM_DEBUG_KMS("crtc changed, full mode switch\n");
835 mode_changed = true; 838 mode_changed = true;
836 connector->encoder->crtc = new_crtc; 839 connector->encoder->crtc = new_crtc;
837 } 840 }
838 DRM_DEBUG("setting connector %d crtc to %p\n", 841 DRM_DEBUG_KMS("setting connector %d crtc to %p\n",
839 connector->base.id, new_crtc); 842 connector->base.id, new_crtc);
840 } 843 }
841 844
@@ -848,7 +851,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
848 set->crtc->fb = set->fb; 851 set->crtc->fb = set->fb;
849 set->crtc->enabled = (set->mode != NULL); 852 set->crtc->enabled = (set->mode != NULL);
850 if (set->mode != NULL) { 853 if (set->mode != NULL) {
851 DRM_DEBUG("attempting to set mode from userspace\n"); 854 DRM_DEBUG_KMS("attempting to set mode from"
855 " userspace\n");
852 drm_mode_debug_printmodeline(set->mode); 856 drm_mode_debug_printmodeline(set->mode);
853 if (!drm_crtc_helper_set_mode(set->crtc, set->mode, 857 if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
854 set->x, set->y, 858 set->x, set->y,
@@ -901,7 +905,7 @@ EXPORT_SYMBOL(drm_crtc_helper_set_config);
901 905
902bool drm_helper_plugged_event(struct drm_device *dev) 906bool drm_helper_plugged_event(struct drm_device *dev)
903{ 907{
904 DRM_DEBUG("\n"); 908 DRM_DEBUG_KMS("\n");
905 909
906 drm_helper_probe_connector_modes(dev, dev->mode_config.max_width, 910 drm_helper_probe_connector_modes(dev, dev->mode_config.max_width,
907 dev->mode_config.max_height); 911 dev->mode_config.max_height);