From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI9J-0005DU-Er for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxI9F-0004ui-CY for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:17 -0400 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:36743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI9F-0004tm-5Y for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:13 -0400 Received: by wgbgq6 with SMTP id gq6so102871155wgb.3 for ; Tue, 26 May 2015 09:55:37 -0700 (PDT) Received: from 640k.localdomain (dynamic-adsl-94-39-199-114.clienti.tiscali.it. [94.39.199.114]) by mx.google.com with ESMTPSA id x3sm17749309wiy.20.2015.05.26.09.55.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 09:55:36 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 26 May 2015 18:54:44 +0200 Message-Id: <1432659305-54578-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> References: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v3 08/29] ui/console: remove dpy_gfx_update_dirty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org dpy_gfx_update_dirty expects DIRTY_MEMORY_VGA logging to be always on, but that will not be the case soon. Because it computes the memory region on the fly for every update (with memory_region_find), it cannot enable/disable logging by itself. We could always treat updates as invalidations if dirty logging is not enabled, assuming that the board will enable logging on the RAM region that includes the framebuffer. However, the function is unused, so just drop it. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- include/ui/console.h | 4 ---- ui/console.c | 61 ---------------------------------------------------- 2 files changed, 65 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index e8b3a9e..be90091 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -242,10 +242,6 @@ void dpy_text_resize(QemuConsole *con, int w, int h); void dpy_mouse_set(QemuConsole *con, int x, int y, int on); void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor); bool dpy_cursor_define_supported(QemuConsole *con); -void dpy_gfx_update_dirty(QemuConsole *con, - MemoryRegion *address_space, - uint64_t base, - bool invalidate); bool dpy_gfx_check_format(QemuConsole *con, pixman_format_code_t format); diff --git a/ui/console.c b/ui/console.c index 406c36b..75fc492 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1619,67 +1619,6 @@ bool dpy_cursor_define_supported(QemuConsole *con) return false; } -/* - * Call dpy_gfx_update for all dirity scanlines. Works for - * DisplaySurfaces backed by guest memory (i.e. the ones created - * using qemu_create_displaysurface_guestmem). - */ -void dpy_gfx_update_dirty(QemuConsole *con, - MemoryRegion *address_space, - hwaddr base, - bool invalidate) -{ - DisplaySurface *ds = qemu_console_surface(con); - int width = surface_stride(ds); - int height = surface_height(ds); - hwaddr size = width * height; - MemoryRegionSection mem_section; - MemoryRegion *mem; - ram_addr_t addr; - int first, last, i; - bool dirty; - - mem_section = memory_region_find(address_space, base, size); - mem = mem_section.mr; - if (int128_get64(mem_section.size) != size || - !memory_region_is_ram(mem_section.mr)) { - goto out; - } - assert(mem); - - memory_region_sync_dirty_bitmap(mem); - addr = mem_section.offset_within_region; - - first = -1; - last = -1; - for (i = 0; i < height; i++, addr += width) { - dirty = invalidate || - memory_region_get_dirty(mem, addr, width, DIRTY_MEMORY_VGA); - if (dirty) { - if (first == -1) { - first = i; - } - last = i; - } - if (first != -1 && !dirty) { - assert(last != -1 && last >= first); - dpy_gfx_update(con, 0, first, surface_width(ds), - last - first + 1); - first = -1; - } - } - if (first != -1) { - assert(last != -1 && last >= first); - dpy_gfx_update(con, 0, first, surface_width(ds), - last - first + 1); - } - - memory_region_reset_dirty(mem, mem_section.offset_within_region, size, - DIRTY_MEMORY_VGA); -out: - memory_region_unref(mem); -} - /***********************************************************/ /* register display */ -- 1.8.3.1