[PATCH RESEND 11/45] media: qcom: camss: sm8250: add IFE pad descriptors

From: Gjorgji . Rosikopulos . gjorgji . rosikopulos

Date: Wed Oct 07 2026 - 05:07:05 EST


From: Atanas Filipov <atanas.filipov@xxxxxxxxxxxxxxxx>

Add the pad, format, size and write-master tables for the SM8250 full
and lite IFE blocks.

Signed-off-by: Atanas Filipov <atanas.filipov@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/camss/Makefile | 1 +
.../platform/qcom/camss/camss-ife-pads.c | 306 ++++++++++++++++++
drivers/media/platform/qcom/camss/camss-ife.h | 2 +
3 files changed, 309 insertions(+)
create mode 100644 drivers/media/platform/qcom/camss/camss-ife-pads.c

diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile
index 22df889656ba..547da75b24b4 100644
--- a/drivers/media/platform/qcom/camss/Makefile
+++ b/drivers/media/platform/qcom/camss/Makefile
@@ -20,6 +20,7 @@ qcom-camss-objs += \
camss-ife-mod-v10x.o \
camss-ife-scale-v10x.o \
camss-ife-top-v20x.o \
+ camss-ife-pads.o \
camss-ispif.o \
camss-tpg.o \
camss-tpg-gen1.o \
diff --git a/drivers/media/platform/qcom/camss/camss-ife-pads.c b/drivers/media/platform/qcom/camss/camss-ife-pads.c
new file mode 100644
index 000000000000..926ba96a7603
--- /dev/null
+++ b/drivers/media/platform/qcom/camss/camss-ife-pads.c
@@ -0,0 +1,306 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2023, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Technologies, Inc.
+ */
+
+#include <linux/videodev2.h>
+#include <media/v4l2-mediabus.h>
+
+#include "camss-format.h"
+#include "camss-ife.h"
+
+static const struct camss_format_info ife_sink_fmts_v20x[] = {
+ { MEDIA_BUS_FMT_UYVY8_1X16, 8, V4L2_PIX_FMT_UYVY, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 16 } },
+ { MEDIA_BUS_FMT_VYUY8_1X16, 8, V4L2_PIX_FMT_VYUY, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 16 } },
+ { MEDIA_BUS_FMT_YUYV8_1X16, 8, V4L2_PIX_FMT_YUYV, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 16 } },
+ { MEDIA_BUS_FMT_YVYU8_1X16, 8, V4L2_PIX_FMT_YVYU, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 16 } },
+ { MEDIA_BUS_FMT_SBGGR8_1X8, 8, V4L2_PIX_FMT_SBGGR8, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 8 } },
+ { MEDIA_BUS_FMT_SGBRG8_1X8, 8, V4L2_PIX_FMT_SGBRG8, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 8 } },
+ { MEDIA_BUS_FMT_SGRBG8_1X8, 8, V4L2_PIX_FMT_SGRBG8, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 8 } },
+ { MEDIA_BUS_FMT_SRGGB8_1X8, 8, V4L2_PIX_FMT_SRGGB8, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 8 } },
+ { MEDIA_BUS_FMT_SBGGR10_1X10, 10, V4L2_PIX_FMT_SBGGR10P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 10 } },
+ { MEDIA_BUS_FMT_SGBRG10_1X10, 10, V4L2_PIX_FMT_SGBRG10P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 10 } },
+ { MEDIA_BUS_FMT_SGRBG10_1X10, 10, V4L2_PIX_FMT_SGRBG10P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 10 } },
+ { MEDIA_BUS_FMT_SRGGB10_1X10, 10, V4L2_PIX_FMT_SRGGB10P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 10 } },
+ { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, 16, V4L2_PIX_FMT_SBGGR10, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 16 } },
+ { MEDIA_BUS_FMT_SBGGR12_1X12, 12, V4L2_PIX_FMT_SBGGR12P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 12 } },
+ { MEDIA_BUS_FMT_SGBRG12_1X12, 12, V4L2_PIX_FMT_SGBRG12P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 12 } },
+ { MEDIA_BUS_FMT_SGRBG12_1X12, 12, V4L2_PIX_FMT_SGRBG12P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 12 } },
+ { MEDIA_BUS_FMT_SRGGB12_1X12, 12, V4L2_PIX_FMT_SRGGB12P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 12 } },
+ { MEDIA_BUS_FMT_SBGGR14_1X14, 14, V4L2_PIX_FMT_SBGGR14P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 14 } },
+ { MEDIA_BUS_FMT_SGBRG14_1X14, 14, V4L2_PIX_FMT_SGBRG14P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 14 } },
+ { MEDIA_BUS_FMT_SGRBG14_1X14, 14, V4L2_PIX_FMT_SGRBG14P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 14 } },
+ { MEDIA_BUS_FMT_SRGGB14_1X14, 14, V4L2_PIX_FMT_SRGGB14P, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 14 } },
+ { MEDIA_BUS_FMT_Y8_1X8, 8, V4L2_PIX_FMT_GREY, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 8 } },
+ { MEDIA_BUS_FMT_Y10_2X8_PADHI_LE, 16, V4L2_PIX_FMT_Y10, 1,
+ { { 1, 1 } }, { { 1, 1 } }, { 16 } },
+};
+
+static const struct camss_format_info ife_vid_pix_fmts_v20x[] = {
+ { MEDIA_BUS_FMT_YUYV8_1_5X8, 8, V4L2_PIX_FMT_NV12, 1,
+ { { 1, 1 } }, { { 2, 3 } }, { 8 } },
+};
+
+static const struct ife_pad_limits ife_vid_limits_v20x = {
+ .min_width = 320,
+ .min_height = 240,
+ .max_width = 4928,
+ .max_height = 8192,
+ .max_h_ratio = 16,
+ .max_v_ratio = 16,
+};
+
+static const struct ife_pad_limits ife_fd_limits = {
+ .min_width = 320,
+ .min_height = 240,
+ .max_width = 1920,
+ .max_height = 1080,
+ .max_h_ratio = 16,
+ .max_v_ratio = 16,
+};
+
+static const struct ife_pad_desc ife_lite_pad_desc_v20x[] = {
+ {
+ .pad_flags = MEDIA_PAD_FL_SINK,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi0",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI0,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI0,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(0),
+ .comp_group_mask = BIT(4),
+ .num_wms = 1,
+ .wm = { 0 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi1",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI1,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI1,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(1),
+ .comp_group_mask = BIT(5),
+ .num_wms = 1,
+ .wm = { 1 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi2",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI2,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI2,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(2),
+ .comp_group_mask = BIT(6),
+ .num_wms = 1,
+ .wm = { 2 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi3",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI3,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI3,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(3),
+ .comp_group_mask = BIT(7),
+ .num_wms = 1,
+ .wm = { 3 },
+ },
+};
+
+static const struct ife_pad_desc ife_pad_desc_v20x[] = {
+ {
+ .pad_flags = MEDIA_PAD_FL_SINK,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi0",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI0,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI0,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(3),
+ .comp_group_mask = BIT(17),
+ .num_wms = 1,
+ .wm = { 23 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi1",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI1,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI1,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(4),
+ .comp_group_mask = BIT(18),
+ .num_wms = 1,
+ .wm = { 24 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_sink_fmts_v20x),
+ .formats = ife_sink_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "rdi2",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_RDI2,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_RDI2,
+ .packing_fmt = 0x0,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_FRAME_BASED,
+ .rup_group_mask = BIT(5),
+ .comp_group_mask = BIT(19),
+ .num_wms = 1,
+ .wm = { 25 },
+ },
+
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_vid_pix_fmts_v20x),
+ .formats = ife_vid_pix_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "vid_full",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_VID_FULL,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_PP,
+ .packing_fmt = 0x1,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_LINE_BASED,
+ .rup_group_mask = BIT(0),
+ .comp_group_mask = BIT(6),
+ .num_wms = 2,
+ .wm = { 0, 1 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_vid_pix_fmts_v20x),
+ .formats = ife_vid_pix_fmts_v20x,
+ },
+ .limits = &ife_vid_limits_v20x,
+ .video_name = "disp_full",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_DISP_FULL,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_PP,
+ .packing_fmt = 0x1,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_LINE_BASED,
+ .rup_group_mask = BIT(0),
+ .comp_group_mask = BIT(7),
+ .num_wms = 2,
+ .wm = { 4, 5 },
+ },
+ {
+ .pad_flags = MEDIA_PAD_FL_SOURCE,
+ .sup_fmts = {
+ .nformats = ARRAY_SIZE(ife_vid_pix_fmts_v20x),
+ .formats = ife_vid_pix_fmts_v20x,
+ },
+ .limits = &ife_fd_limits,
+ .video_name = "fd",
+ .link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED,
+ .buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ .output = CAMSS_IFE_OUTPUT_FD,
+ .hw_pipe = CAMSS_IFE_HW_PIPE_PP,
+ .packing_fmt = 0x1,
+ .mode_config = BUSWR_CLIENT_CFG_MODE_LINE_BASED,
+ .rup_group_mask = BIT(0),
+ .comp_group_mask = BIT(8),
+ .num_wms = 2,
+ .wm[0] = 8,
+ .wm[1] = 9,
+ },
+};
+
+const struct ife_pads_descriptors ife_lite_pads_v20x = {
+ .num_desc = ARRAY_SIZE(ife_lite_pad_desc_v20x),
+ .desc = ife_lite_pad_desc_v20x,
+};
+
+const struct ife_pads_descriptors ife_pads_v20x = {
+ .num_desc = ARRAY_SIZE(ife_pad_desc_v20x),
+ .desc = ife_pad_desc_v20x,
+};
diff --git a/drivers/media/platform/qcom/camss/camss-ife.h b/drivers/media/platform/qcom/camss/camss-ife.h
index a36efd8a6352..45fce7e33c4a 100644
--- a/drivers/media/platform/qcom/camss/camss-ife.h
+++ b/drivers/media/platform/qcom/camss/camss-ife.h
@@ -389,10 +389,12 @@ camss_ife_pipe_for_stream_id(int nstreams,
const struct camss_ife_stream *streams,
u32 id);

+extern const struct ife_pads_descriptors ife_pads_v20x;
extern const struct ife_hw_top_ops ife_top_20x_ops;
extern const struct ife_hw_buswr_ops ife_buswr_20x_ops;
extern const struct camss_mod_ops ife_mod_v10x_ops;

+extern const struct ife_pads_descriptors ife_lite_pads_v20x;
extern const struct ife_hw_top_ops ife_lite_top_10x_ops;

#endif /* CAMSS_IFE_SUB_DEV_H */
--
2.34.1