Commit 3c5b2673 authored by Carlos Palminha's avatar Carlos Palminha Committed by Daniel Vetter

drm: fixes crct set_mode when encoder mode_fixup is null.

Avoids null crash when encoders don't implement mode_fixup.
Signed-off-by: default avatarCarlos Palminha <palminha@synopsys.com>
[danvet: Also update kerneldoc.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com
parent 71dfb744
...@@ -337,12 +337,14 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, ...@@ -337,12 +337,14 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
} }
encoder_funcs = encoder->helper_private; encoder_funcs = encoder->helper_private;
if (encoder_funcs->mode_fixup) {
if (!(ret = encoder_funcs->mode_fixup(encoder, mode, if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
adjusted_mode))) { adjusted_mode))) {
DRM_DEBUG_KMS("Encoder fixup failed\n"); DRM_DEBUG_KMS("Encoder fixup failed\n");
goto done; goto done;
} }
} }
}
if (!(ret = crtc_funcs->mode_fixup(crtc, mode, adjusted_mode))) { if (!(ret = crtc_funcs->mode_fixup(crtc, mode, adjusted_mode))) {
DRM_DEBUG_KMS("CRTC fixup failed\n"); DRM_DEBUG_KMS("CRTC fixup failed\n");
......
...@@ -439,7 +439,7 @@ struct drm_encoder_helper_funcs { ...@@ -439,7 +439,7 @@ struct drm_encoder_helper_funcs {
* can be modified by this callback and does not need to match mode. * can be modified by this callback and does not need to match mode.
* *
* This function is used by both legacy CRTC helpers and atomic helpers. * This function is used by both legacy CRTC helpers and atomic helpers.
* With atomic helpers it is optional. * This hook is optional.
* *
* NOTE: * NOTE:
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment