diff options
author | Chia-I Wu <[email protected]> | 2015-06-23 23:59:31 -0600 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-06-26 13:45:27 +0800 |
commit | 36d107e92cc4c1d2b60e0017dbe998af3a2e8b75 (patch) | |
tree | 6e99dec878e136e59116dd69626bceea5a6c1f30 /src/gallium/drivers/ilo/ilo_resource.h | |
parent | fbba25bba017b3dde5f6613698004b0086bdea00 (diff) |
ilo: introduce ilo_vma
This cleans up the code a bit and makes ilo_state_vector_resource_renamed()
simpler and more robust. It also allows a single bo to back mulitple VMAs.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.h')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_resource.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gallium/drivers/ilo/ilo_resource.h b/src/gallium/drivers/ilo/ilo_resource.h index d602e0cbf70..0357499f44a 100644 --- a/src/gallium/drivers/ilo/ilo_resource.h +++ b/src/gallium/drivers/ilo/ilo_resource.h @@ -31,6 +31,7 @@ #include "core/intel_winsys.h" #include "core/ilo_buffer.h" #include "core/ilo_image.h" +#include "core/ilo_vma.h" #include "ilo_common.h" #include "ilo_screen.h" @@ -93,6 +94,8 @@ struct ilo_texture { bool imported; struct ilo_image image; + struct ilo_vma vma; + struct ilo_vma aux_vma; /* XXX thread-safety */ struct ilo_texture_slice *slices[PIPE_MAX_TEXTURE_LEVELS]; @@ -104,13 +107,14 @@ struct ilo_buffer_resource { struct pipe_resource base; struct ilo_buffer buffer; + struct ilo_vma vma; }; -static inline struct ilo_buffer * -ilo_buffer(struct pipe_resource *res) +static inline struct ilo_buffer_resource * +ilo_buffer_resource(struct pipe_resource *res) { - return (res && res->target == PIPE_BUFFER) ? - &((struct ilo_buffer_resource *) res)->buffer : NULL; + return (struct ilo_buffer_resource *) + ((res && res->target == PIPE_BUFFER) ? res : NULL); } static inline struct ilo_texture * @@ -127,13 +131,14 @@ bool ilo_resource_rename_bo(struct pipe_resource *res); /** - * Return the bo of the resource. + * Return the VMA of the resource. */ -static inline struct intel_bo * -ilo_resource_get_bo(struct pipe_resource *res) +static inline const struct ilo_vma * +ilo_resource_get_vma(struct pipe_resource *res) { return (res->target == PIPE_BUFFER) ? - ilo_buffer(res)->bo : ilo_texture(res)->image.bo; + &((struct ilo_buffer_resource *) res)->vma : + &((struct ilo_texture *) res)->vma; } static inline struct ilo_texture_slice * |