I implemented an opengl-es application running on mali-400 gpu. I grab the 1280x960 RGB buffer from camera and render on GPU , I use zero copy operation using EGL_EXT_image_dma_buf_importextension.
EGL_EXT_image_dma_buf_import
My problem is that the Besler camera gives frames in RGB888 format.
but eglCreateImageKHR is working only if I give RGBA8888 format .
eglCreateImageKHR
If I pass RGB888 to eglCreateImageKHR it gives black screen and also egl image returned is 0.
If I convert RGB888 data to RGBA8888 it works . but I don't want to do extra conversions for better performance. How can I use the RGB888 data with eglCreateImageKHR?
Please find the code below:
EGLint egl_img_attr[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_DMA_BUF_PLANE0_FD_EXT, buffer->dbuf_fd, EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, EGL_DMA_BUF_PLANE0_PITCH_EXT, TEX_WIDTH * 4, EGL_WIDTH, TEX_WIDTH, EGL_HEIGHT, TEX_HEIGHT, EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_RGBA8888 , EGL_NONE, EGL_NONE }; buffer->egl_img = eglCreateImageKHR(egl_dpy, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)0, egl_img_attr);
Hi samicko,
Looking at the code here I think it should be supported, although without knowing what error is being thrown it's hard to tell where it's failing. For next steps can you:
Also it would be useful to know the driver version you have (query the GL_VERSION string in OpenGL ES).
Cheers, Pete
Hi Peter,
I got the same error as mentioned above. I can't create an RGB texture but an RGBA texture. The DRM framebuffer format is AR24. Is there a list which formats are supported?
When calling:
EGLint egl_img_attr[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_DMA_BUF_PLANE0_FD_EXT, buffer->dbuf_fd, EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, EGL_DMA_BUF_PLANE0_PITCH_EXT, TEX_WIDTH * 3, EGL_WIDTH, TEX_WIDTH, EGL_HEIGHT, TEX_HEIGHT, EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_RGB888 , EGL_NONE, EGL_NONE };
glCreateImageKHR(egl_dpy, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)0, egl_img_attr);
I get error 0x3009 (EGL_BAD_MATCH).
Is the OpenSource Lima driver a better alternative.
My EGL version is: 1.4 Linux-r9p0-01rel0 ?
Thanks and best regards.