qemu_mallocz(sizeof(blizzard_fn_t) * 0x10);
break;
case 8:
- s->line_fn_tab[0] = 0 ? blizzard_draw_fn_bgr_8 : blizzard_draw_fn_8;
- s->line_fn_tab[1] = 0 ? blizzard_draw_fn_r_bgr_8 : blizzard_draw_fn_r_8;
+ s->line_fn_tab[0] = blizzard_draw_fn_8;
+ s->line_fn_tab[1] = blizzard_draw_fn_r_8;
break;
case 15:
- s->line_fn_tab[0] = 0 ? blizzard_draw_fn_bgr_15 : blizzard_draw_fn_15;
- s->line_fn_tab[1] = 0 ? blizzard_draw_fn_r_bgr_15 : blizzard_draw_fn_r_15;
+ s->line_fn_tab[0] = blizzard_draw_fn_15;
+ s->line_fn_tab[1] = blizzard_draw_fn_r_15;
break;
case 16:
- s->line_fn_tab[0] = 0 ? blizzard_draw_fn_bgr_16 : blizzard_draw_fn_16;
- s->line_fn_tab[1] = 0 ? blizzard_draw_fn_r_bgr_16 : blizzard_draw_fn_r_16;
+ s->line_fn_tab[0] = blizzard_draw_fn_16;
+ s->line_fn_tab[1] = blizzard_draw_fn_r_16;
break;
case 24:
- s->line_fn_tab[0] = 0 ? blizzard_draw_fn_bgr_24 : blizzard_draw_fn_24;
- s->line_fn_tab[1] = 0 ? blizzard_draw_fn_r_bgr_24 : blizzard_draw_fn_r_24;
+ s->line_fn_tab[0] = blizzard_draw_fn_24;
+ s->line_fn_tab[1] = blizzard_draw_fn_r_24;
break;
case 32:
- s->line_fn_tab[0] = 0 ? blizzard_draw_fn_bgr_32 : blizzard_draw_fn_32;
- s->line_fn_tab[1] = 0 ? blizzard_draw_fn_r_bgr_32 : blizzard_draw_fn_r_32;
+ s->line_fn_tab[0] = blizzard_draw_fn_32;
+ s->line_fn_tab[1] = blizzard_draw_fn_r_32;
break;
default:
fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__);
#endif
}
-static void glue(blizzard_draw_line16_bgr_, DEPTH)(PIXEL_TYPE *dest,
- const uint16_t *src, unsigned int width)
-{
-#if !defined(SWAP_WORDS) && DEPTH == 16
- memcpy(dest, src, width);
-#else
- uint16_t data;
- unsigned int r, g, b;
- const uint16_t *end = (const void *) src + width;
- while (src < end) {
- data = lduw_raw(src ++);
- r = (data & 0x1f) << 3;
- data >>= 5;
- g = (data & 0x3f) << 2;
- data >>= 6;
- b = (data & 0x1f) << 3;
- data >>= 5;
- COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
- }
-#endif
-}
-
static void glue(blizzard_draw_line24mode1_, DEPTH)(PIXEL_TYPE *dest,
const uint8_t *src, unsigned int width)
{
}
}
-static void glue(blizzard_draw_line24mode1_bgr_, DEPTH)(PIXEL_TYPE *dest,
- const uint8_t *src, unsigned int width)
-{
- /* TODO: check if SDL 24-bit planes are not in the same format and
- * if so, use memcpy */
- unsigned int r[2], g[2], b[2];
- const uint8_t *end = src + width;
- while (src < end) {
- g[0] = *src ++;
- b[0] = *src ++;
- b[1] = *src ++;
- r[0] = *src ++;
- COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r[0], g[0], b[0]));
- r[1] = *src ++;
- g[1] = *src ++;
- COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r[1], g[1], b[1]));
- }
-}
-
static void glue(blizzard_draw_line24mode2_, DEPTH)(PIXEL_TYPE *dest,
const uint8_t *src, unsigned int width)
{
}
}
-static void glue(blizzard_draw_line24mode2_bgr_, DEPTH)(PIXEL_TYPE *dest,
- const uint8_t *src, unsigned int width)
-{
- unsigned int r, g, b;
- const uint8_t *end = src + width;
- while (src < end) {
- b = *src ++;
- src ++;
- r = *src ++;
- g = *src ++;
- COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
- }
-}
-
/* No rotation */
static blizzard_fn_t glue(blizzard_draw_fn_, DEPTH)[0x10] = {
NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
};
-/* No rotation, BGR */
-static blizzard_fn_t glue(blizzard_draw_fn_bgr_, DEPTH)[0x10] = {
- NULL,
- /* RGB 5:6:5*/
- (blizzard_fn_t) glue(blizzard_draw_line16_bgr_, DEPTH),
- /* RGB 6:6:6 mode 1 */
- (blizzard_fn_t) glue(blizzard_draw_line24mode1_bgr_, DEPTH),
- /* RGB 8:8:8 mode 1 */
- (blizzard_fn_t) glue(blizzard_draw_line24mode1_bgr_, DEPTH),
- NULL, NULL,
- /* RGB 6:6:6 mode 2 */
- (blizzard_fn_t) glue(blizzard_draw_line24mode2_bgr_, DEPTH),
- /* RGB 8:8:8 mode 2 */
- (blizzard_fn_t) glue(blizzard_draw_line24mode2_bgr_, DEPTH),
- /* YUV 4:2:2 */
- NULL,
- /* YUV 4:2:0 */
- NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
-};
-
/* 90deg, 180deg and 270deg rotation */
static blizzard_fn_t glue(blizzard_draw_fn_r_, DEPTH)[0x10] = {
/* TODO */
[0 ... 0xf] = NULL,
};
-/* 90deg, 180deg and 270deg rotation, BGR */
-static blizzard_fn_t glue(blizzard_draw_fn_r_bgr_, DEPTH)[0x10] = {
- /* TODO */
- [0 ... 0xf] = NULL,
-};
-
#undef DEPTH
#undef SKIP_PIXEL
#undef COPY_PIXEL
target_phys_addr_t l3_base,
qemu_irq irq, qemu_irq drq,
omap_clk fck1, omap_clk fck2, omap_clk ck54m,
- omap_clk ick1, omap_clk ick2);
+ omap_clk ick1, omap_clk ick2, int region_start);
void omap_rfbi_attach(struct omap_dss_s *s, int cs, struct rfbi_chip_s *chip);
void omap3_lcd_panel_attach(struct omap_dss_s *s, int cs, struct omap3_lcd_panel_s *lcd_panel);
void *omap3_lcd_panel_init(DisplayState *ds);
omap_findclk(s, "dss_clk1"), omap_findclk(s, "dss_clk2"),
omap_findclk(s, "dss_54m_clk"),
omap_findclk(s, "dss_l3_iclk"),
- omap_findclk(s, "dss_l4_iclk"));
+ omap_findclk(s, "dss_l4_iclk"),0);
omap_sti_init(omap_l4ta(s->l4, 18), 0x54000000,
s->irq[0][OMAP_INT_24XX_STI], omap_findclk(s, "emul_ck"),
s->dss = omap_dss_init(omap3_l4ta_get(s->l4, L4A_DSS), 0x68005400,
s->irq[0][OMAP_INT_35XX_DSS_IRQ], s->drq[OMAP24XX_DMA_DSS],
- NULL,NULL,NULL,NULL,NULL);
+ NULL,NULL,NULL,NULL,NULL,1);
//gpio_clks[0] = NULL;
//gpio_clks[1] = NULL;
};
struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
- target_phys_addr_t l3_base,
- qemu_irq irq, qemu_irq drq,
- omap_clk fck1, omap_clk fck2, omap_clk ck54m,
- omap_clk ick1, omap_clk ick2)
+ target_phys_addr_t l3_base,
+ qemu_irq irq, qemu_irq drq,
+ omap_clk fck1, omap_clk fck2, omap_clk ck54m,
+ omap_clk ick1, omap_clk ick2, int region_base)
{
int iomemtype[6];
struct omap_dss_s *s = (struct omap_dss_s *)
iomemtype[4] = cpu_register_io_memory(0, omap_im3_readfn,
omap_im3_writefn, s);
/* TODO: DSI */
- omap_l4_attach(ta, 1, iomemtype[0]);
- omap_l4_attach(ta, 2, iomemtype[1]);
- omap_l4_attach(ta, 3, iomemtype[2]);
- omap_l4_attach(ta, 4, iomemtype[3]);
+ omap_l4_attach(ta, region_base+0, iomemtype[0]);
+ omap_l4_attach(ta, region_base+1, iomemtype[1]);
+ omap_l4_attach(ta, region_base+2, iomemtype[2]);
+ omap_l4_attach(ta, region_base+3, iomemtype[3]);
cpu_register_physical_memory(l3_base, 0x1000, iomemtype[4]);
#if 0