drm/exynos: add mode_fixup callback to exynos_drm_crtc_ops
authorAndrzej Hajda <a.hajda@samsung.com>
Fri, 29 Sep 2017 10:05:38 +0000 (12:05 +0200)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:56:05 +0000 (14:56 +0900)
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>
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_drv.h

index 4787560..fed252d 100644 (file)
@@ -95,8 +95,23 @@ static enum drm_mode_status exynos_crtc_mode_valid(struct drm_crtc *crtc,
        return MODE_OK;
 }
 
+static bool exynos_crtc_mode_fixup(struct drm_crtc *crtc,
+               const struct drm_display_mode *mode,
+               struct drm_display_mode *adjusted_mode)
+{
+       struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+
+       if (exynos_crtc->ops->mode_fixup)
+               return exynos_crtc->ops->mode_fixup(exynos_crtc, mode,
+                               adjusted_mode);
+
+       return true;
+}
+
+
 static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
        .mode_valid     = exynos_crtc_mode_valid,
+       .mode_fixup     = exynos_crtc_mode_fixup,
        .atomic_check   = exynos_crtc_atomic_check,
        .atomic_begin   = exynos_crtc_atomic_begin,
        .atomic_flush   = exynos_crtc_atomic_flush,
index d228b51..4c14a07 100644 (file)
@@ -135,6 +135,9 @@ struct exynos_drm_crtc_ops {
        void (*disable_vblank)(struct exynos_drm_crtc *crtc);
        enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc,
                const struct drm_display_mode *mode);
+       bool (*mode_fixup)(struct exynos_drm_crtc *crtc,
+                          const struct drm_display_mode *mode,
+                          struct drm_display_mode *adjusted_mode);
        int (*atomic_check)(struct exynos_drm_crtc *crtc,
                            struct drm_crtc_state *state);
        void (*atomic_begin)(struct exynos_drm_crtc *crtc);