Skip to content

Commit 2abdd44

Browse files
committed
drm/tegra: nvdec: Use tegra_dev_iommu_get_stream_id()
Use the newly implemented tegra_dev_iommu_get_stream_id() helper to encapsulate and centralize the IOMMU stream ID access. Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent b50ad38 commit 2abdd44

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

drivers/gpu/drm/tegra/nvdec.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,18 @@ static inline void nvdec_writel(struct nvdec *nvdec, u32 value,
6767

6868
static int nvdec_boot_falcon(struct nvdec *nvdec)
6969
{
70-
#ifdef CONFIG_IOMMU_API
71-
struct iommu_fwspec *spec = dev_iommu_fwspec_get(nvdec->dev);
72-
#endif
70+
u32 stream_id;
7371
int err;
7472

75-
#ifdef CONFIG_IOMMU_API
76-
if (nvdec->config->supports_sid && spec) {
73+
if (nvdec->config->supports_sid && tegra_dev_iommu_get_stream_id(nvdec->dev, &stream_id)) {
7774
u32 value;
7875

7976
value = TRANSCFG_ATT(1, TRANSCFG_SID_FALCON) | TRANSCFG_ATT(0, TRANSCFG_SID_HW);
8077
nvdec_writel(nvdec, value, NVDEC_TFBIF_TRANSCFG);
8178

82-
if (spec->num_ids > 0) {
83-
value = spec->ids[0] & 0xffff;
84-
85-
nvdec_writel(nvdec, value, VIC_THI_STREAMID0);
86-
nvdec_writel(nvdec, value, VIC_THI_STREAMID1);
87-
}
79+
nvdec_writel(nvdec, stream_id, VIC_THI_STREAMID0);
80+
nvdec_writel(nvdec, stream_id, VIC_THI_STREAMID1);
8881
}
89-
#endif
9082

9183
err = falcon_boot(&nvdec->falcon);
9284
if (err < 0)

0 commit comments

Comments
 (0)