• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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.

変更サマリ

差分

--- a/Makefile.am
+++ b/Makefile.am
@@ -32,10 +32,13 @@ endif
3232
3333 pcfiles = libva.pc
3434 pcfiles += libva-x11.pc
35+if USE_GLX
36+pcfiles += libva-glx.pc
37+endif
3538
3639 pkgconfigdir = @pkgconfigdir@
3740 pkgconfig_DATA = $(pcfiles)
3841
39-EXTRA_DIST = libva.pc.in libva-x11.pc.in
42+EXTRA_DIST = libva.pc.in libva-x11.pc.in libva-glx.pc.in
4043
4144 CLEANFILES = $(pcfiles)
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,11 @@ LIBVA_LT_LDFLAGS="-version-info $LIBVA_LT_VERSION"
6060 AC_SUBST(LIBVA_LT_VERSION)
6161 AC_SUBST(LIBVA_LT_LDFLAGS)
6262
63+AC_ARG_ENABLE(glx,
64+ [AC_HELP_STRING([--enable-glx],
65+ [build with OpenGL for X11 support])],
66+ [], [enable_glx=yes])
67+
6368 AC_ARG_ENABLE(dummy-driver,
6469 [AC_HELP_STRING([--enable-dummy-driver],
6570 [build dummy video driver])],
@@ -113,6 +118,22 @@ if test x$libudev = xno; then
113118 fi
114119 AM_CONDITIONAL(BUILD_DUMMY_BACKEND, test x$enable_dummy_backend = xyes)
115120
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+
116137 # We only need the headers, we don't link against the DRM libraries
117138 LIBVA_CFLAGS="$DRM_CFLAGS"
118139 AC_SUBST(LIBVA_CFLAGS)
@@ -146,5 +167,6 @@ AC_OUTPUT([
146167 test/encode/Makefile
147168 libva.pc
148169 libva-x11.pc
170+ libva-glx.pc
149171 ])
150172
--- /dev/null
+++ b/libva-glx.pc.in
@@ -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}
--- a/va/va_backend.h
+++ b/va/va_backend.h
@@ -371,6 +371,9 @@ struct VADriverVTable
371371 VADriverContextP ctx,
372372 VASurfaceID surface
373373 );
374+
375+ /* Optional: GLX support hooks */
376+ struct VADriverVTableGLX *glx;
374377 };
375378
376379 struct VADriverContext
@@ -394,6 +397,7 @@ struct VADriverContext
394397 void *handle; /* dlopen handle */
395398
396399 void *dri_state;
400+ void *glx; /* opaque for GLX code */
397401 };
398402
399403 #define VA_DISPLAY_MAGIC 0x56414430 /* VAD0 */
@@ -416,6 +420,8 @@ struct VADisplayContext
416420 VADisplayContextP ctx,
417421 char **driver_name
418422 );
423+
424+ void *opaque; /* opaque for display extensions (e.g. GLX) */
419425 };
420426
421427 typedef VAStatus (*VADriverInit) (
--- a/va/x11/va_x11.c
+++ b/va/x11/va_x11.c
@@ -198,6 +198,7 @@ VADisplay vaGetDisplay (
198198 pDisplayContext->vaIsValid = va_DisplayContextIsValid;
199199 pDisplayContext->vaDestroy = va_DisplayContextDestroy;
200200 pDisplayContext->vaGetDriverName = va_DisplayContextGetDriverName;
201+ pDisplayContext->opaque = NULL;
201202 pDisplayContexts = pDisplayContext;
202203 pDriverContext->dri_state = dri_state;
203204 dpy = (VADisplay)pDisplayContext;