SGX530 ARGB8888 Support

Hello,

I am trying to render headless with BeagleBone Black. But since I cannot do it out of the box (other post) I bought myself a headless ghost which I attached to microHDMI port.

With the regular DefaultPixelFormat=RGB565 settings the PVR SDK examples run just fine and I am able to run eglinfo. However, when changing it to ARGB8888, I receive this error:

Creating Window surface..
PVR:(Error): WSEGL_CreateWindowDrawable: Couldn't set CRTC: Invalid argument [0, ]
Unable to create surface
    egl error 'EGL_BAD_ALLOC' (0x3003)

The image used is the latest PVR image for BBB (2020.04). Could you help me?

Hi jduchniewicz,

Many thanks for your mesage.

We were still working in your previous post (Headless rendering with PVR SGX530, EGL, OpenGL - is it supported? - #8 by jduchniewicz).

Now we are aware of your update, we will look into the new issue you’re experiencing and come back to you as soon as we have information about how to solve / workaround it.

Best regards,
Alejandro

Hi Alejandro,

I am right now using RGB565 on BBB for computations, however having 32-bits would make the computations easier and of course faster. I suspect the issue may lie in some DRM drivers for the BBB as it outputs to 24-bits LCD (in particular ti-crtc).

It seems like PVR library tries to establish DRM_CRTC params and fails to do so due to aforementioned driver condition (please observe that there is no ARGB8888 setting which may be the cause).

Jakub

Hi jduchniewicz,

thanks for the update, we will mention your findings to the Drivers Team to confirm your guess.

Best regards,
Alejandro

Hi jduchniewicz,

I had a chat with our internal teams and it appears that the TI DRM/KMS display driver advertises encoding using ARGB8888 pixel format in drmModeGetPlaneResources(). However, while creating an EGL window surface, it fails to drive the requested mode on the connected display (HDMI ghost) in drmModeSetCrtc().

Our suggestion would be to use eglCreatePbufferSurface() (instead of eglCreateWindowSurface()) with EGL_TEXTURE_FORMAT=EGL_TEXTURE_RGBA. This will render to an offscreen ARGB8888 framebuffer regardless of what the TI DRM/KMS display driver or the connected display supports.

Do let me know if this helps you out with your issue.

Best regards,
Omar.

2 Likes

Hi Omar,

I tried replacing the call you mentioned (eglCreateWindowSurface()) with eglCreatePbufferSurface() but it fails with EGL_NO_SURFACE even though I set up the config type to be EGL_PBUFFER_BIT. I also changed the powervr.ini to be ARGB8888.

It also does not work with RGB565 settings.

It seems that Pbuffer rendering seems to be unrelated to whether we set RGB565 or RGBA8888.

Jakub

Hi Jakub,

Setting EGL_TEXTURE_FORMAT=EGL_TEXTURE_RGBA will also requires setting EGL_TEXTURE_TARGET=EGL_TEXTURE_2D (you can also use the default value of EGL_NO_TEXTURE for EGL_TEXTURE_TARGET) so that the pixel format of PBuffer surface is derived from the EGL frame buffer configuration (config argument of eglCreatePbufferSurface()).

You should choose an EGL config using individual component widths in the config attributes and EGL_SURFACE_TYPE=EGL_PBUFFER_BIT and only set EGL_WIDTH and EGL_HEIGHT in attrib_list argument of eglCreatePbufferSurface().

e.g.

EGLint cfg_attribs[] = {EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE};
eglChooseConfig(dpy, cfg_attribs, &config, 1, &config_count);
EGLint pbuf[] = {EGL_WIDTH, WINDOW_WIDTH, EGL_HEIGHT, WINDOW_HEIGHT, EGL_NONE};
EGLSurface surface = eglCreatePbufferSurface (dpy, config, pbuf);

Best regards,
Omar