Skip to content

Commit 9e3e344

Browse files
Vishnu Reddygouravk-qualcomm
authored andcommitted
PENDING: media: iris: enable context banks on sm8550 and sa8775p
Switch the iris video codec node in sm8550 (kailua) and sa8775p (lemans) DTS from the legacy 'iommus' property to 'iommu-map', assigning named function IDs (IRIS_NON_PIXEL_VCODEC and IRIS_PIXEL) to each SMMU stream mapping. This allows the driver to look up and attach the correct IOMMU domain per context bank instead of sharing a single domain. Add a new dt-bindings header include/dt-bindings/media/qcom,sm8550-iris.h that defines the two function identifiers so they can be shared between device-trees and the driver without hard-coded magic numbers. Wire up sm8550_init_cb_devs() in iris_platform_gen2.c to register the two child context-bank platform devices (iris_non_pixel and iris_pixel) using iris_create_cb_dev(), and hook it into the sm8550_data platform data via the new .init_cb_devs callback. Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com> Signed-off-by: Gourav Kumar <gouravk@qti.qualcomm.com>
1 parent 821bb8a commit 9e3e344

4 files changed

Lines changed: 44 additions & 4 deletions

File tree

arch/arm64/boot/dts/qcom/lemans.dtsi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <dt-bindings/interconnect/qcom,osm-l3.h>
1818
#include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
1919
#include <dt-bindings/mailbox/qcom-ipcc.h>
20+
#include <dt-bindings/media/qcom,sm8550-iris.h>
2021
#include <dt-bindings/firmware/qcom,scm.h>
2122
#include <dt-bindings/power/qcom-rpmpd.h>
2223
#include <dt-bindings/soc/qcom,gpr.h>
@@ -4608,8 +4609,8 @@
46084609
resets = <&gcc GCC_VIDEO_AXI0_CLK_ARES>;
46094610
reset-names = "bus";
46104611

4611-
iommus = <&apps_smmu 0x0880 0x0400>,
4612-
<&apps_smmu 0x0887 0x0400>;
4612+
iommu-map = <IRIS_NON_PIXEL_VCODEC &apps_smmu 0x0880 0x0400 0x1>,
4613+
<IRIS_PIXEL &apps_smmu 0x0887 0x0400 0x1>;
46134614
dma-coherent;
46144615

46154616
status = "disabled";

arch/arm64/boot/dts/qcom/sm8550.dtsi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <dt-bindings/interconnect/qcom,icc.h>
1919
#include <dt-bindings/interconnect/qcom,sm8550-rpmh.h>
2020
#include <dt-bindings/mailbox/qcom-ipcc.h>
21+
#include <dt-bindings/media/qcom,sm8550-iris.h>
2122
#include <dt-bindings/power/qcom-rpmpd.h>
2223
#include <dt-bindings/power/qcom,rpmhpd.h>
2324
#include <dt-bindings/soc/qcom,gpr.h>
@@ -3292,8 +3293,8 @@
32923293
resets = <&gcc GCC_VIDEO_AXI0_CLK_ARES>;
32933294
reset-names = "bus";
32943295

3295-
iommus = <&apps_smmu 0x1940 0>,
3296-
<&apps_smmu 0x1947 0>;
3296+
iommu-map = <IRIS_NON_PIXEL_VCODEC &apps_smmu 0x1940 0x0 0x1>,
3297+
<IRIS_PIXEL &apps_smmu 0x1947 0x0 0x1>;
32973298
dma-coherent;
32983299

32993300
/*

drivers/media/platform/qcom/iris/iris_platform_gen2.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright (c) 2025 Linaro Ltd
55
*/
66

7+
#include <dt-bindings/media/qcom,sm8550-iris.h>
8+
79
#include "iris_core.h"
810
#include "iris_ctrls.h"
911
#include "iris_hfi_gen2.h"
@@ -762,6 +764,28 @@ static void iris_set_sm8550_preset_registers(struct iris_core *core)
762764
writel(0x0, core->reg_base + 0xB0088);
763765
}
764766

767+
static int sm8550_init_cb_devs(struct iris_core *core)
768+
{
769+
const u32 f_ids_np[] = {1, IRIS_NON_PIXEL_VCODEC};
770+
const u32 f_ids_p[] = {1, IRIS_PIXEL};
771+
772+
core->dev_np = iris_create_cb_dev(core, "iris_non_pixel", f_ids_np);
773+
if (!core->dev_np)
774+
return -ENODEV;
775+
776+
core->dev_p = iris_create_cb_dev(core, "iris_pixel", f_ids_p);
777+
if (!core->dev_p)
778+
goto unreg_dev_np;
779+
780+
return 0;
781+
782+
unreg_dev_np:
783+
device_unregister(core->dev_np);
784+
core->dev_np = NULL;
785+
786+
return -ENODEV;
787+
}
788+
765789
static const struct icc_info sm8550_icc_table[] = {
766790
{ "cpu-cfg", 1000, 1000 },
767791
{ "video-mem", 1000, 15000000 },
@@ -1016,6 +1040,7 @@ const struct iris_platform_data sm8550_data = {
10161040
.get_vpu_buffer_size = iris_vpu_buf_size,
10171041
.vpu_ops = &iris_vpu3_ops,
10181042
.set_preset_registers = iris_set_sm8550_preset_registers,
1043+
.init_cb_devs = sm8550_init_cb_devs,
10191044
.icc_tbl = sm8550_icc_table,
10201045
.icc_tbl_size = ARRAY_SIZE(sm8550_icc_table),
10211046
.clk_rst_tbl = sm8550_clk_reset_table,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2+
/*
3+
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
4+
*/
5+
6+
#ifndef _DT_BINDINGS_MEDIA_QCOM_SM8550_IRIS_H_
7+
#define _DT_BINDINGS_MEDIA_QCOM_SM8550_IRIS_H_
8+
9+
/* Function identifiers for iommu-map to attach for the context bank devices */
10+
#define IRIS_NON_PIXEL_VCODEC 0
11+
#define IRIS_PIXEL 1
12+
13+
#endif

0 commit comments

Comments
 (0)