Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: add mode_fixup callback to exynos_drm_crtc_ops

crtc::mode_fixup callback is required by crtcs which internally use
a different mode than requested by user - case of Exynos Mixer.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Andrzej Hajda and committed by
Inki Dae
2466db97 991ea04e

+18
+15
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 95 95 return MODE_OK; 96 96 } 97 97 98 + static bool exynos_crtc_mode_fixup(struct drm_crtc *crtc, 99 + const struct drm_display_mode *mode, 100 + struct drm_display_mode *adjusted_mode) 101 + { 102 + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); 103 + 104 + if (exynos_crtc->ops->mode_fixup) 105 + return exynos_crtc->ops->mode_fixup(exynos_crtc, mode, 106 + adjusted_mode); 107 + 108 + return true; 109 + } 110 + 111 + 98 112 static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { 99 113 .mode_valid = exynos_crtc_mode_valid, 114 + .mode_fixup = exynos_crtc_mode_fixup, 100 115 .atomic_check = exynos_crtc_atomic_check, 101 116 .atomic_begin = exynos_crtc_atomic_begin, 102 117 .atomic_flush = exynos_crtc_atomic_flush,
+3
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 136 136 u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc); 137 137 enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, 138 138 const struct drm_display_mode *mode); 139 + bool (*mode_fixup)(struct exynos_drm_crtc *crtc, 140 + const struct drm_display_mode *mode, 141 + struct drm_display_mode *adjusted_mode); 139 142 int (*atomic_check)(struct exynos_drm_crtc *crtc, 140 143 struct drm_crtc_state *state); 141 144 void (*atomic_begin)(struct exynos_drm_crtc *crtc);