Revision e27f01ef hw/pxa2xx_lcd.c

b/hw/pxa2xx_lcd.c
8 8
 */
9 9

  
10 10
#include "vl.h"
11
#include "pixel_ops.h"
11 12

  
12 13
typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int);
13 14

  
......
575 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 579
/* Load new palette for a given DMA channel, convert to internal format */
609 580
static void pxa2xx_palette_parse(struct pxa2xx_lcdc_s *s, int ch, int bpp)
610 581
{

Also available in: Unified diff