drm/exynos: pass struct exynos_drm_plane in update/enable
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 3 Aug 2015 05:39:36 +0000 (14:39 +0900)
committerInki Dae <inki.dae@samsung.com>
Sun, 16 Aug 2015 01:23:34 +0000 (10:23 +0900)
We already have the plane pointer in before calling .update_plane() or
disable_plane() so pass it directly to those calls avoiding a new
conversion from zpos to struct exynos_drm_plane.

v2: don't remove check for suspended in FIMD (comment by Joonyoung)

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
drivers/gpu/drm/exynos/exynos7_drm_decon.c
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_plane.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_mixer.c

index 83fbf38..a4ea096 100644 (file)
@@ -219,17 +219,13 @@ static void decon_shadow_protect_win(struct decon_context *ctx, int win,
        writel(val, ctx->addr + DECON_SHADOWCON);
 }
 
-static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
+static void decon_update_plane(struct exynos_drm_crtc *crtc,
+                              struct exynos_drm_plane *plane)
 {
        struct decon_context *ctx = crtc->ctx;
-       struct exynos_drm_plane *plane;
+       unsigned int win = plane->zpos;
        u32 val;
 
-       if (win < 0 || win >= WINDOWS_NR)
-               return;
-
-       plane = &ctx->planes[win];
-
        if (ctx->suspended)
                return;
 
@@ -277,17 +273,13 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
                atomic_set(&ctx->win_updated, 1);
 }
 
-static void decon_disable_plane(struct exynos_drm_crtc *crtc, unsigned int win)
+static void decon_disable_plane(struct exynos_drm_crtc *crtc,
+                               struct exynos_drm_plane *plane)
 {
        struct decon_context *ctx = crtc->ctx;
-       struct exynos_drm_plane *plane;
+       unsigned int win = plane->zpos;
        u32 val;
 
-       if (win < 0 || win >= WINDOWS_NR)
-               return;
-
-       plane = &ctx->planes[win];
-
        if (ctx->suspended)
                return;
 
@@ -378,7 +370,7 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
         * a destroyed buffer later.
         */
        for (i = 0; i < WINDOWS_NR; i++)
-               decon_disable_plane(crtc, i);
+               decon_disable_plane(crtc, &ctx->planes[i]);
 
        decon_swreset(ctx);
 
index 31210be..0bb3938 100644 (file)
@@ -383,24 +383,20 @@ static void decon_shadow_protect_win(struct decon_context *ctx,
        writel(val, ctx->regs + SHADOWCON);
 }
 
-static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
+static void decon_update_plane(struct exynos_drm_crtc *crtc,
+                              struct exynos_drm_plane *plane)
 {
        struct decon_context *ctx = crtc->ctx;
        struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
-       struct exynos_drm_plane *plane;
        int padding;
        unsigned long val, alpha;
        unsigned int last_x;
        unsigned int last_y;
+       unsigned int win = plane->zpos;
 
        if (ctx->suspended)
                return;
 
-       if (win < 0 || win >= WINDOWS_NR)
-               return;
-
-       plane = &ctx->planes[win];
-
        /*
         * SHADOWCON/PRTCON register is used for enabling timing.
         *
@@ -493,17 +489,13 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
        writel(val, ctx->regs + DECON_UPDATE);
 }
 
-static void decon_disable_plane(struct exynos_drm_crtc *crtc, unsigned int win)
+static void decon_disable_plane(struct exynos_drm_crtc *crtc,
+                               struct exynos_drm_plane *plane)
 {
        struct decon_context *ctx = crtc->ctx;
-       struct exynos_drm_plane *plane;
+       unsigned int win = plane->zpos;
        u32 val;
 
-       if (win < 0 || win >= WINDOWS_NR)
-               return;
-
-       plane = &ctx->planes[win];
-
        if (ctx->suspended)
                return;
 
@@ -599,7 +591,7 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
         * a destroyed buffer later.
         */
        for (i = 0; i < WINDOWS_NR; i++)
-               decon_disable_plane(crtc, i);
+               decon_disable_plane(crtc, &ctx->planes[i]);
 
        clk_disable_unprepare(ctx->vclk);
        clk_disable_unprepare(ctx->eclk);
Simple merge