diff options
author | Myy <myy@miouyouyou.fr> | 2017-01-11 18:14:10 +0000 |
---|---|---|
committer | Myy <myy@miouyouyou.fr> | 2017-01-11 18:14:10 +0000 |
commit | 905627dab2afa27f4b88193257847240f21e456e (patch) | |
tree | 64c9b4e7fa6bae9b0f28b77ab644a92915235ec8 | |
parent | 8c6a20901f95e1b465bbca127f9d47fcfb8762e6 (diff) |
Used eglGetPlatformDisplayEXT in order to use this sample with Mali
For some reason, ARM Mali Wayland/DRM drivers does not seem to support
eglGetDisplay(gbm.dev) and prefers instead
eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, gbm.dev, NULL).
Used the Weston DRM and GL renderers as reference.
Signed-off-by: Myy <myy@miouyouyou.fr>
-rw-r--r-- | kmscube.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -42,6 +42,8 @@ #include <EGL/egl.h> #include <EGL/eglext.h> +#include <assert.h> + #include "esUtil.h" @@ -120,6 +122,7 @@ static uint32_t find_crtc_for_connector(const drmModeRes *resources, static int init_drm(void) { static const char *modules[] = { + "rockchip", "exynos", "i915", "msm", @@ -393,7 +396,12 @@ static int init_gl(void) " gl_FragColor = vVaryingColor; \n" "} \n"; - gl.display = eglGetDisplay(gbm.dev); + PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL; + get_platform_display = + (void *) eglGetProcAddress("eglGetPlatformDisplayEXT"); + assert(get_platform_display != NULL); + + gl.display = get_platform_display(EGL_PLATFORM_GBM_KHR, gbm.dev, NULL); if (!eglInitialize(gl.display, &major, &minor)) { printf("failed to initialize\n"); |