From 2f7c68cb55ecb7331f2381deb497c27155f32faf Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 03 Jan 2024 09:43:39 +0000
Subject: [PATCH] update kernel to 5.10.198
---
kernel/drivers/media/platform/rockchip/isp/capture.h | 109 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 97 insertions(+), 12 deletions(-)
diff --git a/kernel/drivers/media/platform/rockchip/isp/capture.h b/kernel/drivers/media/platform/rockchip/isp/capture.h
index 3fe566d..bbdcf1e 100644
--- a/kernel/drivers/media/platform/rockchip/isp/capture.h
+++ b/kernel/drivers/media/platform/rockchip/isp/capture.h
@@ -35,17 +35,57 @@
#ifndef _RKISP_PATH_VIDEO_H
#define _RKISP_PATH_VIDEO_H
+#include <linux/interrupt.h>
+
#include "common.h"
#include "capture_v1x.h"
#include "capture_v2x.h"
+#include "capture_v3x.h"
#include "isp_ispp.h"
-#define RDBK_MAX 3
-#define RDBK_L 0
-#define RDBK_M 1
-#define RDBK_S 2
+#define SP_VDEV_NAME DRIVER_NAME "_selfpath"
+#define MP_VDEV_NAME DRIVER_NAME "_mainpath"
+#define FBC_VDEV_NAME DRIVER_NAME "_fbcpath"
+#define BP_VDEV_NAME DRIVER_NAME "_bypasspath"
+#define MPDS_VDEV_NAME DRIVER_NAME "_mainpath_4x4sampling"
+#define BPDS_VDEV_NAME DRIVER_NAME "_bypasspath_4x4sampling"
+#define LUMA_VDEV_NAME DRIVER_NAME "_lumapath"
+#define VIR_VDEV_NAME DRIVER_NAME "_iqtool"
+
+#define DMATX0_VDEV_NAME DRIVER_NAME "_rawwr0"
+#define DMATX1_VDEV_NAME DRIVER_NAME "_rawwr1"
+#define DMATX2_VDEV_NAME DRIVER_NAME "_rawwr2"
+#define DMATX3_VDEV_NAME DRIVER_NAME "_rawwr3"
struct rkisp_stream;
+
+enum {
+ ROCKIT_DVBM_END,
+ ROCKIT_DVBM_START,
+};
+
+enum {
+ RDBK_L,
+ RDBK_M,
+ RDBK_S,
+ RDBK_MAX,
+};
+
+enum {
+ RKISP_STREAM_MP,
+ RKISP_STREAM_SP,
+ RKISP_STREAM_DMATX0,
+ RKISP_STREAM_DMATX1,
+ RKISP_STREAM_DMATX2,
+ RKISP_STREAM_DMATX3,
+ RKISP_STREAM_FBC,
+ RKISP_STREAM_BP,
+ RKISP_STREAM_MPDS,
+ RKISP_STREAM_BPDS,
+ RKISP_STREAM_LUMA,
+ RKISP_STREAM_VIR,
+ RKISP_MAX_STREAM,
+};
/*
* @fourcc: pixel format
@@ -109,11 +149,10 @@
struct stream_config {
const struct capture_fmt *fmts;
int fmt_size;
- /* constrains */
- const int max_rsz_width;
- const int max_rsz_height;
- const int min_rsz_width;
- const int min_rsz_height;
+ int max_rsz_width;
+ int max_rsz_height;
+ int min_rsz_width;
+ int min_rsz_height;
const int frame_end_id;
/* registers */
struct {
@@ -161,6 +200,8 @@
u32 cr_offs_cnt_init;
u32 y_base_ad_shd;
u32 length;
+ u32 ctrl;
+ u32 y_pic_size;
} mi;
struct {
u32 ctrl;
@@ -175,10 +216,20 @@
void (*stop_mi)(struct rkisp_stream *stream);
void (*enable_mi)(struct rkisp_stream *stream);
void (*disable_mi)(struct rkisp_stream *stream);
- void (*set_data_path)(void __iomem *base);
- bool (*is_stream_stopped)(void __iomem *base);
+ void (*set_data_path)(struct rkisp_stream *stream);
+ bool (*is_stream_stopped)(struct rkisp_stream *stream);
void (*update_mi)(struct rkisp_stream *stream);
- int (*frame_end)(struct rkisp_stream *stream);
+ int (*frame_end)(struct rkisp_stream *stream, u32 state);
+ int (*frame_start)(struct rkisp_stream *stream, u32 mis);
+ int (*set_wrap)(struct rkisp_stream *stream, int line);
+};
+
+struct rockit_isp_ops {
+ int (*rkisp_stream_start)(struct rkisp_stream *stream);
+ void (*rkisp_stream_stop)(struct rkisp_stream *stream);
+ int (*rkisp_set_fmt)(struct rkisp_stream *stream,
+ struct v4l2_pix_format_mplane *pixm,
+ bool try);
};
/*
@@ -215,17 +266,28 @@
struct list_head buf_queue;
struct rkisp_buffer *curr_buf;
struct rkisp_buffer *next_buf;
+ struct rkisp_dummy_buffer dummy_buf;
struct mutex apilock;
+ struct tasklet_struct buf_done_tasklet;
+ struct list_head buf_done_list;
bool streaming;
bool stopping;
bool frame_end;
bool linked;
bool start_stream;
+ bool is_mf_upd;
+ bool is_flip;
+ bool is_pause;
+ bool is_crop_upd;
+ bool is_using_resmem;
+ bool frame_early;
wait_queue_head_t done;
unsigned int burst;
atomic_t sequence;
struct frame_debug_info dbg;
+ int conn_id;
u32 memory;
+ u32 skip_frame;
union {
struct rkisp_stream_sp sp;
struct rkisp_stream_mp mp;
@@ -234,18 +296,36 @@
} u;
};
+struct rkisp_vir_cpy {
+ struct work_struct work;
+ struct completion cmpl;
+ struct list_head queue;
+ struct rkisp_stream *stream;
+};
+
struct rkisp_capture_device {
struct rkisp_device *ispdev;
struct rkisp_stream stream[RKISP_MAX_STREAM];
struct rkisp_buffer *rdbk_buf[RDBK_MAX];
+ struct rkisp_vir_cpy vir_cpy;
+ struct tasklet_struct rd_tasklet;
atomic_t refcnt;
u32 wait_line;
+ u32 wrap_width;
+ u32 wrap_line;
bool is_done_early;
+ bool is_mirror;
+
+ struct work_struct fast_work;
};
extern struct stream_config rkisp_mp_stream_config;
extern struct stream_config rkisp_sp_stream_config;
+extern struct rockit_isp_ops rockit_isp_ops;
+void rkisp_stream_buf_done_early(struct rkisp_device *dev);
+void rkisp_stream_buf_done(struct rkisp_stream *stream,
+ struct rkisp_buffer *buf);
void rkisp_unregister_stream_vdev(struct rkisp_stream *stream);
int rkisp_register_stream_vdev(struct rkisp_stream *stream);
void rkisp_unregister_stream_vdevs(struct rkisp_device *dev);
@@ -253,8 +333,13 @@
void rkisp_mi_isr(u32 mis_val, struct rkisp_device *dev);
void rkisp_set_stream_def_fmt(struct rkisp_device *dev, u32 id,
u32 width, u32 height, u32 pixelformat);
+int rkisp_stream_frame_start(struct rkisp_device *dev, u32 isp_mis);
int rkisp_fcc_xysubs(u32 fcc, u32 *xsubs, u32 *ysubs);
int rkisp_mbus_code_xysubs(u32 code, u32 *xsubs, u32 *ysubs);
int rkisp_fh_open(struct file *filp);
int rkisp_fop_release(struct file *file);
+
+int rkisp_get_tb_stream_info(struct rkisp_stream *stream,
+ struct rkisp_tb_stream_info *info);
+int rkisp_free_tb_stream_buf(struct rkisp_stream *stream);
#endif /* _RKISP_PATH_VIDEO_H */
--
Gitblit v1.6.2