diff options
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
| -rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index f554516ec2a4..738a4294d820 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -565,14 +565,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 565 | 565 | ||
| 566 | DRM_DEBUG_KMS("\n"); | 566 | DRM_DEBUG_KMS("\n"); |
| 567 | 567 | ||
| 568 | if (!set) | 568 | BUG_ON(!set); |
| 569 | return -EINVAL; | 569 | BUG_ON(!set->crtc); |
| 570 | BUG_ON(!set->crtc->helper_private); | ||
| 570 | 571 | ||
| 571 | if (!set->crtc) | 572 | /* Enforce sane interface api - has been abused by the fb helper. */ |
| 572 | return -EINVAL; | 573 | BUG_ON(!set->mode && set->fb); |
| 573 | 574 | BUG_ON(set->fb && set->num_connectors == 0); | |
| 574 | if (!set->crtc->helper_private) | ||
| 575 | return -EINVAL; | ||
| 576 | 575 | ||
| 577 | crtc_funcs = set->crtc->helper_private; | 576 | crtc_funcs = set->crtc->helper_private; |
| 578 | 577 | ||
| @@ -646,11 +645,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 646 | mode_changed = true; | 645 | mode_changed = true; |
| 647 | } else if (set->fb == NULL) { | 646 | } else if (set->fb == NULL) { |
| 648 | mode_changed = true; | 647 | mode_changed = true; |
| 649 | } else if (set->fb->depth != set->crtc->fb->depth) { | ||
| 650 | mode_changed = true; | ||
| 651 | } else if (set->fb->bits_per_pixel != | ||
| 652 | set->crtc->fb->bits_per_pixel) { | ||
| 653 | mode_changed = true; | ||
| 654 | } else if (set->fb->pixel_format != | 648 | } else if (set->fb->pixel_format != |
| 655 | set->crtc->fb->pixel_format) { | 649 | set->crtc->fb->pixel_format) { |
| 656 | mode_changed = true; | 650 | mode_changed = true; |
| @@ -760,12 +754,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 760 | ret = -EINVAL; | 754 | ret = -EINVAL; |
| 761 | goto fail; | 755 | goto fail; |
| 762 | } | 756 | } |
| 763 | DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); | ||
| 764 | for (i = 0; i < set->num_connectors; i++) { | ||
| 765 | DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, | ||
| 766 | drm_get_connector_name(set->connectors[i])); | ||
| 767 | set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON); | ||
| 768 | } | ||
| 769 | } | 757 | } |
| 770 | drm_helper_disable_unused_functions(dev); | 758 | drm_helper_disable_unused_functions(dev); |
| 771 | } else if (fb_changed) { | 759 | } else if (fb_changed) { |
| @@ -783,6 +771,22 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 783 | } | 771 | } |
| 784 | } | 772 | } |
| 785 | 773 | ||
| 774 | /* | ||
| 775 | * crtc set_config helpers implicit set the crtc and all connected | ||
| 776 | * encoders to DPMS on for a full mode set. But for just an fb update it | ||
| 777 | * doesn't do that. To not confuse userspace, do an explicit DPMS_ON | ||
| 778 | * unconditionally. This will also ensure driver internal dpms state is | ||
| 779 | * consistent again. | ||
| 780 | */ | ||
| 781 | if (set->crtc->enabled) { | ||
| 782 | DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); | ||
| 783 | for (i = 0; i < set->num_connectors; i++) { | ||
| 784 | DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, | ||
| 785 | drm_get_connector_name(set->connectors[i])); | ||
| 786 | set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON); | ||
| 787 | } | ||
| 788 | } | ||
| 789 | |||
| 786 | kfree(save_connectors); | 790 | kfree(save_connectors); |
| 787 | kfree(save_encoders); | 791 | kfree(save_encoders); |
| 788 | kfree(save_crtcs); | 792 | kfree(save_crtcs); |
