aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-13 22:36:30 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-13 22:36:30 +0000
commite27f01ef248ce63b2dc6591c28a275526d2dbc16 (patch)
tree656ab643026050fa9fe5f7f59e7da290ce98f340
parent85b2d44057c2519f3878d0772b55b44f9280d085 (diff)
Use pixel_ops.h in PXA LCD screen drawing.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2983 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--hw/pixel_ops.h12
-rw-r--r--hw/pxa2xx_lcd.c31
2 files changed, 13 insertions, 30 deletions
diff --git a/hw/pixel_ops.h b/hw/pixel_ops.h
index 5334f1dbf..d390adfd1 100644
--- a/hw/pixel_ops.h
+++ b/hw/pixel_ops.h
@@ -28,6 +28,18 @@ static inline unsigned int rgb_to_pixel16bgr(unsigned int r, unsigned int g,
return ((b >> 3) << 11) | ((g >> 2) << 5) | (r >> 3);
}
+static inline unsigned int rgb_to_pixel24(unsigned int r, unsigned int g,
+ unsigned int b)
+{
+ return (r << 16) | (g << 8) | b;
+}
+
+static inline unsigned int rgb_to_pixel24bgr(unsigned int r, unsigned int g,
+ unsigned int b)
+{
+ return (b << 16) | (g << 8) | r;
+}
+
static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g,
unsigned int b)
{
diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c
index effeaa384..2c1096389 100644
--- a/hw/pxa2xx_lcd.c
+++ b/hw/pxa2xx_lcd.c
@@ -8,6 +8,7 @@
*/
#include "vl.h"
+#include "pixel_ops.h"
typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int);
@@ -575,36 +576,6 @@ static CPUWriteMemoryFunc *pxa2xx_lcdc_writefn[] = {
pxa2xx_lcdc_write
};
-static inline
-uint32_t rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
-{
- return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
-}
-
-static inline
-uint32_t rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b)
-{
- return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
-}
-
-static inline
-uint32_t rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b)
-{
- return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
-}
-
-static inline
-uint32_t rgb_to_pixel24(unsigned int r, unsigned int g, unsigned b)
-{
- return (r << 16) | (g << 8) | b;
-}
-
-static inline
-uint32_t rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b)
-{
- return (r << 16) | (g << 8) | b;
-}
-
/* Load new palette for a given DMA channel, convert to internal format */
static void pxa2xx_palette_parse(struct pxa2xx_lcdc_s *s, int ch, int bpp)
{