Mesa (master): egl/wayland: Fix possible lockup in drm initialization

Kristian Høgsberg krh at kemper.freedesktop.org
Fri Apr 29 08:10:05 PDT 2011


Module: Mesa
Branch: master
Commit: dc520d4fefa6a92b3a8f2eed3c5a1044dfccb3ff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc520d4fefa6a92b3a8f2eed3c5a1044dfccb3ff

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Fri Apr 29 17:04:11 2011 +0200

egl/wayland: Fix possible lockup in drm initialization

Lockup happens when wl_drm interface is not available.

---

 src/egl/drivers/dri2/platform_wayland.c            |    2 +-
 .../state_trackers/egl/wayland/native_drm.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 030c687..1b75ffe 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -680,7 +680,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
 
    id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
    if (id == 0)
-      wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
+      force_roundtrip(dri2_dpy->wl_dpy);
    id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
    if (id == 0)
       goto cleanup_dpy;
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c
index 75c871d..604720f 100644
--- a/src/gallium/state_trackers/egl/wayland/native_drm.c
+++ b/src/gallium/state_trackers/egl/wayland/native_drm.c
@@ -205,7 +205,7 @@ wayland_drm_display_init_screen(struct native_display *ndpy)
 
    id = wl_display_get_global(drmdpy->base.dpy, "wl_drm", 1);
    if (id == 0)
-      wl_display_iterate(drmdpy->base.dpy, WL_DISPLAY_READABLE);
+      force_roundtrip(drmdpy->base.dpy);
    id = wl_display_get_global(drmdpy->base.dpy, "wl_drm", 1);
    if (id == 0)
       return FALSE;



More information about the mesa-commit mailing list