qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui/console: Check console before emitting GL event
@ 2022-03-25  9:51 Akihiko Odaki
  2022-03-25 13:11 ` Marc-André Lureau
  0 siblings, 1 reply; 2+ messages in thread
From: Akihiko Odaki @ 2022-03-25  9:51 UTC (permalink / raw)
  Cc: qemu-devel, Akihiko Odaki, Gerd Hoffmann

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 ui/console.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/ui/console.c b/ui/console.c
index da434ce1b2f..1752f2ec889 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1886,6 +1886,9 @@ void dpy_gl_scanout_disable(QemuConsole *con)
         con->scanout.kind = SCANOUT_NONE;
     }
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_scanout_disable) {
             dcl->ops->dpy_gl_scanout_disable(dcl);
         }
@@ -1909,6 +1912,9 @@ void dpy_gl_scanout_texture(QemuConsole *con,
         x, y, width, height
     };
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_scanout_texture) {
             dcl->ops->dpy_gl_scanout_texture(dcl, backing_id,
                                              backing_y_0_top,
@@ -1927,6 +1933,9 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con,
     con->scanout.kind = SCANOUT_DMABUF;
     con->scanout.dmabuf = dmabuf;
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_scanout_dmabuf) {
             dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf);
         }
@@ -1940,6 +1949,9 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf,
     DisplayChangeListener *dcl;
 
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_cursor_dmabuf) {
             dcl->ops->dpy_gl_cursor_dmabuf(dcl, dmabuf,
                                            have_hot, hot_x, hot_y);
@@ -1954,6 +1966,9 @@ void dpy_gl_cursor_position(QemuConsole *con,
     DisplayChangeListener *dcl;
 
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_cursor_position) {
             dcl->ops->dpy_gl_cursor_position(dcl, pos_x, pos_y);
         }
@@ -1967,6 +1982,9 @@ void dpy_gl_release_dmabuf(QemuConsole *con,
     DisplayChangeListener *dcl;
 
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_release_dmabuf) {
             dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf);
         }
@@ -1983,6 +2001,9 @@ void dpy_gl_update(QemuConsole *con,
 
     graphic_hw_gl_block(con, true);
     QLIST_FOREACH(dcl, &s->listeners, next) {
+        if (con != (dcl->con ? dcl->con : active_console)) {
+            continue;
+        }
         if (dcl->ops->dpy_gl_update) {
             dcl->ops->dpy_gl_update(dcl, x, y, w, h);
         }
-- 
2.32.0 (Apple Git-132)



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ui/console: Check console before emitting GL event
  2022-03-25  9:51 [PATCH] ui/console: Check console before emitting GL event Akihiko Odaki
@ 2022-03-25 13:11 ` Marc-André Lureau
  0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2022-03-25 13:11 UTC (permalink / raw)
  To: Akihiko Odaki; +Cc: QEMU, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 3580 bytes --]

Hi

On Fri, Mar 25, 2022 at 1:53 PM Akihiko Odaki <akihiko.odaki@gmail.com>
wrote:

> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Akihiko, is this fixing a visible bug? If so, it would be nice you detail
it in the commit message and someone should queue it for 7.0

thanks


> ---
>  ui/console.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/ui/console.c b/ui/console.c
> index da434ce1b2f..1752f2ec889 100644
> --- a/ui/console.c
> +++ b/ui/console.c
> @@ -1886,6 +1886,9 @@ void dpy_gl_scanout_disable(QemuConsole *con)
>          con->scanout.kind = SCANOUT_NONE;
>      }
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_scanout_disable) {
>              dcl->ops->dpy_gl_scanout_disable(dcl);
>          }
> @@ -1909,6 +1912,9 @@ void dpy_gl_scanout_texture(QemuConsole *con,
>          x, y, width, height
>      };
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_scanout_texture) {
>              dcl->ops->dpy_gl_scanout_texture(dcl, backing_id,
>                                               backing_y_0_top,
> @@ -1927,6 +1933,9 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con,
>      con->scanout.kind = SCANOUT_DMABUF;
>      con->scanout.dmabuf = dmabuf;
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_scanout_dmabuf) {
>              dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf);
>          }
> @@ -1940,6 +1949,9 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con,
> QemuDmaBuf *dmabuf,
>      DisplayChangeListener *dcl;
>
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_cursor_dmabuf) {
>              dcl->ops->dpy_gl_cursor_dmabuf(dcl, dmabuf,
>                                             have_hot, hot_x, hot_y);
> @@ -1954,6 +1966,9 @@ void dpy_gl_cursor_position(QemuConsole *con,
>      DisplayChangeListener *dcl;
>
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_cursor_position) {
>              dcl->ops->dpy_gl_cursor_position(dcl, pos_x, pos_y);
>          }
> @@ -1967,6 +1982,9 @@ void dpy_gl_release_dmabuf(QemuConsole *con,
>      DisplayChangeListener *dcl;
>
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_release_dmabuf) {
>              dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf);
>          }
> @@ -1983,6 +2001,9 @@ void dpy_gl_update(QemuConsole *con,
>
>      graphic_hw_gl_block(con, true);
>      QLIST_FOREACH(dcl, &s->listeners, next) {
> +        if (con != (dcl->con ? dcl->con : active_console)) {
> +            continue;
> +        }
>          if (dcl->ops->dpy_gl_update) {
>              dcl->ops->dpy_gl_update(dcl, x, y, w, h);
>          }
> --
> 2.32.0 (Apple Git-132)
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 4942 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-25 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25  9:51 [PATCH] ui/console: Check console before emitting GL event Akihiko Odaki
2022-03-25 13:11 ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).