i work on firefly/rk3288,and got the same problem as this discussion http://community.arm.com/thread/8116
when i try to use eglCreateImageKHR , it returned EGL_NO_IMAGE_KHR, error code is EGL_BAD_PARAMETER(0x300c),accroding to this site https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_image_base.txt, it seem the <target> or <attrib_list> is invalid, but i am
doubt,i use as below
const EGLint img_attribs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE }; EGLImageKHR image = eglCreateImageKHR (display, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &pixmap, img_attribs);
pixmap is define as
#define YUYV_FORMAT 0x001022A88LL struct fbdev_pixmap { int width, height; struct { /** @brief The line stride of each plane. * For each plane required by the format, the number of bytes from one line of samples to the next. Other entries in * the array should be 0. */ khronos_usize_t stride; /** @brief The byte size of each plane. * For each plane required by the format, the number of bytes taken up by that plane. That includes any space wasted * in partially-used blocks. */ khronos_usize_t size; /** @brief The offset from the memory handle to each plane. * For each plane required by the format, the number of bytes from the start of the allocation to the start of that * plane. Other entries in the array should be 0. */ khronos_usize_t offset; } planes[3]; /** An integer that specifies the format of the pixmap. Its meaning is known by the Mali driver. */ uint64_t pixmap_format; /* dma_buf fd for each of the plan */ int handles[3]; }; struct fbdev_pixmap pixmap; memset(&pixmap, 0, sizeof(struct fbdev_pixmap)); pixmap.width = width; pixmap.height = height; pixmap.handles[0] = dma_fd; pixmap.planes[0].stride = width * pixel_size; pixmap.planes[0].size = width * height * pixel_size; pixmap.pixmap_format = YUYV_FORMAT;
so,i dont know where is the problem
my mali lib version is mali-t76x_r5p0-06rel0_linux_1+fbdev
and i need the definition of struct fbdev_pixmap on YUYV_FORMAT and GL_RGBA format, thx
Hi fengyin,
The code looks good, the question is whether or not the particular version of the driver you're using supports this extension / type of memory.
I've asked guillaume.tucker to look into it for you. (He's the person building and publishing the various versions of the Mali driver you can find on malidevelopers)
Thanks,
Anthony
thx a lot.
it seems that this version of driver dont support pixmap?
the string i got from eglQueryString is :
EGL_VENDOR:ARM
EGL_VERSION:1.4 Midgard-"r5p0-06rel0"
EGL_CLIENT_APIS:OpenGL_ES
EGL_EXTENSIONS:EGL_KHR_config_attribs EGL_KHR_image EGL_KHR_image_base EGL_KHR_fence_sync EGL_KHR_wait_sync EGL_KHR_gl_colorspace EGL_KHR_get_all_proc_addresses EGL_ARM_pixmap_multisample_discard EGL_KHR_gl_texture_2D_image EGL_KHR_gl_renderbuffer_image EGL_KHR_create_context EGL_KHR_surfaceless_context EGL_KHR_gl_texture_cubemap_image EGL_KHR_cl_event2
i can not find the string:EGL_KHR_image_pixmap, is it says that i can't use the extension EGL_NATIVE_PIXMAP_KHR?
is it means i need a driver with new version?
thanks for reply
by the way,if a new version of driver is needed, when can you release that new version? the deadline of our program is closing in months, so if there is no new version in the near future,we have to find another way to do this
This is correct, I haven't tried to use this extension but if it's not listed in the strings then it should not be available.
Unfortunately I'm not aware of this pixmap extension being on our roadmap for new driver versions but I'll investigate whether this could be enabled. I would strongly advise you to consider a different extension to import textures in the meantime.
Also, r5p0 is a rather old version of the driver and we'll be publishing new ones soon (r6p0, r7p0 for Mali-T76x / Firefly). I can't give you definitive date but I would hope to see r6p0 out within a few weeks and r7p0 within a couple of months.
We may have at least partial support for https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt. Even though it may not appear in the strings of supported extensinos, as some pixel formats may not be supported, this is something worth trying if it makes sense for your project. I will look for more information on this topic as I believe it may only be available in r6p0 (yet to be released).
Best wishes,
Guillaume