Path: blob/21.2-virgl/src/panfrost/lib/pan_blitter.h
4560 views
/*1* Copyright (C) 2021 Collabora, Ltd.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,19* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE20* SOFTWARE.21*22*/2324#ifndef __PAN_BLITTER_H25#define __PAN_BLITTER_H2627#include "panfrost-job.h"28#include "pan_cs.h"29#include "pan_pool.h"30#include "pan_texture.h"31#include "pan_util.h"32#include "util/format/u_format.h"3334struct pan_fb_info;35struct pan_scoreboard;36struct pan_pool;37struct panfrost_device;3839struct pan_blit_info {40struct {41struct {42const struct pan_image *image;43enum pipe_format format;44} planes[2];45unsigned level;46struct {47int32_t x, y, z;48unsigned layer;49} start, end;50} src, dst;51struct {52bool enable;53uint16_t minx, miny, maxx, maxy;54} scissor;55bool nearest;56};5758struct pan_blit_context {59mali_ptr rsd, vpd;60mali_ptr textures;61mali_ptr samplers;62mali_ptr position;63struct {64enum mali_texture_dimension dim;65struct {66float x, y;67} start, end;68union {69unsigned layer_offset;70float z_offset;71};72} src;73struct {74int32_t layer_offset;75int32_t cur_layer;76int32_t last_layer;77} dst;78float z_scale;79};8081void82pan_blitter_init(struct panfrost_device *dev,83struct pan_pool *bin_pool,84struct pan_pool *desc_pool);8586void87pan_blitter_cleanup(struct panfrost_device *dev);8889void90pan_preload_fb(struct pan_pool *desc_pool,91struct pan_scoreboard *scoreboard,92struct pan_fb_info *fb,93mali_ptr tsd, mali_ptr tiler);9495void96pan_blit_ctx_init(struct panfrost_device *dev,97const struct pan_blit_info *info,98struct pan_pool *blit_pool,99struct pan_blit_context *ctx);100101bool102pan_blit_next_surface(struct pan_blit_context *ctx);103104void105pan_blit(struct pan_blit_context *ctx,106struct pan_pool *pool,107struct pan_scoreboard *scoreboard,108mali_ptr tsd, mali_ptr tiler);109110#endif111112113