# HG changeset patch # User Paul Boddie # Date 1609021306 -3600 # Node ID aa50d8a97e7186a7a9a898932e29ebbd720e758d # Parent 31bf31efe500670e50f14838b0b893c48f4b068c Fixed non-JZ4780 support, moving OSD-related code out of the driver base class. diff -r 31bf31efe500 -r aa50d8a97e71 pkg/devices/lib/lcd/include/lcd-jz4740.h --- a/pkg/devices/lib/lcd/include/lcd-jz4740.h Sat Dec 26 23:19:06 2020 +0100 +++ b/pkg/devices/lib/lcd/include/lcd-jz4740.h Sat Dec 26 23:21:46 2020 +0100 @@ -83,10 +83,6 @@ uint32_t _control_stn_frc(); uint32_t _control_transfer(); - /* OSD configure register value calculation. */ - - uint32_t _osd_config_irq(); - /* Command register value calculation. */ uint32_t _command_irq(); @@ -120,7 +116,7 @@ void disable(); void disable_quick(); - void enable(); + virtual void enable(); bool enabled(); /* Peripheral properties. */ diff -r 31bf31efe500 -r aa50d8a97e71 pkg/devices/lib/lcd/include/lcd-jz4780.h --- a/pkg/devices/lib/lcd/include/lcd-jz4780.h Sat Dec 26 23:19:06 2020 +0100 +++ b/pkg/devices/lib/lcd/include/lcd-jz4780.h Sat Dec 26 23:21:46 2020 +0100 @@ -34,6 +34,10 @@ class Lcd_jz4780_chip : public Lcd_jz4740_chip { protected: + /* OSD configure register value calculation. */ + + uint32_t _osd_config_irq(); + /* Priority level threshold value calculation. */ uint32_t _priority_transfer(); @@ -51,6 +55,8 @@ 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 31bf31efe500 -r aa50d8a97e71 pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Sat Dec 26 23:19:06 2020 +0100 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Sat Dec 26 23:21:46 2020 +0100 @@ -103,9 +103,7 @@ Lcd_jz4740_chip::enable() { // Clear the disable bit and set the enable bit. - // JZ4780: OSD status set. - _regs[Osd_status] = 0; _regs[Lcd_status] = 0; _regs[Lcd_control] = (_regs[Lcd_control] & ~(1U << Control_disable)) | (1U << Control_enable); } @@ -421,15 +419,6 @@ ((_irq_conditions & Lcd_irq_frame_end) ? (1U << Control_frame_end_irq_enable) : 0); } -// Return an interrupt-related OSD configuration value. - -uint32_t -Lcd_jz4740_chip::_osd_config_irq() -{ - return ((_irq_conditions & Lcd_irq_frame_start) ? (1U << Osd_config_fg0_frame_start_irq_enable) : 0) | - ((_irq_conditions & Lcd_irq_frame_end) ? (1U << Osd_config_fg0_frame_end_irq_enable) : 0); -} - // Return an interrupt-related command value. uint32_t diff -r 31bf31efe500 -r aa50d8a97e71 pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Sat Dec 26 23:19:06 2020 +0100 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Sat Dec 26 23:21:46 2020 +0100 @@ -41,6 +41,22 @@ _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 +Lcd_jz4780_chip::_osd_config_irq() +{ + return ((_irq_conditions & Lcd_irq_frame_start) ? (1U << Osd_config_fg0_frame_start_irq_enable) : 0) | + ((_irq_conditions & Lcd_irq_frame_end) ? (1U << Osd_config_fg0_frame_end_irq_enable) : 0); +} + // Return colour depth control value. // JZ4780 position details only.