diff options
author | Seema Khowala <seemaj@nvidia.com> | 2017-12-12 18:07:50 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-12-14 00:23:11 -0500 |
commit | 1bf9b91c05ceebf872171a536c2660ee69fa5f64 (patch) | |
tree | 6d9a295ef801dbd1d3dfd88f2b01593ee14675e5 /drivers/gpu/nvgpu/common/linux | |
parent | b92a6bdbf51da0d071fc11146258ca6a80e2b9d7 (diff) |
gpu: nvgpu: gv11b: get syncpt aperture only if host1x is present
nvgpu_get_nvhost_dev will not return error if host1x field within
gv11b device tree is not present. It will just set has_syncpoints
in gk20a struct to false. syncpt_unit_interface* should be called
only if g->has_syncpoints is set to true.
Change-Id: Id1eb94aba4cff1942ad519f528ebdb8291963971
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1615973
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c index a2a60aaa..42f59a26 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c | |||
@@ -59,18 +59,24 @@ static int gv11b_tegra_probe(struct device *dev) | |||
59 | return err; | 59 | return err; |
60 | } | 60 | } |
61 | 61 | ||
62 | err = nvgpu_nvhost_syncpt_unit_interface_get_aperture( | 62 | if (g->has_syncpoints) { |
63 | err = nvgpu_nvhost_syncpt_unit_interface_get_aperture( | ||
63 | g->nvhost_dev, | 64 | g->nvhost_dev, |
64 | &g->syncpt_unit_base, | 65 | &g->syncpt_unit_base, |
65 | &g->syncpt_unit_size); | 66 | &g->syncpt_unit_size); |
66 | if (err) { | 67 | if (err) { |
67 | dev_err(dev, "Failed to get syncpt interface"); | 68 | dev_err(dev, "Failed to get syncpt interface"); |
68 | return -ENOSYS; | 69 | return -ENOSYS; |
70 | } | ||
71 | g->syncpt_size = | ||
72 | nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1); | ||
73 | nvgpu_info(g, "syncpt_unit_base %llx " | ||
74 | "syncpt_unit_size %zx size %x\n", | ||
75 | g->syncpt_unit_base, g->syncpt_unit_size, | ||
76 | g->syncpt_size); | ||
69 | } | 77 | } |
70 | g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1); | 78 | #else |
71 | gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", | 79 | g->has_syncpoints = false; |
72 | g->syncpt_unit_base, g->syncpt_unit_size, | ||
73 | g->syncpt_size); | ||
74 | #endif | 80 | #endif |
75 | 81 | ||
76 | platform->bypass_smmu = !device_is_iommuable(dev); | 82 | platform->bypass_smmu = !device_is_iommuable(dev); |