Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/panfrost/lib/pan_blitter.h
4560 views
1
/*
2
* Copyright (C) 2021 Collabora, Ltd.
3
*
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:
10
*
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
13
* Software.
14
*
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
21
* SOFTWARE.
22
*
23
*/
24
25
#ifndef __PAN_BLITTER_H
26
#define __PAN_BLITTER_H
27
28
#include "panfrost-job.h"
29
#include "pan_cs.h"
30
#include "pan_pool.h"
31
#include "pan_texture.h"
32
#include "pan_util.h"
33
#include "util/format/u_format.h"
34
35
struct pan_fb_info;
36
struct pan_scoreboard;
37
struct pan_pool;
38
struct panfrost_device;
39
40
struct pan_blit_info {
41
struct {
42
struct {
43
const struct pan_image *image;
44
enum pipe_format format;
45
} planes[2];
46
unsigned level;
47
struct {
48
int32_t x, y, z;
49
unsigned layer;
50
} start, end;
51
} src, dst;
52
struct {
53
bool enable;
54
uint16_t minx, miny, maxx, maxy;
55
} scissor;
56
bool nearest;
57
};
58
59
struct pan_blit_context {
60
mali_ptr rsd, vpd;
61
mali_ptr textures;
62
mali_ptr samplers;
63
mali_ptr position;
64
struct {
65
enum mali_texture_dimension dim;
66
struct {
67
float x, y;
68
} start, end;
69
union {
70
unsigned layer_offset;
71
float z_offset;
72
};
73
} src;
74
struct {
75
int32_t layer_offset;
76
int32_t cur_layer;
77
int32_t last_layer;
78
} dst;
79
float z_scale;
80
};
81
82
void
83
pan_blitter_init(struct panfrost_device *dev,
84
struct pan_pool *bin_pool,
85
struct pan_pool *desc_pool);
86
87
void
88
pan_blitter_cleanup(struct panfrost_device *dev);
89
90
void
91
pan_preload_fb(struct pan_pool *desc_pool,
92
struct pan_scoreboard *scoreboard,
93
struct pan_fb_info *fb,
94
mali_ptr tsd, mali_ptr tiler);
95
96
void
97
pan_blit_ctx_init(struct panfrost_device *dev,
98
const struct pan_blit_info *info,
99
struct pan_pool *blit_pool,
100
struct pan_blit_context *ctx);
101
102
bool
103
pan_blit_next_surface(struct pan_blit_context *ctx);
104
105
void
106
pan_blit(struct pan_blit_context *ctx,
107
struct pan_pool *pool,
108
struct pan_scoreboard *scoreboard,
109
mali_ptr tsd, mali_ptr tiler);
110
111
#endif
112
113