[Title] fixed a bug that array index error in brightness
authorjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 30 Aug 2012 15:42:12 +0000 (00:42 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 30 Aug 2012 15:42:12 +0000 (00:42 +0900)
[Type] Bugfix
[Module] Emulator / Brightness
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/hw/maru_brightness.c
tizen/src/hw/maru_vga.c

index 4403eaa82f5f35355b7dcba131d0f0bebc163a3b..ccbfdeba09fe810bb95e8a22c1947176fed7eae8 100644 (file)
@@ -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 ) {
index 555be0ee22e10684b5ce886fbcffa9208b0ab5c2..b1e1614e5225a6eee2b3d6c9abe97154208353b7 100644 (file)
@@ -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];