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
117117 /*
118118 * Defect Pixel Cluster Correction
119119 */
120−#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3
120+#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))
121160
122161 /*
123162 * Denoising pre filter
@@ -249,16 +288,20 @@ struct rkisp1_cif_isp_bls_config { · 125 unmodified lines
249288 };
250289
251290 /**
252− * struct rkisp1_cif_isp_dpcc_methods_config - Methods Configuration used by DPCC
291+ * struct rkisp1_cif_isp_dpcc_methods_config - DPCC methods set configuration
253292 *
254− * Methods Configuration used by Defect Pixel Cluster Correction
293+ * 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.
255298 *
256− * @method: Method enable bits
257− * @line_thresh: Line threshold
258− * @line_mad_fac: Line MAD factor
259− * @pg_fac: Peak gradient factor
260− * @rnd_thresh: Rank Neighbor Difference threshold
261− * @rg_fac: Rank gradient factor
299+ * @method: Method enable bits (RKISP1_CIF_ISP_DPCC_METHODS_SET_*)
300+ * @line_thresh: Line threshold (RKISP1_CIF_ISP_DPCC_LINE_THRESH_*)
301+ * @line_mad_fac: Line Mean Absolute Difference factor (RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_*)
302+ * @pg_fac: Peak gradient factor (RKISP1_CIF_ISP_DPCC_PG_FAC_*)
303+ * @rnd_thresh: Rank Neighbor Difference threshold (RKISP1_CIF_ISP_DPCC_RND_THRESH_*)
304+ * @rg_fac: Rank gradient factor (RKISP1_CIF_ISP_DPCC_RG_FAC_*)
262305 */
263306 struct rkisp1_cif_isp_dpcc_methods_config {
264307 __u32 method;
@@ -272,14 +315,16 @@ struct rkisp1_cif_isp_dpcc_methods_config { · 7 unmodified lines
272315 /**
273316 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
274317 *
275− * Configuration used by Defect Pixel Cluster Correction
318+ * 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.
276321 *
277− * @mode: dpcc output mode
278− * @output_mode: whether use hard coded methods
279− * @set_use: stage1 methods set
280− * @methods: methods config
281− * @ro_limits: rank order limits
282− * @rnd_offs: differential rank offsets for rank neighbor difference
322+ * @mode: DPCC mode (RKISP1_CIF_ISP_DPCC_MODE_*)
323+ * @output_mode: Interpolation output mode (RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_*)
324+ * @set_use: Methods sets selection (RKISP1_CIF_ISP_DPCC_SET_USE_*)
325+ * @methods: Methods sets configuration
326+ * @ro_limits: Rank order limits (RKISP1_CIF_ISP_DPCC_RO_LIMITS_*)
327+ * @rnd_offs: Differential rank offsets for rank neighbor difference (RKISP1_CIF_ISP_DPCC_RND_OFFS_*)
283328 */
284329 struct rkisp1_cif_isp_dpcc_config {
285330 __u32 mode;