Add support for wl_display types for native display 47/30147/1
authorDamian Hobson-Garcia <dhobsong@igel.co.jp>
Tue, 10 Dec 2013 05:16:47 +0000 (14:16 +0900)
committerTony SIM <chinyeow.sim.xt@renesas.com>
Wed, 12 Nov 2014 05:39:59 +0000 (13:39 +0800)
In the nested wayland composition scenario, the compositor needs to forward the
DRM authentication to its server. Only the DRM master can authenticate the
client.

We store the wl_display and pass it to the wl_kms server in the middle, so that
the wl_kms server in the middle can forward the authentication request to its
server.

This fix requires the latest wayland-kms.

Change-Id: Iee7d87f1097270cb328252bd53230bbb0bf62159
Signed-off-by: Tony SIM <chinyeow.sim.xt@renesas.com>
egl.c

diff --git a/egl.c b/egl.c
index 1275f6f..d9438d4 100644 (file)
--- a/egl.c
+++ b/egl.c
@@ -163,6 +163,7 @@ EGLint eglGetError(void)
 
 #ifdef WANT_WAYLAND
 static struct gbm_device *__gbm;
+static struct wl_display *__wl_display = NULL;
 #endif
 
 EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
@@ -175,6 +176,8 @@ EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
                void *head = *(void**)display_id;
                if (head == gbm_create_device)
                        __gbm = (struct gbm_device*)display_id;
+               if (head == &wl_display_interface)
+                       __wl_display = (struct wl_display*)display_id;
        }
 #endif
 
@@ -534,7 +537,7 @@ static EGLBoolean __eglBindWaylandDisplayWL(EGLDisplay dpy,
        }
        EGL_DEBUG("%s: decice_name=%s\n", __func__, device_name);
 
-       __wl_kms = wayland_kms_init(display, device_name, fd);
+       __wl_kms = wayland_kms_init(display, __wl_display, device_name, fd);
        return EGL_TRUE;
 }