summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-06-02 05:21:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-08 09:37:17 -0400
commit5205ab23a29d6bb2d94eecae67ba344f438c5045 (patch)
tree9305a25a50771b12393e11aa5901e493993806c7 /drivers/gpu/nvgpu
parent366386d1898af61eb425aa8b37cfb656ff898c1a (diff)
gpu: nvgpu: use nvgpu specific nvhost APIs
Remove use of linux specifix header files <linux/nvhost.h> and <linux/nvhost_t194.h> and use nvgpu specific header file <nvgpu/nvhost_t19x.h> instead This is needed to remove all Linux dependencies from nvgpu driver Replace all nvhost_*() calls by nvgpu_nvhost_*() calls from new nvgpu library Jira NVGPU-29 Change-Id: I32d59628ca5ab3ece80a10eb5aefa150b1da448b Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1494648 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c9
-rw-r--r--drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c33
2 files changed, 13 insertions, 29 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 0dd0fc40..b018f3d9 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -14,10 +14,6 @@
14 */ 14 */
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#ifdef CONFIG_TEGRA_GK20A_NVHOST
18#include <linux/nvhost.h>
19#include <linux/nvhost_t194.h>
20#endif
21 17
22#include <nvgpu/semaphore.h> 18#include <nvgpu/semaphore.h>
23#include <nvgpu/timers.h> 19#include <nvgpu/timers.h>
@@ -27,6 +23,7 @@
27#include <nvgpu/gmmu.h> 23#include <nvgpu/gmmu.h>
28#include <nvgpu/soc.h> 24#include <nvgpu/soc.h>
29#include <nvgpu/debug.h> 25#include <nvgpu/debug.h>
26#include <nvgpu/nvhost_t19x.h>
30 27
31#include "gk20a/gk20a.h" 28#include "gk20a/gk20a.h"
32#include "gk20a/fifo_gk20a.h" 29#include "gk20a/fifo_gk20a.h"
@@ -1461,7 +1458,7 @@ static void gv11b_fifo_add_syncpt_wait_cmd(struct gk20a *g,
1461 u32 id, u32 thresh, u64 gpu_va_base) 1458 u32 id, u32 thresh, u64 gpu_va_base)
1462{ 1459{
1463 u64 gpu_va = gpu_va_base + 1460 u64 gpu_va = gpu_va_base +
1464 nvhost_syncpt_unit_interface_get_byte_offset(id); 1461 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(id);
1465 1462
1466 gk20a_dbg_fn(""); 1463 gk20a_dbg_fn("");
1467 1464
@@ -1497,7 +1494,7 @@ static void gv11b_fifo_add_syncpt_incr_cmd(struct gk20a *g,
1497{ 1494{
1498 u32 off = cmd->off; 1495 u32 off = cmd->off;
1499 u64 gpu_va = gpu_va_base + 1496 u64 gpu_va = gpu_va_base +
1500 nvhost_syncpt_unit_interface_get_byte_offset(id); 1497 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(id);
1501 1498
1502 gk20a_dbg_fn(""); 1499 gk20a_dbg_fn("");
1503 1500
diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
index 4b600cdd..2b6f8759 100644
--- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
+++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
@@ -19,9 +19,8 @@
19#include <linux/nvmap.h> 19#include <linux/nvmap.h>
20#include <linux/reset.h> 20#include <linux/reset.h>
21#include <linux/hashtable.h> 21#include <linux/hashtable.h>
22#ifdef CONFIG_TEGRA_GK20A_NVHOST 22#include <nvgpu/nvhost.h>
23#include <linux/nvhost_t194.h> 23#include <nvgpu/nvhost_t19x.h>
24#endif
25 24
26#include <uapi/linux/nvgpu.h> 25#include <uapi/linux/nvgpu.h>
27 26
@@ -40,38 +39,26 @@ static void gr_gv11b_remove_sysfs(struct device *dev);
40 39
41static int gv11b_tegra_probe(struct device *dev) 40static int gv11b_tegra_probe(struct device *dev)
42{ 41{
43 int err = 0;
44 struct gk20a_platform *platform = dev_get_drvdata(dev); 42 struct gk20a_platform *platform = dev_get_drvdata(dev);
45 struct gk20a *g = platform->g;
46 struct device_node *np = dev->of_node;
47 struct device_node *host1x_node;
48 struct platform_device *host1x_pdev;
49 const __be32 *host1x_ptr;
50
51#ifdef CONFIG_TEGRA_GK20A_NVHOST 43#ifdef CONFIG_TEGRA_GK20A_NVHOST
52 host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); 44 struct gk20a *g = platform->g;
53 if (!host1x_ptr) { 45 int err = 0;
54 dev_err(dev, "host1x device not available");
55 return -ENOSYS;
56 }
57 46
58 host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); 47 err = nvgpu_get_nvhost_dev(g);
59 host1x_pdev = of_find_device_by_node(host1x_node); 48 if (err) {
60 if (!host1x_pdev) {
61 dev_err(dev, "host1x device not available"); 49 dev_err(dev, "host1x device not available");
62 return -ENOSYS; 50 return err;
63 } 51 }
64 52
65 platform->g->host1x_dev = host1x_pdev; 53 err = nvgpu_nvhost_syncpt_unit_interface_get_aperture(
66 err = nvhost_syncpt_unit_interface_get_aperture( 54 g->nvhost_dev,
67 g->host1x_dev,
68 &g->syncpt_unit_base, 55 &g->syncpt_unit_base,
69 &g->syncpt_unit_size); 56 &g->syncpt_unit_size);
70 if (err) { 57 if (err) {
71 dev_err(dev, "Failed to get syncpt interface"); 58 dev_err(dev, "Failed to get syncpt interface");
72 return -ENOSYS; 59 return -ENOSYS;
73 } 60 }
74 g->syncpt_size = nvhost_syncpt_unit_interface_get_byte_offset(1); 61 g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1);
75 gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", 62 gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n",
76 g->syncpt_unit_base, g->syncpt_unit_size, 63 g->syncpt_unit_base, g->syncpt_unit_size,
77 g->syncpt_size); 64 g->syncpt_size);