diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2016-05-05 15:24:32 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-05-10 08:54:09 +0200 |
commit | 75229eca569fb275de6d1a0e019df7d63b298762 (patch) | |
tree | 705e9ecce695ab429fe3ad32515c8e0f223a6c8f /drivers/gpu/drm/drm_atomic_helper.c | |
parent | 8863dc7f5642737e49ff681cbb842d2c614bdcf4 (diff) | |
download | op-kernel-dev-75229eca569fb275de6d1a0e019df7d63b298762.zip op-kernel-dev-75229eca569fb275de6d1a0e019df7d63b298762.tar.gz |
drm: Make drm_encoder_helper_funcs optional
Make drm_encoder_helper_funcs and it's functions optional to avoid
having dummy functions.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1462454674-2246-3-git-send-email-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 997fd21..027b227 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -696,6 +696,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) continue; funcs = encoder->helper_private; + if (!funcs) + continue; DRM_DEBUG_ATOMIC("disabling [ENCODER:%d:%s]\n", encoder->base.id, encoder->name); @@ -711,7 +713,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) funcs->prepare(encoder); else if (funcs->disable) funcs->disable(encoder); - else + else if (funcs->dpms) funcs->dpms(encoder, DRM_MODE_DPMS_OFF); drm_bridge_post_disable(encoder->bridge); @@ -859,6 +861,9 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state) encoder = connector->state->best_encoder; funcs = encoder->helper_private; + if (!funcs) + continue; + new_crtc_state = connector->state->crtc->state; mode = &new_crtc_state->mode; adjusted_mode = &new_crtc_state->adjusted_mode; @@ -964,6 +969,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, encoder = connector->state->best_encoder; funcs = encoder->helper_private; + if (!funcs) + continue; DRM_DEBUG_ATOMIC("enabling [ENCODER:%d:%s]\n", encoder->base.id, encoder->name); @@ -976,7 +983,7 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, if (funcs->enable) funcs->enable(encoder); - else + else if (funcs->commit) funcs->commit(encoder); drm_bridge_enable(encoder->bridge); |