diff options
| author | Andrzej Hajda <a.hajda@samsung.com> | 2017-09-29 06:05:38 -0400 |
|---|---|---|
| committer | Inki Dae <inki.dae@samsung.com> | 2017-10-25 20:06:33 -0400 |
| commit | 2466db97e39d5479bb44a09a56ca85043d3d3997 (patch) | |
| tree | c740baf1822b74efef0a59ad765035e74472a88f | |
| parent | 991ea04e2cf4a9705462ec2fe878e385feb48d73 (diff) | |
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>
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_crtc.c | 15 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 6ce0821590df..dc01342e759a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c | |||
| @@ -95,8 +95,23 @@ static enum drm_mode_status exynos_crtc_mode_valid(struct drm_crtc *crtc, | |||
| 95 | return MODE_OK; | 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 | static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { | 112 | static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { |
| 99 | .mode_valid = exynos_crtc_mode_valid, | 113 | .mode_valid = exynos_crtc_mode_valid, |
| 114 | .mode_fixup = exynos_crtc_mode_fixup, | ||
| 100 | .atomic_check = exynos_crtc_atomic_check, | 115 | .atomic_check = exynos_crtc_atomic_check, |
| 101 | .atomic_begin = exynos_crtc_atomic_begin, | 116 | .atomic_begin = exynos_crtc_atomic_begin, |
| 102 | .atomic_flush = exynos_crtc_atomic_flush, | 117 | .atomic_flush = exynos_crtc_atomic_flush, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index f8bae4cb4823..c6847fa708fa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
| @@ -136,6 +136,9 @@ struct exynos_drm_crtc_ops { | |||
| 136 | u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc); | 136 | u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc); |
| 137 | enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, | 137 | enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, |
| 138 | const struct drm_display_mode *mode); | 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 | int (*atomic_check)(struct exynos_drm_crtc *crtc, | 142 | int (*atomic_check)(struct exynos_drm_crtc *crtc, |
| 140 | struct drm_crtc_state *state); | 143 | struct drm_crtc_state *state); |
| 141 | void (*atomic_begin)(struct exynos_drm_crtc *crtc); | 144 | void (*atomic_begin)(struct exynos_drm_crtc *crtc); |
