tree: add the driver_data parameter to the IMAGE macro as well

The IMAGE macro takes an implicit driver_data argument. In order to make
it obvious that we need it, let's put it as an explicit parameter.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
Maxime Ripard
2018-07-16 14:06:26 +02:00
parent b4605a08bd
commit 3119125a2a
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ VAStatus RequestCreateImage(VADriverContextP context, VAImageFormat *format,
size += destination_sizes[i]; size += destination_sizes[i];
id = object_heap_allocate(&driver_data->image_heap); id = object_heap_allocate(&driver_data->image_heap);
image_object = IMAGE(id); image_object = IMAGE(driver_data, id);
if (image_object == NULL) if (image_object == NULL)
return VA_STATUS_ERROR_ALLOCATION_FAILED; return VA_STATUS_ERROR_ALLOCATION_FAILED;
@@ -102,7 +102,7 @@ VAStatus RequestDestroyImage(VADriverContextP context, VAImageID image_id)
struct object_image *image_object; struct object_image *image_object;
VAStatus status; VAStatus status;
image_object = IMAGE(image_id); image_object = IMAGE(driver_data, image_id);
if (image_object == NULL) if (image_object == NULL)
return VA_STATUS_ERROR_INVALID_IMAGE; return VA_STATUS_ERROR_INVALID_IMAGE;
+2 -3
View File
@@ -30,9 +30,8 @@
#include "object_heap.h" #include "object_heap.h"
#define IMAGE(id) \ #define IMAGE(data, id) \
((struct object_image *)object_heap_lookup(&driver_data->image_heap, \ ((struct object_image *)object_heap_lookup(&(data)->image_heap, id))
id))
#define IMAGE_ID_OFFSET 0x10000000 #define IMAGE_ID_OFFSET 0x10000000
struct object_image { struct object_image {