From 3119125a2aa2fc36240cfe9d40725bd1634dcf06 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 16 Jul 2018 14:06:26 +0200 Subject: [PATCH] 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 --- src/image.c | 4 ++-- src/image.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/image.c b/src/image.c index 1c008af..57d9b3e 100644 --- a/src/image.c +++ b/src/image.c @@ -63,7 +63,7 @@ VAStatus RequestCreateImage(VADriverContextP context, VAImageFormat *format, size += destination_sizes[i]; id = object_heap_allocate(&driver_data->image_heap); - image_object = IMAGE(id); + image_object = IMAGE(driver_data, id); if (image_object == NULL) return VA_STATUS_ERROR_ALLOCATION_FAILED; @@ -102,7 +102,7 @@ VAStatus RequestDestroyImage(VADriverContextP context, VAImageID image_id) struct object_image *image_object; VAStatus status; - image_object = IMAGE(image_id); + image_object = IMAGE(driver_data, image_id); if (image_object == NULL) return VA_STATUS_ERROR_INVALID_IMAGE; diff --git a/src/image.h b/src/image.h index 40dc984..77aaea5 100644 --- a/src/image.h +++ b/src/image.h @@ -30,9 +30,8 @@ #include "object_heap.h" -#define IMAGE(id) \ - ((struct object_image *)object_heap_lookup(&driver_data->image_heap, \ - id)) +#define IMAGE(data, id) \ + ((struct object_image *)object_heap_lookup(&(data)->image_heap, id)) #define IMAGE_ID_OFFSET 0x10000000 struct object_image {