All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/6] video: fsl_dcu_fb: Update DCU layers for Vybrid
Date: Thu, 30 Mar 2017 08:34:08 -0700	[thread overview]
Message-ID: <8dc7d9e9ee41025be0353f56666fdf12@agner.ch> (raw)
In-Reply-To: <7686f5784f9dc014ea7ed36f25e7209b39d19016.1490856350.git.maitysanchayan@gmail.com>

On 2017-03-30 00:14, Sanchayan Maity wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
> 
> Users control the graphical content of the panel by manipulating
> configuration of elements in DCU4 called layers. The number of
> layers is different for Vybrid and LS102XA SoC's. Update this
> to reflect for LS102XA accordingly and for use with Vybrid.
> 
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
> ---
>  arch/arm/include/asm/arch-ls102xa/config.h | 1 +
>  drivers/video/fsl_dcu_fb.c                 | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/include/asm/arch-ls102xa/config.h
> b/arch/arm/include/asm/arch-ls102xa/config.h
> index 2f7233f2fe..7a909c88af 100644
> --- a/arch/arm/include/asm/arch-ls102xa/config.h
> +++ b/arch/arm/include/asm/arch-ls102xa/config.h
> @@ -107,6 +107,7 @@
>  #define CONFIG_SYS_FSL_SRK_LE
>  
>  #define DCU_LAYER_MAX_NUM			16

That is currently used for DCU_MODE_BLEND_ITER, and it actually
overflows the maximum value of BLEND_ITER (for VF610 as well as
LS1021a)! I guess since we blindly shift 20 in DCU_MODE_BLEND_ITER(x),
we actually write the ADDR register (Two-bit value to be added to pixel
red component for dithering), so no real harm there. Still, we should
fix it.

I suggest to do the following:

Add a new patch, and fix fsl_dcu_init, just use the default value of 2
pixel blending:

        dcu_write32(&regs->mode,
                    DCU_MODE_BLEND_ITER(2) |
                    DCU_MODE_RASTER_EN);

Then we also can avoid adding DCU_TOTAL_LAYER_NUM and just use
DCU_LAYER_MAX_NUM for the total layer count...

> +#define DCU_TOTAL_LAYER_NUM			16
>  
>  #ifdef CONFIG_LS102XA
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT		1
> diff --git a/drivers/video/fsl_dcu_fb.c b/drivers/video/fsl_dcu_fb.c
> index a922a91fb2..35550afd63 100644
> --- a/drivers/video/fsl_dcu_fb.c
> +++ b/drivers/video/fsl_dcu_fb.c
> @@ -178,7 +178,7 @@ static void reset_total_layers(void)
>  	struct dcu_reg *regs = (struct dcu_reg *)CONFIG_SYS_DCU_ADDR;
>  	int i;
>  
> -	for (i = 0; i < DCU_LAYER_MAX_NUM; i++) {
> +	for (i = 0; i < DCU_TOTAL_LAYER_NUM; i++) {

You should also update ctrldescl in struct dcu_reg to use
DCU_TOTAL_LAYER_NUM.

With the above suggestion though, this should be taken care of.

--
Stefan

>  		dcu_write32(&regs->ctrldescl[i][0], 0);
>  		dcu_write32(&regs->ctrldescl[i][1], 0);
>  		dcu_write32(&regs->ctrldescl[i][2], 0);
> @@ -188,8 +188,10 @@ static void reset_total_layers(void)
>  		dcu_write32(&regs->ctrldescl[i][6], 0);
>  		dcu_write32(&regs->ctrldescl[i][7], 0);
>  		dcu_write32(&regs->ctrldescl[i][8], 0);
> +#ifdef CONFIG_LS102XA
>  		dcu_write32(&regs->ctrldescl[i][9], 0);
>  		dcu_write32(&regs->ctrldescl[i][10], 0);
> +#endif
>  	}
>  }

  reply	other threads:[~2017-03-30 15:34 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 ` [U-Boot] [PATCH v2 3/6] video: fsl_dcu_fb: Enable pixel clock after initialization Sanchayan Maity
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 [this message]
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=8dc7d9e9ee41025be0353f56666fdf12@agner.ch \
    --to=stefan@agner.ch \
    --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.