From ec0cf4f48f4fd58bd6dff6dfbf03ab756c0c0e0b Mon Sep 17 00:00:00 2001 From: "jinhyung.jo" Date: Wed, 11 Jun 2014 14:39:57 +0900 Subject: [PATCH] maru_overlay: remove device Since VIGS supports the planes, the maru overlay is unnecessary. Change-Id: I43daa83eebc8be53df4dc4a627b056435e8edf26 Signed-off-by: Jinhyung Jo --- tizen/src/Makefile.tizen.i386 | 1 - tizen/src/hw/maru_device_ids.h | 1 - tizen/src/hw/maru_overlay.c | 278 -------------------------------- tizen/src/hw/maru_overlay.h | 55 ------- tizen/src/maru_sdl_processing.c | 15 -- tizen/src/maru_shm.c | 15 -- 6 files changed, 365 deletions(-) delete mode 100644 tizen/src/hw/maru_overlay.c delete mode 100644 tizen/src/hw/maru_overlay.h diff --git a/tizen/src/Makefile.tizen.i386 b/tizen/src/Makefile.tizen.i386 index 576f9223b4..e8034c60a4 100644 --- a/tizen/src/Makefile.tizen.i386 +++ b/tizen/src/Makefile.tizen.i386 @@ -2,5 +2,4 @@ # for TIZEN-maru-x86 board obj-y += maru_board.o -obj-y += maru_overlay.o obj-y += maru_pm.o diff --git a/tizen/src/hw/maru_device_ids.h b/tizen/src/hw/maru_device_ids.h index 9f713ba165..9f4306f21a 100644 --- a/tizen/src/hw/maru_device_ids.h +++ b/tizen/src/hw/maru_device_ids.h @@ -44,7 +44,6 @@ /* PCI */ #define PCI_VENDOR_ID_TIZEN 0xC9B5 -#define PCI_DEVICE_ID_VIRTUAL_OVERLAY 0x1010 #define PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS 0x1014 #define PCI_DEVICE_ID_VIRTUAL_CAMERA 0x1018 #define PCI_DEVICE_ID_VIRTUAL_CODEC 0x101C diff --git a/tizen/src/hw/maru_overlay.c b/tizen/src/hw/maru_overlay.c deleted file mode 100644 index b2d8563be0..0000000000 --- a/tizen/src/hw/maru_overlay.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Maru overlay device for VGA - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JinHyung Jo - * YeongKyoon Lee - * DongKyun Yun - * DoHyung Hong - * Hyunjun Son - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "hw/i386/pc.h" -#include "hw/pci/pci.h" -#include "maru_device_ids.h" -#include "maru_overlay.h" -#include "debug_ch.h" - -MULTI_DEBUG_CHANNEL(tizen, maru-overlay); - -#define QEMU_DEV_NAME "maru-overlay" - -#define OVERLAY_MEM_SIZE (8192 * 1024) /* 4MB(overlay0) + 4MB(overlay1) */ -#define OVERLAY_REG_SIZE 256 -#define OVERLAY1_REG_OFFSET (OVERLAY_REG_SIZE / 2) - - -enum { - OVERLAY_POWER = 0x00, - OVERLAY_POSITION = 0x04, /* left top position */ - OVERLAY_SIZE = 0x08, /* width and height */ -}; - -uint8_t *overlay_ptr; - -uint8_t overlay0_power; -uint16_t overlay0_left; -uint16_t overlay0_top; -uint16_t overlay0_width; -uint16_t overlay0_height; - -uint8_t overlay1_power; -uint16_t overlay1_left; -uint16_t overlay1_top; -uint16_t overlay1_width; -uint16_t overlay1_height; - -pixman_image_t *overlay0_image; -pixman_image_t *overlay1_image; - -typedef struct OverlayState { - PCIDevice dev; - - MemoryRegion mem_addr; - MemoryRegion mmio_addr; -} OverlayState; - -static uint64_t overlay_reg_read(void *opaque, - hwaddr addr, - unsigned size) -{ - switch (addr) { - case OVERLAY_POWER: - TRACE("GET => overlay0 power status(%d)\n", overlay0_power); - return overlay0_power; - break; - case OVERLAY_POSITION: - TRACE("GET => overlay0 position, left(%d):top(%d)\n", - overlay0_left, overlay0_top); - return (uint64_t)overlay0_left | ((uint64_t)overlay0_top << 16); - break; - case OVERLAY_SIZE: - TRACE("GET => overlay0 size, width(%d):height(%d)\n", - overlay0_width, overlay0_height); - return (uint64_t)overlay0_width | ((uint64_t)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_POSITION: - TRACE("GET => overlay1 position, left(%d):top(%d)\n", - overlay1_left, overlay1_top); - return (uint64_t)overlay1_left | ((uint64_t)overlay1_top << 16); - break; - case OVERLAY1_REG_OFFSET + OVERLAY_SIZE: - TRACE("GET => overlay1 size, width(%d):height(%d)\n", - overlay1_width, overlay1_height); - return (uint64_t)overlay1_width | ((uint64_t)overlay1_height << 16); - break; - default: - ERR("wrong overlay register read - addr : %d\n", (int)addr); - break; - } - - return 0; -} - -static void overlay_reg_write(void *opaque, - hwaddr addr, - uint64_t val, - unsigned size) -{ - switch (addr) { - case OVERLAY_POWER: - overlay0_power = val; - INFO("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; - 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: - 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; - INFO("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; - 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: - 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); - break; - } -} - -static const MemoryRegionOps overlay_mmio_ops = { - .read = overlay_reg_read, - .write = overlay_reg_write, - .endianness = DEVICE_LITTLE_ENDIAN, -}; - -static int overlay_initfn(PCIDevice *dev) -{ - OverlayState *s = DO_UPCAST(OverlayState, dev, dev); - uint8_t *pci_conf = s->dev.config; - - pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_TIZEN); - pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIRTUAL_OVERLAY); - pci_config_set_class(pci_conf, PCI_CLASS_DISPLAY_OTHER); - - memory_region_init_ram(&s->mem_addr, NULL, "maru-overlay.ram", OVERLAY_MEM_SIZE); - overlay_ptr = memory_region_get_ram_ptr(&s->mem_addr); - - memory_region_init_io(&s->mmio_addr, NULL, &overlay_mmio_ops, - s, - "maru-overlay-mmio", - OVERLAY_REG_SIZE); - - /* setup memory space */ - /* memory #0 device memory (overlay surface) */ - /* 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("initialize maru-overlay device\n"); - - 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("reset maru-overlay device\n"); -} - -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("finalize maru-overlay device\n"); -} - -static void overlay_classinit(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - - k->init = overlay_initfn; - k->exit = overlay_exitfn; - dc->reset = overlay_reset; -} - -static TypeInfo overlay_info = { - .name = QEMU_DEV_NAME, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(OverlayState), - .class_init = overlay_classinit, -}; - -static void overlay_register_types(void) -{ - type_register_static(&overlay_info); -} - -type_init(overlay_register_types); diff --git a/tizen/src/hw/maru_overlay.h b/tizen/src/hw/maru_overlay.h deleted file mode 100644 index 1f40885399..0000000000 --- a/tizen/src/hw/maru_overlay.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Maru overlay device for VGA - * - * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JinHyung Jo - * YeongKyoon Lee - * DoHyung Hong - * Hyunjun Son - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - - -#ifndef MARU_OVERLAY_H_ -#define MARU_OVERLAY_H_ - -#include "qemu-common.h" -#include "ui/qemu-pixman.h" - -extern uint8_t *overlay_ptr; -extern uint8_t overlay0_power; -extern uint16_t overlay0_left; -extern uint16_t overlay0_top; -extern uint16_t overlay0_width; -extern uint16_t overlay0_height; - -extern uint8_t overlay1_power; -extern uint16_t overlay1_left; -extern uint16_t overlay1_top; -extern uint16_t overlay1_width; -extern uint16_t overlay1_height; - -extern pixman_image_t *overlay0_image; -extern pixman_image_t *overlay1_image; - -#endif /* MARU_OVERLAY_H_ */ diff --git a/tizen/src/maru_sdl_processing.c b/tizen/src/maru_sdl_processing.c index 7ed8378f1a..4e28eb8e6e 100644 --- a/tizen/src/maru_sdl_processing.c +++ b/tizen/src/maru_sdl_processing.c @@ -30,7 +30,6 @@ #include "maru_sdl_processing.h" -#include "hw/maru_overlay.h" #include "hw/maru_brightness.h" #include "debug_ch.h" @@ -40,20 +39,6 @@ MULTI_DEBUG_CHANNEL(tizen, sdl_processing); /* Image processing functions using the pixman library */ void maru_do_pixman_dpy_surface(pixman_image_t *dst_image) { - /* overlay0 */ - if (overlay0_power) { - pixman_image_composite(PIXMAN_OP_OVER, - overlay0_image, NULL, dst_image, - 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, dst_image, - 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, diff --git a/tizen/src/maru_shm.c b/tizen/src/maru_shm.c index 4d5d3acbd2..f4ad3ae691 100644 --- a/tizen/src/maru_shm.c +++ b/tizen/src/maru_shm.c @@ -35,7 +35,6 @@ #include "maru_shm.h" #include "emul_state.h" #include "hw/maru_brightness.h" -#include "hw/maru_overlay.h" #include "skin/maruskin_server.h" #include "debug_ch.h" #include "maru_err_table.h" @@ -66,20 +65,6 @@ static unsigned int drop_frame; /* Image processing functions using the pixman library */ static void maru_do_pixman_dpy_surface(pixman_image_t *dst_image) { - /* overlay0 */ - if (overlay0_power) { - pixman_image_composite(PIXMAN_OP_OVER, - overlay0_image, NULL, dst_image, - 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, dst_image, - 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, -- 2.34.1