Browse files

vaapi: add support for EGL and texture-from-pixmap.

This initial approach relies on VA/X11 and vaPutSurface() to a Pixmap.
Then, an EGLImage is created from that pixmap and bound to a texture
with glEGLImageTargetTexture2DOES().

Signed-off-by: Gwenole Beauchesne <>
  • Loading branch information...
1 parent 72571bb commit c734a0bcbeef9ab61da27f2d26ea5e074befe707 @gbeauchesne committed Aug 10, 2012
@@ -1545,6 +1545,13 @@ if test "x$use_vaapi" != "xno"; then
LIBS="$LIBS $LIBVA_LIBS"], [use_vaapi="no"])
if test "x$use_vaapi" != "xno"; then
+ if test "$use_gles" = "yes"; then
+ dnl XXX: necessary for texture-from-pixmap
+ PKG_CHECK_MODULES([LIBVA_X11], [libva-x11], [
+ has_va_x11="yes"], [use_vaapi="no"])
+ fi
if test "$use_gl" = "yes"; then
@@ -1562,6 +1569,9 @@ if test "x$use_vaapi" != "xno"; then
AC_DEFINE([HAVE_LIBVA], [1], [Define to 1 if you have the 'vaapi' libraries])
+ if test "$has_va_x11" = "yes"; then
+ AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is available])
+ fi
if test "$has_va_glx" = "yes"; then
AC_DEFINE([HAVE_VA_GLX], [1], [Defined to 1 if VA/GLX API is available])
Oops, something went wrong.

3 comments on commit c734a0b

Very nice overall. I have a few general org recommendations (as we discussed via mail) though I don't see any reason to call them blockers.

I'd prefer to see the symbol getters and pixmap creation/uploads in our gles renderer or base renderer. Reason being I have global domination plans for a render manager one of these days, so that we have a single processor for rendering, rather than everyone doing it themselves all over the show.

I'm also having trouble understanding why the pixmap upload/render are tied to vaapi. Is this just because that's it's first user? I ask because if this is a general kms/drm feature, It'd be useful for skin texture uploads as well (for off-thread uploads). If they're not tied to vaapi, see the first note above again :)


gbeauchesne replied Aug 20, 2012

@theuni: the pixmap upload could better fit VAAPI.cpp because the EGL/X11 path actually suits "desktop" OpenGL, GLESv1 and GLESv2. So, moving it to the GLES renderer may not be fully correct. I will try to move a few things to base renderer then.


gbeauchesne replied Aug 20, 2012

@theuni: wrt. quick buffer to fb swap/blit, there is vaPutSurface() that is specific to X11 and doesn't use any form of GL. On some occasions, you could even use an overlay. However, there could be some issues when rendering the UI on top of it. Some VA drivers support overlay + 3D UI in another plane though.

Please sign in to comment.