diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-03-15 09:10:43 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-23 11:04:23 -0400 |
commit | 33f637585ecd617a9f4423f56e2aa6df0691ac64 (patch) | |
tree | e6f67da9b18ec64cae039b6af76c6abb27a70323 /drivers/gpu/nvgpu/gk20a | |
parent | 7505a759542c2d95e5abb42d44b8fb6afda74a87 (diff) |
gpu: nvgpu: split nvhost dependency on plat interface
Add CONFIG_TEGRA_GK20A_NVHOST and remove the TEGRA_GRHOST ||
TEGRA_HOST1X dependency in CONFIG_TEGRA_GK20A to allow using the iGPU
without the nvhost driver. Use the new config to guard syncpt-related
code.
Also make TEGRA_ACR depend on GK20A too so that it aligns properly under
gk20a in menuconfig.
Bug 1853519
Change-Id: I9e9b0a7915d000aae7930821627b7a01d08d3f5c
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1321303
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 7 |
6 files changed, 18 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 11448094..ae22ee7d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -31,11 +31,8 @@ | |||
31 | #include "../drivers/staging/android/sync.h" | 31 | #include "../drivers/staging/android/sync.h" |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifdef CONFIG_TEGRA_GK20A | 34 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
35 | #include <linux/nvhost.h> | 35 | #include <linux/nvhost.h> |
36 | #endif | ||
37 | |||
38 | #ifdef CONFIG_TEGRA_GK20A | ||
39 | 36 | ||
40 | struct gk20a_channel_syncpt { | 37 | struct gk20a_channel_syncpt { |
41 | struct gk20a_channel_sync ops; | 38 | struct gk20a_channel_sync ops; |
@@ -382,7 +379,7 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c) | |||
382 | 379 | ||
383 | return &sp->ops; | 380 | return &sp->ops; |
384 | } | 381 | } |
385 | #endif /* CONFIG_TEGRA_GK20A */ | 382 | #endif /* CONFIG_TEGRA_GK20A_NVHOST */ |
386 | 383 | ||
387 | struct gk20a_channel_semaphore { | 384 | struct gk20a_channel_semaphore { |
388 | struct gk20a_channel_sync ops; | 385 | struct gk20a_channel_sync ops; |
@@ -972,7 +969,7 @@ void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync) | |||
972 | 969 | ||
973 | struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c) | 970 | struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c) |
974 | { | 971 | { |
975 | #ifdef CONFIG_TEGRA_GK20A | 972 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
976 | if (gk20a_platform_has_syncpoints(c->g->dev)) | 973 | if (gk20a_platform_has_syncpoints(c->g->dev)) |
977 | return gk20a_channel_syncpt_create(c); | 974 | return gk20a_channel_syncpt_create(c); |
978 | #endif | 975 | #endif |
@@ -981,9 +978,7 @@ struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c) | |||
981 | 978 | ||
982 | bool gk20a_channel_sync_needs_sync_framework(struct channel_gk20a *c) | 979 | bool gk20a_channel_sync_needs_sync_framework(struct channel_gk20a *c) |
983 | { | 980 | { |
984 | #ifdef CONFIG_TEGRA_GK20A | ||
985 | if (gk20a_platform_has_syncpoints(c->g->dev)) | 981 | if (gk20a_platform_has_syncpoints(c->g->dev)) |
986 | return false; | 982 | return false; |
987 | #endif | ||
988 | return true; | 983 | return true; |
989 | } | 984 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index 89bfd0cf..4836e386 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c | |||
@@ -12,10 +12,6 @@ | |||
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifdef CONFIG_TEGRA_GK20A | ||
16 | #include <linux/nvhost.h> | ||
17 | #endif | ||
18 | |||
19 | #include <linux/debugfs.h> | 15 | #include <linux/debugfs.h> |
20 | #include <linux/seq_file.h> | 16 | #include <linux/seq_file.h> |
21 | #include <linux/io.h> | 17 | #include <linux/io.h> |
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index 115cd2b5..ea3cd3ff 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "../drivers/staging/android/sync.h" | 27 | #include "../drivers/staging/android/sync.h" |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #ifdef CONFIG_TEGRA_GK20A | 30 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
31 | #include <linux/nvhost.h> | 31 | #include <linux/nvhost.h> |
32 | #include <linux/nvhost_ioctl.h> | 32 | #include <linux/nvhost_ioctl.h> |
33 | #endif | 33 | #endif |
@@ -262,7 +262,7 @@ int gk20a_fence_from_semaphore( | |||
262 | return 0; | 262 | return 0; |
263 | } | 263 | } |
264 | 264 | ||
265 | #ifdef CONFIG_TEGRA_GK20A | 265 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
266 | /* Fences that are backed by host1x syncpoints: */ | 266 | /* Fences that are backed by host1x syncpoints: */ |
267 | 267 | ||
268 | static int gk20a_syncpt_fence_wait(struct gk20a_fence *f, long timeout) | 268 | static int gk20a_syncpt_fence_wait(struct gk20a_fence *f, long timeout) |
@@ -341,8 +341,11 @@ int gk20a_fence_from_syncpt( | |||
341 | return 0; | 341 | return 0; |
342 | } | 342 | } |
343 | #else | 343 | #else |
344 | int gk20a_fence_from_syncpt(struct platform_device *host1x_pdev, | 344 | int gk20a_fence_from_syncpt( |
345 | u32 id, u32 value, bool wfi) | 345 | struct gk20a_fence *fence_out, |
346 | struct platform_device *host1x_pdev, | ||
347 | u32 id, u32 value, bool wfi, | ||
348 | bool need_sync_fence) | ||
346 | { | 349 | { |
347 | return -EINVAL; | 350 | return -EINVAL; |
348 | } | 351 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index b390daa4..58020d41 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -21,7 +21,9 @@ | |||
21 | #include <linux/scatterlist.h> | 21 | #include <linux/scatterlist.h> |
22 | #include <trace/events/gk20a.h> | 22 | #include <trace/events/gk20a.h> |
23 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
24 | #ifdef CONFIG_TEGRA_GK20A_NVHOST | ||
24 | #include <linux/nvhost.h> | 25 | #include <linux/nvhost.h> |
26 | #endif | ||
25 | #include <linux/sort.h> | 27 | #include <linux/sort.h> |
26 | 28 | ||
27 | #include <nvgpu/timers.h> | 29 | #include <nvgpu/timers.h> |
@@ -3714,7 +3716,7 @@ void gk20a_dump_channel_status_ramfc(struct gk20a *g, | |||
3714 | atomic_read(&hw_sema->next_value), | 3716 | atomic_read(&hw_sema->next_value), |
3715 | nvgpu_hw_sema_addr(hw_sema)); | 3717 | nvgpu_hw_sema_addr(hw_sema)); |
3716 | 3718 | ||
3717 | #ifdef CONFIG_TEGRA_GK20A | 3719 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
3718 | if ((pbdma_syncpointb_op_v(syncpointb) == pbdma_syncpointb_op_wait_v()) | 3720 | if ((pbdma_syncpointb_op_v(syncpointb) == pbdma_syncpointb_op_wait_v()) |
3719 | && (pbdma_syncpointb_wait_switch_v(syncpointb) == | 3721 | && (pbdma_syncpointb_wait_switch_v(syncpointb) == |
3720 | pbdma_syncpointb_wait_switch_en_v())) | 3722 | pbdma_syncpointb_wait_switch_en_v())) |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index c8e2b19e..76484dd5 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1842,8 +1842,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) | |||
1842 | if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g)) | 1842 | if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g)) |
1843 | gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS; | 1843 | gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS; |
1844 | 1844 | ||
1845 | if (IS_ENABLED(CONFIG_TEGRA_GK20A) && | 1845 | if (gk20a_platform_has_syncpoints(g->dev)) |
1846 | gk20a_platform_has_syncpoints(g->dev)) | ||
1847 | gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; | 1846 | gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; |
1848 | 1847 | ||
1849 | gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS; | 1848 | gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS; |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 99ea1bb7..d685639b 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h | |||
@@ -35,9 +35,6 @@ struct secure_page_buffer { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | struct gk20a_platform { | 37 | struct gk20a_platform { |
38 | #ifdef CONFIG_TEGRA_GK20A | ||
39 | u32 syncpt_base; | ||
40 | #endif | ||
41 | /* Populated by the gk20a driver before probing the platform. */ | 38 | /* Populated by the gk20a driver before probing the platform. */ |
42 | struct gk20a *g; | 39 | struct gk20a *g; |
43 | 40 | ||
@@ -277,8 +274,12 @@ extern struct gk20a_platform vgpu_tegra_platform; | |||
277 | 274 | ||
278 | static inline bool gk20a_platform_has_syncpoints(struct device *dev) | 275 | static inline bool gk20a_platform_has_syncpoints(struct device *dev) |
279 | { | 276 | { |
277 | #ifdef CONFIG_TEGRA_GK20A_NVHOST | ||
280 | struct gk20a_platform *p = dev_get_drvdata(dev); | 278 | struct gk20a_platform *p = dev_get_drvdata(dev); |
281 | return p->has_syncpoints && !p->disable_syncpoints; | 279 | return p->has_syncpoints && !p->disable_syncpoints; |
280 | #else | ||
281 | return false; | ||
282 | #endif | ||
282 | } | 283 | } |
283 | 284 | ||
284 | int gk20a_tegra_busy(struct device *dev); | 285 | int gk20a_tegra_busy(struct device *dev); |