[Mesa-users] Using EGL/GLES2 on Linux console gives blank screen

Roger Leigh rleigh at codelibre.net
Sun Jun 26 15:05:09 PDT 2011

Hi folks,

I'm a newcomer to using OpenGL, so it's possible I'm simply hitting
an issue with buggy code.

I've built the mesa-demos and can run src/egl/opengles*/*_screen
without problems providing I set EGL_PLATFORM=drm.  The only issue
I've run into is https://bugs.freedesktop.org/show_bug.cgi?id=38473
which I hope can be resolved in the kernel, since this does cause
problems.  I'm testing using 7.11~0.2 (current git packaged in
Debian experimental) with Linux 2.6.39 and and ATI Radeon HD 4850.
It's possible I'm hitting this bug on startup as well as shutdown
with the example below.

I've subsequently been trying to convert an example opengl 2.0
program (https://github.com/jckarter/hello-gl.git) to use GLES2.
The above git repo builds fine with the "full" mesa opengl when
run under X [I needed to add -lm which was missing], and the example
program runs correctly as well.  I've converted it to use EGL and
GLES2, using eglut from mesa-demos, and it builds and runs without
error, including (AFAICT) the shader code.
I've put this at http://www.codelibre.net/~rleigh/hello-gl.tar.xz

% EGL_PLATFORM=drm ./hello-gl
libEGL warning: pci id for 3: 1002:9442, driver r600
EGL_VERSION = 1.4 (Gallium)
Found 16 modes:
  0: 1920 x 1200
 15: 640 x 480
Will use screen size: 1920 x 1200
1382 frames in 5.0 seconds = 276.289 FPS
[ 3065.972070] HDMI hot plug event: Pin=3 Presence_Detect=0 ELD_Valid=0
[ 3065.973680] HDMI hot plug event: Pin=3 Presence_Detect=0 ELD_Valid=0

The screen was entirely black for the duration of this run.
Being fairly new to OpenGL, I'm not entirely sure whether this is due
to me doing something wrong, or if I'm tripping up on an issue with
mesa or dri (I'm sure it's more likely to be me at fault).  The shaders
did have "#version 110" at the top which initally caused them to fail to
compile since this is not supported by GL|ES2.  However, they don't
AFAICT appear to use any GLSL1.10 functionality, so I removed it and
they compile successfully.

I'm unsure what is the best way to debug opengl code or the dri stuff,
so any guidance on what might be wrong or how to best go about
investigating things would be greatly appreciated.

Many thanks,

  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20110626/97c43997/attachment.pgp>

More information about the mesa-users mailing list