2
* Copyright (C) 2021 Collabora, Ltd.
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
* and/or sell copies of the Software, and to permit persons to whom the
9
* Software is furnished to do so, subject to the following conditions:
11
* The above copyright notice and this permission notice (including the next
12
* paragraph) shall be included in all copies or substantial portions of the
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
#ifndef __PAN_BLITTER_H
26
#define __PAN_BLITTER_H
28
#include "genxml/gen_macros.h"
30
#include "panfrost-job.h"
33
#include "pan_texture.h"
35
#include "util/format/u_format.h"
38
struct pan_scoreboard;
40
struct panfrost_device;
42
struct pan_blit_info {
45
const struct pan_image *image;
46
enum pipe_format format;
56
uint16_t minx, miny, maxx, maxy;
61
struct pan_blit_context {
67
enum mali_texture_dimension dim;
72
unsigned layer_offset;
85
GENX(pan_blitter_init)(struct panfrost_device *dev,
86
struct pan_pool *bin_pool,
87
struct pan_pool *desc_pool);
90
GENX(pan_blitter_cleanup)(struct panfrost_device *dev);
93
GENX(pan_preload_fb)(struct pan_pool *desc_pool,
94
struct pan_scoreboard *scoreboard,
95
struct pan_fb_info *fb,
96
mali_ptr tsd, mali_ptr tiler,
97
struct panfrost_ptr *jobs);
100
GENX(pan_blit_ctx_init)(struct panfrost_device *dev,
101
const struct pan_blit_info *info,
102
struct pan_pool *blit_pool,
103
struct pan_blit_context *ctx);
106
pan_blit_next_surface(struct pan_blit_context *ctx)
108
if (ctx->dst.last_layer < ctx->dst.layer_offset) {
109
if (ctx->dst.cur_layer <= ctx->dst.last_layer)
112
ctx->dst.cur_layer--;
114
if (ctx->dst.cur_layer >= ctx->dst.last_layer)
117
ctx->dst.cur_layer++;
124
GENX(pan_blit)(struct pan_blit_context *ctx,
125
struct pan_pool *pool,
126
struct pan_scoreboard *scoreboard,
127
mali_ptr tsd, mali_ptr tiler);