qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-devel@nongnu.org, "Akihiko Odaki" <akihiko.odaki@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PATCH 6/6] Revert "ui: factor out qemu_console_set_display_gl_ctx()"
Date: Sun, 13 Feb 2022 11:42:22 +0900	[thread overview]
Message-ID: <20220213024222.3548-7-akihiko.odaki@gmail.com> (raw)
In-Reply-To: <20220213024222.3548-1-akihiko.odaki@gmail.com>

This reverts commit 4f4181499170dcf80182745b319607802ea32896.
This eliminates the situation where a display is registered as a GL
context provider but not as a listener.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 include/ui/console.h |  3 ---
 ui/console.c         | 22 ++++++++--------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 58722312534..760dde770d1 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -409,9 +409,6 @@ void graphic_hw_gl_block(QemuConsole *con, bool block);
 
 void qemu_console_early_init(void);
 
-void qemu_console_set_display_gl_ctx(QemuConsole *con,
-                                     DisplayChangeListener *dcl);
-
 QemuConsole *qemu_console_lookup_by_index(unsigned int index);
 QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
 QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
diff --git a/ui/console.c b/ui/console.c
index f3d72655bb6..dce2ed3e1de 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1458,19 +1458,6 @@ static bool dpy_compatible_with(QemuConsole *con,
     return true;
 }
 
-void qemu_console_set_display_gl_ctx(QemuConsole *con,
-                                     DisplayChangeListener *dcl)
-{
-    /* display has opengl support */
-    assert(dcl->con);
-    if (dcl->con->gl) {
-        fprintf(stderr, "can't register two opengl displays (%s, %s)\n",
-                dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
-        exit(1);
-    }
-    dcl->con->gl = dcl;
-}
-
 void register_displaychangelistener(DisplayChangeListener *dcl)
 {
     static const char nodev[] =
@@ -1481,7 +1468,14 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
     assert(!dcl->ds);
 
     if (dcl->ops->dpy_gl_ctx_create) {
-        qemu_console_set_display_gl_ctx(dcl->con, dcl);
+        /* display has opengl support */
+        assert(dcl->con);
+        if (dcl->con->gl) {
+            error_report("can't register two opengl displays (%s, %s)\n",
+                         dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
+            exit(1);
+        }
+        dcl->con->gl = dcl;
     }
 
     if (dcl->con) {
-- 
2.32.0 (Apple Git-132)



  parent reply	other threads:[~2022-02-13  2:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13  2:42 [PATCH 0/6] ui/dbus: Share one listener for a console Akihiko Odaki
2022-02-13  2:42 ` [PATCH 1/6] " Akihiko Odaki
2022-02-13  2:42 ` [PATCH 2/6] Revert "console: save current scanout details" Akihiko Odaki
2022-02-13  2:42 ` [PATCH 3/6] Revert "ui: split the GL context in a different object" Akihiko Odaki
2022-02-13  2:42 ` [PATCH 4/6] Revert "ui: dispatch GL events to all listeners" Akihiko Odaki
2022-02-13  2:42 ` [PATCH 5/6] Revert "ui: associate GL context outside of display listener registration" Akihiko Odaki
2022-02-13  2:42 ` Akihiko Odaki [this message]
2022-02-14 12:06 ` [PATCH 0/6] ui/dbus: Share one listener for a console Marc-André Lureau
2022-02-14 13:15   ` Akihiko Odaki
2022-02-14 19:49     ` Marc-André Lureau
2022-02-15  3:08       ` Akihiko Odaki
2022-02-15 13:32         ` Marc-André Lureau
     [not found]           ` <CAMVc7JWnqucqKeEBDWFES8JYY77gmbMaX-inz+CSzd-bymr5cQ@mail.gmail.com>
     [not found]             ` <CAJ+F1CJ1ZZV-dv6kHhYmAkg5Pnrb_-q7o3Bndo6cQZsYN+RkgA@mail.gmail.com>
2022-02-16 17:05               ` Akihiko Odaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220213024222.3548-7-akihiko.odaki@gmail.com \
    --to=akihiko.odaki@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).