tree: Change the macros to take the actual arguments they are using

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
Maxime Ripard
2018-07-13 16:00:08 +02:00
parent 18331ff41d
commit fd263773cc
9 changed files with 25 additions and 25 deletions
+3 -3
View File
@@ -66,7 +66,7 @@ VAStatus SunxiCedrusCreateConfig(VADriverContextP context, VAProfile profile,
attributes_count = SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES; attributes_count = SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES;
id = object_heap_allocate(&driver_data->config_heap); id = object_heap_allocate(&driver_data->config_heap);
config_object = CONFIG(id); config_object = CONFIG(driver_data, id);
if (config_object == NULL) if (config_object == NULL)
return VA_STATUS_ERROR_ALLOCATION_FAILED; return VA_STATUS_ERROR_ALLOCATION_FAILED;
@@ -94,7 +94,7 @@ VAStatus SunxiCedrusDestroyConfig(VADriverContextP context,
(struct sunxi_cedrus_driver_data *) context->pDriverData; (struct sunxi_cedrus_driver_data *) context->pDriverData;
struct object_config *config_object; struct object_config *config_object;
config_object = CONFIG(config_id); config_object = CONFIG(driver_data, config_id);
if (config_object == NULL) if (config_object == NULL)
return VA_STATUS_ERROR_INVALID_CONFIG; return VA_STATUS_ERROR_INVALID_CONFIG;
@@ -163,7 +163,7 @@ VAStatus SunxiCedrusQueryConfigAttributes(VADriverContextP context,
struct object_config *config_object; struct object_config *config_object;
int i; int i;
config_object = CONFIG(config_id); config_object = CONFIG(driver_data, config_id);
if (config_object == NULL) if (config_object == NULL)
return VA_STATUS_ERROR_INVALID_CONFIG; return VA_STATUS_ERROR_INVALID_CONFIG;
+1 -1
View File
@@ -30,7 +30,7 @@
#include "object_heap.h" #include "object_heap.h"
#define CONFIG(id) ((struct object_config *) object_heap_lookup(&driver_data->config_heap, id)) #define CONFIG(data, id) ((struct object_config *) object_heap_lookup(&(data)->config_heap, id))
#define CONFIG_ID_OFFSET 0x01000000 #define CONFIG_ID_OFFSET 0x01000000
struct object_config { struct object_config {
+4 -4
View File
@@ -61,14 +61,14 @@ VAStatus SunxiCedrusCreateContext(VADriverContextP context,
unsigned int i; unsigned int i;
int rc; int rc;
config_object = CONFIG(config_id); config_object = CONFIG(driver_data, config_id);
if (config_object == NULL) { if (config_object == NULL) {
status = VA_STATUS_ERROR_INVALID_CONFIG; status = VA_STATUS_ERROR_INVALID_CONFIG;
goto error; goto error;
} }
id = object_heap_allocate(&driver_data->context_heap); id = object_heap_allocate(&driver_data->context_heap);
context_object = CONTEXT(id); context_object = CONTEXT(driver_data, id);
if (context_object == NULL) { if (context_object == NULL) {
status = VA_STATUS_ERROR_ALLOCATION_FAILED; status = VA_STATUS_ERROR_ALLOCATION_FAILED;
goto error; goto error;
@@ -119,7 +119,7 @@ VAStatus SunxiCedrusCreateContext(VADriverContextP context,
memcpy(ids, surfaces_ids, surfaces_count * sizeof(VASurfaceID)); memcpy(ids, surfaces_ids, surfaces_count * sizeof(VASurfaceID));
for (i = 0; i < surfaces_count; i++) { for (i = 0; i < surfaces_count; i++) {
surface_object = SURFACE(surfaces_ids[i]); surface_object = SURFACE(driver_data, surfaces_ids[i]);
if (surface_object == NULL) { if (surface_object == NULL) {
status = VA_STATUS_ERROR_INVALID_SURFACE; status = VA_STATUS_ERROR_INVALID_SURFACE;
goto error; goto error;
@@ -190,7 +190,7 @@ VAStatus SunxiCedrusDestroyContext(VADriverContextP context,
struct object_context *context_object; struct object_context *context_object;
int rc; int rc;
context_object = CONTEXT(context_id); context_object = CONTEXT(driver_data, context_id);
if (context_object == NULL) if (context_object == NULL)
return VA_STATUS_ERROR_INVALID_CONTEXT; return VA_STATUS_ERROR_INVALID_CONTEXT;
+1 -1
View File
@@ -30,7 +30,7 @@
#include "object_heap.h" #include "object_heap.h"
#define CONTEXT(id) ((struct object_context *) object_heap_lookup(&driver_data->context_heap, id)) #define CONTEXT(data, id) ((struct object_context *) object_heap_lookup(&(data)->context_heap, id))
#define CONTEXT_ID_OFFSET 0x02000000 #define CONTEXT_ID_OFFSET 0x02000000
struct object_context { struct object_context {
+1 -1
View File
@@ -123,7 +123,7 @@ VAStatus SunxiCedrusDeriveImage(VADriverContextP context,
VAImageFormat format; VAImageFormat format;
VAStatus status; VAStatus status;
surface_object = SURFACE(surface_id); surface_object = SURFACE(driver_data, surface_id);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_INVALID_SURFACE; return VA_STATUS_ERROR_INVALID_SURFACE;
+2 -2
View File
@@ -68,13 +68,13 @@ int mpeg2_set_controls(struct sunxi_cedrus_driver_data *driver_data,
slice_params.intra_vlc_format = parameters->picture_coding_extension.bits.intra_vlc_format; slice_params.intra_vlc_format = parameters->picture_coding_extension.bits.intra_vlc_format;
slice_params.alternate_scan = parameters->picture_coding_extension.bits.alternate_scan; slice_params.alternate_scan = parameters->picture_coding_extension.bits.alternate_scan;
forward_reference_surface = SURFACE(parameters->forward_reference_picture); forward_reference_surface = SURFACE(driver_data, parameters->forward_reference_picture);
if (forward_reference_surface != NULL) if (forward_reference_surface != NULL)
slice_params.forward_ref_index = forward_reference_surface->destination_index; slice_params.forward_ref_index = forward_reference_surface->destination_index;
else else
slice_params.forward_ref_index = surface_object->destination_index; slice_params.forward_ref_index = surface_object->destination_index;
backward_reference_surface = SURFACE(parameters->backward_reference_picture); backward_reference_surface = SURFACE(driver_data, parameters->backward_reference_picture);
if (backward_reference_surface != NULL) if (backward_reference_surface != NULL)
slice_params.backward_ref_index = backward_reference_surface->destination_index; slice_params.backward_ref_index = backward_reference_surface->destination_index;
else else
+8 -8
View File
@@ -155,11 +155,11 @@ VAStatus SunxiCedrusBeginPicture(VADriverContextP context,
struct object_context *context_object; struct object_context *context_object;
struct object_surface *surface_object; struct object_surface *surface_object;
context_object = CONTEXT(context_id); context_object = CONTEXT(driver_data, context_id);
if (context_object == NULL) if (context_object == NULL)
return VA_STATUS_ERROR_INVALID_CONTEXT; return VA_STATUS_ERROR_INVALID_CONTEXT;
surface_object = SURFACE(surface_id); surface_object = SURFACE(driver_data, surface_id);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_INVALID_SURFACE; return VA_STATUS_ERROR_INVALID_SURFACE;
@@ -184,15 +184,15 @@ VAStatus SunxiCedrusRenderPicture(VADriverContextP context,
int rc; int rc;
int i; int i;
context_object = CONTEXT(context_id); context_object = CONTEXT(driver_data, context_id);
if (context_object == NULL) if (context_object == NULL)
return VA_STATUS_ERROR_INVALID_CONTEXT; return VA_STATUS_ERROR_INVALID_CONTEXT;
config_object = CONFIG(context_object->config_id); config_object = CONFIG(driver_data, context_object->config_id);
if (config_object == NULL) if (config_object == NULL)
return VA_STATUS_ERROR_INVALID_CONFIG; return VA_STATUS_ERROR_INVALID_CONFIG;
surface_object = SURFACE(context_object->render_surface_id); surface_object = SURFACE(driver_data, context_object->render_surface_id);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_INVALID_SURFACE; return VA_STATUS_ERROR_INVALID_SURFACE;
@@ -221,15 +221,15 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context,
VAStatus status; VAStatus status;
int rc; int rc;
context_object = CONTEXT(context_id); context_object = CONTEXT(driver_data, context_id);
if (context_object == NULL) if (context_object == NULL)
return VA_STATUS_ERROR_INVALID_CONTEXT; return VA_STATUS_ERROR_INVALID_CONTEXT;
config_object = CONFIG(context_object->config_id); config_object = CONFIG(driver_data, context_object->config_id);
if (config_object == NULL) if (config_object == NULL)
return VA_STATUS_ERROR_INVALID_CONFIG; return VA_STATUS_ERROR_INVALID_CONFIG;
surface_object = SURFACE(context_object->render_surface_id); surface_object = SURFACE(driver_data, context_object->render_surface_id);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_INVALID_SURFACE; return VA_STATUS_ERROR_INVALID_SURFACE;
+4 -4
View File
@@ -84,7 +84,7 @@ VAStatus SunxiCedrusCreateSurfaces(VADriverContextP context, int width,
for (i = 0; i < surfaces_count; i++) { for (i = 0; i < surfaces_count; i++) {
id = object_heap_allocate(&driver_data->surface_heap); id = object_heap_allocate(&driver_data->surface_heap);
surface_object = SURFACE(id); surface_object = SURFACE(driver_data, id);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_ALLOCATION_FAILED; return VA_STATUS_ERROR_ALLOCATION_FAILED;
@@ -149,7 +149,7 @@ VAStatus SunxiCedrusDestroySurfaces(VADriverContextP context,
unsigned int i, j; unsigned int i, j;
for (i = 0; i < surfaces_count; i++) { for (i = 0; i < surfaces_count; i++) {
surface_object = SURFACE(surfaces_ids[i]); surface_object = SURFACE(driver_data, surfaces_ids[i]);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_INVALID_SURFACE; return VA_STATUS_ERROR_INVALID_SURFACE;
@@ -182,7 +182,7 @@ VAStatus SunxiCedrusSyncSurface(VADriverContextP context,
int request_fd = -1; int request_fd = -1;
int rc; int rc;
surface_object = SURFACE(surface_id); surface_object = SURFACE(driver_data, surface_id);
if (surface_object == NULL) { if (surface_object == NULL) {
status = VA_STATUS_ERROR_INVALID_SURFACE; status = VA_STATUS_ERROR_INVALID_SURFACE;
goto error; goto error;
@@ -251,7 +251,7 @@ VAStatus SunxiCedrusQuerySurfaceStatus(VADriverContextP context,
(struct sunxi_cedrus_driver_data *) context->pDriverData; (struct sunxi_cedrus_driver_data *) context->pDriverData;
struct object_surface *surface_object; struct object_surface *surface_object;
surface_object = SURFACE(surface_id); surface_object = SURFACE(driver_data, surface_id);
if (surface_object == NULL) if (surface_object == NULL)
return VA_STATUS_ERROR_INVALID_SURFACE; return VA_STATUS_ERROR_INVALID_SURFACE;
+1 -1
View File
@@ -32,7 +32,7 @@
#include "object_heap.h" #include "object_heap.h"
#define SURFACE(id) ((struct object_surface *) object_heap_lookup(&driver_data->surface_heap, id)) #define SURFACE(data, id) ((struct object_surface *) object_heap_lookup(&(data)->surface_heap, id))
#define SURFACE_ID_OFFSET 0x04000000 #define SURFACE_ID_OFFSET 0x04000000
struct object_surface { struct object_surface {