This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use fbdev_pixmap structure passed to eglCreatePixmapSurface create Surface

Hi,
I now use the fbdev window system, I assign a fbdev_pixmap structure configured corresponding content, pass it to eglCreatePixmapSurface function, but get to the error information 0x0000300A
Such as:
Error: eglCreatePixmapSurface failed Error: 0x0000300A
I will be how to configure fbdev_pixmap structure content, there is no successful example sent to me ah?

Thank you

Parents
  • hi

    I am now using mali 400mp2 platform, the repository is framebuffer-r3p0;

    examples are as follows:


    static EGLint const config_attribute_list[] = {
        EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,// EGL_PBUFFER_BIT EGL_WINDOW_BIT
        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
        EGL_NONE
    };
    
    
      setenv("EGL_PLATFORM", "fbdev", 0);
      setenv("FRAMEBUFFER", argv[1], 0);
    
      struct fbdev_pixmap surface = {
             .width = 1920,
             .height = 1080,
             .bytes_per_pixel = 32,
             .red_size = 8,
             .green_size = 8,
             .blue_size = 8,
             .alpha_size = 8,
             .flags = FBDEV_PIXMAP_DEFAULT,
             .format = 1,
      };
    
      egl_dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    
       if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
          printf("Error: eglInitialize() failed\n");
          return -1;
       }
    
       if (!eglChooseConfig(egl_dpy, config_attribute_list, &config, 1, &num_configs)) {
          printf("Error: couldn't get an EGL visual config\n");
          exit(1);
       }
    
       assert(config);
       assert(num_configs > 0);
    
    
        EGLint ai32ContextAttribs[4];
        i=0;
        ai32ContextAttribs[i] = EGL_NONE;
        ai32ContextAttribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
        ai32ContextAttribs[i++] = 2;
        ai32ContextAttribs[i] = EGL_NONE;
    
    
           eglBindAPI(EGL_OPENGL_ES_API);
    
    
       ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, ai32ContextAttribs );
       if (!ctx) {
          printf("Error: eglCreateContext failed\n");
          exit(1);
       }
    
        EGLint        attrib_list[16];
        attrib_list[0] = EGL_NONE;
    
       *surfRet = eglCreatePixmapSurface(egl_dpy, config, winRet, attrib_list);
    
       if (!*surfRet) {
              printf("Error: eglCreatePixmapSurface failed Error:0x%08X\n", eglGetError());
              exit(1);
       }
    

    The program prints the error:

    Error: eglCreatePixmapSurface failed Error: 0x0000300A

    May I ask how to configure struct fbdev_pixmap, do not know if there are no relevant success stories?

Reply
  • hi

    I am now using mali 400mp2 platform, the repository is framebuffer-r3p0;

    examples are as follows:


    static EGLint const config_attribute_list[] = {
        EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,// EGL_PBUFFER_BIT EGL_WINDOW_BIT
        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
        EGL_NONE
    };
    
    
      setenv("EGL_PLATFORM", "fbdev", 0);
      setenv("FRAMEBUFFER", argv[1], 0);
    
      struct fbdev_pixmap surface = {
             .width = 1920,
             .height = 1080,
             .bytes_per_pixel = 32,
             .red_size = 8,
             .green_size = 8,
             .blue_size = 8,
             .alpha_size = 8,
             .flags = FBDEV_PIXMAP_DEFAULT,
             .format = 1,
      };
    
      egl_dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    
       if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
          printf("Error: eglInitialize() failed\n");
          return -1;
       }
    
       if (!eglChooseConfig(egl_dpy, config_attribute_list, &config, 1, &num_configs)) {
          printf("Error: couldn't get an EGL visual config\n");
          exit(1);
       }
    
       assert(config);
       assert(num_configs > 0);
    
    
        EGLint ai32ContextAttribs[4];
        i=0;
        ai32ContextAttribs[i] = EGL_NONE;
        ai32ContextAttribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
        ai32ContextAttribs[i++] = 2;
        ai32ContextAttribs[i] = EGL_NONE;
    
    
           eglBindAPI(EGL_OPENGL_ES_API);
    
    
       ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, ai32ContextAttribs );
       if (!ctx) {
          printf("Error: eglCreateContext failed\n");
          exit(1);
       }
    
        EGLint        attrib_list[16];
        attrib_list[0] = EGL_NONE;
    
       *surfRet = eglCreatePixmapSurface(egl_dpy, config, winRet, attrib_list);
    
       if (!*surfRet) {
              printf("Error: eglCreatePixmapSurface failed Error:0x%08X\n", eglGetError());
              exit(1);
       }
    

    The program prints the error:

    Error: eglCreatePixmapSurface failed Error: 0x0000300A

    May I ask how to configure struct fbdev_pixmap, do not know if there are no relevant success stories?

Children