Commit e27f01ef248ce63b2dc6591c28a275526d2dbc16
1 parent
85b2d440
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
Showing
2 changed files
with
13 additions
and
30 deletions
hw/pixel_ops.h
@@ -28,6 +28,18 @@ static inline unsigned int rgb_to_pixel16bgr(unsigned int r, unsigned int g, | @@ -28,6 +28,18 @@ static inline unsigned int rgb_to_pixel16bgr(unsigned int r, unsigned int g, | ||
28 | return ((b >> 3) << 11) | ((g >> 2) << 5) | (r >> 3); | 28 | return ((b >> 3) << 11) | ((g >> 2) << 5) | (r >> 3); |
29 | } | 29 | } |
30 | 30 | ||
31 | +static inline unsigned int rgb_to_pixel24(unsigned int r, unsigned int g, | ||
32 | + unsigned int b) | ||
33 | +{ | ||
34 | + return (r << 16) | (g << 8) | b; | ||
35 | +} | ||
36 | + | ||
37 | +static inline unsigned int rgb_to_pixel24bgr(unsigned int r, unsigned int g, | ||
38 | + unsigned int b) | ||
39 | +{ | ||
40 | + return (b << 16) | (g << 8) | r; | ||
41 | +} | ||
42 | + | ||
31 | static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, | 43 | static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, |
32 | unsigned int b) | 44 | unsigned int b) |
33 | { | 45 | { |
hw/pxa2xx_lcd.c
@@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "vl.h" | 10 | #include "vl.h" |
11 | +#include "pixel_ops.h" | ||
11 | 12 | ||
12 | typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int); | 13 | typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int); |
13 | 14 | ||
@@ -575,36 +576,6 @@ static CPUWriteMemoryFunc *pxa2xx_lcdc_writefn[] = { | @@ -575,36 +576,6 @@ static CPUWriteMemoryFunc *pxa2xx_lcdc_writefn[] = { | ||
575 | pxa2xx_lcdc_write | 576 | pxa2xx_lcdc_write |
576 | }; | 577 | }; |
577 | 578 | ||
578 | -static inline | ||
579 | -uint32_t rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b) | ||
580 | -{ | ||
581 | - return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6); | ||
582 | -} | ||
583 | - | ||
584 | -static inline | ||
585 | -uint32_t rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b) | ||
586 | -{ | ||
587 | - return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3); | ||
588 | -} | ||
589 | - | ||
590 | -static inline | ||
591 | -uint32_t rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b) | ||
592 | -{ | ||
593 | - return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); | ||
594 | -} | ||
595 | - | ||
596 | -static inline | ||
597 | -uint32_t rgb_to_pixel24(unsigned int r, unsigned int g, unsigned b) | ||
598 | -{ | ||
599 | - return (r << 16) | (g << 8) | b; | ||
600 | -} | ||
601 | - | ||
602 | -static inline | ||
603 | -uint32_t rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b) | ||
604 | -{ | ||
605 | - return (r << 16) | (g << 8) | b; | ||
606 | -} | ||
607 | - | ||
608 | /* Load new palette for a given DMA channel, convert to internal format */ | 579 | /* Load new palette for a given DMA channel, convert to internal format */ |
609 | static void pxa2xx_palette_parse(struct pxa2xx_lcdc_s *s, int ch, int bpp) | 580 | static void pxa2xx_palette_parse(struct pxa2xx_lcdc_s *s, int ch, int bpp) |
610 | { | 581 | { |