Commit 50c8ae8a authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Austin Yuan

Add OpenGL extensions (v3) and generic implementation with TFP and FBO.

parent e734b66e
......@@ -32,10 +32,13 @@ endif
pcfiles = libva.pc
pcfiles += libva-x11.pc
if USE_GLX
pcfiles += libva-glx.pc
endif
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = $(pcfiles)
EXTRA_DIST = libva.pc.in libva-x11.pc.in
EXTRA_DIST = libva.pc.in libva-x11.pc.in libva-glx.pc.in
CLEANFILES = $(pcfiles)
......@@ -60,6 +60,11 @@ LIBVA_LT_LDFLAGS="-version-info $LIBVA_LT_VERSION"
AC_SUBST(LIBVA_LT_VERSION)
AC_SUBST(LIBVA_LT_LDFLAGS)
AC_ARG_ENABLE(glx,
[AC_HELP_STRING([--enable-glx],
[build with OpenGL for X11 support])],
[], [enable_glx=yes])
AC_ARG_ENABLE(dummy-driver,
[AC_HELP_STRING([--enable-dummy-driver],
[build dummy video driver])],
......@@ -113,6 +118,22 @@ if test x$libudev = xno; then
fi
AM_CONDITIONAL(BUILD_DUMMY_BACKEND, test x$enable_dummy_backend = xyes)
# Check for OpenGL (X11)
USE_GLX="no"
GL_DEPS_CFLAGS=""
GL_DEPS_LIBS=""
if test x$enable_glx = xyes; then
AC_CHECK_HEADERS([GL/gl.h])
AC_CHECK_HEADERS([GL/glx.h])
AC_CHECK_LIB(GL, glXCreateContext, [
USE_GLX="yes"
GL_DEPS_LIBS="-lX11 -lGL"
])
fi
AC_SUBST(GL_DEPS_CFLAGS)
AC_SUBST(GL_DEPS_LIBS)
AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes")
# We only need the headers, we don't link against the DRM libraries
LIBVA_CFLAGS="$DRM_CFLAGS"
AC_SUBST(LIBVA_CFLAGS)
......@@ -146,5 +167,6 @@ AC_OUTPUT([
test/encode/Makefile
libva.pc
libva-x11.pc
libva-glx.pc
])
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
display=glx
Name: libva-${display}
Description: Userspace Video Acceleration (VA) ${display} interface
Requires: libva
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lva-${display}
Cflags: -I${includedir}
......@@ -371,6 +371,9 @@ struct VADriverVTable
VADriverContextP ctx,
VASurfaceID surface
);
/* Optional: GLX support hooks */
struct VADriverVTableGLX *glx;
};
struct VADriverContext
......@@ -394,6 +397,7 @@ struct VADriverContext
void *handle; /* dlopen handle */
void *dri_state;
void *glx; /* opaque for GLX code */
};
#define VA_DISPLAY_MAGIC 0x56414430 /* VAD0 */
......@@ -416,6 +420,8 @@ struct VADisplayContext
VADisplayContextP ctx,
char **driver_name
);
void *opaque; /* opaque for display extensions (e.g. GLX) */
};
typedef VAStatus (*VADriverInit) (
......
......@@ -198,6 +198,7 @@ VADisplay vaGetDisplay (
pDisplayContext->vaIsValid = va_DisplayContextIsValid;
pDisplayContext->vaDestroy = va_DisplayContextDestroy;
pDisplayContext->vaGetDriverName = va_DisplayContextGetDriverName;
pDisplayContext->opaque = NULL;
pDisplayContexts = pDisplayContext;
pDriverContext->dri_state = dri_state;
dpy = (VADisplay)pDisplayContext;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment