hardware/intel/libva
リビジョン | 50c8ae8a5379a3aa6312edae6bb083936eaa43a6 (tree) |
---|---|
日時 | 2010-05-13 03:29:32 |
作者 | Gwenole Beauchesne <gbeauchesne@spli...> |
コミッター | Austin Yuan |
Add OpenGL extensions (v3) and generic implementation with TFP and FBO.
@@ -32,10 +32,13 @@ endif | ||
32 | 32 | |
33 | 33 | pcfiles = libva.pc |
34 | 34 | pcfiles += libva-x11.pc |
35 | +if USE_GLX | |
36 | +pcfiles += libva-glx.pc | |
37 | +endif | |
35 | 38 | |
36 | 39 | pkgconfigdir = @pkgconfigdir@ |
37 | 40 | pkgconfig_DATA = $(pcfiles) |
38 | 41 | |
39 | -EXTRA_DIST = libva.pc.in libva-x11.pc.in | |
42 | +EXTRA_DIST = libva.pc.in libva-x11.pc.in libva-glx.pc.in | |
40 | 43 | |
41 | 44 | CLEANFILES = $(pcfiles) |
@@ -60,6 +60,11 @@ LIBVA_LT_LDFLAGS="-version-info $LIBVA_LT_VERSION" | ||
60 | 60 | AC_SUBST(LIBVA_LT_VERSION) |
61 | 61 | AC_SUBST(LIBVA_LT_LDFLAGS) |
62 | 62 | |
63 | +AC_ARG_ENABLE(glx, | |
64 | + [AC_HELP_STRING([--enable-glx], | |
65 | + [build with OpenGL for X11 support])], | |
66 | + [], [enable_glx=yes]) | |
67 | + | |
63 | 68 | AC_ARG_ENABLE(dummy-driver, |
64 | 69 | [AC_HELP_STRING([--enable-dummy-driver], |
65 | 70 | [build dummy video driver])], |
@@ -113,6 +118,22 @@ if test x$libudev = xno; then | ||
113 | 118 | fi |
114 | 119 | AM_CONDITIONAL(BUILD_DUMMY_BACKEND, test x$enable_dummy_backend = xyes) |
115 | 120 | |
121 | +# Check for OpenGL (X11) | |
122 | +USE_GLX="no" | |
123 | +GL_DEPS_CFLAGS="" | |
124 | +GL_DEPS_LIBS="" | |
125 | +if test x$enable_glx = xyes; then | |
126 | + AC_CHECK_HEADERS([GL/gl.h]) | |
127 | + AC_CHECK_HEADERS([GL/glx.h]) | |
128 | + AC_CHECK_LIB(GL, glXCreateContext, [ | |
129 | + USE_GLX="yes" | |
130 | + GL_DEPS_LIBS="-lX11 -lGL" | |
131 | + ]) | |
132 | +fi | |
133 | +AC_SUBST(GL_DEPS_CFLAGS) | |
134 | +AC_SUBST(GL_DEPS_LIBS) | |
135 | +AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes") | |
136 | + | |
116 | 137 | # We only need the headers, we don't link against the DRM libraries |
117 | 138 | LIBVA_CFLAGS="$DRM_CFLAGS" |
118 | 139 | AC_SUBST(LIBVA_CFLAGS) |
@@ -146,5 +167,6 @@ AC_OUTPUT([ | ||
146 | 167 | test/encode/Makefile |
147 | 168 | libva.pc |
148 | 169 | libva-x11.pc |
170 | + libva-glx.pc | |
149 | 171 | ]) |
150 | 172 |
@@ -0,0 +1,12 @@ | ||
1 | +prefix=@prefix@ | |
2 | +exec_prefix=@exec_prefix@ | |
3 | +libdir=@libdir@ | |
4 | +includedir=@includedir@ | |
5 | +display=glx | |
6 | + | |
7 | +Name: libva-${display} | |
8 | +Description: Userspace Video Acceleration (VA) ${display} interface | |
9 | +Requires: libva | |
10 | +Version: @PACKAGE_VERSION@ | |
11 | +Libs: -L${libdir} -lva-${display} | |
12 | +Cflags: -I${includedir} |
@@ -371,6 +371,9 @@ struct VADriverVTable | ||
371 | 371 | VADriverContextP ctx, |
372 | 372 | VASurfaceID surface |
373 | 373 | ); |
374 | + | |
375 | + /* Optional: GLX support hooks */ | |
376 | + struct VADriverVTableGLX *glx; | |
374 | 377 | }; |
375 | 378 | |
376 | 379 | struct VADriverContext |
@@ -394,6 +397,7 @@ struct VADriverContext | ||
394 | 397 | void *handle; /* dlopen handle */ |
395 | 398 | |
396 | 399 | void *dri_state; |
400 | + void *glx; /* opaque for GLX code */ | |
397 | 401 | }; |
398 | 402 | |
399 | 403 | #define VA_DISPLAY_MAGIC 0x56414430 /* VAD0 */ |
@@ -416,6 +420,8 @@ struct VADisplayContext | ||
416 | 420 | VADisplayContextP ctx, |
417 | 421 | char **driver_name |
418 | 422 | ); |
423 | + | |
424 | + void *opaque; /* opaque for display extensions (e.g. GLX) */ | |
419 | 425 | }; |
420 | 426 | |
421 | 427 | typedef VAStatus (*VADriverInit) ( |
@@ -198,6 +198,7 @@ VADisplay vaGetDisplay ( | ||
198 | 198 | pDisplayContext->vaIsValid = va_DisplayContextIsValid; |
199 | 199 | pDisplayContext->vaDestroy = va_DisplayContextDestroy; |
200 | 200 | pDisplayContext->vaGetDriverName = va_DisplayContextGetDriverName; |
201 | + pDisplayContext->opaque = NULL; | |
201 | 202 | pDisplayContexts = pDisplayContext; |
202 | 203 | pDriverContext->dri_state = dri_state; |
203 | 204 | dpy = (VADisplay)pDisplayContext; |