From: jinhyung.jo Date: Thu, 30 Aug 2012 15:42:12 +0000 (+0900) Subject: [Title] fixed a bug that array index error in brightness X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1444^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19947aa8eb37c77545d90eaa0bee1c6bab65fd9f;p=sdk%2Femulator%2Fqemu.git [Title] fixed a bug that array index error in brightness [Type] Bugfix [Module] Emulator / Brightness [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/tizen/src/hw/maru_brightness.c b/tizen/src/hw/maru_brightness.c index 4403eaa82f..ccbfdeba09 100644 --- a/tizen/src/hw/maru_brightness.c +++ b/tizen/src/hw/maru_brightness.c @@ -64,9 +64,10 @@ enum { uint32_t brightness_level = 24; uint32_t brightness_off = 0; -// level : 0 ~ 23, interval : 6 or 7. -uint8_t brightness_tbl[] = {110, 110, 116, 122, 128, 134, 140, 146, 152, 158, 164, 170, - 176, 182, 188, 194, 200, 206, 213, 220, 227, 234, 241, 248}; +/* level : 1 ~ 24, interval : 6 or 7. */ +uint8_t brightness_tbl[] = {97, /* level 0 : reserved for dimming */ +/* level 1 ~ 12 */ 104, 110, 116, 122, 128, 134, 140, 146, 152, 158, 164, 170, +/* level 13 ~ 24 */ 176, 182, 188, 194, 200, 206, 213, 220, 227, 234, 241, 248}; static uint64_t brightness_reg_read( void *opaque, target_phys_addr_t addr, unsigned size ) { switch ( addr & 0xFF ) { diff --git a/tizen/src/hw/maru_vga.c b/tizen/src/hw/maru_vga.c index 555be0ee22..b1e1614e52 100644 --- a/tizen/src/hw/maru_vga.c +++ b/tizen/src/hw/maru_vga.c @@ -1190,7 +1190,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) } else { - if ( brightness_level < BRIGHTNESS_MAX ) { + if ( brightness_level <= BRIGHTNESS_MAX ) { alpha = brightness_tbl[brightness_level];