History

media: rockchip: rkisp1: Define macros for DPCC configurations in UAPI

Extend the UAPI rkisp1-config.h header with macros for all DPCC configuration fields. While at it, clarify of fix issues in the DPCC documentation.

Laurent Pinchart committed 4 years ago

Commit 8e2b7441 parent 9daa2b82 files · +61 −17Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/rkisp1-config.h+61−16
@@ -117,7 +117,46 @@ · 116 unmodified lines
117/*117/*
118 * Defect Pixel Cluster Correction118 * Defect Pixel Cluster Correction
119 */119 */
120#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3120#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3
121
122#define RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE (1U << 2)
123
124#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER (1U << 0)
125#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_RB_CENTER (1U << 1)
126#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_G_3X3 (1U << 2)
127#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_RB_3X3 (1U << 3)
128
129/* 0-2 for sets 1-3 */
130#define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_SET(n) ((n) << 0)
131#define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_FIX_SET (1U << 3)
132
133#define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_GREEN_ENABLE (1U << 0)
134#define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_GREEN_ENABLE (1U << 1)
135#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_GREEN_ENABLE (1U << 2)
136#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_GREEN_ENABLE (1U << 3)
137#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_GREEN_ENABLE (1U << 4)
138#define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_RED_BLUE_ENABLE (1U << 8)
139#define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_RED_BLUE_ENABLE (1U << 9)
140#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_RED_BLUE_ENABLE (1U << 10)
141#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_RED_BLUE_ENABLE (1U << 11)
142#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_RED_BLUE_ENABLE (1U << 12)
143
144#define RKISP1_CIF_ISP_DPCC_LINE_THRESH_G(v) ((v) << 0)
145#define RKISP1_CIF_ISP_DPCC_LINE_THRESH_RB(v) ((v) << 8)
146#define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_G(v) ((v) << 0)
147#define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_RB(v) ((v) << 8)
148#define RKISP1_CIF_ISP_DPCC_PG_FAC_G(v) ((v) << 0)
149#define RKISP1_CIF_ISP_DPCC_PG_FAC_RB(v) ((v) << 8)
150#define RKISP1_CIF_ISP_DPCC_RND_THRESH_G(v) ((v) << 0)
151#define RKISP1_CIF_ISP_DPCC_RND_THRESH_RB(v) ((v) << 8)
152#define RKISP1_CIF_ISP_DPCC_RG_FAC_G(v) ((v) << 0)
153#define RKISP1_CIF_ISP_DPCC_RG_FAC_RB(v) ((v) << 8)
154
155#define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_G(n, v) ((v) << ((n) * 4))
156#define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_RB(n, v) ((v) << ((n) * 4 + 2))
157
158#define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_G(n, v) ((v) << ((n) * 4))
159#define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_RB(n, v) ((v) << ((n) * 4 + 2))
121 160
122/*161/*
123 * Denoising pre filter162 * Denoising pre filter
@@ -249,16 +288,20 @@ struct rkisp1_cif_isp_bls_config { · 125 unmodified lines
249};288};
250 289
251/**290/**
252 * struct rkisp1_cif_isp_dpcc_methods_config - Methods Configuration used by DPCC291 * struct rkisp1_cif_isp_dpcc_methods_config - DPCC methods set configuration
253 *292 *
254 * Methods Configuration used by Defect Pixel Cluster Correction293 * This structure stores the configuration of one set of methods for the DPCC
294 * algorithm. Multiple methods can be selected in each set (independently for
295 * the Green and Red/Blue components) through the @method field, the result is
296 * the logical AND of all enabled methods. The remaining fields set thresholds
297 * and factors for each method.
255 *298 *
256 * @method: Method enable bits299 * @method: Method enable bits (RKISP1_CIF_ISP_DPCC_METHODS_SET_*)
257 * @line_thresh: Line threshold300 * @line_thresh: Line threshold (RKISP1_CIF_ISP_DPCC_LINE_THRESH_*)
258 * @line_mad_fac: Line MAD factor301 * @line_mad_fac: Line Mean Absolute Difference factor (RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_*)
259 * @pg_fac: Peak gradient factor302 * @pg_fac: Peak gradient factor (RKISP1_CIF_ISP_DPCC_PG_FAC_*)
260 * @rnd_thresh: Rank Neighbor Difference threshold303 * @rnd_thresh: Rank Neighbor Difference threshold (RKISP1_CIF_ISP_DPCC_RND_THRESH_*)
261 * @rg_fac: Rank gradient factor304 * @rg_fac: Rank gradient factor (RKISP1_CIF_ISP_DPCC_RG_FAC_*)
262 */305 */
263struct rkisp1_cif_isp_dpcc_methods_config {306struct rkisp1_cif_isp_dpcc_methods_config {
264 __u32 method;307 __u32 method;
@@ -272,14 +315,16 @@ struct rkisp1_cif_isp_dpcc_methods_config { · 7 unmodified lines
272/**315/**
273 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC316 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
274 *317 *
275 * Configuration used by Defect Pixel Cluster Correction318 * Configuration used by Defect Pixel Cluster Correction. Three sets of methods
319 * can be configured and selected through the @set_use field. The result is the
320 * logical OR of all enabled sets.
276 *321 *
277 * @mode: dpcc output mode322 * @mode: DPCC mode (RKISP1_CIF_ISP_DPCC_MODE_*)
278 * @output_mode: whether use hard coded methods323 * @output_mode: Interpolation output mode (RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_*)
279 * @set_use: stage1 methods set324 * @set_use: Methods sets selection (RKISP1_CIF_ISP_DPCC_SET_USE_*)
280 * @methods: methods config325 * @methods: Methods sets configuration
281 * @ro_limits: rank order limits326 * @ro_limits: Rank order limits (RKISP1_CIF_ISP_DPCC_RO_LIMITS_*)
282 * @rnd_offs: differential rank offsets for rank neighbor difference327 * @rnd_offs: Differential rank offsets for rank neighbor difference (RKISP1_CIF_ISP_DPCC_RND_OFFS_*)
283 */328 */
284struct rkisp1_cif_isp_dpcc_config {329struct rkisp1_cif_isp_dpcc_config {
285 __u32 mode;330 __u32 mode;