gpu: host1x: Select context device based on attached IOMMU
authorMikko Perttunen <mperttunen@nvidia.com>
Wed, 7 Sep 2022 08:38:42 +0000 (11:38 +0300)
committerThierry Reding <treding@nvidia.com>
Fri, 25 Nov 2022 15:14:19 +0000 (16:14 +0100)
commit8935002fc37fce1ad211d98a70f2fd42083c0594
tree942af9c580d212eccce15438c06aa035eea6bbb7
parentc2418f911a31a266af4fbaca998dc73d3676475a
gpu: host1x: Select context device based on attached IOMMU

On Tegra234, engines that are programmed through Host1x channels can
be attached to either the NISO0 or NISO1 SMMU. Because of that, when
selecting a context device to use with an engine, we need to select
one that is also attached to the same SMMU.

Add a parameter to host1x_memory_context_alloc to specify which device
we are allocating a context for, and use it to pick an appropriate
context device.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
[treding@nvidia.com: update !IOMMU_API stub signature]
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/uapi.c
drivers/gpu/host1x/context.c
include/linux/host1x.h