surface: Add basic support for CreateSurfaces2

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
Paul Kocialkowski
2018-07-18 14:20:19 +02:00
parent 3119125a2a
commit 829abae895
3 changed files with 21 additions and 3 deletions
+1
View File
@@ -86,6 +86,7 @@ VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP context)
vtable->vaDestroyConfig = RequestDestroyConfig; vtable->vaDestroyConfig = RequestDestroyConfig;
vtable->vaGetConfigAttributes = RequestGetConfigAttributes; vtable->vaGetConfigAttributes = RequestGetConfigAttributes;
vtable->vaCreateSurfaces = RequestCreateSurfaces; vtable->vaCreateSurfaces = RequestCreateSurfaces;
vtable->vaCreateSurfaces2 = RequestCreateSurfaces2;
vtable->vaDestroySurfaces = RequestDestroySurfaces; vtable->vaDestroySurfaces = RequestDestroySurfaces;
vtable->vaCreateContext = RequestCreateContext; vtable->vaCreateContext = RequestCreateContext;
vtable->vaDestroyContext = RequestDestroyContext; vtable->vaDestroyContext = RequestDestroyContext;
+14 -3
View File
@@ -42,9 +42,12 @@
#include "v4l2.h" #include "v4l2.h"
#include "video.h" #include "video.h"
VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height, VAStatus RequestCreateSurfaces2(VADriverContextP context, unsigned int format,
int format, int surfaces_count, unsigned int width, unsigned int height,
VASurfaceID *surfaces_ids) VASurfaceID *surfaces_ids,
unsigned int surfaces_count,
VASurfaceAttrib *attributes,
unsigned int attributes_count)
{ {
struct request_data *driver_data = context->pDriverData; struct request_data *driver_data = context->pDriverData;
struct object_surface *surface_object; struct object_surface *surface_object;
@@ -171,6 +174,14 @@ VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height,
return VA_STATUS_SUCCESS; return VA_STATUS_SUCCESS;
} }
VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height,
int format, int surfaces_count,
VASurfaceID *surfaces_ids)
{
return RequestCreateSurfaces2(context, format, width, height,
surfaces_ids, surfaces_count, NULL, 0);
}
VAStatus RequestDestroySurfaces(VADriverContextP context, VAStatus RequestDestroySurfaces(VADriverContextP context,
VASurfaceID *surfaces_ids, int surfaces_count) VASurfaceID *surfaces_ids, int surfaces_count)
{ {
+6
View File
@@ -75,6 +75,12 @@ struct object_surface {
int request_fd; int request_fd;
}; };
VAStatus RequestCreateSurfaces2(VADriverContextP context, unsigned int format,
unsigned int width, unsigned int height,
VASurfaceID *surfaces_ids,
unsigned int surfaces_count,
VASurfaceAttrib *attributes,
unsigned int attributes_count);
VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height, VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height,
int format, int surfaces_count, int format, int surfaces_count,
VASurfaceID *surfaces_ids); VASurfaceID *surfaces_ids);