All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sanchayan Maity <maitysanchayan@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/6] video: fsl_dcu_fb: Enable pixel clock after initialization
Date: Thu, 30 Mar 2017 12:44:03 +0530	[thread overview]
Message-ID: <61d51ec4c73e3651f88d9853a477dc9b45069385.1490856350.git.maitysanchayan@gmail.com> (raw)
In-Reply-To: <cover.1490856350.git.maitysanchayan@gmail.com>

From: Stefan Agner <stefan.agner@toradex.com>

When enabling the DCU and pixel clock, the test mode is activated
since this is the reset configuration. The test mode immediately
shows a red screen on a LCD. A moment later, the DCU gets
initialized properly.

This patch enables the pixel clock after initialization of the DCU
control register. This avoids this initial flicker on LCD screens.

While at it change the polarity of pixel clock to display samples
data on the rising edge.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
---
 drivers/video/fsl_dcu_fb.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fsl_dcu_fb.c b/drivers/video/fsl_dcu_fb.c
index 801bf3db95..a922a91fb2 100644
--- a/drivers/video/fsl_dcu_fb.c
+++ b/drivers/video/fsl_dcu_fb.c
@@ -41,7 +41,7 @@
 #define DCU_VSYN_PARA_BP(x)		((x) << 22)
 #define DCU_VSYN_PARA_PW(x)		((x) << 11)
 #define DCU_VSYN_PARA_FP(x)		(x)
-#define DCU_SYN_POL_INV_PXCK_FALL	(0 << 6)
+#define DCU_SYN_POL_INV_PXCK_FALL	(1 << 6)
 #define DCU_SYN_POL_NEG_REMAIN		(0 << 5)
 #define DCU_SYN_POL_INV_VS_LOW		(1 << 1)
 #define DCU_SYN_POL_INV_HS_LOW		(1)
@@ -191,8 +191,6 @@ static void reset_total_layers(void)
 		dcu_write32(&regs->ctrldescl[i][9], 0);
 		dcu_write32(&regs->ctrldescl[i][10], 0);
 	}
-
-	dcu_write32(&regs->update_mode, DCU_UPDATE_MODE_READREG);
 }
 
 static int layer_ctrldesc_init(int index, u32 pixel_format)
@@ -246,8 +244,6 @@ static int layer_ctrldesc_init(int index, u32 pixel_format)
 	dcu_write32(&regs->ctrldescl[index][7], DCU_CTRLDESCLN_8_FG_FCOLOR(0));
 	dcu_write32(&regs->ctrldescl[index][8], DCU_CTRLDESCLN_9_BG_BCOLOR(0));
 
-	dcu_write32(&regs->update_mode, DCU_UPDATE_MODE_READREG);
-
 	return 0;
 }
 
@@ -273,8 +269,6 @@ int fsl_dcu_init(unsigned int xres, unsigned int yres,
 	memset(info.screen_base, 0, info.screen_size);
 
 	reset_total_layers();
-	div = dcu_set_pixel_clock(info.var.pixclock);
-	dcu_write32(&regs->div_ratio, (div - 1));
 
 	dcu_write32(&regs->disp_size,
 		    DCU_DISP_SIZE_DELTA_Y(info.var.yres) |
@@ -313,6 +307,11 @@ int fsl_dcu_init(unsigned int xres, unsigned int yres,
 
 	layer_ctrldesc_init(0, pixel_format);
 
+	div = dcu_set_pixel_clock(info.var.pixclock);
+	dcu_write32(&regs->div_ratio, (div - 1));
+
+	dcu_write32(&regs->update_mode, DCU_UPDATE_MODE_READREG);
+
 	return 0;
 }
 
-- 
2.12.1

  parent reply	other threads:[~2017-03-30  7:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  7:14 [U-Boot] [PATCH v2 0/6] Introduce DCU support for Vybrid Sanchayan Maity
2017-03-30  7:14 ` [U-Boot] [PATCH v2 1/6] Convert CONFIG_FSL_DCU_FB to Kconfig Sanchayan Maity
2017-03-30  7:14 ` [U-Boot] [PATCH v2 2/6] video: fsl_dcu_fb: fix framebuffer to the end of memory Sanchayan Maity
2017-03-30  7:14 ` Sanchayan Maity [this message]
2017-03-30  7:14 ` [U-Boot] [PATCH v2 4/6] video: fsl_dcu_fb: Update DCU layers for Vybrid Sanchayan Maity
2017-03-30 15:34   ` Stefan Agner
2017-03-30  7:14 ` [U-Boot] [PATCH v2 5/6] video: fsl_dcu_fb: add additional modes for DCU Sanchayan Maity
2017-03-30  7:14 ` [U-Boot] [PATCH v2 6/6] board: toradex: colibri_vf: Add DCU support for Colibri Vybrid Sanchayan Maity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61d51ec4c73e3651f88d9853a477dc9b45069385.1490856350.git.maitysanchayan@gmail.com \
    --to=maitysanchayan@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.