[PATCH] ui/spice: Use HAVE_SPICE_GL for OpenGL checks

Akihiko Odaki posted 1 patch 2 years, 9 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210714055735.86050-1-akihiko.odaki@gmail.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-app.c  | 3 ++-
ui/spice-core.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
[PATCH] ui/spice: Use HAVE_SPICE_GL for OpenGL checks
Posted by Akihiko Odaki 2 years, 9 months ago
Some code in ui/spice used CONFIG_OPENGL for OpenGL conditionals, but
SPICE also depends on CONFIG_GBM and SPICE server whose version is
0.13.1 or later for OpenGL. Always use HAVE_SPICE_GL, which defines the
precise condition.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 ui/spice-app.c  | 3 ++-
 ui/spice-core.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ui/spice-app.c b/ui/spice-app.c
index 641f4a9d53e..7e71e18da9a 100644
--- a/ui/spice-app.c
+++ b/ui/spice-app.c
@@ -27,6 +27,7 @@
 #include <gio/gio.h>
 
 #include "ui/console.h"
+#include "ui/spice-display.h"
 #include "qemu/config-file.h"
 #include "qemu/option.h"
 #include "qemu/cutils.h"
@@ -175,7 +176,7 @@ static void spice_app_display_early_init(DisplayOptions *opts)
     qemu_opt_set(qopts, "addr", sock_path, &error_abort);
     qemu_opt_set(qopts, "image-compression", "off", &error_abort);
     qemu_opt_set(qopts, "streaming-video", "off", &error_abort);
-#ifdef CONFIG_OPENGL
+#ifdef HAVE_SPICE_GL
     qemu_opt_set(qopts, "gl", opts->has_gl ? "on" : "off", &error_abort);
     display_opengl = opts->has_gl;
 #endif
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 86d43783aca..0371055e6c1 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -1039,6 +1039,6 @@ static void spice_register_config(void)
 opts_init(spice_register_config);
 module_opts("spice");
 
-#ifdef CONFIG_OPENGL
+#ifdef HAVE_SPICE_GL
 module_dep("ui-opengl");
 #endif
-- 
2.30.1 (Apple Git-130)


Re: [PATCH] ui/spice: Use HAVE_SPICE_GL for OpenGL checks
Posted by Marc-André Lureau 2 years, 9 months ago
On Wed, Jul 14, 2021 at 9:58 AM Akihiko Odaki <akihiko.odaki@gmail.com>
wrote:

> Some code in ui/spice used CONFIG_OPENGL for OpenGL conditionals, but
> SPICE also depends on CONFIG_GBM and SPICE server whose version is
> 0.13.1 or later for OpenGL. Always use HAVE_SPICE_GL, which defines the
> precise condition.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
>

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



> ---
>  ui/spice-app.c  | 3 ++-
>  ui/spice-core.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/ui/spice-app.c b/ui/spice-app.c
> index 641f4a9d53e..7e71e18da9a 100644
> --- a/ui/spice-app.c
> +++ b/ui/spice-app.c
> @@ -27,6 +27,7 @@
>  #include <gio/gio.h>
>
>  #include "ui/console.h"
> +#include "ui/spice-display.h"
>  #include "qemu/config-file.h"
>  #include "qemu/option.h"
>  #include "qemu/cutils.h"
> @@ -175,7 +176,7 @@ static void
> spice_app_display_early_init(DisplayOptions *opts)
>      qemu_opt_set(qopts, "addr", sock_path, &error_abort);
>      qemu_opt_set(qopts, "image-compression", "off", &error_abort);
>      qemu_opt_set(qopts, "streaming-video", "off", &error_abort);
> -#ifdef CONFIG_OPENGL
> +#ifdef HAVE_SPICE_GL
>      qemu_opt_set(qopts, "gl", opts->has_gl ? "on" : "off", &error_abort);
>      display_opengl = opts->has_gl;
>  #endif
> diff --git a/ui/spice-core.c b/ui/spice-core.c
> index 86d43783aca..0371055e6c1 100644
> --- a/ui/spice-core.c
> +++ b/ui/spice-core.c
> @@ -1039,6 +1039,6 @@ static void spice_register_config(void)
>  opts_init(spice_register_config);
>  module_opts("spice");
>
> -#ifdef CONFIG_OPENGL
> +#ifdef HAVE_SPICE_GL
>  module_dep("ui-opengl");
>  #endif
> --
> 2.30.1 (Apple Git-130)
>
>
>

-- 
Marc-André Lureau