diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/nvgpu_mem.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/nvgpu_mem.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c index 63a14f40..3cac13ba 100644 --- a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c | |||
@@ -33,10 +33,18 @@ | |||
33 | 33 | ||
34 | #include "gk20a/gk20a.h" | 34 | #include "gk20a/gk20a.h" |
35 | #include "gk20a/mm_gk20a.h" | 35 | #include "gk20a/mm_gk20a.h" |
36 | #include "platform_gk20a.h" | ||
36 | 37 | ||
37 | static inline u64 __nvgpu_sgl_phys(struct gk20a *g, struct nvgpu_sgl *sgl) | 38 | static u64 __nvgpu_sgl_phys(struct gk20a *g, struct nvgpu_sgl *sgl) |
38 | { | 39 | { |
39 | return sg_phys((struct scatterlist *)sgl); | 40 | struct device *dev = dev_from_gk20a(g); |
41 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
42 | u64 ipa = sg_phys((struct scatterlist *)sgl); | ||
43 | |||
44 | if (platform->phys_addr) | ||
45 | return platform->phys_addr(g, ipa); | ||
46 | |||
47 | return ipa; | ||
40 | } | 48 | } |
41 | 49 | ||
42 | int nvgpu_mem_begin(struct gk20a *g, struct nvgpu_mem *mem) | 50 | int nvgpu_mem_begin(struct gk20a *g, struct nvgpu_mem *mem) |