Re: [PATCH v2 2/3] drm/exynos: remove chained calls to enable

2015-06-15 Thread Gustavo Padovan
Hi Joonyoung,

2015-06-12 Joonyoung Shim jy0922.s...@samsung.com:

 With atomic modesetting all the control for CRTC, Planes, Encoders and
 Connectors should come from DRM core, so the driver is not allowed to
 enable or disable planes from inside the crtc_enable()/disable() call.
 
 But it needs to disable planes with crtc_disable in exynos driver
 internally. Because crtc is disabled before plane is disabled, it means
 plane_disable just returns without any register changes, then we cannot
 be sure setting register to disable plane when crtc is disable.
 
 This patch removes this chainned calls to enable plane from exynos hw
 drivers code letting only DRM core touch planes except to disable plane.
 Also it leads eliminable enabled and resume of struct exynos_drm_plane.
 
 Signed-off-by: Gustavo Padovan gustavo.pado...@collabora.co.uk
 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 Tested-by: Marek Szyprowski m.szyprow...@samsung.com
 ---
 This patch was modified from original patch of Gustavo Padovan - 
 http://www.spinics.net/lists/linux-samsung-soc/msg45351.html
 
 v2 changes:
 - add 1/3 additional patch to remove waiting vblank in mixer.
 - rebase this from 1/3 patch.
 - add 3/3 additional patch to fix IOMMU page fault of fimd.
 
  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 63 
 +++---
  drivers/gpu/drm/exynos/exynos_drm_drv.h|  5 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 63 
 +++---
  drivers/gpu/drm/exynos/exynos_drm_vidi.c   | 27 -
  drivers/gpu/drm/exynos/exynos_mixer.c  | 38 ++
  5 files changed, 16 insertions(+), 180 deletions(-)

Reviewed-by: Gustavo Padovan gustavo.pado...@collabora.co.uk

Gustavo
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/3] drm/exynos: remove chained calls to enable

2015-06-12 Thread Joonyoung Shim
With atomic modesetting all the control for CRTC, Planes, Encoders and
Connectors should come from DRM core, so the driver is not allowed to
enable or disable planes from inside the crtc_enable()/disable() call.

But it needs to disable planes with crtc_disable in exynos driver
internally. Because crtc is disabled before plane is disabled, it means
plane_disable just returns without any register changes, then we cannot
be sure setting register to disable plane when crtc is disable.

This patch removes this chainned calls to enable plane from exynos hw
drivers code letting only DRM core touch planes except to disable plane.
Also it leads eliminable enabled and resume of struct exynos_drm_plane.

Signed-off-by: Gustavo Padovan gustavo.pado...@collabora.co.uk
Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
Tested-by: Marek Szyprowski m.szyprow...@samsung.com
---
This patch was modified from original patch of Gustavo Padovan - 
http://www.spinics.net/lists/linux-samsung-soc/msg45351.html

v2 changes:
- add 1/3 additional patch to remove waiting vblank in mixer.
- rebase this from 1/3 patch.
- add 3/3 additional patch to fix IOMMU page fault of fimd.

 drivers/gpu/drm/exynos/exynos7_drm_decon.c | 63 +++---
 drivers/gpu/drm/exynos/exynos_drm_drv.h|  5 ---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 63 +++---
 drivers/gpu/drm/exynos/exynos_drm_vidi.c   | 27 -
 drivers/gpu/drm/exynos/exynos_mixer.c  | 38 ++
 5 files changed, 16 insertions(+), 180 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index d659ba2..f73ceae 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -410,11 +410,8 @@ static void decon_win_commit(struct exynos_drm_crtc *crtc, 
unsigned int win)
 
plane = ctx-planes[win];
 
-   /* If suspended, enable this on resume */
-   if (ctx-suspended) {
-   plane-resume = true;
+   if (ctx-suspended)
return;
-   }
 
/*
 * SHADOWCON/PRTCON register is used for enabling timing.
@@ -506,8 +503,6 @@ static void decon_win_commit(struct exynos_drm_crtc *crtc, 
unsigned int win)
val = readl(ctx-regs + DECON_UPDATE);
val |= DECON_UPDATE_STANDALONE_F;
writel(val, ctx-regs + DECON_UPDATE);
-
-   plane-enabled = true;
 }
 
 static void decon_win_disable(struct exynos_drm_crtc *crtc, unsigned int win)
@@ -521,11 +516,8 @@ static void decon_win_disable(struct exynos_drm_crtc 
*crtc, unsigned int win)
 
plane = ctx-planes[win];
 
-   if (ctx-suspended) {
-   /* do not resume this window*/
-   plane-resume = false;
+   if (ctx-suspended)
return;
-   }
 
/* protect windows */
decon_shadow_protect_win(ctx, win, true);
@@ -541,49 +533,6 @@ static void decon_win_disable(struct exynos_drm_crtc 
*crtc, unsigned int win)
val = readl(ctx-regs + DECON_UPDATE);
val |= DECON_UPDATE_STANDALONE_F;
writel(val, ctx-regs + DECON_UPDATE);
-
-   plane-enabled = false;
-}
-
-static void decon_window_suspend(struct decon_context *ctx)
-{
-   struct exynos_drm_plane *plane;
-   int i;
-
-   for (i = 0; i  WINDOWS_NR; i++) {
-   plane = ctx-planes[i];
-   plane-resume = plane-enabled;
-   if (plane-enabled)
-   decon_win_disable(ctx-crtc, i);
-   }
-}
-
-static void decon_window_resume(struct decon_context *ctx)
-{
-   struct exynos_drm_plane *plane;
-   int i;
-
-   for (i = 0; i  WINDOWS_NR; i++) {
-   plane = ctx-planes[i];
-   plane-enabled = plane-resume;
-   plane-resume = false;
-   }
-}
-
-static void decon_apply(struct decon_context *ctx)
-{
-   struct exynos_drm_plane *plane;
-   int i;
-
-   for (i = 0; i  WINDOWS_NR; i++) {
-   plane = ctx-planes[i];
-   if (plane-enabled)
-   decon_win_commit(ctx-crtc, i);
-   else
-   decon_win_disable(ctx-crtc, i);
-   }
-
-   decon_commit(ctx-crtc);
 }
 
 static void decon_init(struct decon_context *ctx)
@@ -625,14 +574,13 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
if (test_and_clear_bit(0, ctx-irq_flags))
decon_enable_vblank(ctx-crtc);
 
-   decon_window_resume(ctx);
-
-   decon_apply(ctx);
+   decon_commit(ctx-crtc);
 }
 
 static void decon_disable(struct exynos_drm_crtc *crtc)
 {
struct decon_context *ctx = crtc-ctx;
+   int i;
 
if (ctx-suspended)
return;
@@ -642,7 +590,8 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
 * suspend that connector. Otherwise we might try to scan from
 * a destroyed buffer later.
 */
-   decon_window_suspend(ctx);