1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef __VSP1_PIPE_H__
14#define __VSP1_PIPE_H__
15
16#include <linux/kref.h>
17#include <linux/list.h>
18#include <linux/spinlock.h>
19#include <linux/wait.h>
20
21#include <media/media-entity.h>
22
23struct vsp1_dl_list;
24struct vsp1_rwpf;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40struct vsp1_format_info {
41 u32 fourcc;
42 unsigned int mbus;
43 unsigned int hwfmt;
44 unsigned int swap;
45 unsigned int planes;
46 unsigned int bpp[3];
47 bool swap_yc;
48 bool swap_uv;
49 unsigned int hsub;
50 unsigned int vsub;
51 bool alpha;
52};
53
54enum vsp1_pipeline_state {
55 VSP1_PIPELINE_STOPPED,
56 VSP1_PIPELINE_RUNNING,
57 VSP1_PIPELINE_STOPPING,
58};
59
60
61
62
63
64
65
66struct vsp1_partition_window {
67 unsigned int left;
68 unsigned int width;
69};
70
71
72
73
74
75
76
77
78
79struct vsp1_partition {
80 struct vsp1_partition_window rpf;
81 struct vsp1_partition_window uds_sink;
82 struct vsp1_partition_window uds_source;
83 struct vsp1_partition_window sru;
84 struct vsp1_partition_window wpf;
85};
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114struct vsp1_pipeline {
115 struct media_pipeline pipe;
116
117 spinlock_t irqlock;
118 enum vsp1_pipeline_state state;
119 wait_queue_head_t wq;
120
121 void (*frame_end)(struct vsp1_pipeline *pipe, bool completed);
122
123 struct mutex lock;
124 struct kref kref;
125 unsigned int stream_count;
126 unsigned int buffers_ready;
127 unsigned int sequence;
128
129 unsigned int num_inputs;
130 struct vsp1_rwpf *inputs[VSP1_MAX_RPF];
131 struct vsp1_rwpf *output;
132 struct vsp1_entity *bru;
133 struct vsp1_entity *hgo;
134 struct vsp1_entity *hgt;
135 struct vsp1_entity *lif;
136 struct vsp1_entity *uds;
137 struct vsp1_entity *uds_input;
138
139
140
141
142
143
144 struct list_head entities;
145
146 struct vsp1_dl_list *dl;
147
148 unsigned int partitions;
149 struct vsp1_partition *partition;
150 struct vsp1_partition *part_table;
151};
152
153void vsp1_pipeline_reset(struct vsp1_pipeline *pipe);
154void vsp1_pipeline_init(struct vsp1_pipeline *pipe);
155
156void vsp1_pipeline_run(struct vsp1_pipeline *pipe);
157bool vsp1_pipeline_stopped(struct vsp1_pipeline *pipe);
158int vsp1_pipeline_stop(struct vsp1_pipeline *pipe);
159bool vsp1_pipeline_ready(struct vsp1_pipeline *pipe);
160
161void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe);
162
163void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
164 struct vsp1_dl_list *dl, unsigned int alpha);
165
166void vsp1_pipeline_propagate_partition(struct vsp1_pipeline *pipe,
167 struct vsp1_partition *partition,
168 unsigned int index,
169 struct vsp1_partition_window *window);
170
171void vsp1_pipelines_suspend(struct vsp1_device *vsp1);
172void vsp1_pipelines_resume(struct vsp1_device *vsp1);
173
174const struct vsp1_format_info *vsp1_get_format_info(struct vsp1_device *vsp1,
175 u32 fourcc);
176
177#endif
178