diff options
author | Alexandros Frantzis <alexandros.frantzis@collabora.com> | 2019-03-05 12:51:14 +0200 |
---|---|---|
committer | Alexandros Frantzis <alexandros.frantzis@collabora.com> | 2019-03-05 13:04:39 +0200 |
commit | 10a733961108f1495894e6143d5281d40ef84ff3 (patch) | |
tree | 385f20083cbffa00c311dcbe7f87e09c45743975 | |
parent | 1c49b5445ebeb84f1767811b6400a0fe87897acf (diff) | |
download | weston-10a733961108f1495894e6143d5281d40ef84ff3.tar.gz |
clients/simple-dmabuf-egl: Create the EGL display using the GBM platform
Since we are managing and rendering to buffers on our own with GBM,
create the EGL display using the GBM platform with the DRM render node,
instead of using the Wayland EGL platform.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
-rw-r--r-- | clients/simple-dmabuf-egl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clients/simple-dmabuf-egl.c b/clients/simple-dmabuf-egl.c index 5353f5a0..142d73e7 100644 --- a/clients/simple-dmabuf-egl.c +++ b/clients/simple-dmabuf-egl.c @@ -1105,8 +1105,8 @@ display_set_up_egl(struct display *display) const char *gl_extensions = NULL; display->egl.display = - weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR, - display->display, NULL); + weston_platform_get_egl_display(EGL_PLATFORM_GBM_KHR, + display->gbm.device, NULL); if (display->egl.display == EGL_NO_DISPLAY) { fprintf(stderr, "Failed to create EGLDisplay\n"); goto error; @@ -1340,13 +1340,15 @@ create_display(char const *drm_render_node, int opts) goto error; } - if (!display_set_up_egl(display)) + /* GBM needs to be initialized before EGL, so that we have a valid + * render node gbm_device to create the EGL display from. */ + if (!display_set_up_gbm(display, drm_render_node)) goto error; - if (!display_update_supported_modifiers_for_egl(display)) + if (!display_set_up_egl(display)) goto error; - if (!display_set_up_gbm(display, drm_render_node)) + if (!display_update_supported_modifiers_for_egl(display)) goto error; /* We use explicit synchronization only if the user hasn't disabled it, |