qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 5/5] linux fbdev display driver.


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [PATCH 5/5] linux fbdev display driver.
Date: Thu, 17 Jun 2010 12:43:41 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100505 Fedora/3.0.4-2.el6 Thunderbird/3.0.4

  Hi,

+static void fbdev_free_displaysurface(DisplaySurface *surface)
+{
+    if (surface == NULL)
+        return;
+
+    if (surface->flags&  QEMU_ALLOCATED_FLAG) {
+        qemu_free(surface->data);
+    }
+
+    surface->data = NULL;

This is pretty pointless ...

+    qemu_free(surface);

... as you free surface anyway ;)

@@ -910,7 +959,17 @@ void fbdev_display_init(DisplayState *ds, const char 
*device)
      dcl->dpy_update  = fbdev_update;
      dcl->dpy_resize  = fbdev_resize;
      dcl->dpy_refresh = fbdev_refresh;
+    dcl->dpy_setdata = fbdev_setdata;
      register_displaychangelistener(ds, dcl);
+
+    da = qemu_mallocz(sizeof (DisplayAllocator));
+    da->create_displaysurface = fbdev_create_displaysurface;
+    da->resize_displaysurface = fbdev_resize_displaysurface;
+    da->free_displaysurface = fbdev_free_displaysurface;
+
+    if (register_displayallocator(ds, da) == da) {
+        dpy_resize(ds);
+    }

You register the display allocator, but don't unregister in fbdev_display_uninit().

You are just lucky that fbdev_cleanup() forgets to unmap the framebuffer.

Apply the attached fix, start qemu with vnc, then do "change fbdev on" and "change fbdev off" in the monitor and watch qemu segfault.

Also after "change fbdev on" the guest screen isn't rendered correctly.

cheers,
  Gerd

Attachment: 0001-fbdev-unmap-framebuffer-on-cleanup.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]