drm/exynos: add atomic_check callback to exynos_crtc
authorAndrzej Hajda <a.hajda@samsung.com>
Mon, 26 Oct 2015 12:03:39 +0000 (13:03 +0100)
committerInki Dae <inki.dae@samsung.com>
Tue, 3 Nov 2015 02:46:37 +0000 (11:46 +0900)
Some CRTCs needs mode validation, this patch adds neccessary
callback to Exynos DRM framework. It is called from DRM core
via atomic_check helper for drm_crtc.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
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 50dec0df160fc270d710486e95c4ed91584f04a5..b3ba27fd9a6bc880d7e061039e61ca42babc148f 100644 (file)
@@ -50,6 +50,17 @@ exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
                exynos_crtc->ops->commit(exynos_crtc);
 }
 
+static int exynos_crtc_atomic_check(struct drm_crtc *crtc,
+                                    struct drm_crtc_state *state)
+{
+       struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+
+       if (exynos_crtc->ops->atomic_check)
+               return exynos_crtc->ops->atomic_check(exynos_crtc, state);
+
+       return 0;
+}
+
 static void exynos_crtc_atomic_begin(struct drm_crtc *crtc,
                                     struct drm_crtc_state *old_crtc_state)
 {
@@ -86,6 +97,7 @@ static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
        .enable         = exynos_drm_crtc_enable,
        .disable        = exynos_drm_crtc_disable,
        .mode_set_nofb  = exynos_drm_crtc_mode_set_nofb,
+       .atomic_check   = exynos_crtc_atomic_check,
        .atomic_begin   = exynos_crtc_atomic_begin,
        .atomic_flush   = exynos_crtc_atomic_flush,
 };
index 638fc43079a8f7d7f6501ba65654da2c791df253..f1eda7fa4e3c68fe22d4a7a41dd464c4047e77df 100644 (file)
@@ -89,6 +89,7 @@ struct exynos_drm_plane {
  * @disable_vblank: specific driver callback for disabling vblank interrupt.
  * @wait_for_vblank: wait for vblank interrupt to make sure that
  *     hardware overlay is updated.
+ * @atomic_check: validate state
  * @atomic_begin: prepare a window to receive a update
  * @atomic_flush: mark the end of a window update
  * @update_plane: apply hardware specific overlay data to registers.
@@ -108,6 +109,8 @@ struct exynos_drm_crtc_ops {
        int (*enable_vblank)(struct exynos_drm_crtc *crtc);
        void (*disable_vblank)(struct exynos_drm_crtc *crtc);
        void (*wait_for_vblank)(struct exynos_drm_crtc *crtc);
+       int (*atomic_check)(struct exynos_drm_crtc *crtc,
+                           struct drm_crtc_state *state);
        void (*atomic_begin)(struct exynos_drm_crtc *crtc,
                              struct exynos_drm_plane *plane);
        void (*update_plane)(struct exynos_drm_crtc *crtc,