diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2014-09-25 14:53:34 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2014-09-26 21:15:55 +0800 |
commit | ce2bda300d00bf4fa92b287ff257f7c5fd17e81e (patch) | |
tree | 1f689bdbfc3dca2a1b401054f765c3008f52fe45 /src/gallium | |
parent | 2df2f60e8db7e2fe4d59377c8c849d6e8eb6234e (diff) |
ilo: add ilo_builder_{dynamic,surface}_used()
Return how many DWords are used in dynamic and surface buffers respectively.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_builder.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/ilo_builder.h b/src/gallium/drivers/ilo/ilo_builder.h index 8203f669806..259487e1346 100644 --- a/src/gallium/drivers/ilo/ilo_builder.h +++ b/src/gallium/drivers/ilo/ilo_builder.h @@ -311,6 +311,15 @@ ilo_builder_dynamic_write(struct ilo_builder *builder, return offset; } +static inline unsigned +ilo_builder_dynamic_used(const struct ilo_builder *builder) +{ + const enum ilo_builder_writer_type which = ILO_BUILDER_WRITER_BATCH; + const struct ilo_builder_writer *writer = &builder->writers[which]; + + return writer->stolen >> 2; +} + /** * Write a surface state to the surface buffer. The offset, in bytes, of the * state is returned. @@ -344,6 +353,12 @@ ilo_builder_surface_reloc(struct ilo_builder *builder, bo, bo_offset, reloc_flags); } +static inline unsigned +ilo_builder_surface_used(const struct ilo_builder *builder) +{ + return ilo_builder_dynamic_used(builder); +} + /** * Write a kernel to the instruction buffer. The offset, in bytes, of the * kernel is returned. |