# HG changeset patch # User Paul Boddie # Date 1642195838 -3600 # Node ID abb9aacce908876b0043da4ba522f509f5dfca11 # Parent 6fb955a6d639852bc40e3b9c153c44e0996066f6 Removed superfluous flags and operations when configuring the JZ4780 LCDC. diff -r 6fb955a6d639 -r abb9aacce908 pkg/devices/lib/lcd/include/lcd-jz4740-regs.h --- a/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Sun Jan 31 22:46:41 2021 +0100 +++ b/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Fri Jan 14 22:30:38 2022 +0100 @@ -2,8 +2,8 @@ * LCD peripheral support for the JZ4740 and related SoCs. * * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016, 2017, 2018, - * 2020 Paul Boddie + * Copyright (C) 2015, 2016, 2017, 2018, 2020, + * 2021 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -299,3 +299,12 @@ Position_bpp_18_24bpp = 5, Position_bpp_30bpp = 7, }; + +// Alpha and size. + +enum Alpha_size_bits : unsigned +{ + Alpha_size_alpha = 24, + Alpha_size_height = 12, + Alpha_size_width = 0, +}; diff -r 6fb955a6d639 -r abb9aacce908 pkg/devices/lib/lcd/include/lcd-jz4780.h --- a/pkg/devices/lib/lcd/include/lcd-jz4780.h Sun Jan 31 22:46:41 2021 +0100 +++ b/pkg/devices/lib/lcd/include/lcd-jz4780.h Fri Jan 14 22:30:38 2022 +0100 @@ -55,8 +55,6 @@ public: Lcd_jz4780_chip(l4_addr_t addr, Jz4740_lcd_panel *panel); - void enable(); - /* Configuration. */ void config(struct Jz4740_lcd_descriptor *desc_vaddr, diff -r 6fb955a6d639 -r abb9aacce908 pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Sun Jan 31 22:46:41 2021 +0100 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Fri Jan 14 22:30:38 2022 +0100 @@ -407,6 +407,8 @@ default: length = Burst_length_16; break; } + // NOTE: Underrun supposedly not needed. + return (length << Control_burst_length) | (1U << Control_out_underrun); } diff -r 6fb955a6d639 -r abb9aacce908 pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Sun Jan 31 22:46:41 2021 +0100 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Fri Jan 14 22:30:38 2022 +0100 @@ -2,8 +2,8 @@ * LCD peripheral support for the JZ4740 and related SoCs. * * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016, 2017, 2018, - * 2020 Paul Boddie + * Copyright (C) 2015, 2016, 2017, 2018, 2020, + * 2021 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -41,13 +41,6 @@ _burst_size = 64; // 64-word burst size available in the JZ4780 } -void -Lcd_jz4780_chip::enable() -{ - _regs[Osd_status] = 0; - Lcd_jz4740_chip::enable(); -} - // Return an interrupt-related OSD configuration value. uint32_t @@ -123,12 +116,14 @@ desc.offset = 0; desc.page_width = 0; + desc.command_position = (1U << Position_premultiply_lcd) | - ((frame_enable ? 1U : 3U) << Position_coefficient) | + (1U << Position_coefficient) | _position_bpp(); - desc.fg_size = 0xff000000 | - ((_panel->height - 1) << 12) | - ((_panel->width - 1) << 0); + + desc.fg_size = (0xff << Alpha_size_alpha) | + ((_panel->height - 1) << Alpha_size_height) | + ((_panel->width - 1) << Alpha_size_width); } // HDMI-compatible JZ4780 configuration. @@ -140,19 +135,18 @@ struct Jz4740_lcd_descriptor *desc_paddr, l4_addr_t fb_paddr) { - // Provide the first framebuffer descriptor in single and dual modes. - // Flip back and forth between any palette and the framebuffer. + // Descriptor for the first DMA channel. _set_descriptor(desc_vaddr[0], get_framebuffer(0, fb_paddr), get_aligned_size(), desc_paddr, _command_irq()); - // Provide the second framebuffer descriptor only in dual-panel mode. - // Only employ this descriptor in the second DMA channel. + // Descriptor for the second DMA channel. + // This just sets an inactive frame. - _set_descriptor(desc_vaddr[1], get_framebuffer(1, fb_paddr), - get_aligned_size(), + _set_descriptor(desc_vaddr[1], 0, + 0, desc_paddr + 1, _command_irq(), false); @@ -168,7 +162,7 @@ _regs[Desc_address_0] = (uint32_t) desc_paddr; - // Provide a descriptor for the second DMA channel, providing foreground 1. + // Provide a descriptor for the second DMA channel, currently not used. _regs[Desc_address_1] = (uint32_t) (desc_paddr + 1); @@ -182,19 +176,6 @@ _regs[Lcd_control] = _control_panel() | _control_transfer() | _control_irq(); _regs[Lcd_config] = _panel->config; - - // JZ4780-specific configuration. - // The RGB control register usage may be superfluous. - - _regs[Rgb_control] = (1U << Rgb_format_enable) | Rgb_odd_line_rgb | Rgb_even_line_rgb; - _regs[Priority_level] = _priority_transfer(); - - // Employ whole image alpha levels by default. - - _regs[Osd_config] = (1U << Osd_config_enable) | - (1U << Osd_config_alpha_enable); - _regs[Alpha_levels] = ((255U << Alpha_level_fg1) & Alpha_level_fg1_mask) | - ((255U << Alpha_level_fg0) & Alpha_level_fg0_mask); } diff -r 6fb955a6d639 -r abb9aacce908 pkg/devices/lib/panel/src/ci20/panel-ci20.c --- a/pkg/devices/lib/panel/src/ci20/panel-ci20.c Sun Jan 31 22:46:41 2021 +0100 +++ b/pkg/devices/lib/panel/src/ci20/panel-ci20.c Fri Jan 14 22:30:38 2022 +0100 @@ -1,7 +1,7 @@ /* * Export a panel structure for the MIPS Creator CI20. * - * Copyright (C) 2018, 2020 Paul Boddie + * Copyright (C) 2018, 2020, 2021 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -27,14 +27,10 @@ Jz4740_lcd_mode_tft_generic | Jz4740_lcd_bpp_24 | Jz4740_lcd_desc_8_word - | Jz4740_lcd_underrun_recover | Jz4740_lcd_ps_disabled | Jz4740_lcd_cls_disabled | Jz4740_lcd_spl_disabled | Jz4740_lcd_rev_disabled - | Jz4740_lcd_pclock_negative - | Jz4740_lcd_hsync_positive - | Jz4740_lcd_vsync_positive | Jz4740_lcd_de_positive), // NOTE: To be configured using the HDMI DDC mechanism.