hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/platform/rockchip/isp/capture.h
....@@ -35,17 +35,57 @@
3535 #ifndef _RKISP_PATH_VIDEO_H
3636 #define _RKISP_PATH_VIDEO_H
3737
38
+#include <linux/interrupt.h>
39
+
3840 #include "common.h"
3941 #include "capture_v1x.h"
4042 #include "capture_v2x.h"
43
+#include "capture_v3x.h"
4144 #include "isp_ispp.h"
4245
43
-#define RDBK_MAX 3
44
-#define RDBK_L 0
45
-#define RDBK_M 1
46
-#define RDBK_S 2
46
+#define SP_VDEV_NAME DRIVER_NAME "_selfpath"
47
+#define MP_VDEV_NAME DRIVER_NAME "_mainpath"
48
+#define FBC_VDEV_NAME DRIVER_NAME "_fbcpath"
49
+#define BP_VDEV_NAME DRIVER_NAME "_bypasspath"
50
+#define MPDS_VDEV_NAME DRIVER_NAME "_mainpath_4x4sampling"
51
+#define BPDS_VDEV_NAME DRIVER_NAME "_bypasspath_4x4sampling"
52
+#define LUMA_VDEV_NAME DRIVER_NAME "_lumapath"
53
+#define VIR_VDEV_NAME DRIVER_NAME "_iqtool"
54
+
55
+#define DMATX0_VDEV_NAME DRIVER_NAME "_rawwr0"
56
+#define DMATX1_VDEV_NAME DRIVER_NAME "_rawwr1"
57
+#define DMATX2_VDEV_NAME DRIVER_NAME "_rawwr2"
58
+#define DMATX3_VDEV_NAME DRIVER_NAME "_rawwr3"
4759
4860 struct rkisp_stream;
61
+
62
+enum {
63
+ ROCKIT_DVBM_END,
64
+ ROCKIT_DVBM_START,
65
+};
66
+
67
+enum {
68
+ RDBK_L,
69
+ RDBK_M,
70
+ RDBK_S,
71
+ RDBK_MAX,
72
+};
73
+
74
+enum {
75
+ RKISP_STREAM_MP,
76
+ RKISP_STREAM_SP,
77
+ RKISP_STREAM_DMATX0,
78
+ RKISP_STREAM_DMATX1,
79
+ RKISP_STREAM_DMATX2,
80
+ RKISP_STREAM_DMATX3,
81
+ RKISP_STREAM_FBC,
82
+ RKISP_STREAM_BP,
83
+ RKISP_STREAM_MPDS,
84
+ RKISP_STREAM_BPDS,
85
+ RKISP_STREAM_LUMA,
86
+ RKISP_STREAM_VIR,
87
+ RKISP_MAX_STREAM,
88
+};
4989
5090 /*
5191 * @fourcc: pixel format
....@@ -109,11 +149,10 @@
109149 struct stream_config {
110150 const struct capture_fmt *fmts;
111151 int fmt_size;
112
- /* constrains */
113
- const int max_rsz_width;
114
- const int max_rsz_height;
115
- const int min_rsz_width;
116
- const int min_rsz_height;
152
+ int max_rsz_width;
153
+ int max_rsz_height;
154
+ int min_rsz_width;
155
+ int min_rsz_height;
117156 const int frame_end_id;
118157 /* registers */
119158 struct {
....@@ -161,6 +200,8 @@
161200 u32 cr_offs_cnt_init;
162201 u32 y_base_ad_shd;
163202 u32 length;
203
+ u32 ctrl;
204
+ u32 y_pic_size;
164205 } mi;
165206 struct {
166207 u32 ctrl;
....@@ -175,10 +216,20 @@
175216 void (*stop_mi)(struct rkisp_stream *stream);
176217 void (*enable_mi)(struct rkisp_stream *stream);
177218 void (*disable_mi)(struct rkisp_stream *stream);
178
- void (*set_data_path)(void __iomem *base);
179
- bool (*is_stream_stopped)(void __iomem *base);
219
+ void (*set_data_path)(struct rkisp_stream *stream);
220
+ bool (*is_stream_stopped)(struct rkisp_stream *stream);
180221 void (*update_mi)(struct rkisp_stream *stream);
181
- int (*frame_end)(struct rkisp_stream *stream);
222
+ int (*frame_end)(struct rkisp_stream *stream, u32 state);
223
+ int (*frame_start)(struct rkisp_stream *stream, u32 mis);
224
+ int (*set_wrap)(struct rkisp_stream *stream, int line);
225
+};
226
+
227
+struct rockit_isp_ops {
228
+ int (*rkisp_stream_start)(struct rkisp_stream *stream);
229
+ void (*rkisp_stream_stop)(struct rkisp_stream *stream);
230
+ int (*rkisp_set_fmt)(struct rkisp_stream *stream,
231
+ struct v4l2_pix_format_mplane *pixm,
232
+ bool try);
182233 };
183234
184235 /*
....@@ -215,17 +266,28 @@
215266 struct list_head buf_queue;
216267 struct rkisp_buffer *curr_buf;
217268 struct rkisp_buffer *next_buf;
269
+ struct rkisp_dummy_buffer dummy_buf;
218270 struct mutex apilock;
271
+ struct tasklet_struct buf_done_tasklet;
272
+ struct list_head buf_done_list;
219273 bool streaming;
220274 bool stopping;
221275 bool frame_end;
222276 bool linked;
223277 bool start_stream;
278
+ bool is_mf_upd;
279
+ bool is_flip;
280
+ bool is_pause;
281
+ bool is_crop_upd;
282
+ bool is_using_resmem;
283
+ bool frame_early;
224284 wait_queue_head_t done;
225285 unsigned int burst;
226286 atomic_t sequence;
227287 struct frame_debug_info dbg;
288
+ int conn_id;
228289 u32 memory;
290
+ u32 skip_frame;
229291 union {
230292 struct rkisp_stream_sp sp;
231293 struct rkisp_stream_mp mp;
....@@ -234,18 +296,36 @@
234296 } u;
235297 };
236298
299
+struct rkisp_vir_cpy {
300
+ struct work_struct work;
301
+ struct completion cmpl;
302
+ struct list_head queue;
303
+ struct rkisp_stream *stream;
304
+};
305
+
237306 struct rkisp_capture_device {
238307 struct rkisp_device *ispdev;
239308 struct rkisp_stream stream[RKISP_MAX_STREAM];
240309 struct rkisp_buffer *rdbk_buf[RDBK_MAX];
310
+ struct rkisp_vir_cpy vir_cpy;
311
+ struct tasklet_struct rd_tasklet;
241312 atomic_t refcnt;
242313 u32 wait_line;
314
+ u32 wrap_width;
315
+ u32 wrap_line;
243316 bool is_done_early;
317
+ bool is_mirror;
318
+
319
+ struct work_struct fast_work;
244320 };
245321
246322 extern struct stream_config rkisp_mp_stream_config;
247323 extern struct stream_config rkisp_sp_stream_config;
324
+extern struct rockit_isp_ops rockit_isp_ops;
248325
326
+void rkisp_stream_buf_done_early(struct rkisp_device *dev);
327
+void rkisp_stream_buf_done(struct rkisp_stream *stream,
328
+ struct rkisp_buffer *buf);
249329 void rkisp_unregister_stream_vdev(struct rkisp_stream *stream);
250330 int rkisp_register_stream_vdev(struct rkisp_stream *stream);
251331 void rkisp_unregister_stream_vdevs(struct rkisp_device *dev);
....@@ -253,8 +333,13 @@
253333 void rkisp_mi_isr(u32 mis_val, struct rkisp_device *dev);
254334 void rkisp_set_stream_def_fmt(struct rkisp_device *dev, u32 id,
255335 u32 width, u32 height, u32 pixelformat);
336
+int rkisp_stream_frame_start(struct rkisp_device *dev, u32 isp_mis);
256337 int rkisp_fcc_xysubs(u32 fcc, u32 *xsubs, u32 *ysubs);
257338 int rkisp_mbus_code_xysubs(u32 code, u32 *xsubs, u32 *ysubs);
258339 int rkisp_fh_open(struct file *filp);
259340 int rkisp_fop_release(struct file *file);
341
+
342
+int rkisp_get_tb_stream_info(struct rkisp_stream *stream,
343
+ struct rkisp_tb_stream_info *info);
344
+int rkisp_free_tb_stream_buf(struct rkisp_stream *stream);
260345 #endif /* _RKISP_PATH_VIDEO_H */