Re: [RFC PATCH 06/11] media: iris: Add hooks for pixel and non-pixel context banks
From: Dmitry Baryshkov
Date: Thu Jul 09 2026 - 09:23:22 EST
On Thu, Jul 09, 2026 at 06:05:52PM +0530, Vikash Garodia wrote:
> Iris platforms use separate context-bank devices for the pixel and
> non-pixel domains. Add platform hooks to create and destroy those
> subdevices, and wire them up for the affected platforms.
>
> Co-developed-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> Signed-off-by: Vikash Garodia <vikash.garodia@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/iris/Makefile | 1 +
> .../platform/qcom/iris/iris_platform_sm8550.c | 71 ++++++++++++++++++++++
> .../platform/qcom/iris/iris_platform_sm8550.h | 24 ++------
> .../media/platform/qcom/iris/iris_platform_vpu3x.c | 4 ++
> 4 files changed, 80 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile
> index 48e415cbc4390bc596f6239fefa2a2ad2cd3a2bb..fd6bfe7e786be3f8a4885296fb11ba430ded6fd1 100644
> --- a/drivers/media/platform/qcom/iris/Makefile
> +++ b/drivers/media/platform/qcom/iris/Makefile
> @@ -12,6 +12,7 @@ qcom-iris-objs += iris_buffer.o \
> iris_hfi_gen2_packet.o \
> iris_hfi_gen2_response.o \
> iris_hfi_queue.o \
> + iris_platform_sm8550.o \
No, it's not a separate platform.
> iris_platform_vpu2.o \
> iris_platform_vpu3x.o \
> iris_power.o \
> diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8550.c b/drivers/media/platform/qcom/iris/iris_platform_sm8550.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..bea904a9249bafe1dfa11ff39155d1930402bf7c
> --- /dev/null
> +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8550.c
> @@ -0,0 +1,71 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#include "iris_core.h"
> +#include "iris_platform_common.h"
> +#include "iris_platform_sm8550.h"
> +
> +const char * const sm8550_clk_reset_table[] = { "bus" };
> +
> +const struct platform_clk_data sm8550_clk_table[] = {
> + {IRIS_AXI_CLK, "iface" },
> + {IRIS_CTRL_CLK, "core" },
> + {IRIS_HW_CLK, "vcodec0_core" },
> +};
> +
> +struct platform_inst_caps platform_inst_cap_sm8550 = {
> + .min_frame_width = 96,
> + .max_frame_width = 8192,
> + .min_frame_height = 96,
> + .max_frame_height = 8192,
> + .max_mbpf = (8192 * 4352) / 256,
> + .mb_cycles_vpp = 200,
> + .mb_cycles_fw = 489583,
> + .mb_cycles_fw_vpp = 66234,
> + .max_frame_rate = MAXIMUM_FPS,
> + .max_operating_rate = MAXIMUM_FPS,
> +};
> +
> +static int sm8550_init_cb_devs(struct iris_core *core)
> +{
> + struct device *dev;
> +
> + dev = iris_create_cb_dev(core, "non-pixel");
> + if (IS_ERR(dev))
> + return PTR_ERR(dev);
> +
> + core->np_dev = dev;
> +
> + dev = iris_create_cb_dev(core, "pixel");
> + if (IS_ERR(dev))
> + goto unreg_np_dev;
> +
> + core->p_dev = dev;
> +
> + return 0;
> +
> +unreg_np_dev:
> + if (core->np_dev)
> + platform_device_unregister(to_platform_device(core->np_dev));
> + core->np_dev = NULL;
> +
> + return PTR_ERR(dev);
> +}
> +
> +static void sm8550_deinit_cb_devs(struct iris_core *core)
> +{
> + if (core->p_dev)
> + platform_device_unregister(to_platform_device(core->p_dev));
> + if (core->np_dev)
> + platform_device_unregister(to_platform_device(core->np_dev));
> +
> + core->p_dev = NULL;
> + core->np_dev = NULL;
> +}
> +
> +const struct iris_context_bank_ops sm8550_cb_ops = {
For a long time I have been asking to fix name prefixes. Now you are
adding one more. No. Please write it as a rule of thumb. All new symbols
in the iris driver should start with iris_.
Moreover, there is nothing sm8550-specific in these hooks. Enable them
for all VPU3.x platforms uniformly.
> + .init = sm8550_init_cb_devs,
> + .deinit = sm8550_deinit_cb_devs,
> +};
--
With best wishes
Dmitry