Not working and unmaintained.
Reviewed-by: Christian König <christian.koenig@amd.com>
[enable vdpau library @<:@default=auto@:>@])],
[enable_vdpau="$enableval"],
[enable_vdpau=auto])
-AC_ARG_ENABLE([va],
- [AS_HELP_STRING([--enable-va],
- [enable va library @<:@default=auto@:>@])],
- [enable_va="$enableval"],
- [enable_va=auto])
AC_ARG_ENABLE([opencl],
[AS_HELP_STRING([--enable-opencl],
[enable OpenCL library @<:@default=no@:>@])],
"x$enable_d3d1x" = xno -a \
"x$enable_xvmc" = xno -a \
"x$enable_vdpau" = xno -a \
- "x$enable_va" = xno -a \
"x$enable_opencl" = xno; then
AC_MSG_ERROR([at least one API should be enabled])
fi
if test "x$enable_vdpau" = xauto; then
PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
fi
-
- if test "x$enable_va" = xauto; then
- #don't enable vaapi state tracker even if package exists
- #PKG_CHECK_EXISTS([libva], [enable_vdpau=yes], [enable_vdpau=no])
- enable_va=no
- fi
fi
if test "x$enable_xvmc" = xyes; then
HAVE_ST_VDPAU="yes"
fi
-if test "x$enable_va" = xyes; then
- PKG_CHECK_MODULES([LIBVA], [libva = 0.31.1 x11-xcb xcb-dri2 >= 1.8])
- AC_MSG_WARN([vaapi state tracker currently unmaintained])
- GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va"
- HAVE_ST_VA="yes"
-fi
-
dnl
dnl OpenCL configuration
dnl
[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 Directory for OpenCL libs
AC_ARG_WITH([opencl-libdir],
[AS_HELP_STRING([--with-opencl-libdir=DIR],
gallium_check_st() {
if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
- test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
+ test "x$HAVE_ST_VDPAU" = xyes; then
if test "x$have_libdrm" != xyes; then
AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
fi
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
}
gallium_require_llvm() {
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
gallium_require_llvm "Gallium R300"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
- gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" "va-r300"
+ gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300"
;;
xr600)
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then
LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs bitreader asmparser`"
fi
- gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
+ gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
;;
xradeonsi)
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
if test "x$HAVE_ST_XVMC" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
fi
- if test "x$HAVE_ST_VA" = xyes; then
- GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe"
- fi
if test "x$HAVE_ST_VDPAU" = xyes ||
- test "x$HAVE_ST_XVMC" = xyes ||
- test "x$HAVE_ST_VA" = xyes; then
+ test "x$HAVE_ST_XVMC" = xyes; then
if test "x$HAVE_WINSYS_XLIB" != xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
fi
+++ /dev/null
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = vatracker
-
-VA_MAJOR = 0
-VA_MINOR = 3
-LIBRARY_DEFINES = -DVER_MAJOR=$(VA_MAJOR) -DVER_MINOR=$(VA_MINOR) $(STATE_TRACKER_DEFINES)
-
-LIBRARY_INCLUDES = $(shell $(PKG_CONFIG) --cflags-only-I libva)
-
-C_SOURCES = htab.c \
- ftab.c \
- va_context.c \
- va_image.c \
- va_subpicture.c \
- va_buffer.c \
- va_config.c \
- va_picture.c \
- va_surface.c \
- va_display.c
-
-
-
-include ../../Makefile.template
-
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <assert.h>
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "va_private.h"
-
-static struct VADriverVTable vtable =
-{
- &vlVaTerminate, /* VAStatus (*vaTerminate) ( VADriverContextP ctx ); */
- &vlVaQueryConfigProfiles, /* VAStatus (*vaQueryConfigProfiles) ( VADriverContextP ctx, VAProfile *profile_list,int *num_profiles); */
- &vlVaQueryConfigEntrypoints, /* VAStatus (*vaQueryConfigEntrypoints) ( VADriverContextP ctx, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints ); */
- &vlVaGetConfigAttributes, /* VAStatus (*vaGetConfigAttributes) ( VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs ); */
- &vlVaCreateConfig, /* VAStatus (*vaCreateConfig) ( VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id); */
- &vlVaDestroyConfig, /* VAStatus (*vaDestroyConfig) ( VADriverContextP ctx, VAConfigID config_id); */
- &vlVaQueryConfigAttributes, /* VAStatus (*vaQueryConfigAttributes) ( VADriverContextP ctx, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs); */
- &vlVaCreateSurfaces, /* VAStatus (*vaCreateSurfaces) ( VADriverContextP ctx,int width,int height,int format,int num_surfaces,VASurfaceID *surfaces); */
- &vlVaDestroySurfaces, /* VAStatus (*vaDestroySurfaces) ( VADriverContextP ctx, VASurfaceID *surface_list, int num_surfaces ); */
- &vlVaCreateContext, /* VAStatus (*vaCreateContext) (VADriverContextP ctx,VAConfigID config_id,int picture_width,int picture_height,int flag,VASurfaceID *render_targets,int num_render_targets,VAContextID *context); */
- &vlVaDestroyContext, /* VAStatus (*vaDestroyContext) (VADriverContextP ctx,VAContextID context); */
- &vlVaCreateBuffer, /* VAStatus (*vaCreateBuffer) (VADriverContextP ctx,VAContextID context,VABufferType type,unsigned int size,unsigned int num_elements,void *data,VABufferID *buf_id); */
- &vlVaBufferSetNumElements, /* VAStatus (*vaBufferSetNumElements) (VADriverContextP ctx,VABufferID buf_id,unsigned int num_elements); */
- &vlVaMapBuffer, /* VAStatus (*vaMapBuffer) (VADriverContextP ctx,VABufferID buf_id,void **pbuf); */
- &vlVaUnmapBuffer, /* VAStatus (*vaUnmapBuffer) (VADriverContextP ctx,VABufferID buf_id); */
- &vlVaDestroyBuffer, /* VAStatus (*vaDestroyBuffer) (VADriverContextP ctx,VABufferID buffer_id); */
- &vlVaBeginPicture, /* VAStatus (*vaBeginPicture) (VADriverContextP ctx,VAContextID context,VASurfaceID render_target); */
- &vlVaRenderPicture, /* VAStatus (*vaRenderPicture) (VADriverContextP ctx,VAContextID context,VABufferID *buffers,int num_buffers); */
- &vlVaEndPicture, /* VAStatus (*vaEndPicture) (VADriverContextP ctx,VAContextID context); */
- &vlVaSyncSurface, /* VAStatus (*vaSyncSurface) (VADriverContextP ctx,VASurfaceID render_target); */
- &vlVaQuerySurfaceStatus, /* VAStatus (*vaQuerySurfaceStatus) (VADriverContextP ctx,VASurfaceID render_target,VASurfaceStatus *status); */
- &vlVaPutSurface, /* VAStatus (*vaPutSurface) (
- VADriverContextP ctx,
- VASurfaceID surface,
- void* draw,
- short srcx,
- short srcy,
- unsigned short srcw,
- unsigned short srch,
- short destx,
- short desty,
- unsigned short destw,
- unsigned short desth,
- VARectangle *cliprects,
- unsigned int number_cliprects,
- unsigned int flags); */
- &vlVaQueryImageFormats, /* VAStatus (*vaQueryImageFormats) ( VADriverContextP ctx, VAImageFormat *format_list,int *num_formats); */
- &vlVaCreateImage, /* VAStatus (*vaCreateImage) (VADriverContextP ctx,VAImageFormat *format,int width,int height,VAImage *image); */
- &vlVaDeriveImage, /* VAStatus (*vaDeriveImage) (VADriverContextP ctx,VASurfaceID surface,VAImage *image); */
- &vlVaDestroyImage, /* VAStatus (*vaDestroyImage) (VADriverContextP ctx,VAImageID image); */
- &vlVaSetImagePalette, /* VAStatus (*vaSetImagePalette) (VADriverContextP ctx,VAImageID image, unsigned char *palette); */
- &vlVaGetImage, /* VAStatus (*vaGetImage) (VADriverContextP ctx,VASurfaceID surface,int x,int y,unsigned int width,unsigned int height,VAImageID image); */
- &vlVaPutImage, /* VAStatus (*vaPutImage) (
- VADriverContextP ctx,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
- unsigned int src_width,
- unsigned int src_height,
- int dest_x,
- int dest_y,
- unsigned int dest_width,
- unsigned int dest_height
- ); */
- &vlVaQuerySubpictureFormats, /* VAStatus (*vaQuerySubpictureFormats) (VADriverContextP ctx,VAImageFormat *format_list,unsigned int *flags,unsigned int *num_formats); */
- &vlVaCreateSubpicture, /* VAStatus (*vaCreateSubpicture) (VADriverContextP ctx,VAImageID image,VASubpictureID *subpicture); */
- &vlVaDestroySubpicture, /* VAStatus (*vaDestroySubpicture) (VADriverContextP ctx,VASubpictureID subpicture); */
- &vlVaSubpictureImage, /* VAStatus (*vaSetSubpictureImage) (VADriverContextP ctx,VASubpictureID subpicture,VAImageID image); */
- &vlVaSetSubpictureChromakey, /* VAStatus (*vaSetSubpictureChromakey) (VADriverContextP ctx,VASubpictureID subpicture,unsigned int chromakey_min,unsigned int chromakey_max,unsigned int chromakey_mask); */
- &vlVaSetSubpictureGlobalAlpha, /* VAStatus (*vaSetSubpictureGlobalAlpha) (VADriverContextP ctx,VASubpictureID subpicture,float global_alpha); */
- &vlVaAssociateSubpicture, /* VAStatus (*vaAssociateSubpicture) (
- VADriverContextP ctx,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x,
- short src_y,
- unsigned short src_width,
- unsigned short src_height,
- short dest_x,
- short dest_y,
- unsigned short dest_width,
- unsigned short dest_height,
- unsigned int flags); */
- &vlVaDeassociateSubpicture, /* VAStatus (*vaDeassociateSubpicture) (VADriverContextP ctx,VASubpictureID subpicture,VASurfaceID *target_surfaces,int num_surfaces); */
- &vlVaQueryDisplayAttributes, /* VAStatus (*vaQueryDisplayAttributes) (VADriverContextP ctx,VADisplayAttribute *attr_list,int *num_attributes); */
- &vlVaGetDisplayAttributes, /* VAStatus (*vaGetDisplayAttributes) (VADriverContextP ctx,VADisplayAttribute *attr_list,int num_attributes); */
- &vlVaSetDisplayAttributes, /* VAStatus (*vaSetDisplayAttributes) (VADriverContextP ctx,VADisplayAttribute *attr_list,int num_attributes); */
- &vlVaBufferInfo, /* VAStatus (*vaBufferInfo) (VADriverContextP ctx,VAContextID context,VABufferID buf_id,VABufferType *type,unsigned int *size,unsigned int *num_elements); */
- &vlVaLockSurface, /* VAStatus (*vaLockSurface) (
- VADriverContextP ctx,
- VASurfaceID surface,
- unsigned int *fourcc,
- unsigned int *luma_stride,
- unsigned int *chroma_u_stride,
- unsigned int *chroma_v_stride,
- unsigned int *luma_offset,
- unsigned int *chroma_u_offset,
- unsigned int *chroma_v_offset,
- unsigned int *buffer_name,
- void **buffer); */
- &vlVaUnlockSurface, /* VAStatus (*vaUnlockSurface) (VADriverContextP ctx,VASurfaceID surface); */
- NULL /* struct VADriverVTableGLX *glx; "Optional" */
-};
-
-struct VADriverVTable vlVaGetVtable()
-{
- return vtable;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Younes Manton.
- * 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.
- *
- **************************************************************************/
-
-#include "util/u_handle_table.h"
-#include "os/os_thread.h"
-
-#include "va_private.h"
-
-#ifdef VL_HANDLES
-static struct handle_table *htab = NULL;
-pipe_static_mutex(htab_lock);
-#endif
-
-bool vlCreateHTAB(void)
-{
-#ifdef VL_HANDLES
- bool ret;
- /* Make sure handle table handles match VAAPI handles. */
- assert(sizeof(unsigned) <= sizeof(VAGenericID));
- pipe_mutex_lock(htab_lock);
- if (!htab)
- htab = handle_table_create();
- ret = htab != NULL;
- pipe_mutex_unlock(htab_lock);
- return ret;
-#else
- return TRUE;
-#endif
-}
-
-void vlDestroyHTAB(void)
-{
-#ifdef VL_HANDLES
- pipe_mutex_lock(htab_lock);
- if (htab) {
- handle_table_destroy(htab);
- htab = NULL;
- }
- pipe_mutex_unlock(htab_lock);
-#endif
-}
-
-VAGenericID vlAddDataHTAB(void *data)
-{
- assert(data);
-#ifdef VL_HANDLES
- VAGenericID handle = 0;
- pipe_mutex_lock(htab_lock);
- if (htab)
- handle = handle_table_add(htab, data);
- pipe_mutex_unlock(htab_lock);
- return handle;
-#else
- return (VAGenericID)data;
-#endif
-}
-
-void* vlGetDataHTAB(VAGenericID handle)
-{
- assert(handle);
-#ifdef VL_HANDLES
- void *data = NULL;
- pipe_mutex_lock(htab_lock);
- if (htab)
- data = handle_table_get(htab, handle);
- pipe_mutex_unlock(htab_lock);
- return data;
-#else
- return (void*)handle;
-#endif
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "va_private.h"
-
-VAStatus
-vlVaCreateBuffer(VADriverContextP ctx, VAContextID context, VABufferType type,
- unsigned int size, unsigned int num_elements, void *data,
- VABufferID *buf_id)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaBufferSetNumElements(VADriverContextP ctx, VABufferID buf_id, unsigned int num_elements)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaUnmapBuffer(VADriverContextP ctx, VABufferID buf_id)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaDestroyBuffer(VADriverContextP ctx, VABufferID buffer_id)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaBufferInfo(VADriverContextP ctx, VAContextID context, VABufferID buf_id,
- VABufferType *type, unsigned int *size, unsigned int *num_elements)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "util/u_debug.h"
-
-#include "va_private.h"
-
-VAStatus
-vlVaQueryConfigProfiles(VADriverContextP ctx, VAProfile *profile_list, int *num_profiles)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- int i = 0;
-
- profile_list[i++] = VAProfileMPEG2Simple;
- *num_profiles = i;
-
- return VA_STATUS_SUCCESS;
-}
-
-
-VAStatus
-vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,
- VAEntrypoint *entrypoint_list, int *num_entrypoints)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- VAStatus vaStatus = VA_STATUS_SUCCESS;
-
- switch (profile) {
- case VAProfileMPEG2Simple:
- case VAProfileMPEG2Main:
- VA_INFO("Using profile %08x\n",profile);
- entrypoint_list[0] = VAEntrypointMoComp;
- *num_entrypoints = 1;
- break;
-
- case VAProfileH264Baseline:
- case VAProfileH264Main:
- case VAProfileH264High:
- vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
- *num_entrypoints = 0;
- break;
-
- default:
- VA_ERROR("Unsupported profile %08x\n",profile);
- vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
- *num_entrypoints = 0;
- break;
- }
-
- return vaStatus;
-}
-
-VAStatus
-vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
- VAConfigAttrib *attrib_list, int num_attribs)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
- VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaDestroyConfig(VADriverContextP ctx, VAConfigID config_id)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile *profile,
- VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "pipe/p_screen.h"
-#include "pipe/p_screen.h"
-#include "pipe/p_video_decoder.h"
-
-#include "util/u_debug.h"
-#include "util/u_memory.h"
-#include "vl/vl_winsys.h"
-
-#include "va_private.h"
-
-PUBLIC VAStatus
-__vaDriverInit_0_31(VADriverContextP ctx)
-{
- vlVaDriverContextPriv *driver_context = NULL;
-
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
-
- /* Create private driver context */
- driver_context = CALLOC(1,sizeof(vlVaDriverContextPriv));
- if (!driver_context)
- return VA_STATUS_ERROR_ALLOCATION_FAILED;
-
- driver_context->vscreen = vl_screen_create(ctx->native_dpy, ctx->x11_screen);
- if (!driver_context->vscreen) {
- FREE(driver_context);
- return VA_STATUS_ERROR_ALLOCATION_FAILED;
- }
-
- ctx->str_vendor = "mesa gallium vaapi";
- ctx->vtable = vlVaGetVtable();
- ctx->max_attributes = 1;
- ctx->max_display_attributes = 1;
- ctx->max_entrypoints = VA_MAX_ENTRYPOINTS;
- ctx->max_image_formats = VA_MAX_IMAGE_FORMATS_SUPPORTED;
- ctx->max_profiles = 1;
- ctx->max_subpic_formats = VA_MAX_SUBPIC_FORMATS_SUPPORTED;
- ctx->version_major = 3;
- ctx->version_minor = 1;
- ctx->pDriverData = (void *)driver_context;
-
- VA_INFO("vl_screen_pointer %p\n",ctx->native_dpy);
-
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
-vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
- int picture_height, int flag, VASurfaceID *render_targets,
- int num_render_targets, VAContextID *conext)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaDestroyContext(VADriverContextP ctx, VAContextID context)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaTerminate(VADriverContextP ctx)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * 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.
- *
- **************************************************************************/
-
- #include <va/va.h>
- #include <va/va_backend.h>
-
- #include "va_private.h"
-
-VAStatus
-vlVaQueryDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int *num_attributes)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- if (!(attr_list && num_attributes))
- return VA_STATUS_ERROR_UNKNOWN;
-
- *num_attributes = 0;
-
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
-vlVaGetDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int num_attributes)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaSetDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int num_attributes)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "pipe/p_format.h"
-
-#include "util/u_memory.h"
-#include "util/u_format.h"
-#include "util/u_debug.h"
-
-#include "va_private.h"
-
-typedef struct {
- enum pipe_format pipe_format;
- VAImageFormat va_format;
-} va_image_formats_supported_t;
-
-static const va_image_formats_supported_t va_image_formats_supported[VA_MAX_IMAGE_FORMATS_SUPPORTED] =
-{
- { PIPE_FORMAT_B8G8R8A8_UNORM,
- { VA_FOURCC('B','G','R','A'), VA_LSB_FIRST, 32, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }},
- { PIPE_FORMAT_R8G8B8A8_UNORM,
- { VA_FOURCC_RGBA, VA_LSB_FIRST, 32, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }}
-};
-
-VAStatus
-vlVaQueryImageFormats(VADriverContextP ctx, VAImageFormat *format_list, int *num_formats)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- if (!(format_list && num_formats))
- return VA_STATUS_ERROR_UNKNOWN;
-
- int n = 0;
-
- num_formats[0] = VA_MAX_IMAGE_FORMATS_SUPPORTED;
-
- /* Query supported formats */
- for (n = 0; n < VA_MAX_IMAGE_FORMATS_SUPPORTED; n++) {
- format_list[n] = va_image_formats_supported[n].va_format;
- }
-
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
-vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int height, VAImage *image)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- if(!format)
- return VA_STATUS_ERROR_UNKNOWN;
-
- if (!(width && height))
- return VA_STATUS_ERROR_INVALID_IMAGE_FORMAT;
-
- if (!vlCreateHTAB())
- return VA_STATUS_ERROR_UNKNOWN;
-
- switch (format->fourcc) {
- case VA_FOURCC('B','G','R','A'):
- VA_INFO("Creating BGRA image of size %dx%d\n",width,height);
- break;
- case VA_FOURCC_RGBA:
- VA_INFO("Creating RGBA image of size %dx%d\n",width,height);
- break;
- default:
- VA_ERROR("Couldn't create image of type %0x08\n",format->fourcc);
- return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
- }
-
- VA_INFO("Image %p created successfully\n",format);
-
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
-vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaDestroyImage(VADriverContextP ctx, VAImageID image)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaSetImagePalette(VADriverContextP ctx, VAImageID image, unsigned char *palette)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaGetImage(VADriverContextP ctx, VASurfaceID surface, int x, int y,
- unsigned int width, unsigned int height, VAImageID image)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
- int src_x, int src_y, unsigned int src_width, unsigned int src_height,
- int dest_x, int dest_y, unsigned int dest_width, unsigned int dest_height)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "util/u_debug.h"
-
-#include "va_private.h"
-
-VAStatus
-vlVaBeginPicture(VADriverContextP ctx, VAContextID context, VASurfaceID render_target)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaRenderPicture(VADriverContextP ctx, VAContextID context, VABufferID *buffers, int num_buffers)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaEndPicture(VADriverContextP ctx, VAContextID context)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "pipe/p_format.h"
-#include "pipe/p_state.h"
-
-#define VA_DEBUG(_str,...) debug_printf("[Gallium VA backend]: " _str,__VA_ARGS__)
-#define VA_INFO(_str,...) VA_DEBUG("INFO: " _str,__VA_ARGS__)
-#define VA_WARNING(_str,...) VA_DEBUG("WARNING: " _str,__VA_ARGS__)
-#define VA_ERROR(_str,...) VA_DEBUG("ERROR: " _str,__VA_ARGS__)
-
-#define VA_MAX_IMAGE_FORMATS_SUPPORTED 2
-#define VA_MAX_SUBPIC_FORMATS_SUPPORTED 2
-#define VA_MAX_ENTRYPOINTS 1
-
-#define VL_HANDLES
-
-typedef struct {
- struct vl_screen *vscreen;
- struct pipe_surface *backbuffer;
-} vlVaDriverContextPriv;
-
-typedef struct {
- unsigned int width;
- unsigned int height;
- enum pipe_video_chroma_format format;
- VADriverContextP ctx;
-} vlVaSurfacePriv;
-
-// Public functions:
-VAStatus __vaDriverInit_0_31 (VADriverContextP ctx);
-
-// Private functions:
-struct VADriverVTable vlVaGetVtable();
-
-bool vlCreateHTAB(void);
-void vlDestroyHTAB(void);
-VAGenericID vlAddDataHTAB(void *data);
-void* vlGetDataHTAB(VAGenericID handle);
-
-// Vtable functions:
-VAStatus vlVaTerminate (VADriverContextP ctx);
-VAStatus vlVaQueryConfigProfiles (VADriverContextP ctx, VAProfile *profile_list,int *num_profiles);
-VAStatus vlVaQueryConfigEntrypoints (VADriverContextP ctx, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints);
-VAStatus vlVaGetConfigAttributes (VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs);
-VAStatus vlVaCreateConfig (VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id);
-VAStatus vlVaDestroyConfig (VADriverContextP ctx, VAConfigID config_id);
-VAStatus vlVaQueryConfigAttributes (VADriverContextP ctx, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs);
-VAStatus vlVaCreateSurfaces (VADriverContextP ctx,int width,int height,int format,int num_surfaces,VASurfaceID *surfaces);
-VAStatus vlVaDestroySurfaces (VADriverContextP ctx, VASurfaceID *surface_list, int num_surfaces);
-VAStatus vlVaCreateContext (VADriverContextP ctx,VAConfigID config_id,int picture_width,int picture_height,int flag,VASurfaceID *render_targets,int num_render_targets,VAContextID *context);
-VAStatus vlVaDestroyContext (VADriverContextP ctx,VAContextID context);
-VAStatus vlVaCreateBuffer (VADriverContextP ctx,VAContextID context,VABufferType type,unsigned int size,unsigned int num_elements,void *data,VABufferID *buf_id);
-VAStatus vlVaBufferSetNumElements (VADriverContextP ctx,VABufferID buf_id,unsigned int num_elements);
-VAStatus vlVaMapBuffer (VADriverContextP ctx,VABufferID buf_id,void **pbuf);
-VAStatus vlVaUnmapBuffer (VADriverContextP ctx,VABufferID buf_id);
-VAStatus vlVaDestroyBuffer (VADriverContextP ctx,VABufferID buffer_id);
-VAStatus vlVaBeginPicture (VADriverContextP ctx,VAContextID context,VASurfaceID render_target);
-VAStatus vlVaRenderPicture (VADriverContextP ctx,VAContextID context,VABufferID *buffers,int num_buffers);
-VAStatus vlVaEndPicture (VADriverContextP ctx,VAContextID context);
-VAStatus vlVaSyncSurface (VADriverContextP ctx,VASurfaceID render_target);
-VAStatus vlVaQuerySurfaceStatus (VADriverContextP ctx,VASurfaceID render_target,VASurfaceStatus *status);
-VAStatus vlVaPutSurface (VADriverContextP ctx,
- VASurfaceID surface,
- void* draw,
- short srcx,
- short srcy,
- unsigned short srcw,
- unsigned short srch,
- short destx,
- short desty,
- unsigned short destw,
- unsigned short desth,
- VARectangle *cliprects,
- unsigned int number_cliprects,
- unsigned int flags);
-VAStatus vlVaQueryImageFormats (VADriverContextP ctx,VAImageFormat *format_list,int *num_formats);
-VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx,VAImageFormat *format_list,unsigned int *flags,unsigned int *num_formats);
-VAStatus vlVaCreateImage(VADriverContextP ctx,VAImageFormat *format,int width,int height,VAImage *image);
-VAStatus vlVaDeriveImage(VADriverContextP ctx,VASurfaceID surface,VAImage *image);
-VAStatus vlVaDestroyImage(VADriverContextP ctx,VAImageID image);
-VAStatus vlVaSetImagePalette(VADriverContextP ctx,VAImageID image, unsigned char *palette);
-VAStatus vlVaGetImage(VADriverContextP ctx,VASurfaceID surface,int x,int y,unsigned int width,unsigned int height,VAImageID image);
-VAStatus vlVaPutImage(VADriverContextP ctx,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
- unsigned int src_width,
- unsigned int src_height,
- int dest_x,
- int dest_y,
- unsigned int dest_width,
- unsigned int dest_height);
-VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx,VAImageFormat *format_list,unsigned int *flags,unsigned int *num_formats);
-VAStatus vlVaCreateSubpicture(VADriverContextP ctx,VAImageID image,VASubpictureID *subpicture);
-VAStatus vlVaDestroySubpicture(VADriverContextP ctx,VASubpictureID subpicture);
-VAStatus vlVaSubpictureImage(VADriverContextP ctx,VASubpictureID subpicture,VAImageID image);
-VAStatus vlVaSetSubpictureChromakey(VADriverContextP ctx,VASubpictureID subpicture,unsigned int chromakey_min,unsigned int chromakey_max,unsigned int chromakey_mask);
-VAStatus vlVaSetSubpictureGlobalAlpha(VADriverContextP ctx,VASubpictureID subpicture,float global_alpha);
-VAStatus vlVaAssociateSubpicture(VADriverContextP ctx,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x,
- short src_y,
- unsigned short src_width,
- unsigned short src_height,
- short dest_x,
- short dest_y,
- unsigned short dest_width,
- unsigned short dest_height,
- unsigned int flags);
-VAStatus vlVaDeassociateSubpicture(VADriverContextP ctx,VASubpictureID subpicture,VASurfaceID *target_surfaces,int num_surfaces);
-VAStatus vlVaQueryDisplayAttributes(VADriverContextP ctx,VADisplayAttribute *attr_list,int *num_attributes);
-VAStatus vlVaGetDisplayAttributes(VADriverContextP ctx,VADisplayAttribute *attr_list,int num_attributes);
-VAStatus vlVaSetDisplayAttributes(VADriverContextP ctx,VADisplayAttribute *attr_list,int num_attributes);
-VAStatus vlVaBufferInfo(VADriverContextP ctx,VAContextID context,VABufferID buf_id,VABufferType *type,unsigned int *size,unsigned int *num_elements);
-VAStatus vlVaLockSurface(VADriverContextP ctx,
- VASurfaceID surface,
- unsigned int *fourcc,
- unsigned int *luma_stride,
- unsigned int *chroma_u_stride,
- unsigned int *chroma_v_stride,
- unsigned int *luma_offset,
- unsigned int *chroma_u_offset,
- unsigned int *chroma_v_offset,
- unsigned int *buffer_name,
- void **buffer);
-VAStatus vlVaUnlockSurface(VADriverContextP ctx,VASurfaceID surface);
-
-#endif //VA_PRIVATE_H
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-
-#include "pipe/p_format.h"
-
-#include "va_private.h"
-
-typedef struct {
- enum pipe_format pipe_format;
- VAImageFormat va_format;
- unsigned int va_flags;
-} va_subpicture_formats_supported_t;
-
-static const va_subpicture_formats_supported_t va_subpicture_formats_supported[VA_MAX_SUBPIC_FORMATS_SUPPORTED + 1] =
-{
- { PIPE_FORMAT_B8G8R8A8_UNORM,
- { VA_FOURCC('B','G','R','A'), VA_LSB_FIRST, 32, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
- 0 },
- { PIPE_FORMAT_R8G8B8A8_UNORM,
- { VA_FOURCC_RGBA, VA_LSB_FIRST, 32, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 },
- 0 }
-};
-
-VAStatus
-vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list,
- unsigned int *flags, unsigned int *num_formats)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- if (!(format_list && flags && num_formats))
- return VA_STATUS_ERROR_UNKNOWN;
-
- num_formats[0] = VA_MAX_SUBPIC_FORMATS_SUPPORTED;
-
- int n = 0;
- /* Query supported formats */
- for (n = 0; n < VA_MAX_SUBPIC_FORMATS_SUPPORTED ; n++) {
- const va_subpicture_formats_supported_t * const format_map = &va_subpicture_formats_supported[n];
- flags[n] = format_map->va_flags;
- format_list[n] = format_map->va_format;
- }
-
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
-vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture,
- unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaSetSubpictureGlobalAlpha(VADriverContextP ctx, VASubpictureID subpicture, float global_alpha)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaAssociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, VASurfaceID *target_surfaces,
- int num_surfaces, short src_x, short src_y,
- unsigned short src_width, unsigned short src_height,
- short dest_x, short dest_y,
- unsigned short dest_width,
- unsigned short dest_height,
- unsigned int flags)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaDeassociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture,
- VASurfaceID *target_surfaces, int num_surfaces)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-/**************************************************************************
- *
- * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
- * 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.
- *
- **************************************************************************/
-
-#include <va/va.h>
-#include <va/va_backend.h>
-#include "util/u_debug.h"
-#include "util/u_memory.h"
-#include "va_private.h"
-
-static enum pipe_video_chroma_format
-VaRTFormatToPipe(unsigned int va_type)
-{
- switch (va_type) {
- case VA_RT_FORMAT_YUV420:
- return PIPE_VIDEO_CHROMA_FORMAT_420;
- case VA_RT_FORMAT_YUV422:
- return PIPE_VIDEO_CHROMA_FORMAT_422;
- case VA_RT_FORMAT_YUV444:
- return PIPE_VIDEO_CHROMA_FORMAT_444;
- default:
- assert(0);
- }
-
- return -1;
-}
-
-VAStatus
-vlVaCreateSurfaces(VADriverContextP ctx, int width, int height, int format,
- int num_surfaces, VASurfaceID *surfaces)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- /* We only support one format */
- if (VA_RT_FORMAT_YUV420 != format)
- return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
-
- if (!(width && height))
- return VA_STATUS_ERROR_INVALID_IMAGE_FORMAT;
-
- if (!vlCreateHTAB())
- return VA_STATUS_ERROR_UNKNOWN;
-
- vlVaSurfacePriv *va_surface = (vlVaSurfacePriv *)CALLOC(num_surfaces,sizeof(vlVaSurfacePriv));
- if (!va_surface)
- return VA_STATUS_ERROR_ALLOCATION_FAILED;
-
- int n = 0;
- for (n = 0; n < num_surfaces; n++) {
- va_surface[n].width = width;
- va_surface[n].height = height;
- va_surface[n].format = VaRTFormatToPipe(format);
- va_surface[n].ctx = ctx;
- surfaces[n] = vlAddDataHTAB((void *)(va_surface + n));
- }
-
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
-vlVaDestroySurfaces(VADriverContextP ctx, VASurfaceID *surface_list, int num_surfaces)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaSyncSurface(VADriverContextP ctx, VASurfaceID render_target)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaQuerySurfaceStatus(VADriverContextP ctx, VASurfaceID render_target, VASurfaceStatus *status)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface, void* draw, short srcx, short srcy,
- unsigned short srcw, unsigned short srch, short destx, short desty,
- unsigned short destw, unsigned short desth, VARectangle *cliprects,
- unsigned int number_cliprects, unsigned int flags)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaLockSurface(VADriverContextP ctx, VASurfaceID surface, unsigned int *fourcc,
- unsigned int *luma_stride, unsigned int *chroma_u_stride, unsigned int *chroma_v_stride,
- unsigned int *luma_offset, unsigned int *chroma_u_offset, unsigned int *chroma_v_offset,
- unsigned int *buffer_name, void **buffer)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
-
-VAStatus
-vlVaUnlockSurface(VADriverContextP ctx, VASurfaceID surface)
-{
- if (!ctx)
- return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
-}
+++ /dev/null
-# This makefile template is used to build "driver"_drv_video.so
-
-LIBNAME = lib$(LIBBASENAME).so
-VA_LIB_GLOB= lib$(LIBBASENAME).*so*
-VA_MAJOR = 0
-VA_MINOR = 3
-INCLUDES = -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/winsys \
- $(DRIVER_INCLUDES)
-DEFINES = -DGALLIUM_TRACE -DVER_MAJOR=$(VA_MAJOR) -DVER_MINOR=$(VA_MINOR) $(DRIVER_DEFINES)
-LIBS = $(DRIVER_LIBS) -lva -lXext -lX11 -lm
-STATE_TRACKER_LIB = $(TOP)/src/gallium/state_trackers/va/libvatracker.a
-
-ifeq ($(MESA_LLVM),1)
-LDFLAGS += $(LLVM_LDFLAGS)
-DRIVER_EXTRAS = $(LLVM_LIBS)
-LD=$(CXX)
-else
- ifeq ($(LINK_WITH_CXX),1)
- LD=$(CXX)
- else
- LD=$(CC)
- endif
-endif
-
-# XXX: Hack, VA public funcs aren't exported
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o) \
- $(TOP)/src/gallium/state_trackers/va/*.o
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-##### TARGETS #####
-
-default: depend symlinks $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME)
-
-$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(OBJECTS) $(PIPE_DRIVERS) $(STATE_TRACKER_LIB) Makefile
- $(MKLIB) -o $(LIBBASENAME) -linker '$(LD)' -ldflags '$(LDFLAGS)' \
- -major $(VA_MAJOR) -minor $(VA_MINOR) $(MKLIB_OPTIONS) \
- -install $(TOP)/$(LIB_DIR)/gallium \
- $(OBJECTS) $(STATE_TRACKER_LIB) $(PIPE_DRIVERS) $(LIBS) $(DRIVER_EXTRAS)
-
-$(TOP)/$(LIB_DIR)/gallium:
- mkdir -p $@
-
-depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
- rm -f depend
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) \
- $(ASM_SOURCES) 2> /dev/null
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-# Remove .o and backup files
-clean:
- -rm -f $(OBJECTS) *~ *.so $(SYMLINKS)
- -rm -f depend depend.bak
-
-install: default
- $(INSTALL) -d $(DESTDIR)$(VA_LIB_INSTALL_DIR)
- $(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(VA_LIB_GLOB) $(DESTDIR)$(VA_LIB_INSTALL_DIR)
-
-include depend
+++ /dev/null
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBBASENAME = r300_drv_video
-
-DRIVER_DEFINES = -DGALLIUM_SOFTPIPE
-DRIVER_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/drivers/r300/libr300.a \
- $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/auxiliary/libgallium.a
-
-C_SOURCES = \
- target.c \
- $(TOP)/src/gallium/auxiliary/vl/vl_winsys_dri.c \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-
-include ../Makefile.va
-
-symlinks:
+++ /dev/null
-#include "state_tracker/drm_driver.h"
-#include "target-helpers/inline_debug_helper.h"
-#include "radeon/drm/radeon_drm_public.h"
-#include "r300/r300_public.h"
-
-static struct pipe_screen *create_screen(int fd)
-{
- struct radeon_winsys *radeon;
- struct pipe_screen *screen;
-
- radeon = radeon_drm_winsys_create(fd);
- if (!radeon)
- return NULL;
-
- screen = r300_screen_create(radeon);
- if (!screen)
- return NULL;
-
- screen = debug_screen_wrap(screen);
-
- return screen;
-}
-
-DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen, NULL)
+++ /dev/null
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBBASENAME = r600_drv_video
-
-DRIVER_DEFINES = -DGALLIUM_SOFTPIPE
-DRIVER_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/drivers/r600/libr600.a \
- $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/auxiliary/libgallium.a
-
-C_SOURCES = \
- target.c \
- $(TOP)/src/gallium/auxiliary/vl/vl_winsys_dri.c \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-
-include ../Makefile.va
-
-symlinks:
+++ /dev/null
-#include "state_tracker/drm_driver.h"
-#include "target-helpers/inline_debug_helper.h"
-#include "radeon/drm/radeon_drm_public.h"
-#include "r600/r600_public.h"
-
-static struct pipe_screen *create_screen(int fd)
-{
- struct radeon_winsys *radeon;
- struct pipe_screen *screen;
-
- radeon = radeon_drm_winsys_create(fd);
- if (!radeon)
- return NULL;
-
- screen = r600_screen_create(radeon);
- if (!screen)
- return NULL;
-
- screen = debug_screen_wrap(screen);
-
- return screen;
-}
-
-DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, NULL)
+++ /dev/null
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBBASENAME = softpipe_drv_video
-
-DRIVER_DEFINES = -DGALLIUM_SOFTPIPE
-DRIVER_INCLUDES =
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/auxiliary/libgallium.a
-
-C_SOURCES = \
- $(TOP)/src/gallium/auxiliary/vl/vl_winsys_xsp.c
-
-DRIVER_LIBS =
-
-include ../Makefile.va
-
-symlinks: