From: Loic Poulain <loic.poulain@oss.qualcomm.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Bryan O'Donoghue <bod@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
devicetree@vger.kernel.org, laurent.pinchart@ideasonboard.com,
kieran.bingham@ideasonboard.com, johannes.goede@oss.qualcomm.com
Subject: [PATCH v3 12/15] media: uapi: Add CAMSS ISP configuration definition
Date: Fri, 08 May 2026 00:49:27 +0200 [thread overview]
Message-ID: <20260508-camss-isp-ope-v3-12-bb1055274603@oss.qualcomm.com> (raw)
In-Reply-To: <20260508-camss-isp-ope-v3-0-bb1055274603@oss.qualcomm.com>
Add the uapi header camss-config.h defining the ISP parameter
structures used by the CAMSS Offline Processing Engine (OPE) driver.
This includes structures for white balance, chroma enhancement and
color correction configuration.
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
---
include/uapi/linux/camss-config.h | 115 ++++++++++++++++++++++++++++++++++++++
1 file changed, 115 insertions(+)
diff --git a/include/uapi/linux/camss-config.h b/include/uapi/linux/camss-config.h
new file mode 100644
index 0000000000000000000000000000000000000000..665406969e66927e8bce83afaa9a3aae53ba2803
--- /dev/null
+++ b/include/uapi/linux/camss-config.h
@@ -0,0 +1,115 @@
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
+/*
+ * Qualcomm CAMSS ISP parameters UAPI
+ *
+ * Uses the generic V4L2 extensible ISP parameters buffer format defined in
+ * <uapi/linux/media/v4l2-isp.h>.
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef _UAPI_LINUX_CAMSS_CONFIG_H
+#define _UAPI_LINUX_CAMSS_CONFIG_H
+
+#include <linux/types.h>
+#include <linux/media/v4l2-isp.h>
+/**
+ * enum camss_params_block_type - CAMSS ISP parameter block identifiers
+ *
+ * Each value identifies one ISP processing block. The value is placed in
+ * the @type field of &struct v4l2_isp_params_block_header.
+ */
+enum camss_params_block_type {
+ CAMSS_PARAMS_WB_GAIN = 1,
+ CAMSS_PARAMS_CHROMA_ENHAN = 2,
+ CAMSS_PARAMS_COLOR_CORRECT = 3,
+ CAMSS_PARAMS_MAX,
+};
+
+/**
+ * struct camss_params_wb_gain - White Balance gains
+ *
+ * @header: generic block header; @header.type = CAMSS_PARAMS_WB_GAIN
+ * @g_gain: green channel gain (15uQ10)
+ * @b_gain: blue channel gain (15uQ10)
+ * @r_gain: red channel gain (15uQ10)
+ */
+struct camss_params_wb_gain {
+ struct v4l2_isp_params_block_header header;
+ __u16 g_gain;
+ __u16 b_gain;
+ __u16 r_gain;
+ __u16 _pad;
+} __aligned(8);
+
+/**
+ * struct camss_params_chroma_enhan - RGB to YUV colour matrix
+ *
+ * Implements the CLC_CHROMA_ENHAN pipeline module. All coefficients are
+ * signed 12-bit fixed-point Q3.8 (range roughly -8.0 to +7.996).
+ *
+ * Luma (Y) row of the matrix:
+ * @luma_v0: R-to-Y coefficient (12sQ8, e.g. 0x04d = 0.299)
+ * @luma_v1: G-to-Y coefficient (12sQ8, e.g. 0x096 = 0.587)
+ * @luma_v2: B-to-Y coefficient (12sQ8, e.g. 0x01d = 0.114)
+ * @luma_k: Y output offset (9s, 0 = no offset)
+ *
+ * Chroma (Cb) row:
+ * @coeff_ap: Cb positive coefficient (12sQ8, e.g. 0x0e6 = 0.886)
+ * @coeff_am: Cb negative coefficient (12sQ8, e.g. 0xfb3 = -0.338)
+ * @kcb: Cb output offset (11s, 128 = +128)
+ *
+ * Chroma (Cr) row:
+ * @coeff_cp: Cr positive coefficient (12sQ8, e.g. 0x0b3 = 0.701)
+ * @coeff_cm: Cr negative coefficient (12sQ8, e.g. 0xfe3 = -0.114)
+ * @coeff_dp: Cr positive coefficient (12sQ8)
+ * @coeff_dm: Cr negative coefficient (12sQ8)
+ * @kcr: Cr output offset (11s, 128 = +128)
+ *
+ * @header: generic block header; @header.type = CAMSS_PARAMS_CHROMA_ENHAN
+ */
+struct camss_params_chroma_enhan {
+ struct v4l2_isp_params_block_header header;
+ __u16 luma_v0;
+ __u16 luma_v1;
+ __u16 luma_v2;
+ __u16 luma_k;
+ __u16 coeff_ap;
+ __u16 coeff_am;
+ __u16 coeff_cp;
+ __u16 coeff_cm;
+ __u16 coeff_dp;
+ __u16 coeff_dm;
+ __u16 kcb;
+ __u16 kcr;
+} __aligned(8);
+
+/**
+ * struct camss_params_color_correct - colour correction matrix
+ *
+ * signed 12-bit fixed-point (Qm)
+ *
+ * Out_ch0 (g) = A0*G+B0*B+C0*R + K0
+ * Out_ch1 (b) = A1*G+B1*B+C1*R + K1
+ * Out_ch2 (r) = A2*G+B2*B+C2*R + K2
+ *
+ * m = 0x0 - Coefficients are signed 12sQ7 numbers
+ * m = 0x1 - Coefficients are signed 12sQ8 numbers
+ * m = 0x2 - Coefficients are signed 12sQ9 numbers
+ * m = 0x3 - Coefficients are signed 12sQ10 numbers
+ */
+struct camss_params_color_correct {
+ struct v4l2_isp_params_block_header header;
+ __u16 a[3];
+ __u16 b[3];
+ __u16 c[3];
+ __u16 k[3];
+ __u16 m;
+} __aligned(8);
+
+#define CAMSS_PARAMS_MAX_PAYLOAD \
+ (sizeof(struct camss_params_wb_gain) +\
+ sizeof(struct camss_params_chroma_enhan) +\
+ sizeof(struct camss_params_color_correct))
+
+#endif /* _UAPI_LINUX_CAMSS_CONFIG_H */
--
2.34.1
next prev parent reply other threads:[~2026-05-07 22:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 22:49 [PATCH v3 00/15] media: qcom: camss: CAMSS Offline Processing Engine support Loic Poulain
2026-05-07 22:49 ` [PATCH v3 01/15] media: qcom: camss: Add PM clock support and integrate with runtime PM Loic Poulain
2026-05-07 22:49 ` [PATCH v3 02/15] media: qcom: camss: Add PM clock definitions for QCM2290 Loic Poulain
2026-05-07 22:49 ` [PATCH v3 03/15] media: qcom: camss: Drop top_ahb/axi from QCM2290 subdevice clocks Loic Poulain
2026-05-07 22:49 ` [PATCH v3 04/15] media: qcom: camss: Add camss-isp-bufq helper Loic Poulain
2026-05-08 9:57 ` Bryan O'Donoghue
2026-05-09 14:30 ` Loic Poulain
2026-05-07 22:49 ` [PATCH v3 05/15] media: qcom: camss: Add camss-isp-sched helper Loic Poulain
2026-05-08 10:05 ` Bryan O'Donoghue
2026-05-09 14:47 ` Loic Poulain
2026-05-07 22:49 ` [PATCH v3 06/15] media: qcom: camss: Add camss-isp-pipeline helper Loic Poulain
2026-05-07 22:49 ` [PATCH v3 07/15] media: qcom: camss: Add V4L2 meta format for CAMSS ISP parameters Loic Poulain
2026-05-07 22:49 ` [PATCH v3 08/15] media: qcom: camss: Add camss-isp-params helper Loic Poulain
2026-05-07 22:49 ` [PATCH v3 09/15] dt-bindings: media: qcom: Add CAMSS Offline Processing Engine (OPE) Loic Poulain
2026-05-07 22:49 ` [PATCH v3 10/15] dt-bindings: media: qcom,qcm2290-camss: Add OPE ISP subnode Loic Poulain
2026-05-07 22:49 ` [PATCH v3 11/15] media: qcom: camss: Populate CAMSS child devices via DT Loic Poulain
2026-05-07 22:49 ` Loic Poulain [this message]
2026-05-08 9:19 ` [PATCH v3 12/15] media: uapi: Add CAMSS ISP configuration definition Bryan O'Donoghue
2026-05-09 14:06 ` Loic Poulain
2026-05-07 22:49 ` [PATCH v3 13/15] media: qcom: camss: Add CAMSS Offline Processing Engine driver Loic Poulain
2026-05-07 22:49 ` [PATCH v3 14/15] arm64: dts: qcom: agatti: Assigned clock rate for CAMSS AXI Loic Poulain
2026-05-07 22:49 ` [PATCH v3 15/15] arm64: dts: qcom: agatti: Add OPE node Loic Poulain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508-camss-isp-ope-v3-12-bb1055274603@oss.qualcomm.com \
--to=loic.poulain@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gustavoars@kernel.org \
--cc=johannes.goede@oss.qualcomm.com \
--cc=kees@kernel.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox