[PATCH 20/45] media: uapi: add Qualcomm IFE statistics
From: Gjorgji . Rosikopulos . gjorgji . rosikopulos
Date: Tue Oct 06 2026 - 18:46:33 EST
From: Atanas Filipov <atanas.filipov@xxxxxxxxxxxxxxxx>
Define the Bayer grid statistics buffer produced by Qualcomm IFE
hardware.
Signed-off-by: Atanas Filipov <atanas.filipov@xxxxxxxxxxxxxxxx>
---
include/uapi/linux/qcom-camss-stats.h | 62 +++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
create mode 100644 include/uapi/linux/qcom-camss-stats.h
diff --git a/include/uapi/linux/qcom-camss-stats.h b/include/uapi/linux/qcom-camss-stats.h
new file mode 100644
index 000000000000..52a9d3e8171f
--- /dev/null
+++ b/include/uapi/linux/qcom-camss-stats.h
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* Copyright (C) 2023 Qualcomm Technologies, Inc. */
+
+#ifndef _UAPI_LINUX_QCOM_CAMSS_STATS_H
+#define _UAPI_LINUX_QCOM_CAMSS_STATS_H
+
+#include <linux/types.h>
+
+/* Max number of bayer grid regions available in statistics */
+#define CAMSS_IFE_MAX_BAYER_GRID_REGIONS (64 * 48)
+
+/**
+ * struct camss_ife_bg_region_stats - IFE bayer grid statistics region.
+ *
+ * The IFE bayer grid statistic region contain sum of pixels and saturated
+ * counters within the region. The region configuration should be available
+ * in the IFE params bayer grid configuration structure.
+ *
+ * @r_sum: Sum of the red pixels.
+ * @b_sum: Sum of the blue pixels.
+ * @gr_sum: Sum of the green red pixels.
+ * @gb_sum: Sum of the green blue pixels.
+ * @r_cnt: Red pixels count.
+ * @b_cnt: Blue pixels count.
+ * @gr_cnt: Green red pixels count.
+ * @gb_cnt: Green blue pixels count.
+ * @sat_r_sum: Saturated sum of the red pixels.
+ * @sat_b_sum: Saturated sum of the blue pixels.
+ * @sat_gr_sum: Saturated sum of the green red pixels.
+ * @sat_gb_sum: Saturated sum of the green blue pixels.
+ * @sat_r_cnt: Saturated red pixels count.
+ * @sat_b_cnt: Saturated blue pixels count.
+ * @sat_gr_cnt: Saturated green red pixels count.
+ * @sat_gb_cnt: Saturated green blue pixels count.
+ */
+struct camss_ife_bg_region_stats {
+ __u32 r_sum;
+ __u32 b_sum;
+ __u32 gr_sum;
+ __u32 gb_sum;
+
+ __u16 r_cnt;
+ __u16 b_cnt;
+ __u16 gr_cnt;
+ __u16 gb_cnt;
+
+ __u32 sat_r_sum;
+ __u32 sat_b_sum;
+ __u32 sat_gr_sum;
+ __u32 sat_gb_sum;
+
+ __u16 sat_r_cnt;
+ __u16 sat_b_cnt;
+ __u16 sat_gr_cnt;
+ __u16 sat_gb_cnt;
+} __attribute__((packed));
+
+struct camss_ife_stats {
+ struct camss_ife_bg_region_stats regions[CAMSS_IFE_MAX_BAYER_GRID_REGIONS];
+} __attribute__((packed));
+
+#endif /* _UAPI_LINUX_QCOM_CAMSS_STATS_H */
--
2.34.1