From nobody Sun Apr 28 06:46:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542906887263812.2123612300205; Thu, 22 Nov 2018 09:14:47 -0800 (PST) Received: from localhost ([::1]:47974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPsYh-0002oI-M1 for importer@patchew.org; Thu, 22 Nov 2018 12:14:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPsNu-0002CB-HD for qemu-devel@nongnu.org; Thu, 22 Nov 2018 12:03:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPsNq-0003WP-Gt for qemu-devel@nongnu.org; Thu, 22 Nov 2018 12:03:22 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:52774) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPsNp-0003OX-00 for qemu-devel@nongnu.org; Thu, 22 Nov 2018 12:03:18 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gPsNj-0005Zt-VH; Thu, 22 Nov 2018 17:03:11 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 22 Nov 2018 17:03:09 +0000 Message-Id: <20181122170309.4856-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH for-4.0] ui/console: Remove qemu_create_display_surface_guestmem() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The qemu_create_display_surface_guestmem() function was added in commit a77549b3ffcc24c32ee4e but apparently never used. Remove it. (The API of this function is in any case awkward as a generic function: it assumes that a physical address uniquely identifies a piece of memory in the system, which is mostly but not always true.) Signed-off-by: Peter Maydell --- include/ui/console.h | 4 ---- ui/console.c | 36 ------------------------------------ 2 files changed, 40 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index c17803c530a..853fcf4eb75 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -257,10 +257,6 @@ DisplaySurface *qemu_create_displaysurface_from(int wi= dth, int height, pixman_format_code_t forma= t, int linesize, uint8_t *dat= a); DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image); -DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, - pixman_format_code_t f= ormat, - int linesize, - uint64_t addr); DisplaySurface *qemu_create_message_surface(int w, int h, const char *msg); PixelFormat qemu_default_pixelformat(int bpp); diff --git a/ui/console.c b/ui/console.c index 3a285bae00a..7076becedd5 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1385,42 +1385,6 @@ DisplaySurface *qemu_create_displaysurface_pixman(pi= xman_image_t *image) return surface; } =20 -static void qemu_unmap_displaysurface_guestmem(pixman_image_t *image, - void *unused) -{ - void *data =3D pixman_image_get_data(image); - uint32_t size =3D pixman_image_get_stride(image) * - pixman_image_get_height(image); - cpu_physical_memory_unmap(data, size, 0, 0); -} - -DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, - pixman_format_code_t f= ormat, - int linesize, uint64_t= addr) -{ - DisplaySurface *surface; - hwaddr size; - void *data; - - if (linesize =3D=3D 0) { - linesize =3D width * PIXMAN_FORMAT_BPP(format) / 8; - } - - size =3D (hwaddr)linesize * height; - data =3D cpu_physical_memory_map(addr, &size, 0); - if (size !=3D (hwaddr)linesize * height) { - cpu_physical_memory_unmap(data, size, 0, 0); - return NULL; - } - - surface =3D qemu_create_displaysurface_from - (width, height, format, linesize, data); - pixman_image_set_destroy_function - (surface->image, qemu_unmap_displaysurface_guestmem, NULL); - - return surface; -} - DisplaySurface *qemu_create_message_surface(int w, int h, const char *msg) { --=20 2.19.1