From: jinhyung.jo Date: Wed, 3 Jul 2013 08:25:48 +0000 (+0900) Subject: Revert "display : Modified to use the pixman library." X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~925 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29fe2ec27375be5ac891a05fd044c6a75f2c9ca1;p=sdk%2Femulator%2Fqemu.git Revert "display : Modified to use the pixman library." This reverts commit 1616f5ed25a7bd30905b044cfa731a2c32fe44db. --- diff --git a/tizen/src/hw/maru_brightness.c b/tizen/src/hw/maru_brightness.c index 17e10ab6f2..a170dbac44 100644 --- a/tizen/src/hw/maru_brightness.c +++ b/tizen/src/hw/maru_brightness.c @@ -61,22 +61,20 @@ enum { uint32_t brightness_level = BRIGHTNESS_MAX; uint32_t brightness_off; -pixman_color_t level_color; -pixman_image_t *brightness_image; /* level : 1 ~ 100, interval : 1 or 2 */ /* skip 100 level, set to default alpha */ -uint8_t brightness_tbl[] = {155, /* level 0 : for dimming */ -/* level 01 ~ 10 */ 149, 147, 146, 144, 143, 141, 140, 138, 137, 135, -/* level 11 ~ 20 */ 134, 132, 131, 129, 128, 126, 125, 123, 122, 120, -/* level 21 ~ 30 */ 119, 117, 116, 114, 113, 111, 110, 108, 107, 105, -/* level 31 ~ 40 */ 104, 102, 101, 99, 98, 96, 95, 93, 92, 90, -/* level 41 ~ 50 */ 89, 87, 86, 84, 83, 81, 80, 78, 77, 75, -/* level 51 ~ 60 */ 74, 72, 71, 69, 68, 66, 65, 63, 62, 60, -/* level 61 ~ 70 */ 59, 57, 56, 54, 53, 51, 50, 48, 47, 45, -/* level 71 ~ 80 */ 44, 42, 41, 39, 38, 36, 35, 33, 32, 30, -/* level 81 ~ 90 */ 29, 27, 26, 24, 23, 21, 20, 18, 17, 15, -/* level 91 ~ 99 */ 14, 12, 11, 9, 8, 6, 5, 3, 2}; +uint8_t brightness_tbl[] = {100, /* level 0 : for dimming */ +/* level 01 ~ 10 */ 106, 108, 109, 111, 112, 114, 115, 117, 118, 120, +/* level 11 ~ 20 */ 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, +/* level 21 ~ 30 */ 136, 138, 139, 141, 142, 144, 145, 147, 148, 150, +/* level 31 ~ 40 */ 151, 153, 154, 156, 157, 159, 160, 162, 163, 165, +/* level 41 ~ 50 */ 166, 168, 169, 171, 172, 174, 175, 177, 178, 180, +/* level 51 ~ 60 */ 181, 183, 184, 186, 187, 189, 190, 192, 193, 195, +/* level 61 ~ 70 */ 196, 198, 199, 201, 202, 204, 205, 207, 208, 210, +/* level 71 ~ 80 */ 211, 213, 214, 216, 217, 219, 220, 222, 223, 225, +/* level 81 ~ 90 */ 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, +/* level 91 ~ 99 */ 241, 243, 244, 246, 247, 249, 250, 252, 253}; QEMUBH *bh; @@ -114,11 +112,6 @@ static void brightness_reg_write(void *opaque, ERR("brightness_reg_write: Invalide brightness level.\n"); } else { brightness_level = val; - if (brightness_image) { - pixman_image_unref(brightness_image); - } - level_color.alpha = brightness_tbl[brightness_level] << 8; - brightness_image = pixman_image_create_solid_fill(&level_color); INFO("brightness_level : %lld\n", val); #ifdef TARGET_ARM vga_hw_invalidate(); @@ -158,9 +151,6 @@ static void brightness_exitfn(PCIDevice *dev) if (bh) { qemu_bh_delete(bh); } - if (brightness_image) { - pixman_image_unref(brightness_image); - } } static void maru_brightness_bh(void *opaque) diff --git a/tizen/src/hw/maru_brightness.h b/tizen/src/hw/maru_brightness.h index f545c2a1cf..98787c3ffe 100644 --- a/tizen/src/hw/maru_brightness.h +++ b/tizen/src/hw/maru_brightness.h @@ -33,7 +33,6 @@ #define MARU_BRIGHTNESS_H_ #include "qemu-common.h" -#include #define BRIGHTNESS_MIN (0) #define BRIGHTNESS_MAX (100) @@ -41,7 +40,6 @@ extern uint32_t brightness_level; extern uint32_t brightness_off; extern uint8_t brightness_tbl[]; -extern pixman_image_t *brightness_image; DeviceState *pci_maru_brightness_init(PCIBus *bus); diff --git a/tizen/src/hw/maru_overlay.c b/tizen/src/hw/maru_overlay.c index 90aa7f524b..7072f586c3 100644 --- a/tizen/src/hw/maru_overlay.c +++ b/tizen/src/hw/maru_overlay.c @@ -53,9 +53,6 @@ enum { uint8_t *overlay_ptr; -pixman_image_t *overlay0_image; -pixman_image_t *overlay1_image; - uint8_t overlay0_power; uint16_t overlay0_left; uint16_t overlay0_top; @@ -130,17 +127,7 @@ static void overlay_reg_write(void *opaque, /* clear the last overlay area. */ memset(overlay_ptr, 0x00, (OVERLAY_MEM_SIZE / 2)); overlay0_left = overlay0_top = overlay0_width = overlay0_height = 0; - if (overlay0_image) { - pixman_image_unref(overlay0_image); - overlay0_image = NULL; - } TRACE("clear the last overlay0 area\n"); - } else { - overlay0_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, - overlay0_width, overlay0_height, - (uint32_t *)overlay_ptr, - overlay0_width * 4); - TRACE("create the overlay0 pixman image\n"); } break; case OVERLAY_POSITION: @@ -163,17 +150,7 @@ static void overlay_reg_write(void *opaque, memset(overlay_ptr + OVERLAY1_REG_OFFSET, 0x00, (OVERLAY_MEM_SIZE / 2)); overlay1_left = overlay1_top = overlay1_width = overlay1_height = 0; - if (overlay1_image) { - pixman_image_unref(overlay1_image); - overlay1_image = NULL; - } TRACE("clear the last overlay1 area\n"); - } else { - overlay1_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, - overlay1_width, overlay1_height, - (uint32_t *)(overlay_ptr + OVERLAY1_REG_OFFSET), - overlay1_width * 4); - TRACE("create the overlay1 pixman image\n"); } break; case OVERLAY1_REG_OFFSET + OVERLAY_POSITION: diff --git a/tizen/src/hw/maru_overlay.h b/tizen/src/hw/maru_overlay.h index f2da6c5566..24a4529560 100644 --- a/tizen/src/hw/maru_overlay.h +++ b/tizen/src/hw/maru_overlay.h @@ -34,10 +34,6 @@ #define MARU_OVERLAY_H_ #include "qemu-common.h" -#include - -extern pixman_image_t *overlay0_image; -extern pixman_image_t *overlay1_image; extern uint8_t *overlay_ptr; extern uint8_t overlay0_power; diff --git a/tizen/src/hw/maru_vga.c b/tizen/src/hw/maru_vga.c index 84b659ac9b..c1991a46a9 100644 --- a/tizen/src/hw/maru_vga.c +++ b/tizen/src/hw/maru_vga.c @@ -1171,7 +1171,6 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) uint8_t *d; uint32_t v, addr1, addr; maru_vga_draw_line_func *maru_vga_draw_line; - static pixman_image_t *surface = NULL; full_update |= update_basic_params(s); @@ -1228,10 +1227,6 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) disp_width * 4, (uint8_t*)shared_memory); */ s->ds->surface = qemu_create_displaysurface(s->ds, disp_width, height); - surface = pixman_image_create_bits(PIXMAN_a8r8g8b8, - disp_width, height, - (uint32_t *)ds_get_data(s->ds), - disp_width * 4); #else //MARU_VGA s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, @@ -1365,6 +1360,76 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) if (s->cursor_draw_line) s->cursor_draw_line(s, d, y); } + +#ifdef MARU_VGA + + int i; + uint8_t *fb_sub; + uint8_t *over_sub; + uint8_t *dst_sub; + uint8_t alpha, c_alpha; + uint32_t *dst; + uint16_t overlay_bottom; + + if ( overlay0_power ) { + + overlay_bottom = overlay0_top + overlay0_height; + + if ( overlay0_top <= y && y < overlay_bottom ) { + + fb_sub = s->vram_ptr + addr + overlay0_left * 4; + over_sub = overlay_ptr + ( y - overlay0_top ) * overlay0_width * 4; + dst = (uint32_t*) ( s->ds->surface->data + addr + overlay0_left * 4 ); + + for ( i = 0; i < overlay0_width; i++, fb_sub += 4, over_sub += 4, dst++ ) { + + alpha = fb_sub[3]; + c_alpha = 0xff - alpha; + + *dst = ( ( c_alpha * over_sub[0] + alpha * fb_sub[0] ) >> 8 ) + | ( ( c_alpha * over_sub[1] + alpha * fb_sub[1] ) & 0xFF00 ) + | ( ( ( c_alpha * over_sub[2] + alpha * fb_sub[2] ) & 0xFF00 ) << 8 ); + } + + } + + } + + if ( overlay1_power ) { + + overlay_bottom = overlay1_top + overlay1_height; + + if ( overlay1_top <= y && y < overlay_bottom ) { + + fb_sub = s->vram_ptr + addr + overlay1_left * 4; + over_sub = overlay_ptr + ( y - overlay1_top ) * overlay1_width * 4 + 0x00400000; + dst = (uint32_t*) ( s->ds->surface->data + addr + overlay1_left * 4 ); + + for ( i = 0; i < overlay1_width; i++, fb_sub += 4, over_sub += 4, dst++ ) { + + alpha = fb_sub[3]; + c_alpha = 0xff - alpha; + + *dst = ( ( c_alpha * over_sub[0] + alpha * fb_sub[0] ) >> 8 ) + | ( ( c_alpha * over_sub[1] + alpha * fb_sub[1] ) & 0xFF00 ) + | ( ( ( c_alpha * over_sub[2] + alpha * fb_sub[2] ) & 0xFF00 ) << 8 ); + } + + } + + } + if (brightness_level < BRIGHTNESS_MAX) { + alpha = brightness_tbl[brightness_level]; + dst_sub = ds_get_data(s->ds) + addr; + dst = (uint32_t *)(ds_get_data(s->ds) + addr); + for (i = 0; i < disp_width; i++, dst_sub += 4, dst++) { + *dst = ((alpha * dst_sub[0])>> 8) + | ((alpha * dst_sub[1]) & 0xFF00) + | (((alpha * dst_sub[2]) & 0xFF00) << 8); + } + } +#endif /* MARU_VGA */ + } else { if (y_start >= 0) { /* flush to display */ @@ -1388,29 +1453,6 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) d += linesize; } -#ifdef MARU_VGA - /* overlay0 */ - if (overlay0_power) { - pixman_image_composite(PIXMAN_OP_OVER, - overlay0_image, NULL, surface, - 0, 0, 0, 0, overlay0_left, overlay0_top, - overlay0_width, overlay0_height); - } - /* overlay1 */ - if (overlay1_power) { - pixman_image_composite(PIXMAN_OP_OVER, - overlay1_image, NULL, surface, - 0, 0, 0, 0, overlay1_left, overlay1_top, - overlay1_width, overlay1_height); - } - /* apply the brightness level */ - if (brightness_level < BRIGHTNESS_MAX) { - pixman_image_composite(PIXMAN_OP_OVER, - brightness_image, NULL, surface, - 0, 0, 0, 0, 0, 0, - disp_width, height); - } -#endif if (y_start >= 0) { /* flush to display */ dpy_update(s->ds, 0, y_start,