Skip to contentSkip to conversation

console: fix dpy_gfx_replace_surface assert

PATCH In review Gerd Hoffmann 2 participants 2 messages Sep 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 console: fix dpy_gfx_replace_surface assert

virtio-gpu can trigger the assert added by commit "6905b93447 console:
add same surface replace pre-condition" in multihead setups (where surface can be NULL for secondary displays). Allow surface being NULL.

Fixes 6905b93447a42e606dfd126b90f75f4cd3c6fe94
---
 ui/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/console.c +1 -1
index d2d3534c49..f0292d7820 100644
@@ -1540,7 +1540,7 @@ void dpy_gfx_replace_surface(QemuConsole *con,
     DisplaySurface *old_surface = con->surface;
     DisplayChangeListener *dcl;
 
-    assert(old_surface != surface);
+    assert(old_surface != surface || surface == NULL);
 
     con->surface = surface;
     QLIST_FOREACH(dcl, &s->listeners, next) {
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gerd Hoffmann

virtio-gpu can trigger the assert added by commit "6905b93447 console:
add same surface replace pre-condition" in multihead setups (where surface can be NULL for secondary displays). Allow surface being NULL.

Fixes 6905b93447a42e606dfd126b90f75f4cd3c6fe94

oops

Quoted 21 lines
---
 ui/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/console.c +1 -2
index d2d3534c49..f0292d7820 100644
@@ -1540,7 +1540,7 @@ void dpy_gfx_replace_surface(QemuConsole *con,
     DisplaySurface *old_surface = con->surface;
     DisplayChangeListener *dcl;
 
-    assert(old_surface != surface);
+    assert(old_surface != surface || surface == NULL);
 
     con->surface = surface;
     QLIST_FOREACH(dcl, &s->listeners, next) {
--

2.9.3

Signature · 1 line
Marc-André Lureau