# HG changeset patch # User Paul Boddie # Date 1686429954 -7200 # Node ID b8f67dd7016023259ab61acd6e7877e4830321e9 # Parent b0793bbce22511dd34ee8afad951f9a6b7934a34# Parent 7aa21a758551cc1b2d6e08c68dba1e98726c154b Merged the default branch. diff -r b0793bbce225 -r b8f67dd70160 pkg/devices/lib/lcd/include/lcd-jz4740-regs.h --- a/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Sat Jun 10 22:45:34 2023 +0200 +++ b/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Sat Jun 10 22:45:54 2023 +0200 @@ -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, 2022 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 @@ -286,6 +286,8 @@ enum Position_bits : unsigned { + Position_alpha_mode = 31, + Position_rgb = 30, Position_bpp = 27, Position_premultiply_lcd = 26, Position_coefficient = 24, @@ -293,9 +295,38 @@ Position_x_position = 0, }; -enum Position_values : unsigned +enum Position_alpha_mode_values : unsigned +{ + Position_alpha_image = 0, + Position_alpha_pixel = 1, +}; + +enum Position_rgb_values : unsigned +{ + Position_rgb_565 = 0, + Position_rgb_555 = 1, +}; + +enum Position_bpp_values : unsigned { Position_bpp_15_16bpp = 4, Position_bpp_18_24bpp = 5, Position_bpp_30bpp = 7, }; + +enum Position_coefficient_values : unsigned +{ + Position_coefficient_0 = 0, + Position_coefficient_1 = 1, + Position_coefficient_alpha = 2, + Position_coefficient_1_minus_alpha = 3, +}; + +// Alpha and size. + +enum Alpha_size_bits : unsigned +{ + Alpha_size_alpha = 24, + Alpha_size_height = 12, + Alpha_size_width = 0, +}; diff -r b0793bbce225 -r b8f67dd70160 pkg/devices/lib/lcd/include/lcd-jz4780.h --- a/pkg/devices/lib/lcd/include/lcd-jz4780.h Sat Jun 10 22:45:34 2023 +0200 +++ b/pkg/devices/lib/lcd/include/lcd-jz4780.h Sat Jun 10 22:45:54 2023 +0200 @@ -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 b0793bbce225 -r b8f67dd70160 pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Sat Jun 10 22:45:34 2023 +0200 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Sat Jun 10 22:45:54 2023 +0200 @@ -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 b0793bbce225 -r b8f67dd70160 pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Sat Jun 10 22:45:34 2023 +0200 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Sat Jun 10 22:45:54 2023 +0200 @@ -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, 2022 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,13 @@ desc.offset = 0; desc.page_width = 0; - desc.command_position = (1U << Position_premultiply_lcd) | - ((frame_enable ? 1U : 3U) << Position_coefficient) | + + desc.command_position = (Position_coefficient_1 << 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 +134,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); @@ -164,11 +157,11 @@ // Configure DMA by setting frame descriptor addresses. - // Provide the palette descriptor address first, if employed. + // Provide a descriptor for the first DMA channel. _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 +175,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 b0793bbce225 -r b8f67dd70160 pkg/devices/lib/panel/src/ci20/panel-ci20.c --- a/pkg/devices/lib/panel/src/ci20/panel-ci20.c Sat Jun 10 22:45:34 2023 +0200 +++ b/pkg/devices/lib/panel/src/ci20/panel-ci20.c Sat Jun 10 22:45:54 2023 +0200 @@ -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. diff -r b0793bbce225 -r b8f67dd70160 tools/listlibs.sh --- a/tools/listlibs.sh Sat Jun 10 22:45:34 2023 +0200 +++ b/tools/listlibs.sh Sat Jun 10 22:45:54 2023 +0200 @@ -73,7 +73,7 @@ $BUILDDIR/bin EOF exit 1 - elif [ ! "$ARCH" ] || [ "$ARCH" = "$BASENAME" ] ; then + elif [ ! "$ARCH" ] || [ "${ARCH}_gen" = "$BASENAME" ] ; then ARCHDIR="$BASENAME" break fi