The exynos_plane_dpms can cause misunderstanding as using dpms term
because it is irrelevant with dpms functionality of DRM. Split to
functions fit for the one purpose instead of DPMS flags.

Signed-off-by: Joonyoung Shim <jy0922.shim at samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  4 ++--
 drivers/gpu/drm/exynos/exynos_drm_plane.c | 38 +++++++++++++++++--------------
 drivers/gpu/drm/exynos/exynos_drm_plane.h |  3 ++-
 3 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index a85c451..dac8f90 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -67,7 +67,7 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
        if (exynos_crtc->ops->commit)
                exynos_crtc->ops->commit(exynos_crtc);

-       exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_ON);
+       exynos_plane_on(crtc->primary);
 }

 static bool
@@ -255,7 +255,7 @@ static int exynos_drm_crtc_set_property(struct drm_crtc 
*crtc,
                        exynos_drm_crtc_commit(crtc);
                        break;
                case CRTC_MODE_BLANK:
-                       exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_OFF);
+                       exynos_plane_off(crtc->primary);
                        break;
                default:
                        break;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c 
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 358cff6..aa87d79 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -145,30 +145,34 @@ void exynos_plane_mode_set(struct drm_plane *plane, 
struct drm_crtc *crtc,
                exynos_crtc->ops->win_mode_set(exynos_crtc, exynos_plane);
 }

-void exynos_plane_dpms(struct drm_plane *plane, int mode)
+void exynos_plane_on(struct drm_plane *plane)
 {
        struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
        struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc);

-       if (mode == DRM_MODE_DPMS_ON) {
-               if (exynos_plane->enabled)
-                       return;
+       if (exynos_plane->enabled)
+               return;

-               if (exynos_crtc->ops->win_enable)
-                       exynos_crtc->ops->win_enable(exynos_crtc,
-                                                    exynos_plane->zpos);
+       if (exynos_crtc->ops->win_enable)
+               exynos_crtc->ops->win_enable(exynos_crtc,
+                                            exynos_plane->zpos);

-               exynos_plane->enabled = true;
-       } else {
-               if (!exynos_plane->enabled)
-                       return;
+       exynos_plane->enabled = true;
+}

-               if (exynos_crtc->ops->win_disable)
-                       exynos_crtc->ops->win_disable(exynos_crtc,
-                                                     exynos_plane->zpos);
+void exynos_plane_off(struct drm_plane *plane)
+{
+       struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
+       struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc);

-               exynos_plane->enabled = false;
-       }
+       if (!exynos_plane->enabled)
+               return;
+
+       if (exynos_crtc->ops->win_disable)
+               exynos_crtc->ops->win_disable(exynos_crtc,
+                                             exynos_plane->zpos);
+
+       exynos_plane->enabled = false;
 }

 int
@@ -199,7 +203,7 @@ exynos_update_plane(struct drm_plane *plane, struct 
drm_crtc *crtc,

 static int exynos_disable_plane(struct drm_plane *plane)
 {
-       exynos_plane_dpms(plane, DRM_MODE_DPMS_OFF);
+       exynos_plane_off(plane);

        return 0;
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h 
b/drivers/gpu/drm/exynos/exynos_drm_plane.h
index 59d4075..c778295 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h
@@ -20,7 +20,8 @@ int exynos_update_plane(struct drm_plane *plane, struct 
drm_crtc *crtc,
                        unsigned int crtc_w, unsigned int crtc_h,
                        uint32_t src_x, uint32_t src_y,
                        uint32_t src_w, uint32_t src_h);
-void exynos_plane_dpms(struct drm_plane *plane, int mode);
+void exynos_plane_on(struct drm_plane *plane);
+void exynos_plane_off(struct drm_plane *plane);
 struct drm_plane *exynos_plane_init(struct drm_device *dev,
                                    unsigned long possible_crtcs,
                                    enum drm_plane_type type);
-- 
1.9.1

Reply via email to