surface: Use object surface structure directly instead of abstract type

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
Paul Kocialkowski
2018-04-23 10:06:11 +02:00
parent 6a06b4570b
commit 97950176ad
8 changed files with 25 additions and 27 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ VAStatus sunxi_cedrus_DeriveImage(VADriverContextP ctx, VASurfaceID surface,
VAImage *image)
{
INIT_DRIVER_DATA
object_surface_p obj_surface;
struct object_surface *obj_surface;
VAImageFormat fmt;
struct object_buffer *obj_buffer;
VAStatus ret;
+4 -4
View File
@@ -40,7 +40,7 @@
*/
VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer)
{
INIT_DRIVER_DATA
@@ -53,7 +53,7 @@ VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx,
}
VAStatus sunxi_cedrus_render_mpeg2_picture_parameter(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer)
{
INIT_DRIVER_DATA
@@ -80,13 +80,13 @@ VAStatus sunxi_cedrus_render_mpeg2_picture_parameter(VADriverContextP ctx,
obj_context->mpeg2_frame_hdr.intra_vlc_format = pic_param->picture_coding_extension.bits.intra_vlc_format;
obj_context->mpeg2_frame_hdr.alternate_scan = pic_param->picture_coding_extension.bits.alternate_scan;
object_surface_p fwd_surface = SURFACE(pic_param->forward_reference_picture);
struct object_surface *fwd_surface = SURFACE(pic_param->forward_reference_picture);
if(fwd_surface)
obj_context->mpeg2_frame_hdr.forward_index = fwd_surface->output_buf_index;
else
obj_context->mpeg2_frame_hdr.forward_index = obj_surface->output_buf_index;
object_surface_p bwd_surface = SURFACE(pic_param->backward_reference_picture);
struct object_surface *bwd_surface = SURFACE(pic_param->backward_reference_picture);
if(bwd_surface)
obj_context->mpeg2_frame_hdr.backward_index = bwd_surface->output_buf_index;
else
+2 -2
View File
@@ -34,11 +34,11 @@
#include "surface.h"
VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer);
VAStatus sunxi_cedrus_render_mpeg2_picture_parameter(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer);
#endif /* _MPEG2_H_ */
+5 -5
View File
@@ -40,7 +40,7 @@
*/
VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer)
{
INIT_DRIVER_DATA
@@ -71,7 +71,7 @@ VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx,
}
VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer)
{
INIT_DRIVER_DATA
@@ -107,12 +107,12 @@ VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx,
obj_context->mpeg4_frame_hdr.trb = pic_param->TRB;
obj_context->mpeg4_frame_hdr.trd = pic_param->TRD;
object_surface_p fwd_surface = SURFACE(pic_param->forward_reference_picture);
struct object_surface *fwd_surface = SURFACE(pic_param->forward_reference_picture);
if(fwd_surface)
obj_context->mpeg4_frame_hdr.forward_index = fwd_surface->output_buf_index;
else
obj_context->mpeg4_frame_hdr.forward_index = obj_surface->output_buf_index;
object_surface_p bwd_surface = SURFACE(pic_param->backward_reference_picture);
struct object_surface *bwd_surface = SURFACE(pic_param->backward_reference_picture);
if(bwd_surface)
obj_context->mpeg4_frame_hdr.backward_index = bwd_surface->output_buf_index;
else
@@ -122,7 +122,7 @@ VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx,
}
VAStatus sunxi_cedrus_render_mpeg4_slice_parameter(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer)
{
VASliceParameterBufferMPEG4 *slice_param = (VASliceParameterBufferMPEG4 *)obj_buffer->buffer_data;
+3 -3
View File
@@ -34,15 +34,15 @@
#include "surface.h"
VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer);
VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer);
VAStatus sunxi_cedrus_render_mpeg4_slice_parameter(VADriverContextP ctx,
struct object_context *obj_context, object_surface_p obj_surface,
struct object_context *obj_context, struct object_surface *obj_surface,
struct object_buffer *obj_buffer);
#endif /* _MPEG4_H_ */
+3 -3
View File
@@ -56,7 +56,7 @@ VAStatus sunxi_cedrus_BeginPicture(VADriverContextP ctx, VAContextID context,
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
struct object_context *obj_context;
object_surface_p obj_surface;
struct object_surface *obj_surface;
obj_context = CONTEXT(context);
assert(obj_context);
@@ -86,7 +86,7 @@ VAStatus sunxi_cedrus_RenderPicture(VADriverContextP ctx, VAContextID context,
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
struct object_context *obj_context;
object_surface_p obj_surface;
struct object_surface *obj_surface;
object_config_p obj_config;
int i;
@@ -145,7 +145,7 @@ VAStatus sunxi_cedrus_EndPicture(VADriverContextP ctx, VAContextID context)
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
struct object_context *obj_context;
object_surface_p obj_surface;
struct object_surface *obj_surface;
struct v4l2_buffer out_buf, cap_buf;
struct v4l2_plane plane[1];
struct v4l2_plane planes[2];
+6 -6
View File
@@ -90,7 +90,7 @@ VAStatus sunxi_cedrus_CreateSurfaces(VADriverContextP ctx, int width,
for (i = 0; i < create_bufs.count; i++)
{
VASurfaceID surfaceID = object_heap_allocate(&driver_data->surface_heap);
object_surface_p obj_surface = SURFACE(surfaceID);
struct object_surface *obj_surface = SURFACE(surfaceID);
if (NULL == obj_surface)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
@@ -132,7 +132,7 @@ VAStatus sunxi_cedrus_CreateSurfaces(VADriverContextP ctx, int width,
/* surfaces[i-1] was the last successful allocation */
for(; i--;)
{
object_surface_p obj_surface = SURFACE(surfaces[i]);
struct object_surface *obj_surface = SURFACE(surfaces[i]);
surfaces[i] = VA_INVALID_SURFACE;
assert(obj_surface);
object_heap_free(&driver_data->surface_heap, (object_base_p) obj_surface);
@@ -148,7 +148,7 @@ VAStatus sunxi_cedrus_DestroySurfaces(VADriverContextP ctx,
int i;
for(i = num_surfaces; i--;)
{
object_surface_p obj_surface = SURFACE(surface_list[i]);
struct object_surface *obj_surface = SURFACE(surface_list[i]);
assert(obj_surface);
object_heap_free(&driver_data->surface_heap, (object_base_p) obj_surface);
}
@@ -159,7 +159,7 @@ VAStatus sunxi_cedrus_SyncSurface(VADriverContextP ctx,
VASurfaceID render_target)
{
INIT_DRIVER_DATA
object_surface_p obj_surface;
struct object_surface *obj_surface;
struct v4l2_buffer buf;
struct v4l2_plane plane[1];
struct v4l2_plane planes[2];
@@ -227,7 +227,7 @@ VAStatus sunxi_cedrus_QuerySurfaceStatus(VADriverContextP ctx,
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_surface_p obj_surface;
struct object_surface *obj_surface;
obj_surface = SURFACE(render_target);
assert(obj_surface);
@@ -254,7 +254,7 @@ VAStatus sunxi_cedrus_PutSurface(VADriverContextP ctx, VASurfaceID surface,
Colormap cm;
int colorratio = 65535 / 255;
int x, y;
object_surface_p obj_surface;
struct object_surface *obj_surface;
obj_surface = SURFACE(surface);
assert(obj_surface);
+1 -3
View File
@@ -30,7 +30,7 @@
#include "object_heap.h"
#define SURFACE(id) ((object_surface_p) object_heap_lookup(&driver_data->surface_heap, id))
#define SURFACE(id) ((struct object_surface *) object_heap_lookup(&driver_data->surface_heap, id))
#define SURFACE_ID_OFFSET 0x04000000
struct object_surface {
@@ -44,8 +44,6 @@ struct object_surface {
VAStatus status;
};
typedef struct object_surface *object_surface_p;
VAStatus sunxi_cedrus_CreateSurfaces(VADriverContextP ctx, int width,
int height, int format, int num_surfaces, VASurfaceID *surfaces);