From 3afbeb115ab19164fb2e5bf8df88b6d03d39254b Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 25 Mar 2015 12:22:40 +0800 Subject: ilo: move BOs from ilo_texture to ilo_image We want to work with ilo_image instead of ilo_texture in core. --- src/gallium/drivers/ilo/core/ilo_image.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/gallium/drivers/ilo/core') diff --git a/src/gallium/drivers/ilo/core/ilo_image.h b/src/gallium/drivers/ilo/core/ilo_image.h index 722a666991d..2ca48b7960f 100644 --- a/src/gallium/drivers/ilo/core/ilo_image.h +++ b/src/gallium/drivers/ilo/core/ilo_image.h @@ -29,6 +29,7 @@ #define ILO_IMAGE_H #include "genhw/genhw.h" +#include "intel_winsys.h" #include "ilo_core.h" #include "ilo_dev.h" @@ -122,6 +123,9 @@ struct ilo_image { unsigned aux_layer_height; unsigned aux_stride; unsigned aux_height; + + struct intel_bo *bo; + struct intel_bo *aux_bo; }; void @@ -134,6 +138,27 @@ ilo_image_update_for_imported_bo(struct ilo_image *img, enum gen_surface_tiling tiling, unsigned bo_stride); +static inline void +ilo_image_cleanup(struct ilo_image *img) +{ + intel_bo_unref(img->bo); + intel_bo_unref(img->aux_bo); +} + +static inline void +ilo_image_set_bo(struct ilo_image *img, struct intel_bo *bo) +{ + intel_bo_unref(img->bo); + img->bo = intel_bo_ref(bo); +} + +static inline void +ilo_image_set_aux_bo(struct ilo_image *img, struct intel_bo *bo) +{ + intel_bo_unref(img->aux_bo); + img->aux_bo = intel_bo_ref(bo); +} + /** * Convert from pixel position to 2D memory offset. */ -- cgit v1.2.3