From: Thomas Balling Sørensen Date: Wed, 27 Oct 2010 09:00:11 +0000 (+0200) Subject: vl: commited Orasanu Lucian's patch containing va stubs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=990cb6296351a41a2e728f181c0dc096eaddaeb7;p=mesa.git vl: commited Orasanu Lucian's patch containing va stubs. --- diff --git a/configure.ac b/configure.ac index 5edd935920d..eac293f56aa 100644 --- a/configure.ac +++ b/configure.ac @@ -1623,6 +1623,9 @@ if test "x$enable_gallium_g3dvl" = xyes; then if test "x$HAVE_ST_VDPAU" = xyes; then GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe" fi + 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 diff --git a/src/gallium/state_trackers/va/Makefile b/src/gallium/state_trackers/va/Makefile index 1d6e303a4f1..1e22bb50d1d 100644 --- a/src/gallium/state_trackers/va/Makefile +++ b/src/gallium/state_trackers/va/Makefile @@ -15,7 +15,11 @@ C_SOURCES = htab.c \ ftab.c \ va_context.c \ va_image.c \ - va_subpicture.c + va_subpicture.c \ + va_buffer.c \ + va_config.c \ + va_picture.c \ + va_surface.c diff --git a/src/gallium/state_trackers/va/ftab.c b/src/gallium/state_trackers/va/ftab.c index 651b7660964..010c04a7d28 100644 --- a/src/gallium/state_trackers/va/ftab.c +++ b/src/gallium/state_trackers/va/ftab.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2010 Thomas Balling Sørensen. + * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -32,28 +32,28 @@ static struct VADriverVTable vtable = { - 0x1, /* VAStatus (*vaTerminate) ( VADriverContextP ctx ); */ - 0x2, /* VAStatus (*vaQueryConfigProfiles) ( VADriverContextP ctx, VAProfile *profile_list,int *num_profiles); */ - 0x3, /* VAStatus (*vaQueryConfigEntrypoints) ( VADriverContextP ctx, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints ); */ - 0x4, /* VAStatus (*vaGetConfigAttributes) ( VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs ); */ - 0x5, /* VAStatus (*vaCreateConfig) ( VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id); */ - 0x6, /* VAStatus (*vaDestroyConfig) ( VADriverContextP ctx, VAConfigID config_id); */ - 0x7, /* VAStatus (*vaQueryConfigAttributes) ( VADriverContextP ctx, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs); */ - 0x8, /* VAStatus (*vaCreateSurfaces) ( VADriverContextP ctx,int width,int height,int format,int num_surfaces,VASurfaceID *surfaces); */ - 0x9, /* VAStatus (*vaDestroySurfaces) ( VADriverContextP ctx, VASurfaceID *surface_list, int num_surfaces ); */ - 0x10, /* VAStatus (*vaCreateContext) (VADriverContextP ctx,VAConfigID config_id,int picture_width,int picture_height,int flag,VASurfaceID *render_targets,int num_render_targets,VAContextID *context); */ - 0x11, /* VAStatus (*vaDestroyContext) (VADriverContextP ctx,VAContextID context); */ - 0x12, /* VAStatus (*vaCreateBuffer) (VADriverContextP ctx,VAContextID context,VABufferType type,unsigned int size,unsigned int num_elements,void *data,VABufferID *buf_id); */ - 0x13, /* VAStatus (*vaBufferSetNumElements) (VADriverContextP ctx,VABufferID buf_id,unsigned int num_elements); */ - 0x14, /* VAStatus (*vaMapBuffer) (VADriverContextP ctx,VABufferID buf_id,void **pbuf); */ - 0x15, /* VAStatus (*vaUnmapBuffer) (VADriverContextP ctx,VABufferID buf_id); */ - 0x16, /* VAStatus (*vaDestroyBuffer) (VADriverContextP ctx,VABufferID buffer_id); */ - 0x17, /* VAStatus (*vaBeginPicture) (VADriverContextP ctx,VAContextID context,VASurfaceID render_target); */ - 0x18, /* VAStatus (*vaRenderPicture) (VADriverContextP ctx,VAContextID context,VABufferID *buffers,int num_buffers); */ - 0x19, /* VAStatus (*vaEndPicture) (VADriverContextP ctx,VAContextID context); */ - 0x20, /* VAStatus (*vaSyncSurface) (VADriverContextP ctx,VASurfaceID render_target); */ - 0x21, /* VAStatus (*vaQuerySurfaceStatus) (VADriverContextP ctx,VASurfaceID render_target,VASurfaceStatus *status); */ - 0x22, /* VAStatus (*vaPutSurface) ( + &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); */ + &vlVaDestroyBuffers, /* 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, @@ -65,16 +65,16 @@ static struct VADriverVTable vtable = short desty, unsigned short destw, unsigned short desth, - VARectangle *cliprects, - unsigned int number_cliprects, + 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); */ - 0x25, /* VAStatus (*vaDeriveImage) (VADriverContextP ctx,VASurfaceID surface,VAImage *image); */ - 0x26, /* VAStatus (*vaDestroyImage) (VADriverContextP ctx,VAImageID image); */ - 0x27, /* VAStatus (*vaSetImagePalette) (VADriverContextP ctx,VAImageID image, unsigned char *palette); */ - 0x28, /* VAStatus (*vaGetImage) (VADriverContextP ctx,VASurfaceID surface,int x,int y,unsigned int width,unsigned int height,VAImageID image); */ - 0x29, /* VAStatus (*vaPutImage) ( + &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, @@ -87,13 +87,13 @@ static struct VADriverVTable vtable = unsigned int dest_width, unsigned int dest_height ); */ - &vlVaQuerySubpictureFormats, /* VAStatus (*vaQuerySubpictureFormats) (VADriverContextP ctx,VAImageFormat *format_list,unsigned int *flags,unsigned int *num_formats); */ - 0x31, /* VAStatus (*vaCreateSubpicture) (VADriverContextP ctx,VAImageID image,VASubpictureID *subpicture); */ - 0x32, /* VAStatus (*vaDestroySubpicture) (VADriverContextP ctx,VASubpictureID subpicture); */ - 0x33, /* VAStatus (*vaSetSubpictureImage) (VADriverContextP ctx,VASubpictureID subpicture,VAImageID image); */ - 0x34, /* VAStatus (*vaSetSubpictureChromakey) (VADriverContextP ctx,VASubpictureID subpicture,unsigned int chromakey_min,unsigned int chromakey_max,unsigned int chromakey_mask); */ - 0x35, /* VAStatus (*vaSetSubpictureGlobalAlpha) (VADriverContextP ctx,VASubpictureID subpicture,float global_alpha); */ - 0x36, /* VAStatus (*vaAssociateSubpicture) ( + &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, @@ -107,12 +107,12 @@ static struct VADriverVTable vtable = unsigned short dest_width, unsigned short dest_height, unsigned int flags); */ - 0x37, /* VAStatus (*vaDeassociateSubpicture) (VADriverContextP ctx,VASubpictureID subpicture,VASurfaceID *target_surfaces,int num_surfaces); */ - 0x38, /* VAStatus (*vaQueryDisplayAttributes) (VADriverContextP ctx,VADisplayAttribute *attr_list,int *num_attributes); */ - 0x39, /* VAStatus (*vaGetDisplayAttributes) (VADriverContextP ctx,VADisplayAttribute *attr_list,int num_attributes); */ - 0x40, /* VAStatus (*vaSetDisplayAttributes) (VADriverContextP ctx,VADisplayAttribute *attr_list,int num_attributes); */ - 0x41, /* VAStatus (*vaBufferInfo) (VADriverContextP ctx,VAContextID context,VABufferID buf_id,VABufferType *type,unsigned int *size,unsigned int *num_elements); */ - 0x42, /* VAStatus (*vaLockSurface) ( + &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, @@ -124,11 +124,11 @@ static struct VADriverVTable vtable = unsigned int *chroma_v_offset, unsigned int *buffer_name, void **buffer); */ - 0x43, /* VAStatus (*vaUnlockSurface) (VADriverContextP ctx,VASurfaceID surface); */ - 0x44 /* struct VADriverVTableGLX *glx; "Optional" */ + &vlVaUnlockSurface, /* VAStatus (*vaUnlockSurface) (VADriverContextP ctx,VASurfaceID surface); */ + 0x44 /* struct VADriverVTableGLX *glx; "Optional" */ }; struct VADriverVTable vlVaGetVtable() { return vtable; -} \ No newline at end of file +} diff --git a/src/gallium/state_trackers/va/va_context.c b/src/gallium/state_trackers/va/va_context.c index 0b8d7865f73..7ef84606305 100644 --- a/src/gallium/state_trackers/va/va_context.c +++ b/src/gallium/state_trackers/va/va_context.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2010 Thomas Balling Sørensen. + * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -24,7 +24,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ - + #include #include #include @@ -39,7 +39,7 @@ VAStatus __vaDriverInit_0_31 (VADriverContextP ctx) { if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; - + ctx->str_vendor = "mesa gallium vaapi"; ctx->vtable = vlVaGetVtable(); ctx->max_attributes = 1; @@ -50,8 +50,40 @@ VAStatus __vaDriverInit_0_31 (VADriverContextP ctx) ctx->max_subpic_formats = 1; ctx->version_major = 3; ctx->version_minor = 1; - + VA_INFO("vl_screen_pointer %p\n",ctx->native_dpy); return VA_STATUS_SUCCESS; -} \ No newline at end of file +} + +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; +} diff --git a/src/gallium/state_trackers/va/va_image.c b/src/gallium/state_trackers/va/va_image.c index b7e1320a4e8..b1f990a15eb 100644 --- a/src/gallium/state_trackers/va/va_image.c +++ b/src/gallium/state_trackers/va/va_image.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2010 Thomas Balling Sørensen. + * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -24,33 +24,99 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ - - #include - #include - #include - #include - #include "va_private.h" - - VAStatus - vlVaQueryImageFormats ( VADriverContextP ctx, - VAImageFormat *format_list, - int *num_formats) + +#include +#include +#include +#include +#include "va_private.h" + +VAStatus +vlVaQueryImageFormats ( VADriverContextP ctx, + VAImageFormat *format_list, + int *num_formats) { if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; - + return VA_STATUS_ERROR_UNIMPLEMENTED; } VAStatus vlVaCreateImage( VADriverContextP ctx, - VAImageFormat *format, - int width, - int height, - VAImage *image) + VAImageFormat *format, + int width, + int height, + VAImage *image) +{ + if (!ctx) + return VA_STATUS_ERROR_INVALID_CONTEXT; + + return VA_STATUS_ERROR_UNIMPLEMENTED; +} + +VAStatus vlVaDeriveImage( VADriverContextP ctx, + VASurfaceID surface, + VAImage *image) { if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; - + + return VA_STATUS_ERROR_UNIMPLEMENTED; -} \ No newline at end of file +} + +VAStatus vlDestroyImage( VADriverContextP ctx, + VAImageID image) +{ + if (!ctx) + return VA_STATUS_ERROR_INVALID_CONTEXT; + + + return VA_STATUS_ERROR_UNIMPLEMENTED; +} + +VAStatus vlSetImagePalette( 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; +} diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h index ccaa5c053ea..3c9922e64fc 100644 --- a/src/gallium/state_trackers/va/va_private.h +++ b/src/gallium/state_trackers/va/va_private.h @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2010 Thomas Balling Sørensen. + * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -24,24 +24,110 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ - - #ifndef VA_PRIVATE_H - #define VA_PRIVATE_H - - #include - #include - #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__) + +#ifndef VA_PRIVATE_H +#define VA_PRIVATE_H + +#include +#include +#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__) // Public functions: VAStatus __vaDriverInit_0_31 (VADriverContextP ctx); // Private functions: struct VADriverVTable vlVaGetVtable(); +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 vlVaDestroyBuffers (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); - - #endif // VA_PRIVATE_H +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 diff --git a/src/gallium/state_trackers/va/va_subpicture.c b/src/gallium/state_trackers/va/va_subpicture.c index 211970913fa..9317d313c65 100644 --- a/src/gallium/state_trackers/va/va_subpicture.c +++ b/src/gallium/state_trackers/va/va_subpicture.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2010 Thomas Balling Sørensen. + * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -24,17 +24,102 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ - + #include #include #include "va_private.h" - -VAStatus -vlVaQuerySubpictureFormats( VADriverContextP ctx, - VAImageFormat *format_list, - unsigned int *flags, - unsigned int *num_formats) + +VAStatus +vlVaQuerySubpictureFormats( VADriverContextP ctx, + VAImageFormat *format_list, + unsigned int *flags, + unsigned int *num_formats) +{ + if (!ctx) + return VA_STATUS_ERROR_INVALID_CONTEXT; + + return VA_STATUS_ERROR_UNIMPLEMENTED; +} + + +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; -} \ No newline at end of file +} diff --git a/src/gallium/state_trackers/xorg/xvmc/context.c b/src/gallium/state_trackers/xorg/xvmc/context.c index 5e4af9e555a..688d68b6ea7 100644 --- a/src/gallium/state_trackers/xorg/xvmc/context.c +++ b/src/gallium/state_trackers/xorg/xvmc/context.c @@ -210,7 +210,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id, return BadImplementation; } if (mc_type != (XVMC_MOCOMP | XVMC_MPEG_2)) { - XVMC_MSG(XVMC_ERR, "[XvMC] Cannot decode requested surface type. Non-MPEG2/Mocomp acceleration unsupported.\n"); + XVMC_MSG(XVMC_ERR, "[XvMC] Cannot decode requested surface type. Non-MPEG2 acceleration unsupported.\n"); return BadImplementation; } if (!(surface_flags & XVMC_INTRA_UNSIGNED)) {