summaryrefslogtreecommitdiffstats
path: root/include/video/imx-ipu-v3.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/video/imx-ipu-v3.h')
-rw-r--r--include/video/imx-ipu-v3.h56
1 files changed, 50 insertions, 6 deletions
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index b03fafa1ff58..06b0b57e996c 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -387,20 +387,64 @@ enum ipu_ic_task {
IC_NUM_TASKS,
};
+/*
+ * The parameters that describe a colorspace according to the
+ * Image Converter:
+ * - Y'CbCr encoding
+ * - quantization
+ * - "colorspace" (RGB or YUV).
+ */
+struct ipu_ic_colorspace {
+ enum v4l2_ycbcr_encoding enc;
+ enum v4l2_quantization quant;
+ enum ipu_color_space cs;
+};
+
+static inline void
+ipu_ic_fill_colorspace(struct ipu_ic_colorspace *ic_cs,
+ enum v4l2_ycbcr_encoding enc,
+ enum v4l2_quantization quant,
+ enum ipu_color_space cs)
+{
+ ic_cs->enc = enc;
+ ic_cs->quant = quant;
+ ic_cs->cs = cs;
+}
+
+struct ipu_ic_csc_params {
+ s16 coeff[3][3]; /* signed 9-bit integer coefficients */
+ s16 offset[3]; /* signed 11+2-bit fixed point offset */
+ u8 scale:2; /* scale coefficients * 2^(scale-1) */
+ bool sat:1; /* saturate to (16, 235(Y) / 240(U, V)) */
+};
+
+struct ipu_ic_csc {
+ struct ipu_ic_colorspace in_cs;
+ struct ipu_ic_colorspace out_cs;
+ struct ipu_ic_csc_params params;
+};
+
struct ipu_ic;
+
+int __ipu_ic_calc_csc(struct ipu_ic_csc *csc);
+int ipu_ic_calc_csc(struct ipu_ic_csc *csc,
+ enum v4l2_ycbcr_encoding in_enc,
+ enum v4l2_quantization in_quant,
+ enum ipu_color_space in_cs,
+ enum v4l2_ycbcr_encoding out_enc,
+ enum v4l2_quantization out_quant,
+ enum ipu_color_space out_cs);
int ipu_ic_task_init(struct ipu_ic *ic,
+ const struct ipu_ic_csc *csc,
int in_width, int in_height,
- int out_width, int out_height,
- enum ipu_color_space in_cs,
- enum ipu_color_space out_cs);
+ int out_width, int out_height);
int ipu_ic_task_init_rsc(struct ipu_ic *ic,
+ const struct ipu_ic_csc *csc,
int in_width, int in_height,
int out_width, int out_height,
- enum ipu_color_space in_cs,
- enum ipu_color_space out_cs,
u32 rsc);
int ipu_ic_task_graphics_init(struct ipu_ic *ic,
- enum ipu_color_space in_g_cs,
+ const struct ipu_ic_colorspace *g_in_cs,
bool galpha_en, u32 galpha,
bool colorkey_en, u32 colorkey);
void ipu_ic_task_enable(struct ipu_ic *ic);