public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ian Campbell <ijc+uboot@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] sunxi: display: Add overscan correction
Date: Wed, 12 Aug 2015 11:45:40 +0100	[thread overview]
Message-ID: <1439376340.8356.13.camel@hellion.org.uk> (raw)
In-Reply-To: <1438787851-31814-4-git-send-email-hdegoede@redhat.com>

On Wed, 2015-08-05 at 17:17 +0200, Hans de Goede wrote:
>  > 	> sunxi_display.fb_size =
>  > 	> 	> (mode->xres * mode->yres * 4 + 0xfff) & ~0xfff;
> +> 	> overscan_offset = (overscan_y * mode->xres + overscan_x) * 4;
> +> 	> /* We want to keep the fb_base for simplefb page aligned, where as
> +> 	>  * the sunxi dma engines will happily accept an unaligned address. */
> +> 	> if (overscan_offset)
> +> 	> 	> sunxi_display.fb_size += 0x1000;

Why plus 4K regardless of the magnitude of overscan_offset? What if it was
0x1004?

Also, what's the link between fb_base's alignment and fb_size which is
implied by the comment?

>  > 	> gd->fb_base = gd->bd->bi_dram[0].start +
>  > 	> 	>       gd->bd->bi_dram[0].size - sunxi_display.fb_size;
>  > 	> sunxi_engines_init();
> -> 	> sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE);
> +
> +> 	> fb_dma_addr = gd->fb_base - CONFIG_SYS_SDRAM_BASE;
> +> 	> sunxi_display.fb_addr = gd->fb_base;
> +> 	> if (overscan_offset) {
> +> 	> 	> fb_dma_addr += 0x1000 - (overscan_offset & 0xfff);
> +> 	> 	> sunxi_display.fb_addr += (overscan_offset + 0xfff) & ~0xfff;
> +> 	> 	> memset((void *)gd->fb_base, 0, sunxi_display.fb_size);
> +> 	> 	> flush_cache(gd->fb_base, sunxi_display.fb_size);
> +> 	> }

Hrm, I think this starts to answer, but I'm still not sure I follow, sorry.

> +	sunxi_mode_set(mode, fb_dma_addr);
>  
>  	/*
>  > 	>  * These are the only members of this structure that are used. All the
>  > 	>  * others are driver specific. There is nothing to decribe pitch or


Pre-existing typo "describe".

  reply	other threads:[~2015-08-12 10:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 15:17 [U-Boot] [PATCH 0/3] sunxi: display: Add overscan correction Hans de Goede
2015-08-05 15:17 ` [U-Boot] [PATCH 1/3] cfbconsole: Remove width argument from the logo functions Hans de Goede
2015-08-12 21:57   ` Anatolij Gustschin
2015-08-05 15:17 ` [U-Boot] [PATCH 2/3] cfbconsole: Add support for stride != width Hans de Goede
2015-08-12 22:01   ` Anatolij Gustschin
2015-08-05 15:17 ` [U-Boot] [PATCH 3/3] sunxi: display: Add overscan correction Hans de Goede
2015-08-12 10:45   ` Ian Campbell [this message]
2015-08-12 12:44     ` Hans de Goede
2015-08-12 16:18       ` Ian Campbell
2015-08-12 16:42     ` Hans de Goede
2015-08-12 22:11   ` Anatolij Gustschin
2015-08-12 22:15 ` [U-Boot] [PATCH 0/3] " Anatolij Gustschin

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=1439376340.8356.13.camel@hellion.org.uk \
    --to=ijc+uboot@hellion.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox