From 96f47d6105203ab06c2004e26979dea153bce073 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 21 Dec 2008 15:48:12 +0100 Subject: fbdev: c2p/atafb - Add support for Atari interleaved bitplanes The c2p() for normal bitplanes is not suitable for interleaved bitplanes with 2 bytes of interleave, causing a garbled penguin logo. Add c2p_iplan2(). Signed-off-by: Geert Uytterhoeven --- drivers/video/c2p_core.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'drivers/video/c2p_core.h') diff --git a/drivers/video/c2p_core.h b/drivers/video/c2p_core.h index 3573cf723e4..e1035a865fb 100644 --- a/drivers/video/c2p_core.h +++ b/drivers/video/c2p_core.h @@ -95,6 +95,53 @@ static inline void transp8(u32 d[], unsigned int n, unsigned int m) } + /* + * Transpose operations on 4 32-bit words + */ + +static inline void transp4(u32 d[], unsigned int n, unsigned int m) +{ + u32 mask = get_mask(n); + + switch (m) { + case 1: + /* First n x 1 block */ + _transp(d, 0, 1, n, mask); + /* Second n x 1 block */ + _transp(d, 2, 3, n, mask); + return; + + case 2: + /* Single n x 2 block */ + _transp(d, 0, 2, n, mask); + _transp(d, 1, 3, n, mask); + return; + } + + c2p_unsupported(); +} + + + /* + * Transpose operations on 4 32-bit words (reverse order) + */ + +static inline void transp4x(u32 d[], unsigned int n, unsigned int m) +{ + u32 mask = get_mask(n); + + switch (m) { + case 2: + /* Single n x 2 block */ + _transp(d, 2, 0, n, mask); + _transp(d, 3, 1, n, mask); + return; + } + + c2p_unsupported(); +} + + /* * Compose two values, using a bitmask as decision value * This is equivalent to (a & mask) | (b & ~mask) -- cgit v1.2.3