From: jinhyung.jo Date: Wed, 4 Dec 2013 02:17:47 +0000 (+0900) Subject: maru_overlay : Added the reset functions X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~566^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1ea554587b40eee4f7c67ec9d10f793eb19ee2b;p=sdk%2Femulator%2Fqemu.git maru_overlay : Added the reset functions Initialize variables related to the overlay device state when the device is rebooting. Change-Id: I4a3871b56d551210c1adee94a099ee35fe8c825d Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/hw/maru_overlay.c b/tizen/src/hw/maru_overlay.c index ebe77acdeb..e075f5e27d 100644 --- a/tizen/src/hw/maru_overlay.c +++ b/tizen/src/hw/maru_overlay.c @@ -222,10 +222,38 @@ static int overlay_initfn(PCIDevice *dev) /* memory #1 memory-mapped I/O */ pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->mem_addr); pci_register_bar(&s->dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio_addr); + INFO("<%s>\n", __func__); return 0; } +static void overlay_reset(DeviceState *d) +{ + memset(overlay_ptr, 0x00, OVERLAY_MEM_SIZE); + + overlay0_power = overlay1_power = 0; + overlay0_left = overlay0_top = overlay0_width = overlay0_height = 0; + overlay1_left = overlay1_top = overlay1_width = overlay1_height = 0; + if (overlay0_image) { + pixman_image_unref(overlay0_image); + overlay0_image = NULL; + } + if (overlay1_image) { + pixman_image_unref(overlay1_image); + overlay1_image = NULL; + } + INFO("<%s>\n", __func__); +} + +static void overlay_exitfn(PCIDevice *dev) +{ + OverlayState *s = DO_UPCAST(OverlayState, dev, dev); + + memory_region_destroy(&s->mem_addr); + memory_region_destroy(&s->mmio_addr); + INFO("<%s>\n", __func__); +} + DeviceState *pci_maru_overlay_init(PCIBus *bus) { INFO("Maru overlay was initailized!\n"); @@ -234,10 +262,13 @@ DeviceState *pci_maru_overlay_init(PCIBus *bus) static void overlay_classinit(ObjectClass *klass, void *data) { + DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->no_hotplug = 1; k->init = overlay_initfn; + k->exit = overlay_exitfn; + dc->reset = overlay_reset; } static TypeInfo overlay_info = {