diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index 0dd0fc40b..b018f3d9d 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c @@ -14,10 +14,6 @@ */ #include #include -#ifdef CONFIG_TEGRA_GK20A_NVHOST -#include -#include -#endif #include #include @@ -27,6 +23,7 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "gk20a/fifo_gk20a.h" @@ -1461,7 +1458,7 @@ static void gv11b_fifo_add_syncpt_wait_cmd(struct gk20a *g, u32 id, u32 thresh, u64 gpu_va_base) { u64 gpu_va = gpu_va_base + - nvhost_syncpt_unit_interface_get_byte_offset(id); + nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(id); gk20a_dbg_fn(""); @@ -1497,7 +1494,7 @@ static void gv11b_fifo_add_syncpt_incr_cmd(struct gk20a *g, { u32 off = cmd->off; u64 gpu_va = gpu_va_base + - nvhost_syncpt_unit_interface_get_byte_offset(id); + nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(id); gk20a_dbg_fn(""); diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 4b600cdd0..2b6f87591 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -19,9 +19,8 @@ #include #include #include -#ifdef CONFIG_TEGRA_GK20A_NVHOST -#include -#endif +#include +#include #include @@ -40,38 +39,26 @@ static void gr_gv11b_remove_sysfs(struct device *dev); static int gv11b_tegra_probe(struct device *dev) { - int err = 0; struct gk20a_platform *platform = dev_get_drvdata(dev); - struct gk20a *g = platform->g; - struct device_node *np = dev->of_node; - struct device_node *host1x_node; - struct platform_device *host1x_pdev; - const __be32 *host1x_ptr; - #ifdef CONFIG_TEGRA_GK20A_NVHOST - host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); - if (!host1x_ptr) { + struct gk20a *g = platform->g; + int err = 0; + + err = nvgpu_get_nvhost_dev(g); + if (err) { dev_err(dev, "host1x device not available"); - return -ENOSYS; + return err; } - host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); - host1x_pdev = of_find_device_by_node(host1x_node); - if (!host1x_pdev) { - dev_err(dev, "host1x device not available"); - return -ENOSYS; - } - - platform->g->host1x_dev = host1x_pdev; - err = nvhost_syncpt_unit_interface_get_aperture( - g->host1x_dev, + err = nvgpu_nvhost_syncpt_unit_interface_get_aperture( + g->nvhost_dev, &g->syncpt_unit_base, &g->syncpt_unit_size); if (err) { dev_err(dev, "Failed to get syncpt interface"); return -ENOSYS; } - g->syncpt_size = nvhost_syncpt_unit_interface_get_byte_offset(1); + g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1); gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", g->syncpt_unit_base, g->syncpt_unit_size, g->syncpt_size);