Skip to contentSkip to conversation

egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType

PATCH In review Alexander Kanavin 3 participants 3 messages Jan 16, 2019 – Jan 31, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType

It was assumed that mesa provides the necessary X11 includes, but it is not always the case, as it can be configured without x11 support.

---
 include/ui/egl-helpers.h | 2 +-
 ui/egl-helpers.c         | 4 ++--
 ui/gtk-egl.c             | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/ui/egl-helpers.h +1 -1
index 9db7293bdb..3fc656a7ba 100644
@@ -43,7 +43,7 @@ void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf);
 
 #endif
 
-EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win);
+EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win);
 
 int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
 int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
ui/egl-helpers.c +2 -2
index 4f475142fc..5e115b3fb4 100644
@@ -273,14 +273,14 @@ void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf)
 
 /* ---------------------------------------------------------------------- */
 
-EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win)
+EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win)
 {
     EGLSurface esurface;
     EGLBoolean b;
 
     esurface = eglCreateWindowSurface(qemu_egl_display,
                                       qemu_egl_config,
-                                      (EGLNativeWindowType)win, NULL);
+                                      win, NULL);
     if (esurface == EGL_NO_SURFACE) {
         error_report("egl: eglCreateWindowSurface failed");
         return NULL;
ui/gtk-egl.c +1 -1
index 5420c2362b..1f9411626a 100644
@@ -54,7 +54,7 @@ void gd_egl_init(VirtualConsole *vc)
     }
 
     vc->gfx.ectx = qemu_egl_init_ctx();
-    vc->gfx.esurface = qemu_egl_init_surface_x11(vc->gfx.ectx, x11_window);
+    vc->gfx.esurface = qemu_egl_init_surface_x11(vc->gfx.ectx, (EGLNativeWindowType)x11_window);
 
     assert(vc->gfx.esurface);
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Cc'ing Gerd again.

$ ./scripts/get_maintainer.pl -f include/ui/egl-helpers.h
Gerd Hoffmann <[email protected]> (odd fixer:Graphics)
[email protected] (open list:All patches CC here)
Quoted 4 lines · Alexander Kanavin

It was assumed that mesa provides the necessary X11 includes, but it is not always the case, as it can be configured without x11 support.

Quoted 54 lines
---
 include/ui/egl-helpers.h | 2 +-
 ui/egl-helpers.c         | 4 ++--
 ui/gtk-egl.c             | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/ui/egl-helpers.h +1 -1
index 9db7293bdb..3fc656a7ba 100644
@@ -43,7 +43,7 @@ void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf);
 
 #endif
 
-EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win);
+EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win);
 
 int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
 int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
ui/egl-helpers.c +2 -2
index 4f475142fc..5e115b3fb4 100644
@@ -273,14 +273,14 @@ void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf)
 
 /* ---------------------------------------------------------------------- */
 
-EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win)
+EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win)
 {
     EGLSurface esurface;
     EGLBoolean b;
 
     esurface = eglCreateWindowSurface(qemu_egl_display,
                                       qemu_egl_config,
-                                      (EGLNativeWindowType)win, NULL);
+                                      win, NULL);
     if (esurface == EGL_NO_SURFACE) {
         error_report("egl: eglCreateWindowSurface failed");
         return NULL;
ui/gtk-egl.c +1 -1
index 5420c2362b..1f9411626a 100644
@@ -54,7 +54,7 @@ void gd_egl_init(VirtualConsole *vc)
     }
 
     vc->gfx.ectx = qemu_egl_init_ctx();
-    vc->gfx.esurface = qemu_egl_init_surface_x11(vc->gfx.ectx, x11_window);
+    vc->gfx.esurface = qemu_egl_init_surface_x11(vc->gfx.ectx, (EGLNativeWindowType)x11_window);
 
     assert(vc->gfx.esurface);
 }
#2 lore raw
In reply to Alexander Kanavin
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [Qemu-devel] [PATCH] egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
e9b284a egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType

=== OUTPUT BEGIN ===
ERROR: line over 90 characters
#57: FILE: ui/gtk-egl.c:57:
+ vc->gfx.esurface = qemu_egl_init_surface_x11(vc->gfx.ectx, (EGLNativeWindowType)x11_window);

total: 1 errors, 0 warnings, 32 lines checked

Commit e9b284a96c5d (egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]