1.1 --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Sun Jan 31 22:46:41 2021 +0100
1.2 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Fri Jan 14 22:30:38 2022 +0100
1.3 @@ -2,8 +2,8 @@
1.4 * LCD peripheral support for the JZ4740 and related SoCs.
1.5 *
1.6 * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc>
1.7 - * Copyright (C) 2015, 2016, 2017, 2018,
1.8 - * 2020 Paul Boddie <paul@boddie.org.uk>
1.9 + * Copyright (C) 2015, 2016, 2017, 2018, 2020,
1.10 + * 2021 Paul Boddie <paul@boddie.org.uk>
1.11 *
1.12 * This program is free software; you can redistribute it and/or
1.13 * modify it under the terms of the GNU General Public License as
1.14 @@ -41,13 +41,6 @@
1.15 _burst_size = 64; // 64-word burst size available in the JZ4780
1.16 }
1.17
1.18 -void
1.19 -Lcd_jz4780_chip::enable()
1.20 -{
1.21 - _regs[Osd_status] = 0;
1.22 - Lcd_jz4740_chip::enable();
1.23 -}
1.24 -
1.25 // Return an interrupt-related OSD configuration value.
1.26
1.27 uint32_t
1.28 @@ -123,12 +116,14 @@
1.29
1.30 desc.offset = 0;
1.31 desc.page_width = 0;
1.32 +
1.33 desc.command_position = (1U << Position_premultiply_lcd) |
1.34 - ((frame_enable ? 1U : 3U) << Position_coefficient) |
1.35 + (1U << Position_coefficient) |
1.36 _position_bpp();
1.37 - desc.fg_size = 0xff000000 |
1.38 - ((_panel->height - 1) << 12) |
1.39 - ((_panel->width - 1) << 0);
1.40 +
1.41 + desc.fg_size = (0xff << Alpha_size_alpha) |
1.42 + ((_panel->height - 1) << Alpha_size_height) |
1.43 + ((_panel->width - 1) << Alpha_size_width);
1.44 }
1.45
1.46 // HDMI-compatible JZ4780 configuration.
1.47 @@ -140,19 +135,18 @@
1.48 struct Jz4740_lcd_descriptor *desc_paddr,
1.49 l4_addr_t fb_paddr)
1.50 {
1.51 - // Provide the first framebuffer descriptor in single and dual modes.
1.52 - // Flip back and forth between any palette and the framebuffer.
1.53 + // Descriptor for the first DMA channel.
1.54
1.55 _set_descriptor(desc_vaddr[0], get_framebuffer(0, fb_paddr),
1.56 get_aligned_size(),
1.57 desc_paddr,
1.58 _command_irq());
1.59
1.60 - // Provide the second framebuffer descriptor only in dual-panel mode.
1.61 - // Only employ this descriptor in the second DMA channel.
1.62 + // Descriptor for the second DMA channel.
1.63 + // This just sets an inactive frame.
1.64
1.65 - _set_descriptor(desc_vaddr[1], get_framebuffer(1, fb_paddr),
1.66 - get_aligned_size(),
1.67 + _set_descriptor(desc_vaddr[1], 0,
1.68 + 0,
1.69 desc_paddr + 1,
1.70 _command_irq(),
1.71 false);
1.72 @@ -168,7 +162,7 @@
1.73
1.74 _regs[Desc_address_0] = (uint32_t) desc_paddr;
1.75
1.76 - // Provide a descriptor for the second DMA channel, providing foreground 1.
1.77 + // Provide a descriptor for the second DMA channel, currently not used.
1.78
1.79 _regs[Desc_address_1] = (uint32_t) (desc_paddr + 1);
1.80
1.81 @@ -182,19 +176,6 @@
1.82
1.83 _regs[Lcd_control] = _control_panel() | _control_transfer() | _control_irq();
1.84 _regs[Lcd_config] = _panel->config;
1.85 -
1.86 - // JZ4780-specific configuration.
1.87 - // The RGB control register usage may be superfluous.
1.88 -
1.89 - _regs[Rgb_control] = (1U << Rgb_format_enable) | Rgb_odd_line_rgb | Rgb_even_line_rgb;
1.90 - _regs[Priority_level] = _priority_transfer();
1.91 -
1.92 - // Employ whole image alpha levels by default.
1.93 -
1.94 - _regs[Osd_config] = (1U << Osd_config_enable) |
1.95 - (1U << Osd_config_alpha_enable);
1.96 - _regs[Alpha_levels] = ((255U << Alpha_level_fg1) & Alpha_level_fg1_mask) |
1.97 - ((255U << Alpha_level_fg0) & Alpha_level_fg0_mask);
1.98 }
1.99
1.100