From e996f25f3942fad58a23ade0344572c4bbf37c44 Mon Sep 17 00:00:00 2001 From: Cai YiWei Date: Fri, 29 Jul 2022 18:44:38 +0800 Subject: [PATCH] media: rockchip: isp: sync head for compressed data Change-Id: Iabfba2ce0b9e8687f3935330f56ff3bb5c5e340b Signed-off-by: Cai YiWei --- include/uapi/linux/rk-camera-module.h | 28 +++++++++++++++++++++++++++ include/uapi/linux/rkisp2-config.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/include/uapi/linux/rk-camera-module.h b/include/uapi/linux/rk-camera-module.h index 9dd909c478d0..c007c76e3939 100644 --- a/include/uapi/linux/rk-camera-module.h +++ b/include/uapi/linux/rk-camera-module.h @@ -354,11 +354,38 @@ struct rkmodule_lsc_cfg { * NO_HDR: linear mode * HDR_X2: hdr two frame or line mode * HDR_X3: hdr three or line mode + * HDR_COMPR: linearised and compressed data for hdr */ enum rkmodule_hdr_mode { NO_HDR = 0, HDR_X2 = 5, HDR_X3 = 6, + HDR_COMPR, +}; + +enum rkmodule_hdr_compr_segment { + HDR_COMPR_SEGMENT_4 = 4, + HDR_COMPR_SEGMENT_12 = 12, + HDR_COMPR_SEGMENT_16 = 16, +}; + +/* rkmodule_hdr_compr + * linearised and compressed data for hdr: data_src = K * data_compr + XX + * + * bit: bit of src data, max 20 bit. + * segment: linear segment, support 4, 6 or 16. + * k_shift: left shift bit of slop amplification factor, 2^k_shift, [0 15]. + * slope_k: K * 2^k_shift. + * data_src_shitf: left shift bit of source data, data_src = 2^data_src_shitf + * data_compr: compressed data. + */ +struct rkmodule_hdr_compr { + enum rkmodule_hdr_compr_segment segment; + __u8 bit; + __u8 k_shift; + __u8 data_src_shitf[HDR_COMPR_SEGMENT_16]; + __u16 data_compr[HDR_COMPR_SEGMENT_16]; + __u32 slope_k[HDR_COMPR_SEGMENT_16]; }; /** @@ -397,6 +424,7 @@ struct rkmodule_hdr_esp { struct rkmodule_hdr_cfg { __u32 hdr_mode; struct rkmodule_hdr_esp esp; + struct rkmodule_hdr_compr compr; } __attribute__ ((packed)); /* sensor lvds sync code diff --git a/include/uapi/linux/rkisp2-config.h b/include/uapi/linux/rkisp2-config.h index 82b345686ca1..0822a007f7cb 100644 --- a/include/uapi/linux/rkisp2-config.h +++ b/include/uapi/linux/rkisp2-config.h @@ -251,6 +251,7 @@ struct isp2x_mesh_head { * T_START_X1: isp read one frame * T_START_X2: isp read hdr two frame * T_START_X3: isp read hdr three frame + * T_START_C: isp read hdr linearised and compressed data */ enum isp2x_trigger_mode { T_TRY = BIT(0), @@ -260,6 +261,7 @@ enum isp2x_trigger_mode { T_START_X1 = BIT(4), T_START_X2 = BIT(5), T_START_X3 = BIT(6), + T_START_C = BIT(7), }; struct isp2x_csi_trigger {