From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] sunxi: video: Add lcd output support
Date: Mon, 05 Jan 2015 17:21:31 +0100 [thread overview]
Message-ID: <54AABA0B.6080808@redhat.com> (raw)
In-Reply-To: <20150101222152.65f78215@i7>
Hi,
On 01-01-15 21:21, Siarhei Siamashka wrote:
> On Wed, 31 Dec 2014 13:07:20 +0100
> Hans de Goede <hdegoede@redhat.com> wrote:
>
>> Add lcd output support, see the new Kconfig entries and doc/README.video for
>> how to enable / configure this.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
<snip>
>> @@ -179,7 +178,21 @@ struct sunxi_hdmi_reg {
>> #define SUNXI_LCDC_CTRL_IO_MAP_TCON0 (0 << 0)
>> #define SUNXI_LCDC_CTRL_IO_MAP_TCON1 (1 << 0)
>> #define SUNXI_LCDC_CTRL_TCON_ENABLE (1 << 31)
>> +#define SUNXI_LCDC_FRAME_CTRL0_RGB666 ((1 << 31) | (0 << 4))
>> +#define SUNXI_LCDC_FRAME_CTRL0_RGB656 ((1 << 31) | (5 << 4))
>
> This would be probably SUNXI_LCDC_FRAME_CTRL0_RGB565 according to
> the Allwinner documentation of the TCON0_FRM_CTL_REG register:
>
> 0: 6bit frm output
> 1: 5bit frm output
>
> Since we have 5 there (101 bit pattern), it simply means RGB565.
You're completely right, I took over the weird RGB656 naming from the
allwinner kernel code without thinking things through properly.
<snip>
>> + bp = mode->vsync_len + mode->upper_margin;
>> + total = mode->yres + mode->lower_margin + bp;
>> + writel(SUNXI_LCDC_TCON0_TIMING_V_TOTAL(total) |
>> + SUNXI_LCDC_TCON0_TIMING_V_BP(bp), &lcdc->tcon0_timing_v);
>> +
>> + writel(SUNXI_LCDC_X(mode->hsync_len) | SUNXI_LCDC_Y(mode->vsync_len),
>> + &lcdc->tcon0_timing_sync);
>> +
>> + /* We only support hv-sync parallel lcd-s for now */
>> + writel(0, &lcdc->tcon0_hv_intf);
>> + writel(0, &lcdc->tcon0_cpu_intf);
>> +
>> + if (sunxi_display.depth == 18 || sunxi_display.depth == 17) {
>
> Here 17 is not quite correct for RGB565.
Right, this should be 16 meaning plain old RGB565, I've fixed both in
my personal tree. Thanks for pointing this out!
>
> Also these are dithering settings, and this code just unconditionally
> enables the right dithering for 16-bit LCD displays (this seems to
> be never used in any real device from the sunxi-boards repository) or
> 18-bit LCD displays, which are very common.
>
> Because 32-bit framebuffers support more colors than the 18-bit LCD
> hardware can show, dithering is needed and used:
> http://en.wikipedia.org/wiki/Frame_rate_control
>
> Do we want to have a separate option to enable/disable dithering? Or
> just keep it always enabled until somebody complains?
>
> A simple program for testing dithering effects/usefulness can be found
> here:
> http://lists.denx.de/pipermail/u-boot/2015-January/200031.html
<snip>
Regards,
Hans
prev parent reply other threads:[~2015-01-05 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-31 12:07 [U-Boot] [PATCH v2 1/2] sunxi: video: Add lcd output support Hans de Goede
2014-12-31 12:07 ` [U-Boot] [PATCH v2 2/2] sunxi: video: Enable video on sun8i, which supports LCD but not HDMI Hans de Goede
2015-01-07 18:51 ` Ian Campbell
2015-01-07 19:54 ` Hans de Goede
2015-01-01 20:21 ` [U-Boot] [PATCH v2 1/2] sunxi: video: Add lcd output support Siarhei Siamashka
2015-01-05 16:21 ` Hans de Goede [this message]
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=54AABA0B.6080808@redhat.com \
--to=hdegoede@redhat.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.