summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2022-09-07 11:38:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 00:12:38 +0300
commit47f18c557ae7172548835774f48a20ec6cc4017e (patch)
tree1ad7c284a0ae966076d7fb8eb69cbf55b3ad1a3a /include
parentcab341c5cf65d7df188ef982bb7998f0670e9867 (diff)
downloadlinux-47f18c557ae7172548835774f48a20ec6cc4017e.tar.xz
gpu: host1x: Select context device based on attached IOMMU
[ Upstream commit 8935002fc37fce1ad211d98a70f2fd42083c0594 ] 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> Stable-dep-of: 6cbab9f0da72 ("drm/tegra: Add call to put_pid()") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/host1x.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index cb2100d9b0ff..dc55d9d3b94f 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -469,11 +469,13 @@ struct host1x_memory_context {
#ifdef CONFIG_IOMMU_API
struct host1x_memory_context *host1x_memory_context_alloc(struct host1x *host1x,
+ struct device *dev,
struct pid *pid);
void host1x_memory_context_get(struct host1x_memory_context *cd);
void host1x_memory_context_put(struct host1x_memory_context *cd);
#else
static inline struct host1x_memory_context *host1x_memory_context_alloc(struct host1x *host1x,
+ struct device *dev,
struct pid *pid)
{
return NULL;