From: jinhyung.jo Date: Fri, 10 Aug 2012 02:47:51 +0000 (+0900) Subject: [Title] fix a bug in getter function & add some trace log X-Git-Tag: TizenStudio_2.0_p2.3~1396^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=479fd21dd9ab2ec71bb03169f675cfb0ce1f6456;p=sdk%2Femulator%2Fqemu.git [Title] fix a bug in getter function & add some trace log [Type] BugFix [Module] Emulator / Overlay [Priority] Major [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/tizen/src/hw/maru_overlay.c b/tizen/src/hw/maru_overlay.c index ecac547..3fe013b 100644 --- a/tizen/src/hw/maru_overlay.c +++ b/tizen/src/hw/maru_overlay.c @@ -83,21 +83,31 @@ static uint64_t overlay_reg_read(void *opaque, target_phys_addr_t addr, unsigned { switch (addr) { case OVERLAY_POWER: + TRACE("GET => overlay0 power status(%d)\n", overlay0_power); return overlay0_power; break; - case OVERLAY_SIZE: + case OVERLAY_POSITION: + TRACE("GET => overlay0 position, left(%d):top(%d)\n", + overlay0_left, overlay0_top); return overlay0_left | overlay0_top << 16; break; - case OVERLAY_POSITION: + case OVERLAY_SIZE: + TRACE("GET => overlay0 size, width(%d):height(%d)\n", + overlay0_width, overlay0_height); return overlay0_width | overlay0_height << 16; break; case OVERLAY1_REG_OFFSET + OVERLAY_POWER: + TRACE("GET => overlay1 power status(%d)\n", overlay1_power); return overlay1_power; break; - case OVERLAY1_REG_OFFSET + OVERLAY_SIZE: + case OVERLAY1_REG_OFFSET + OVERLAY_POSITION: + TRACE("GET => overlay1 position, left(%d):top(%d)\n", + overlay1_left, overlay1_top); return overlay1_left | overlay1_top << 16; break; - case OVERLAY1_REG_OFFSET + OVERLAY_POSITION: + case OVERLAY1_REG_OFFSET + OVERLAY_SIZE: + TRACE("GET => overlay1 size, width(%d):height(%d)\n", + overlay1_width, overlay1_height); return overlay1_width | overlay1_height << 16; break; default: @@ -113,33 +123,48 @@ static void overlay_reg_write(void *opaque, target_phys_addr_t addr, uint64_t va switch (addr) { case OVERLAY_POWER: overlay0_power = val; - if( !overlay0_power ) { - // clear the last overlay area. - memset( overlay_ptr, 0x00, ( OVERLAY_MEM_SIZE / 2 ) ); + TRACE("SET => overlay0 power status(%d)\n", overlay0_power); + if (!overlay0_power) { + /* clear the last overlay area. */ + memset(overlay_ptr, 0x00, (OVERLAY_MEM_SIZE / 2)); + overlay0_left = overlay0_top = overlay0_width = overlay0_height = 0; + TRACE("clear the last overlay0 area\n"); } break; case OVERLAY_POSITION: overlay0_left = val & 0xFFFF; overlay0_top = val >> 16; + TRACE("SET => overlay0 position, left(%d):top(%d)\n", + overlay0_left, overlay0_top); break; case OVERLAY_SIZE: overlay0_width = val & 0xFFFF; overlay0_height = val >> 16; + TRACE("SET => overlay0 size, width(%d):height(%d)\n", + overlay0_width, overlay0_height); break; case OVERLAY1_REG_OFFSET + OVERLAY_POWER: overlay1_power = val; - if( !overlay1_power ) { - // clear the last overlay area. - memset( overlay_ptr + OVERLAY1_REG_OFFSET , 0x00, ( OVERLAY_MEM_SIZE / 2 ) ); + TRACE("SET => overlay1 power status(%d)\n", overlay1_power); + if (!overlay1_power) { + /* clear the last overlay area. */ + memset(overlay_ptr + OVERLAY1_REG_OFFSET, + 0x00, (OVERLAY_MEM_SIZE / 2)); + overlay1_left = overlay1_top = overlay1_width = overlay1_height = 0; + TRACE("clear the last overlay1 area\n"); } break; case OVERLAY1_REG_OFFSET + OVERLAY_POSITION: overlay1_left = val & 0xFFFF; overlay1_top = val >> 16; + TRACE("SET => overlay1 position, left(%d):top(%d)\n", + overlay1_left, overlay1_top); break; case OVERLAY1_REG_OFFSET + OVERLAY_SIZE: overlay1_width = val & 0xFFFF; overlay1_height = val >> 16; + TRACE("SET => overlay1 size, width(%d):height(%d)\n", + overlay1_width, overlay1_height); break; default: ERR("wrong overlay register write - addr : %d\n", (int)addr); @@ -178,6 +203,7 @@ static int overlay_initfn(PCIDevice *dev) int pci_maru_overlay_init(PCIBus *bus) { + INFO("Maru overlay was initailized!\n"); pci_create_simple(bus, -1, QEMU_DEV_NAME); return 0; }