[Qemu-devel] [PATCH for-4.0] ui/console: Remove qemu_create_display_surface_guestmem()

Peter Maydell posted 1 patch 5 years, 4 months ago
Test asan passed
Test checkpatch passed
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181122170309.4856-1-peter.maydell@linaro.org
include/ui/console.h |  4 ----
ui/console.c         | 36 ------------------------------------
2 files changed, 40 deletions(-)
[Qemu-devel] [PATCH for-4.0] ui/console: Remove qemu_create_display_surface_guestmem()
Posted by Peter Maydell 5 years, 4 months ago
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 <peter.maydell@linaro.org>
---
 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 width, int height,
                                                 pixman_format_code_t format,
                                                 int linesize, uint8_t *data);
 DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image);
-DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height,
-                                                    pixman_format_code_t format,
-                                                    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(pixman_image_t *image)
     return surface;
 }
 
-static void qemu_unmap_displaysurface_guestmem(pixman_image_t *image,
-                                               void *unused)
-{
-    void *data = pixman_image_get_data(image);
-    uint32_t size = 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 format,
-                                                    int linesize, uint64_t addr)
-{
-    DisplaySurface *surface;
-    hwaddr size;
-    void *data;
-
-    if (linesize == 0) {
-        linesize = width * PIXMAN_FORMAT_BPP(format) / 8;
-    }
-
-    size = (hwaddr)linesize * height;
-    data = cpu_physical_memory_map(addr, &size, 0);
-    if (size != (hwaddr)linesize * height) {
-        cpu_physical_memory_unmap(data, size, 0, 0);
-        return NULL;
-    }
-
-    surface = 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)
 {
-- 
2.19.1


Re: [Qemu-devel] [PATCH for-4.0] ui/console: Remove qemu_create_display_surface_guestmem()
Posted by Gerd Hoffmann 5 years, 3 months ago
On Thu, Nov 22, 2018 at 05:03:09PM +0000, Peter Maydell wrote:
> 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.)

Added to ui queue.

thanks,
  Gerd


Re: [Qemu-devel] [PATCH for-4.0] ui/console: Remove qemu_create_display_surface_guestmem()
Posted by Peter Maydell 5 years, 2 months ago
On Mon, 10 Dec 2018 at 14:31, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Thu, Nov 22, 2018 at 05:03:09PM +0000, Peter Maydell wrote:
> > 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.)
>
> Added to ui queue.

Ping? This doesn't seem to have made it to master.

thanks
-- PMM

Re: [Qemu-devel] [PATCH for-4.0] ui/console: Remove qemu_create_display_surface_guestmem()
Posted by Gerd Hoffmann 5 years, 2 months ago
On Tue, Jan 08, 2019 at 01:02:02PM +0000, Peter Maydell wrote:
> On Mon, 10 Dec 2018 at 14:31, Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > On Thu, Nov 22, 2018 at 05:03:09PM +0000, Peter Maydell wrote:
> > > 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.)
> >
> > Added to ui queue.
> 
> Ping? This doesn't seem to have made it to master.

Not lost, still in the queue.  Didn't manage to send out a UI pull req
before xmas.  Still busy processing the xmas backlog, a UI pull request
should arrive in the next days as part of that.

cheers,
  Gerd