Path: blob/21.2-virgl/src/gallium/drivers/etnaviv/etnaviv_blt.h
4570 views
/*1* Copyright (c) 2017 Etnaviv Project2* Copyright (C) 2017 Zodiac Inflight Innovations3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* the rights to use, copy, modify, merge, publish, distribute, sub license,8* and/or sell copies of the Software, and to permit persons to whom the9* Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the12* next paragraph) shall be included in all copies or substantial portions13* of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING20* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER21* DEALINGS IN THE SOFTWARE.22*23* Authors:24* Wladimir J. van der Laan <[email protected]>25*/26#ifndef H_ETNAVIV_BLT27#define H_ETNAVIV_BLT2829#include "etnaviv_tiling.h"3031#include <stdbool.h>32#include "drm/etnaviv_drmif.h"3334struct pipe_context;3536/* src/dest info for image operations */37struct blt_imginfo38{39unsigned use_ts:1;40struct etna_reloc addr;41struct etna_reloc ts_addr;42uint32_t format; /* BLT_FORMAT_* */43uint32_t stride;44enum etna_surface_layout tiling; /* ETNA_LAYOUT_* */45uint32_t ts_clear_value[2];46uint8_t swizzle[4]; /* TEXTURE_SWIZZLE_* */47uint8_t ts_mode; /* TS_MODE_* */48int8_t ts_compress_fmt; /* COLOR_COMPRESSION_FORMAT_* */49uint8_t endian_mode; /* ENDIAN_MODE_* */50uint8_t bpp; /* # bytes per pixel 1/2/4/8 - only used for CLEAR_IMAGE */51};5253/** (Partial) image clear operation.54*/55struct blt_clear_op56{57struct blt_imginfo dest;58uint32_t clear_value[2];59uint32_t clear_bits[2]; /* bit mask of bits to clear */60uint16_t rect_x;61uint16_t rect_y;62uint16_t rect_w;63uint16_t rect_h;64};6566/** Copy image operation.67*/68struct blt_imgcopy_op69{70unsigned flip_y:1;71struct blt_imginfo src;72struct blt_imginfo dest;73uint16_t src_x;74uint16_t src_y;75uint16_t dest_x;76uint16_t dest_y;77uint16_t rect_w;78uint16_t rect_h;79};8081/** Resolve-in-place operation.82* Fills unfilled tiles.83*/84struct blt_inplace_op85{86struct etna_reloc addr;87struct etna_reloc ts_addr;88uint32_t ts_clear_value[2];89uint32_t num_tiles;90uint8_t ts_mode; /* TS_MODE_* */91uint8_t bpp;92};9394/* Context initialization for BLT clear_blit functions. */95void96etna_clear_blit_blt_init(struct pipe_context *pctx);9798#endif99100101