diff options
author | Maciej W. Rozycki | 2016-02-22 01:55:27 +0000 |
---|---|---|
committer | Tomi Valkeinen | 2016-02-26 13:06:11 +0200 |
commit | 5832706e8b50bab3fce1b4bad62b356554b851e4 (patch) | |
tree | 95bd825327984824f38adc9828225e0e4d1031cd /drivers/video/fbdev/bt455.h | |
parent | 01ac59c34420d5807724a5bb21c1464e6dfb7a92 (diff) |
video: fbdev: pmag-ba-fb: Optimize Bt455 colormap addressing
Use the address autoincrement feature when accessing successive palette
entries and also skip loading a palette address in overlay register
assesses which do not use that address. Provide a red/green/blue
register sequencer reset helper for use in overlay register assesses
where the state of the sequencer is not known.
References:
[1] "Bt454 Bt455 170 MHz Monolithic CMOS 16 Color Palette RAMDAC",
Brooktree Corporation, Document Number: L454001, Rev. I
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/bt455.h')
-rw-r--r-- | drivers/video/fbdev/bt455.h | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/video/fbdev/bt455.h b/drivers/video/fbdev/bt455.h index a4bba5a49d77..dd1404b40611 100644 --- a/drivers/video/fbdev/bt455.h +++ b/drivers/video/fbdev/bt455.h @@ -30,13 +30,17 @@ static inline void bt455_select_reg(struct bt455_regs *regs, int ir) regs->addr_cmap = ir & 0x0f; } +static inline void bt455_reset_reg(struct bt455_regs *regs) +{ + mb(); + regs->addr_clr = 0; +} + /* * Read/write to a Bt455 color map register. */ -static inline void bt455_read_cmap_entry(struct bt455_regs *regs, - int cr, u8 *grey) +static inline void bt455_read_cmap_next(struct bt455_regs *regs, u8 *grey) { - bt455_select_reg(regs, cr); mb(); regs->addr_cmap_data; rmb(); @@ -45,10 +49,8 @@ static inline void bt455_read_cmap_entry(struct bt455_regs *regs, regs->addr_cmap_data; } -static inline void bt455_write_cmap_entry(struct bt455_regs *regs, - int cr, u8 grey) +static inline void bt455_write_cmap_next(struct bt455_regs *regs, u8 grey) { - bt455_select_reg(regs, cr); wmb(); regs->addr_cmap_data = 0x0; wmb(); @@ -57,10 +59,8 @@ static inline void bt455_write_cmap_entry(struct bt455_regs *regs, regs->addr_cmap_data = 0x0; } -static inline void bt455_write_ovly_entry(struct bt455_regs *regs, - int cr, u8 grey) +static inline void bt455_write_ovly_next(struct bt455_regs *regs, u8 grey) { - bt455_select_reg(regs, cr); wmb(); regs->addr_ovly = 0x0; wmb(); @@ -68,3 +68,23 @@ static inline void bt455_write_ovly_entry(struct bt455_regs *regs, wmb(); regs->addr_ovly = 0x0; } + +static inline void bt455_read_cmap_entry(struct bt455_regs *regs, + int cr, u8 *grey) +{ + bt455_select_reg(regs, cr); + bt455_read_cmap_next(regs, grey); +} + +static inline void bt455_write_cmap_entry(struct bt455_regs *regs, + int cr, u8 grey) +{ + bt455_select_reg(regs, cr); + bt455_write_cmap_next(regs, grey); +} + +static inline void bt455_write_ovly_entry(struct bt455_regs *regs, u8 grey) +{ + bt455_reset_reg(regs); + bt455_write_ovly_next(regs, grey); +} |