xserver: Branch 'master' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 8 10:02:58 UTC 2019


 hw/xwayland/xwayland-glamor-eglstream.c |    2 -
 hw/xwayland/xwayland-glamor-gbm.c       |    2 -
 hw/xwayland/xwayland-shm.c              |    2 -
 hw/xwayland/xwayland.h                  |   50 ++++++++++++++++----------------
 4 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit eddad048e35cbf0968d0f892009a248359a15ecd
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Wed Oct 30 15:33:39 2019 +0100

    xwayland: Cosmetic, fix indentation
    
    For some reason, indentation for EGL backend hooks was broken.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 74556bb34..9728cc512 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -86,31 +86,31 @@ struct xwl_egl_backend {
      * this to setup any required wraps around X server callbacks like
      * CreatePixmap.
      */
-     Bool (*init_screen)(struct xwl_screen *xwl_screen);
-
-     /* Called by Xwayland to retrieve a pointer to a valid wl_buffer for
-      * the given window/pixmap combo so that damage to the pixmap may be
-      * displayed on-screen. Backends should use this to create a new
-      * wl_buffer for a currently buffer-less pixmap, or simply return the
-      * pixmap they've prepared beforehand.
-      */
-     struct wl_buffer *(*get_wl_buffer_for_pixmap)(PixmapPtr pixmap,
-                                                   Bool *created);
-
-     /* Called by Xwayland to perform any pre-wl_surface damage routines
-      * that are required by the backend. If your backend is poorly
-      * designed and lacks the ability to render directly to a surface,
-      * you should implement blitting from the glamor pixmap to the wayland
-      * pixmap here. Otherwise, this callback is optional.
-      */
-     void (*post_damage)(struct xwl_window *xwl_window,
-                         PixmapPtr pixmap, RegionPtr region);
-
-     /* Called by Xwayland to confirm with the egl backend that the given
-      * pixmap is completely setup and ready for display on-screen. This
-      * callback is optional.
-      */
-     Bool (*allow_commits)(struct xwl_window *xwl_window);
+    Bool (*init_screen)(struct xwl_screen *xwl_screen);
+
+    /* Called by Xwayland to retrieve a pointer to a valid wl_buffer for
+     * the given window/pixmap combo so that damage to the pixmap may be
+     * displayed on-screen. Backends should use this to create a new
+     * wl_buffer for a currently buffer-less pixmap, or simply return the
+     * pixmap they've prepared beforehand.
+     */
+    struct wl_buffer *(*get_wl_buffer_for_pixmap)(PixmapPtr pixmap,
+                                                  Bool *created);
+
+    /* Called by Xwayland to perform any pre-wl_surface damage routines
+     * that are required by the backend. If your backend is poorly
+     * designed and lacks the ability to render directly to a surface,
+     * you should implement blitting from the glamor pixmap to the wayland
+     * pixmap here. Otherwise, this callback is optional.
+     */
+    void (*post_damage)(struct xwl_window *xwl_window,
+                        PixmapPtr pixmap, RegionPtr region);
+
+    /* Called by Xwayland to confirm with the egl backend that the given
+     * pixmap is completely setup and ready for display on-screen. This
+     * callback is optional.
+     */
+    Bool (*allow_commits)(struct xwl_window *xwl_window);
 };
 
 struct xwl_screen {
commit 4a857b161ce1202c60ac464c8eb6de358fed5508
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Wed Oct 30 13:11:28 2019 +0100

    xwayland/shm: Use `calloc()`
    
    Currently, Xwayland pixmap SHM code uses `malloc()` to allocate the
    xwl_pixmap.
    
    Use `calloc()` instead, as the EGLstream backend does, as it is safer
    (initializing the allocated data to 0).
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/hw/xwayland/xwayland-shm.c b/hw/xwayland/xwayland-shm.c
index d1127efc0..bce74fa1d 100644
--- a/hw/xwayland/xwayland-shm.c
+++ b/hw/xwayland/xwayland-shm.c
@@ -210,7 +210,7 @@ xwl_shm_create_pixmap(ScreenPtr screen,
     if (!pixmap)
         return NULL;
 
-    xwl_pixmap = malloc(sizeof *xwl_pixmap);
+    xwl_pixmap = calloc(1, sizeof(*xwl_pixmap));
     if (xwl_pixmap == NULL)
         goto err_destroy_pixmap;
 
commit 0d4667b65a81047fe5d5af537d295c64cfa08d9c
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Wed Oct 30 11:50:24 2019 +0100

    xwayland/glamor-gbm: Use `calloc()`
    
    Currently, glamor GBM backend uses `malloc()` to allocate the
    xwl_pixmap.
    
    Use `calloc()` instead, as the EGLstream backend does, as it is safer
    (initializing the allocated data to 0).
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 9cbce5f55..e3a4ba382 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -149,7 +149,7 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo,
     struct xwl_pixmap *xwl_pixmap;
     struct xwl_screen *xwl_screen = xwl_screen_get(screen);
 
-    xwl_pixmap = malloc(sizeof *xwl_pixmap);
+    xwl_pixmap = calloc(1, sizeof(*xwl_pixmap));
     if (xwl_pixmap == NULL)
         return NULL;
 
commit 2c5acdef3aab52d0a416aee3654a63328847f22e
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Thu Oct 31 09:04:19 2019 +0100

    xwayland/eglstream: Fix order of `calloc()` args
    
    The definition by the manual is `calloc(size_t nmemb, size_t size)`.
    
    Swap the arguments of calloc() calls to match the definition.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
index 36b749aaf..c897c74a8 100644
--- a/hw/xwayland/xwayland-glamor-eglstream.c
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
@@ -910,7 +910,7 @@ xwl_glamor_init_eglstream(struct xwl_screen *xwl_screen)
     if (!dixRegisterPrivateKey(&xwl_eglstream_private_key, PRIVATE_SCREEN, 0))
         return;
 
-    xwl_eglstream = calloc(sizeof(*xwl_eglstream), 1);
+    xwl_eglstream = calloc(1, sizeof(*xwl_eglstream));
     if (!xwl_eglstream) {
         ErrorF("Failed to allocate memory required to init EGLStream support\n");
         return;


More information about the xorg-commit mailing list