1
2
3
4
5
6
7
8
9#ifndef __VSP1_PIPE_H__
10#define __VSP1_PIPE_H__
11
12#include <linux/kref.h>
13#include <linux/list.h>
14#include <linux/spinlock.h>
15#include <linux/wait.h>
16
17#include <media/media-entity.h>
18
19struct vsp1_dl_list;
20struct vsp1_rwpf;
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36struct vsp1_format_info {
37 u32 fourcc;
38 unsigned int mbus;
39 unsigned int hwfmt;
40 unsigned int swap;
41 unsigned int planes;
42 unsigned int bpp[3];
43 bool swap_yc;
44 bool swap_uv;
45 unsigned int hsub;
46 unsigned int vsub;
47 bool alpha;
48};
49
50enum vsp1_pipeline_state {
51 VSP1_PIPELINE_STOPPED,
52 VSP1_PIPELINE_RUNNING,
53 VSP1_PIPELINE_STOPPING,
54};
55
56
57
58
59
60
61
62struct vsp1_partition_window {
63 unsigned int left;
64 unsigned int width;
65};
66
67
68
69
70
71
72
73
74
75struct vsp1_partition {
76 struct vsp1_partition_window rpf;
77 struct vsp1_partition_window uds_sink;
78 struct vsp1_partition_window uds_source;
79 struct vsp1_partition_window sru;
80 struct vsp1_partition_window wpf;
81};
82
83
84
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
112struct vsp1_pipeline {
113 struct media_pipeline pipe;
114
115 spinlock_t irqlock;
116 enum vsp1_pipeline_state state;
117 wait_queue_head_t wq;
118
119 void (*frame_end)(struct vsp1_pipeline *pipe, unsigned int completion);
120
121 struct mutex lock;
122 struct kref kref;
123 unsigned int stream_count;
124 unsigned int buffers_ready;
125 unsigned int sequence;
126
127 unsigned int num_inputs;
128 struct vsp1_rwpf *inputs[VSP1_MAX_RPF];
129 struct vsp1_rwpf *output;
130 struct vsp1_entity *brx;
131 struct vsp1_entity *hgo;
132 struct vsp1_entity *hgt;
133 struct vsp1_entity *lif;
134 struct vsp1_entity *uds;
135 struct vsp1_entity *uds_input;
136
137
138
139
140
141
142 struct list_head entities;
143
144 struct vsp1_dl_body *stream_config;
145 bool configured;
146 bool interlaced;
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_body *dlb,
165 unsigned int alpha);
166
167void vsp1_pipeline_propagate_partition(struct vsp1_pipeline *pipe,
168 struct vsp1_partition *partition,
169 unsigned int index,
170 struct vsp1_partition_window *window);
171
172const struct vsp1_format_info *vsp1_get_format_info(struct vsp1_device *vsp1,
173 u32 fourcc);
174
175#endif
176