diff options
| -rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 17 | ||||
| -rw-r--r-- | include/drm/drm_crtc_helper.h | 20 |
2 files changed, 30 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d0c3611402da..379b6c833bb2 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
| @@ -599,7 +599,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) | |||
| 599 | encoder->bridge->funcs->disable(encoder->bridge); | 599 | encoder->bridge->funcs->disable(encoder->bridge); |
| 600 | 600 | ||
| 601 | /* Right function depends upon target state. */ | 601 | /* Right function depends upon target state. */ |
| 602 | if (connector->state->crtc) | 602 | if (connector->state->crtc && funcs->prepare) |
| 603 | funcs->prepare(encoder); | 603 | funcs->prepare(encoder); |
| 604 | else if (funcs->disable) | 604 | else if (funcs->disable) |
| 605 | funcs->disable(encoder); | 605 | funcs->disable(encoder); |
| @@ -628,7 +628,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) | |||
| 628 | funcs = crtc->helper_private; | 628 | funcs = crtc->helper_private; |
| 629 | 629 | ||
| 630 | /* Right function depends upon target state. */ | 630 | /* Right function depends upon target state. */ |
| 631 | if (crtc->state->enable) | 631 | if (crtc->state->enable && funcs->prepare) |
| 632 | funcs->prepare(crtc); | 632 | funcs->prepare(crtc); |
| 633 | else if (funcs->disable) | 633 | else if (funcs->disable) |
| 634 | funcs->disable(crtc); | 634 | funcs->disable(crtc); |
| @@ -792,8 +792,12 @@ void drm_atomic_helper_commit_post_planes(struct drm_device *dev, | |||
| 792 | 792 | ||
| 793 | funcs = crtc->helper_private; | 793 | funcs = crtc->helper_private; |
| 794 | 794 | ||
| 795 | if (crtc->state->enable) | 795 | if (crtc->state->enable) { |
| 796 | funcs->commit(crtc); | 796 | if (funcs->enable) |
| 797 | funcs->enable(crtc); | ||
| 798 | else | ||
| 799 | funcs->commit(crtc); | ||
| 800 | } | ||
| 797 | } | 801 | } |
| 798 | 802 | ||
| 799 | for (i = 0; i < old_state->num_connector; i++) { | 803 | for (i = 0; i < old_state->num_connector; i++) { |
| @@ -819,7 +823,10 @@ void drm_atomic_helper_commit_post_planes(struct drm_device *dev, | |||
| 819 | if (encoder->bridge) | 823 | if (encoder->bridge) |
| 820 | encoder->bridge->funcs->pre_enable(encoder->bridge); | 824 | encoder->bridge->funcs->pre_enable(encoder->bridge); |
| 821 | 825 | ||
| 822 | funcs->commit(encoder); | 826 | if (funcs->enable) |
| 827 | funcs->enable(encoder); | ||
| 828 | else | ||
| 829 | funcs->commit(encoder); | ||
| 823 | 830 | ||
| 824 | if (encoder->bridge) | 831 | if (encoder->bridge) |
| 825 | encoder->bridge->funcs->enable(encoder->bridge); | 832 | encoder->bridge->funcs->enable(encoder->bridge); |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index e76828d81a8b..4b19f7a20d62 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
| @@ -58,11 +58,19 @@ enum mode_set_atomic { | |||
| 58 | * @mode_set_base_atomic: non-blocking mode set (used for kgdb support) | 58 | * @mode_set_base_atomic: non-blocking mode set (used for kgdb support) |
| 59 | * @load_lut: load color palette | 59 | * @load_lut: load color palette |
| 60 | * @disable: disable CRTC when no longer in use | 60 | * @disable: disable CRTC when no longer in use |
| 61 | * @enable: enable CRTC | ||
| 61 | * @atomic_check: check for validity of an atomic state | 62 | * @atomic_check: check for validity of an atomic state |
| 62 | * @atomic_begin: begin atomic update | 63 | * @atomic_begin: begin atomic update |
| 63 | * @atomic_flush: flush atomic update | 64 | * @atomic_flush: flush atomic update |
| 64 | * | 65 | * |
| 65 | * The helper operations are called by the mid-layer CRTC helper. | 66 | * The helper operations are called by the mid-layer CRTC helper. |
| 67 | * | ||
| 68 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are | ||
| 69 | * deprecated. Used @enable and @disable instead exclusively. | ||
| 70 | * | ||
| 71 | * With legacy crtc helpers there's a big semantic difference between @disable | ||
| 72 | * and the other hooks: @disable also needs to release any resources acquired in | ||
| 73 | * @mode_set (like shared PLLs). | ||
| 66 | */ | 74 | */ |
| 67 | struct drm_crtc_helper_funcs { | 75 | struct drm_crtc_helper_funcs { |
| 68 | /* | 76 | /* |
| @@ -93,8 +101,8 @@ struct drm_crtc_helper_funcs { | |||
| 93 | /* reload the current crtc LUT */ | 101 | /* reload the current crtc LUT */ |
| 94 | void (*load_lut)(struct drm_crtc *crtc); | 102 | void (*load_lut)(struct drm_crtc *crtc); |
| 95 | 103 | ||
| 96 | /* disable crtc when not in use - more explicit than dpms off */ | ||
| 97 | void (*disable)(struct drm_crtc *crtc); | 104 | void (*disable)(struct drm_crtc *crtc); |
| 105 | void (*enable)(struct drm_crtc *crtc); | ||
| 98 | 106 | ||
| 99 | /* atomic helpers */ | 107 | /* atomic helpers */ |
| 100 | int (*atomic_check)(struct drm_crtc *crtc, | 108 | int (*atomic_check)(struct drm_crtc *crtc, |
| @@ -115,8 +123,16 @@ struct drm_crtc_helper_funcs { | |||
| 115 | * @get_crtc: return CRTC that the encoder is currently attached to | 123 | * @get_crtc: return CRTC that the encoder is currently attached to |
| 116 | * @detect: connection status detection | 124 | * @detect: connection status detection |
| 117 | * @disable: disable encoder when not in use (overrides DPMS off) | 125 | * @disable: disable encoder when not in use (overrides DPMS off) |
| 126 | * @enable: enable encoder | ||
| 118 | * | 127 | * |
| 119 | * The helper operations are called by the mid-layer CRTC helper. | 128 | * The helper operations are called by the mid-layer CRTC helper. |
| 129 | * | ||
| 130 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are | ||
| 131 | * deprecated. Used @enable and @disable instead exclusively. | ||
| 132 | * | ||
| 133 | * With legacy crtc helpers there's a big semantic difference between @disable | ||
| 134 | * and the other hooks: @disable also needs to release any resources acquired in | ||
| 135 | * @mode_set (like shared PLLs). | ||
| 120 | */ | 136 | */ |
| 121 | struct drm_encoder_helper_funcs { | 137 | struct drm_encoder_helper_funcs { |
| 122 | void (*dpms)(struct drm_encoder *encoder, int mode); | 138 | void (*dpms)(struct drm_encoder *encoder, int mode); |
| @@ -135,8 +151,8 @@ struct drm_encoder_helper_funcs { | |||
| 135 | /* detect for DAC style encoders */ | 151 | /* detect for DAC style encoders */ |
| 136 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, | 152 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, |
| 137 | struct drm_connector *connector); | 153 | struct drm_connector *connector); |
| 138 | /* disable encoder when not in use - more explicit than dpms off */ | ||
| 139 | void (*disable)(struct drm_encoder *encoder); | 154 | void (*disable)(struct drm_encoder *encoder); |
| 155 | void (*enable)(struct drm_encoder *encoder); | ||
| 140 | }; | 156 | }; |
| 141 | 157 | ||
| 142 | /** | 158 | /** |
