diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-11-18 10:44:31 +0100 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-11-30 07:27:57 +0100 |
commit | dd3a04c2c3303e47beff0d8f66e7501790e845ed (patch) | |
tree | 1216336bcb9df0cb94a48f66469fd07abfdeb257 /src/gallium/drivers/etnaviv/etnaviv_blt.h | |
parent | 079bbaec0c7a0ef984ce502fb86f980cbe8577f8 (diff) |
etnaviv: GC7000: BLT engine blitting support
Add an implemenation of key clear_blit functions using the BLT engine
that replaced the RS on GC7000.
Also set level->size correctly for imported resources. This is important
for the BLT resolve-in-place path to work for them.
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_blt.h')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_blt.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blt.h b/src/gallium/drivers/etnaviv/etnaviv_blt.h new file mode 100644 index 00000000000..6f1a3c419d2 --- /dev/null +++ b/src/gallium/drivers/etnaviv/etnaviv_blt.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 Etnaviv Project + * Copyright (C) 2017 Zodiac Inflight Innovations + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Wladimir J. van der Laan <[email protected]> + */ +#ifndef H_ETNAVIV_BLT +#define H_ETNAVIV_BLT + +#include "etnaviv_tiling.h" + +#include <stdbool.h> +#include <etnaviv_drmif.h> + +struct pipe_context; + +/* src/dest info for image operations */ +struct blt_imginfo +{ + unsigned compressed:1; + unsigned use_ts:1; + struct etna_reloc addr; + struct etna_reloc ts_addr; + uint32_t format; /* BLT_FORMAT_* */ + uint32_t stride; + uint32_t compress_fmt; /* COLOR_COMPRESSION_FORMAT_* */ + enum etna_surface_layout tiling; /* ETNA_LAYOUT_* */ + uint32_t ts_clear_value[2]; + uint8_t swizzle[4]; /* TEXTURE_SWIZZLE_* */ + uint8_t cache_mode; /* TS_CACHE_MODE_* */ + uint8_t endian_mode; /* ENDIAN_MODE_* */ + uint8_t bpp; /* # bytes per pixel 1/2/4/8 - only used for CLEAR_IMAGE */ +}; + +/** (Partial) image clear operation. + */ +struct blt_clear_op +{ + struct blt_imginfo dest; + uint32_t clear_value[2]; + uint32_t clear_bits[2]; /* bit mask of bits to clear */ + uint16_t rect_x; + uint16_t rect_y; + uint16_t rect_w; + uint16_t rect_h; +}; + +/** Copy image operation. + */ +struct blt_imgcopy_op +{ + unsigned flip_y:1; + struct blt_imginfo src; + struct blt_imginfo dest; + uint16_t src_x; + uint16_t src_y; + uint16_t dest_x; + uint16_t dest_y; + uint16_t rect_w; + uint16_t rect_h; +}; + +/** Resolve-in-place operation. + * Fills unfilled tiles. + */ +struct blt_inplace_op +{ + struct etna_reloc addr; + struct etna_reloc ts_addr; + uint32_t ts_clear_value[2]; + uint32_t num_tiles; + uint8_t cache_mode; /* TS_CACHE_MODE_* */ + uint8_t bpp; +}; + +/* Context initialization for BLT clear_blit functions. */ +void +etna_clear_blit_blt_init(struct pipe_context *pctx); + +#endif |