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

eglCreatePixmapSurface  error 0x300a

Note: This was originally posted on 12th September 2012 at http://forums.arm.com

When I try the SAMSUNG S3 run the above code, I failed.


void GLImageRenderBlux::initEGL(int width, int height, SkBitmap bitmap)
{
const EGLint attribList[] = { EGL_WIDTH, width, EGL_HEIGHT, height, EGL_NONE };

EGLConfig config;
EGLint maj;
EGLint min;

m_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
checkEGLError("eglGetDisplay");
if(m_display == EGL_NO_DISPLAY) {
  LOGE("getDisplay fail!");
  return ;
}

if(eglInitialize(m_display, &maj, &min) == EGL_FALSE) {
  LOGE("Initialize fail");
  return ;
}

config = chooseConfig(m_display);
EGLint contextAttrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };

m_context = eglCreateContext(m_display, config, EGL_NO_CONTEXT, contextAttrs);
checkEGLError("eglCreateContext");
if(m_context == EGL_NO_CONTEXT) {
  LOGE("Create Context failure");
  return ;
}


//
SkPixelRef* ref = bitmap.pixelRef();
SkSafeRef(ref);
ref->lockPixels();

egl_native_pixmap_t pixmap;
pixmap.version = sizeof(pixmap);
pixmap.width  = width;
pixmap.height = height;
pixmap.stride = bitmap.rowBytes() / bitmap.bytesPerPixel();
pixmap.format = SkBitmap::kARGB_8888_Config;
pixmap.data   = (uint8_t*)ref->pixels();

ref->unlockPixels();

m_surface = eglCreatePixmapSurface(m_display, config, &pixmap, attribList);
checkEGLError("eglCreatePixmapSurface");
if(m_surface == EGL_NO_SURFACE) {
  LOGE("Create Surface failure");
  return ;
}

if (!eglMakeCurrent(m_display, m_surface, m_surface, m_context)) {
  LOGE("Make Current failure");
  return ;
}
}

EGLConfig GLImageRenderBlux::chooseConfig(EGLDisplay display)
{
EGLConfig config;
EGLint numConfigs;

static const EGLint configAttribs[] = {
   EGL_SURFACE_TYPE,
   EGL_PIXMAP_BIT,
   EGL_RENDERABLE_TYPE,
   EGL_OPENGL_ES2_BIT,
   EGL_NONE
};

eglChooseConfig(display, configAttribs, &config, 1, &numConfigs);
checkEGLError("eglPbufferConfig");
if (numConfigs != 1) {
  LOGE("eglPbufferConfig failed (%d)\n", numConfigs);
}

return config;
}

Error information is as follows:
'eglCreatePixmapSurface error: EGL_BAD_NATIVE_PIXMAP (0x300a)'
'[color=#FF0000]Create Surface failure'[/color]

Does any know how to fix the problem?
Parents
  • Note: This was originally posted on 22nd September 2012 at http://forums.arm.com

    Hi KarthikH,

       Sorry!The log output from 'checkFrameBufferStatus' function, but error happened in where.
    I use samsung sIII (I9300 Android 4.0.4) will bring this problem?
    I9300 configuration parameters are as follows:
    [
      GL Version = OpenGL ES 2.0
      GL Vendor = ARM
      GL Renderer = Mali-400 MP
      GL Extensions =
          GL_OES_texture_npot    GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives  GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture    GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_blend_minmax    GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8    GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer
    ]

    'glGenTexutres' and 'glGenFramebuffers' function need to call after 'eglCreaeteContext', and 'eglMakeCurrent' function to run?

    On my I9300 'eglCreatePbufferSurface' and use 'glReadPixels' to get the pixel data is entirely feasible, so I think it must in after the initialization EGLDisplay, EGLSurface and EGLContext before use of texture and Framebuffer, is this it?

    my 'checkFrameBufferStatus' function code:


    static void checkFrameBufferStatus(const char* op)
    {
    GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
    switch (status)
    {
    case GL_FRAMEBUFFER_COMPLETE:
      LOGI("after %s FLIPBOOM : FBO complete GL_FRAMEBUFFER_COMPLETE %x", op, status);
      break;
    case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
      LOGI("after %s FLIPBOOM : FBO GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT  %x", op, status);
      break;
    case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
      LOGI("after %s FLIPBOOM : FBO FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT %x", op, status);
      break;
    case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
      LOGI("after %s FLIPBOOM : FBO FRAMEBUFFER_INCOMPLETE_DIMENSIONS  %x", op, status);
      break;
    case GL_FRAMEBUFFER_UNSUPPORTED:
      LOGI("after %s FLIPBOOM : FBO GL_FRAMEBUFFER_UNSUPPORTED  %x", op, status);
      break;
    default :
      LOGE("after %s FLIPBOOM : failed to make complete FrameBuffer object %x", op, status);
      break;
    }
    }
Reply
  • Note: This was originally posted on 22nd September 2012 at http://forums.arm.com

    Hi KarthikH,

       Sorry!The log output from 'checkFrameBufferStatus' function, but error happened in where.
    I use samsung sIII (I9300 Android 4.0.4) will bring this problem?
    I9300 configuration parameters are as follows:
    [
      GL Version = OpenGL ES 2.0
      GL Vendor = ARM
      GL Renderer = Mali-400 MP
      GL Extensions =
          GL_OES_texture_npot    GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives  GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture    GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_blend_minmax    GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8    GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer
    ]

    'glGenTexutres' and 'glGenFramebuffers' function need to call after 'eglCreaeteContext', and 'eglMakeCurrent' function to run?

    On my I9300 'eglCreatePbufferSurface' and use 'glReadPixels' to get the pixel data is entirely feasible, so I think it must in after the initialization EGLDisplay, EGLSurface and EGLContext before use of texture and Framebuffer, is this it?

    my 'checkFrameBufferStatus' function code:


    static void checkFrameBufferStatus(const char* op)
    {
    GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
    switch (status)
    {
    case GL_FRAMEBUFFER_COMPLETE:
      LOGI("after %s FLIPBOOM : FBO complete GL_FRAMEBUFFER_COMPLETE %x", op, status);
      break;
    case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
      LOGI("after %s FLIPBOOM : FBO GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT  %x", op, status);
      break;
    case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
      LOGI("after %s FLIPBOOM : FBO FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT %x", op, status);
      break;
    case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
      LOGI("after %s FLIPBOOM : FBO FRAMEBUFFER_INCOMPLETE_DIMENSIONS  %x", op, status);
      break;
    case GL_FRAMEBUFFER_UNSUPPORTED:
      LOGI("after %s FLIPBOOM : FBO GL_FRAMEBUFFER_UNSUPPORTED  %x", op, status);
      break;
    default :
      LOGE("after %s FLIPBOOM : failed to make complete FrameBuffer object %x", op, status);
      break;
    }
    }
Children
No data