Hello.
I work with Freescale i.MX6 processor-based board (next, i’m going to call it TARGET) with Linux. Now I am trying to run on the TARGET a Java application, which uses OpenGL through JOGL.
I faced an issue and figured out that it is in glXChooseFBConfig function.
I wrote a simple code i(n C) in two variations: with and without third argument in glXChooseFBConfig
#include <GL/glx.h>
#include <GL/gl.h>
#include <unistd.h>
#include <stdio.h>
int main (int argc, char ** argv)
{
Display *dpy = XOpenDisplay(0);
int nelements;
static int attributeList[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DOUBLEBUFFER, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, None};
GLXFBConfig *fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), NULL, &nelements);
printf("OK!
");
return 0;
}
Let’s say that version with
glXChooseFBConfig(dpy, DefaultScreen(dpy), attributeList, &nelements); is test-1
and
glXChooseFBConfig(dpy, DefaultScreen(dpy), NULL, &nelements); is test-2
When I run both test on the HOST-machine (Linux 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 GNU/Linux), I see OK!
When I run test-1 on the TARGET, I see OK!
But when I run test-2 on the TARGET, I see Segmentation fault.
In the OpenGL documentation:
If attrib_list is NULL, then glXChooseFBConfig returns an array of GLX frame buffer configurations that are available on the specified screen. If an error occurs, no frame buffer configurations exist on the specified screen, or if no frame buffer configurations match the specified attributes, then NULL is returned.
I have fb, fb0, fb1 devices in the TARGET’s /dev directory.
glxgears run perfectly.
glxinfo:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_make_current_read
client glx vendor string: Vivante Corp
client glx version string: 1.4
client glx extensions:
GLX_ARB_get_proc_address, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGI_make_current_read
GLX version: 1.4
GLX extensions:
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_make_current_read
OpenGL vendor string: Vivante Corporation
OpenGL renderer string: Vivante GC2000
OpenGL version string: 2.1 2.0.1
OpenGL shading language version string: 1.20
OpenGL extensions:
GL_ARB_depth_texture, GL_ARB_fragment_program_shadow,
GL_ARB_fragment_shader, GL_ARB_imaging, GL_ARB_multisample,
GL_ARB_multitexture, GL_ARB_pixel_buffer_object, GL_ARB_shader_objects,
GL_ARB_texture_compression, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_non_power_of_two,
GL_ARB_texture_rectangle, GL_ARB_vertex_buffer_object,
GL_ARB_vertex_shader, GL_ARB_window_pos, GL_ATI_draw_buffers,
GL_ATI_element_array, GL_ATI_separate_stencil,
GL_ATI_texture_env_combine3, GL_ATI_vertex_array_object, GL_EXT_abgr,
GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_equation_separate,
GL_EXT_blend_func_separate, GL_EXT_color_table, GL_EXT_convolution,
GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements,
GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample,
GL_EXT_framebuffer_object, GL_EXT_histogram, GL_EXT_packed_depth_stencil,
GL_EXT_pixel_buffer_object, GL_EXT_polygon_offset, GL_EXT_rescale_normal,
GL_EXT_secondary_color, GL_EXT_separate_specular_color,
GL_EXT_stencil_two_side, GL_EXT_subtexture, GL_EXT_texture,
GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_buffer_object,
GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map,
GL_EXT_texture_env_add, GL_EXT_texture_env_combine,
GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias,
GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_timer_query,
GL_EXT_vertex_array, GL_NV_texture_rectangle, GL_SGIS_generate_mipmap,
GL_SGIS_texture_lod, GL_SGI_color_matrix, WGL_ARB_extensions_string,
WGL_EXT_extensions_string, WGL_EXT_swap_control
24 GLX Visuals
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
----------------------------------------------------------------------------
0x021 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x0a5 16 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0a6 16 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 None
0x0a7 16 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0a8 16 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 None
0x0ad 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0ae 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 None
0x0af 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0b0 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 None
0x0b1 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x0b2 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 None
0x0b3 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 None
0x0b4 16 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0b5 16 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 None
0x0b6 16 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0b7 16 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 None
0x0bc 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0bd 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 None
0x0be 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0bf 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 None
0x0c0 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x0c1 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 None
0x0c2 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x0c3 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 None
24 GLXFBConfigs:
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
----------------------------------------------------------------------------
0x045 16 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x046 16 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow
0x047 16 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x048 16 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow
0x04d 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x04e 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x04f 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x050 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x051 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x052 16 tc 0 16 0 r . . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 Slow
0x053 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x054 16 tc 0 16 0 r y . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 Slow
0x075 16 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x076 16 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow
0x077 16 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x078 16 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow
0x07d 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x07e 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x07f 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x080 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x081 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x082 16 dc 0 16 0 r . . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 Slow
0x083 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 8 0 0 0 0 0 0 None
0x084 16 dc 0 16 0 r y . 5 6 5 0 . . 0 16 8 16 16 16 0 0 0 Slow
Please tell me the way to solve this problem.
Best Regards.