vl: va state-tracker configuration scripts
authorThomas Balling Sørensen <tball@tball-laptop.(none)>
Sun, 24 Oct 2010 17:27:29 +0000 (19:27 +0200)
committerThomas Balling Sørensen <tball@tball-laptop.(none)>
Sun, 24 Oct 2010 17:27:29 +0000 (19:27 +0200)
configs/autoconf.in
configure.ac
src/gallium/state_trackers/va/Makefile
src/gallium/state_trackers/va/ftab.c
src/gallium/state_trackers/va/htab.c
src/gallium/state_trackers/va/va_private.h
src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h
src/gallium/state_trackers/vdpau/vdpau_private.h

index d7eb162b6846d94042a05ebad973cfbefbdba4ff..df52b3f42f6e8c2e50652f6a8ca1d5d862def2fc 100644 (file)
@@ -160,6 +160,9 @@ EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
 # VDPAU library install directory
 VDPAU_LIB_INSTALL_DIR=@VDPAU_LIB_INSTALL_DIR@
 
+# VA library install directory
+VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
+
 # Xorg driver install directory (for xorg state-tracker)
 XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
 
index 0344be00703c598b97d190dd437adfc6d984dc2e..59c2eb157b71d43d73e473490dcd707f9cbe3301 100644 (file)
@@ -1345,6 +1345,13 @@ yes)
             fi
             HAVE_ST_VDPAU="yes"
             ;;
+       va)
+            # Check for libva?
+            if test "x$enable_gallium_g3dvl" != xyes; then
+                AC_MSG_ERROR([cannot build va state tracker without --enable-gallium-g3dvl])
+            fi
+            HAVE_ST_VA="yes"
+            ;;
         esac
 
        if test -n "$tracker"; then
@@ -1479,7 +1486,7 @@ dnl
 dnl Gallium helper functions
 dnl
 gallium_check_st() {
-    if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_EGL" = xyes || test "x$HAVE_ST_XORG" = xyes || test "x$HAVE_ST_XVMC" = xyes || test "x$HAVE_ST_VDPAU" = xyes; then
+    if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_EGL" = xyes || test "x$HAVE_ST_XORG" = xyes || test "x$HAVE_ST_XVMC" = xyes || test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
          GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
     fi
     if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
@@ -1497,6 +1504,9 @@ gallium_check_st() {
     if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
     fi
+    if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then
+         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
+    fi
 }
 
 
@@ -1613,8 +1623,13 @@ AC_ARG_ENABLE([gallium-g3dvl],
 if test "x$enable_gallium_g3dvl" = xyes; then
     case "$mesa_driver" in
     xlib)
+       if test "x$HAVE_ST_VDPAU" = xyes; then
         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
-        ;;
+       fi
+       if test "x$HAVE_ST_VA" = xyes; then
+       GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe"
+       fi
+       ;;
     dri)
         GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS g3dvl/dri"
         ;;
@@ -1628,6 +1643,14 @@ AC_ARG_WITH([vdpau-libdir],
     [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
 AC_SUBST([VDPAU_LIB_INSTALL_DIR])
 
+dnl Directory for VA libs
+AC_ARG_WITH([va-libdir],
+    [AS_HELP_STRING([--with-va-libdir=DIR],
+        [directory for the VA libraries @<:@default=${libdir}/va@:>@])],
+    [VA_LIB_INSTALL_DIR="$withval"],
+    [VA_LIB_INSTALL_DIR='${libdir}/va'])
+AC_SUBST([VA_LIB_INSTALL_DIR])
+
 dnl
 dnl Gallium swrast configuration
 dnl
index 28fe5d09694be43991a83a73f59780885118a418..15c6ee0ef6d0e166230b0874d78137ddc66c75ca 100644 (file)
@@ -8,7 +8,7 @@ VA_MINOR = 3
 LIBRARY_DEFINES = -DVER_MAJOR=$(VA_MAJOR) -DVER_MINOR=$(VA_MINOR) $(STATE_TRACKER_DEFINES)
 
 LIBRARY_INCLUDES = \
-       $(shell pkg-config --cflags-only-I vdpau) \
+       $(shell pkg-config --cflags-only-I va) \
        -I$(TOP)/src/gallium/winsys/g3dvl
 
 C_SOURCES = htab.c \
index 694390b346440e296a60a2563f46cad04ae9eec2..034424cdee702ce174a95937f7ac408ebee9c08f 100644 (file)
@@ -26,7 +26,7 @@
  **************************************************************************/
 
 #include <assert.h>
-#include <VA/va_backend.h>
+#include <va/va_backend.h>
 
 const struct VADriverVTable vtable =
 {
index 7b7c111a4be3d3f24f50c203a9c29ea8f3db260b..069c793092723aeae0f443d139b6e7772f977748 100644 (file)
 #include <os/os_thread.h>
 #include "va_private.h"
 
+#define VL_HANDLES
+
+typedef uint32_t vlHandle;
+
 #ifdef VL_HANDLES
 static struct handle_table *htab = NULL;
 pipe_static_mutex(htab_lock);
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8264c259ed139fe97ea67b0a56e9bc6aebde3937 100644 (file)
@@ -0,0 +1,32 @@
+/**************************************************************************
+ *
+ * Copyright 2010 Thomas Balling Sørensen.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+ #ifndef VA_PRIVATE_H
+ #define VA_PRIVATE_H
+ #endif // VA_PRIVATE_H
\ No newline at end of file
index 414d6597c6cde931951e7ca04c4749e30bccb22e..25f3516f8212ba717d5bab374e28625c9d9f1ae7 100644 (file)
@@ -36,19 +36,14 @@ enum vdpMPEG2States
 {
        MPEG2_SEEK_HEADER,
        MPEG2_HEADER_DONE,
-       MPEG2_BITSTREAM_DONE
-       MPEG2
+       MPEG2_BITSTREAM_DONE,
+       MPEG2_HEADER_START_CODE
 };
 
-enum vdpMPEG2Action
-{
-       MPEG2_
-};
 
 struct vdpMPEG2BitstreamParser
 {
        enum vdpMPEG2States state;
-       enum vdpMPEG2Actions action;
        uint32_t cur_bitstream;
        const uint8_t *ptr_bitstream_end;
        const uint8_t *ptr_bitstream;
index d582b8e6c29c9d723e73647c484e6c49258c8fbe..1deea3a67d34b723b5e67199e42c43b4c0d00520 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  *
- * Copyright 2010 Younes Manton.
+ * Copyright 2010 Younes Manton & Thomas Balling Sørensen.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a