[Mesa-users] Mesa EGL via drm platform

Matwey V. Kornilov matwey.kornilov at gmail.com
Fri Sep 8 08:51:11 UTC 2017


Hello,

I am running Mesa-17.0.5. I am trying to learn how to use EGL. My
final goal is to perform off-screen OpenGL rendering on systems
without running X server.
Well, I have the following simple snipped. Full source code is
available here: http://paste.opensuse.org/59747271

    EGLDisplay eglDpy = eglGetDisplay((NativeDisplayType)0);
    EGLint major, minor;

    if (eglInitialize(eglDpy, &major, &minor) != EGL_TRUE) {
        printf("Fail: eglInitialize %04x\n", eglGetError());
        return 1;
    }

When I try to run the code as the following:

> EGL_PLATFORM=drm ./a.out
get chip id failed: -1 [13]
param: 4, val: 0
[intel_init_bufmgr:1193] Error initializing buffer manager.
Extensions: EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import
EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context
EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses
EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base
EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync
EGL_KHR_surfaceless_context EGL_KHR_wait_sync
EGL_MESA_configless_context EGL_MESA_image_dma_buf_export
function is no-op
function is no-op
function is no-op
function is no-op
function is no-op
Vendor: (null)
Renderer: (null)

What do I do wrong here? Access permissions for /dev/dri/card0 allow
user to write and read.

When I try to run the same code with Cuda, then I see more-less
reasonable output:
$ ./a.out
Extensions: EGL_EXT_create_context_robustness EGL_EXT_output_base
EGL_EXT_output_drm EGL_EXT_stream_consumer_egloutput
EGL_EXT_stream_acquire_mode EGL_IMG_context_priority
EGL_KHR_config_attribs EGL_KHR_create_context_no_error
EGL_KHR_create_context EGL_KHR_fence_sync
EGL_KHR_get_all_proc_addresses EGL_KHR_swap_buffers_with_damage
EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base
EGL_KHR_reusable_sync EGL_KHR_stream EGL_KHR_stream_consumer_gltexture
EGL_KHR_stream_cross_process_fd EGL_KHR_stream_fifo
EGL_KHR_stream_producer_eglsurface EGL_KHR_surfaceless_context
EGL_NV_stream_metadata EGL_NV_stream_sync
EGL_NV_stream_consumer_gltexture_yuv EGL_NV_sync EGL_NV_system_time
EGL_NV_output_drm_flip_event EGL_WL_bind_wayland_display
Vendor: NVIDIA Corporation
Renderer: GeForce GTX 960/PCIe/SSE2

-- 
With best regards,
Matwey V. Kornilov


More information about the mesa-users mailing list