Forums - glEGLImageTargetTexture2DOES failure on Adreno 200

3 posts / 0 new
Last post
glEGLImageTargetTexture2DOES failure on Adreno 200
korDen
Join Date: 30 Jan 13
Posts: 1
Posted: Wed, 2013-01-30 20:59
Hi, guys,

I'm trying to use gralloc to speed-up and ease texture uploads on Android. I'm have a few hick-ups, but everything is mostly great on most platforms, but there are a few that have issues. One of them is Adreno 200.

On Nexus One (QSD8250, Android 2.3.6), I'm getting Permission Error when trying to allocate memory:

E/qsd8k.gralloc(677): /dev/pmem: failed to open pmem device: Permission denied
E/qsd8k.gralloc(677): /dev/pmem: failed to initialize pmem area
E/qsd8k.gralloc(677): couldn't open pmem (Permission denied)
E/qsd8k.gralloc(677): gralloc failed err=Permission denied
W/GraphicBufferAllocator(677): alloc(2048, 2048, 5, 00000120, ...) failed -13 (Permission denied)

Could be that it's just not accessible from user space. Is there anything I can do to enable/fix it?

Another device is HTC Evo 4G (QSD8650, Android 2.3.5). I can allocate the memory and create EGLImageKHR successfully, but then glEGLImageTargetTexture2DOES fails with GL_INVALID_OPERATION (1282).

For what it's worth, this all hapens in a separate thread. I tried all HAL pixel formats (8888, 565 etc) to no success. Also android::egl_get_image_for_current_context(image); returns 0 (probably makes sense since I pass EGL_NO_CONTEXT when I create eglImageKHR).

Here is a summary of my code:

GraphicBuffer* buffer = createBuffer(width, height, format, usage, ...);
buffer->lock(CPUWrite, ..);
// write to it
buffer->unlock();

EGLDisplay display = eglGetCurrentDisplay();
EGLint eglImgAttrs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE, EGL_NONE };

EGLContext context = EGL_NO_CONTEXT;
EGLImageKHR image = eglCreateImageKHR(display, context, EGL_NATIVE_BUFFER_ANDROID, buffer->getNativeWindowBuffer(), NULL);

glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
int result = glGetError();

eglDestroyImageKHR(display, image);

if (result != GL_NO_ERROR) {
   // Fall back to glTexImage2D
}

Do you have any ideas about what's wrong? Should I give up on Adreno 200 support?

Thanks a lot in a advance!

  • Up0
  • Down0
bostwickenator
Join Date: 30 May 13
Posts: 1
Posted: Thu, 2013-05-30 19:19

I'm interested in this question as well. I'm trying to marshal some image frames in and out of OpenGL without using glReadPixels and I hit upon the same approach as you thanks to the ARM Mali guys. It's a fairly hacky way to write applications but it seems the best bet at getting any speed. It's worth noting I've tried this on both a Tegra 3 and Mali 400 device and they both allow access to gralloc via GraphicsBuffer. However I am having other issues with both of these. Has anyone managed to actually get this all working?

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Fri, 2013-05-31 09:40

Not sure if this will work on Adreno 200, but maybe try the following before giving up on supportting the hardware:

1) make sure there is an EGLContext:

EGLContext context =(EGLContext)eglGetCurrentContext()

 

2) Use GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.