[PATCH 18/72] gpu: ipu-v3: Split out DI clock enable/disable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



DI clock enable/disable is moved out of ipu_di_enable() and ipu_di_disable()
and into (new) ipu_di_enable_clock() and ipu_di_disable_clock(). So
ipu_di_enable() and ipu_di_disable() are now pure module enable/disable.

The purpose of this change is to more closely emulate the display mode
setting sequence in FSL kernels, which enable and disable the DI
clock as the very last steps during legacy fbdev set_par().

Signed-off-by: Steve Longerbeam <steve_longerbeam@xxxxxxxxxx>
---
 drivers/gpu/ipu-v3/ipu-di.c          |   20 +++++++++++++-------
 drivers/staging/imx-drm/ipuv3-crtc.c |    2 ++
 include/video/imx-ipu-v3.h           |    2 ++
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c
index 9841419..7ab19a3 100644
--- a/drivers/gpu/ipu-v3/ipu-di.c
+++ b/drivers/gpu/ipu-v3/ipu-di.c
@@ -659,14 +659,8 @@ EXPORT_SYMBOL(ipu_di_uninit_sync_panel);
 
 int ipu_di_enable(struct ipu_di *di)
 {
-	int ret;
-
 	WARN_ON(IS_ERR(di->clk_di_pixel));
 
-	ret = clk_prepare_enable(di->clk_di_pixel);
-	if (ret)
-		return ret;
-
 	dev_dbg(di->ipu->dev, "DI%d enable\n", di->id);
 	ipu_module_enable(di->ipu, di->module);
 
@@ -674,6 +668,12 @@ int ipu_di_enable(struct ipu_di *di)
 }
 EXPORT_SYMBOL_GPL(ipu_di_enable);
 
+int ipu_di_enable_clock(struct ipu_di *di)
+{
+	return clk_prepare_enable(di->clk_di_pixel);
+}
+EXPORT_SYMBOL_GPL(ipu_di_enable_clock);
+
 int ipu_di_disable(struct ipu_di *di)
 {
 	WARN_ON(IS_ERR(di->clk_di_pixel));
@@ -681,11 +681,17 @@ int ipu_di_disable(struct ipu_di *di)
 	dev_dbg(di->ipu->dev, "DI%d disable\n", di->id);
 	ipu_module_disable(di->ipu, di->module);
 
+	return 0;
+}
+EXPORT_SYMBOL_GPL(ipu_di_disable);
+
+int ipu_di_disable_clock(struct ipu_di *di)
+{
 	clk_disable_unprepare(di->clk_di_pixel);
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(ipu_di_disable);
+EXPORT_SYMBOL_GPL(ipu_di_disable_clock);
 
 int ipu_di_get_num(struct ipu_di *di)
 {
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c
index 7053619..be24cb9 100644
--- a/drivers/staging/imx-drm/ipuv3-crtc.c
+++ b/drivers/staging/imx-drm/ipuv3-crtc.c
@@ -68,6 +68,7 @@ static void ipu_fb_enable(struct ipu_crtc *ipu_crtc)
 	/* Start DC channel and DI after IDMAC */
 	ipu_dc_enable_channel(ipu_crtc->dc);
 	ipu_di_enable(ipu_crtc->di);
+	ipu_di_enable_clock(ipu_crtc->di);
 
 	ipu_crtc->enabled = 1;
 }
@@ -82,6 +83,7 @@ static void ipu_fb_disable(struct ipu_crtc *ipu_crtc)
 	ipu_di_disable(ipu_crtc->di);
 	ipu_plane_disable(ipu_crtc->plane[0]);
 	ipu_dc_disable(ipu_crtc->dc);
+	ipu_di_disable_clock(ipu_crtc->di);
 
 	ipu_crtc->enabled = 0;
 }
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 01ab5e0..31b6fde 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -257,7 +257,9 @@ void ipu_dc_disable(struct ipu_dc *dc);
 struct ipu_di *ipu_di_get(struct ipu_soc *ipu, int disp);
 void ipu_di_put(struct ipu_di *);
 int ipu_di_disable(struct ipu_di *);
+int ipu_di_disable_clock(struct ipu_di *di);
 int ipu_di_enable(struct ipu_di *);
+int ipu_di_enable_clock(struct ipu_di *di);
 int ipu_di_get_num(struct ipu_di *);
 int ipu_di_init_sync_panel(struct ipu_di *, struct ipu_di_signal_cfg *sig);
 void ipu_di_uninit_sync_panel(struct ipu_di *di);
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux