dvdhrm / kmscon

Linux KMS/DRM based virtual Console Emulator
http://www.freedesktop.org/wiki/Software/kmscon
Other
429 stars 78 forks source link

Compile error after mesa upgrade. #101

Closed yuyichao closed 10 years ago

yuyichao commented 10 years ago

After upgrading git version of mesa, I got a compile error:

src/uterm_drm3d_render.c: In function 'uterm_drm3d_display_blit':
src/uterm_drm3d_render.c:214:17: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function)
   glPixelStorei(GL_UNPACK_ROW_LENGTH, buf->stride / 4);
                 ^

grep -R in /usr/include shows:

GLES3/gl3.h:#define GL_UNPACK_ROW_LENGTH                             0x0CF2
cogl/cogl-gles2/GLES2/gl2ext.h:#define GL_UNPACK_ROW_LENGTH                                    0x0CF2
GL/glew.h:#define GL_UNPACK_ROW_LENGTH 0x0CF2
GL/gl.h:#define GL_UNPACK_ROW_LENGTH                    0x0CF2
kwinglutils_funcs.h:#ifndef GL_UNPACK_ROW_LENGTH
kwinglutils_funcs.h:#define GL_UNPACK_ROW_LENGTH 0x0CF2
GLES2/gl2ext.h:#define GL_UNPACK_ROW_LENGTH_EXT                                0x0CF2
qt/QtGui/qopengles2ext.h:#define GL_UNPACK_ROW_LENGTH_EXT                                0x0CF2

After adding "-DGL_UNPACK_ROW_LENGTH=0x0CF2" to my CFLAGS, it compiles and runs fine.

dvdhrm commented 10 years ago

Gnah! The related mesa commit ist: http://cgit.freedesktop.org/mesa/mesa/commit/include/GLES2/gl2ext.h?id=00a945f61e5d3e1a28fd20fcd18402b9300d1ca8

They updated the GLES headers from the khronos site and added several _EXT and _KHR suffixes. I need to talk to some mesa devs about that, but I think they will just forward me to khronos upstream. Anyway, I probably have to test for both, GL_UNPACK_ROW_LENGTH and GL_UNPACK_ROW_LENGTH_EXT..

Thanks for the hint! I will fix it once I got a response in #dri-devel.

dvdhrm commented 10 years ago

Ok, I tried fixing it. Can you test 31d7b4d5964ef501eddf5ca6ae64a1275284433e?

I didn't fetch mesa-git, but I hope it works. Otherwise, please let me know. Thanks!

yuyichao commented 10 years ago

From master

src/text_gltex.c: In function 'find_glyph':
src/text_gltex.c:465:17: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function)
   glPixelStorei(GL_UNPACK_ROW_LENGTH, GLYPH_STRIDE(glyph));
                 ^
src/text_gltex.c:465:17: note: each undeclared identifier is reported only once for each function it appears in

Well....

dvdhrm commented 10 years ago

Ugh, right, the gltex renderer also uses it. Fixed.

Thanks

yuyichao commented 10 years ago

Looks fine, at least when configured with

./autogen.sh --prefix=/usr --enable-wlterm \
  --with-renderers=cairo,bbulk,gltex