mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
drm: fixes crct set_mode when encoder mode_fixup is null.
Avoids null crash when encoders don't implement mode_fixup. Signed-off-by: Carlos Palminha <palminha@synopsys.com> [danvet: Also update kerneldoc.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com
This commit is contained in:
parent
71dfb744bd
commit
3c5b267314
@ -337,10 +337,12 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
|
||||
}
|
||||
|
||||
encoder_funcs = encoder->helper_private;
|
||||
if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
|
||||
adjusted_mode))) {
|
||||
DRM_DEBUG_KMS("Encoder fixup failed\n");
|
||||
goto done;
|
||||
if (encoder_funcs->mode_fixup) {
|
||||
if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
|
||||
adjusted_mode))) {
|
||||
DRM_DEBUG_KMS("Encoder fixup failed\n");
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ struct drm_encoder_helper_funcs {
|
||||
* 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.
|
||||
* With atomic helpers it is optional.
|
||||
* This hook is optional.
|
||||
*
|
||||
* NOTE:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user