summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorskadamati <skadamati@nvidia.com>2017-05-23 06:25:29 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-26 06:34:42 -0400
commite21e6e947b334cd16cc92c41953bf3c0153b1508 (patch)
treea9222039f465548e0f69730c8c3bf24ad6223116 /drivers/gpu
parent2e338c77eac4edffb94c8c9480dbd72712c7696f (diff)
gpu: nvgpu: Fix build failure by missing headers
Move the platform_gk20a.h include out of the ifdef CONFIG_DEBUG_FS in the CDE code since dev_from_gk20a() is used regardless of whether debugfs is enabled. Also modify some of the CE ops to take a struct gk20a instead of a struct device. This avoids any requirement for including linux/device.h or platform_gk20a.h. Bug 200310575 Change-Id: Ifef963cd0f66d05094a698200386cc6140920eac Signed-off-by: skadamati <skadamati@nvidia.com> Reviewed-on: http://git-master/r/1487830 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.c9
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.h6
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c8
-rw-r--r--drivers/gpu/nvgpu/gk20a/sched_gk20a.c3
5 files changed, 12 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index d2bb3ee9..a0160274 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -20,7 +20,6 @@
20#include <linux/fs.h> 20#include <linux/fs.h>
21#ifdef CONFIG_DEBUG_FS 21#ifdef CONFIG_DEBUG_FS
22#include <linux/debugfs.h> 22#include <linux/debugfs.h>
23#include "platform_gk20a.h"
24#endif 23#endif
25#include <linux/dma-buf.h> 24#include <linux/dma-buf.h>
26 25
@@ -42,6 +41,7 @@
42#include "fence_gk20a.h" 41#include "fence_gk20a.h"
43#include "gr_gk20a.h" 42#include "gr_gk20a.h"
44#include "debug_gk20a.h" 43#include "debug_gk20a.h"
44#include "platform_gk20a.h"
45 45
46#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> 46#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
47#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> 47#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
index 25d6462d..1ed90b14 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
@@ -424,7 +424,7 @@ void gk20a_ce_suspend(struct gk20a *g)
424} 424}
425 425
426/* CE app utility functions */ 426/* CE app utility functions */
427u32 gk20a_ce_create_context_with_cb(struct device *dev, 427u32 gk20a_ce_create_context_with_cb(struct gk20a *g,
428 int runlist_id, 428 int runlist_id,
429 int priority, 429 int priority,
430 int timeslice, 430 int timeslice,
@@ -432,7 +432,6 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev,
432 ce_event_callback user_event_callback) 432 ce_event_callback user_event_callback)
433{ 433{
434 struct gk20a_gpu_ctx *ce_ctx; 434 struct gk20a_gpu_ctx *ce_ctx;
435 struct gk20a *g = gk20a_from_dev(dev);
436 struct gk20a_ce_app *ce_app = &g->ce_app; 435 struct gk20a_ce_app *ce_app = &g->ce_app;
437 u32 ctx_id = ~0; 436 u32 ctx_id = ~0;
438 int err = 0; 437 int err = 0;
@@ -548,7 +547,7 @@ end:
548} 547}
549EXPORT_SYMBOL(gk20a_ce_create_context_with_cb); 548EXPORT_SYMBOL(gk20a_ce_create_context_with_cb);
550 549
551int gk20a_ce_execute_ops(struct device *dev, 550int gk20a_ce_execute_ops(struct gk20a *g,
552 u32 ce_ctx_id, 551 u32 ce_ctx_id,
553 u64 src_buf, 552 u64 src_buf,
554 u64 dst_buf, 553 u64 dst_buf,
@@ -561,7 +560,6 @@ int gk20a_ce_execute_ops(struct device *dev,
561 struct gk20a_fence **gk20a_fence_out) 560 struct gk20a_fence **gk20a_fence_out)
562{ 561{
563 int ret = -EPERM; 562 int ret = -EPERM;
564 struct gk20a *g = gk20a_from_dev(dev);
565 struct gk20a_ce_app *ce_app = &g->ce_app; 563 struct gk20a_ce_app *ce_app = &g->ce_app;
566 struct gk20a_gpu_ctx *ce_ctx, *ce_ctx_save; 564 struct gk20a_gpu_ctx *ce_ctx, *ce_ctx_save;
567 bool found = false; 565 bool found = false;
@@ -700,10 +698,9 @@ end:
700} 698}
701EXPORT_SYMBOL(gk20a_ce_execute_ops); 699EXPORT_SYMBOL(gk20a_ce_execute_ops);
702 700
703void gk20a_ce_delete_context(struct device *dev, 701void gk20a_ce_delete_context(struct gk20a *g,
704 u32 ce_ctx_id) 702 u32 ce_ctx_id)
705{ 703{
706 struct gk20a *g = gk20a_from_dev(dev);
707 gk20a_ce_delete_context_priv(g, ce_ctx_id); 704 gk20a_ce_delete_context_priv(g, ce_ctx_id);
708} 705}
709 706
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h
index ac0bae32..dfd19019 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h
@@ -134,13 +134,13 @@ void gk20a_ce_suspend(struct gk20a *g);
134void gk20a_ce_destroy(struct gk20a *g); 134void gk20a_ce_destroy(struct gk20a *g);
135 135
136/* CE app utility functions */ 136/* CE app utility functions */
137u32 gk20a_ce_create_context_with_cb(struct device *dev, 137u32 gk20a_ce_create_context_with_cb(struct gk20a *g,
138 int runlist_id, 138 int runlist_id,
139 int priority, 139 int priority,
140 int timeslice, 140 int timeslice,
141 int runlist_level, 141 int runlist_level,
142 ce_event_callback user_event_callback); 142 ce_event_callback user_event_callback);
143int gk20a_ce_execute_ops(struct device *dev, 143int gk20a_ce_execute_ops(struct gk20a *g,
144 u32 ce_ctx_id, 144 u32 ce_ctx_id,
145 u64 src_buf, 145 u64 src_buf,
146 u64 dst_buf, 146 u64 dst_buf,
@@ -153,7 +153,7 @@ int gk20a_ce_execute_ops(struct device *dev,
153 struct gk20a_fence **gk20a_fence_out); 153 struct gk20a_fence **gk20a_fence_out);
154void gk20a_ce_delete_context_priv(struct gk20a *g, 154void gk20a_ce_delete_context_priv(struct gk20a *g,
155 u32 ce_ctx_id); 155 u32 ce_ctx_id);
156void gk20a_ce_delete_context(struct device *dev, 156void gk20a_ce_delete_context(struct gk20a *g,
157 u32 ce_ctx_id); 157 u32 ce_ctx_id);
158 158
159 159
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 72f9eeab..17fa0c17 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -502,7 +502,7 @@ static int gk20a_vidmem_clear_all(struct gk20a *g)
502 if (mm->vidmem.ce_ctx_id == (u32)~0) 502 if (mm->vidmem.ce_ctx_id == (u32)~0)
503 return -EINVAL; 503 return -EINVAL;
504 504
505 err = gk20a_ce_execute_ops(g->dev, 505 err = gk20a_ce_execute_ops(g,
506 mm->vidmem.ce_ctx_id, 506 mm->vidmem.ce_ctx_id,
507 0, 507 0,
508 mm->vidmem.base, 508 mm->vidmem.base,
@@ -521,7 +521,7 @@ static int gk20a_vidmem_clear_all(struct gk20a *g)
521 521
522 region2_base = mm->vidmem.bootstrap_base + mm->vidmem.bootstrap_size; 522 region2_base = mm->vidmem.bootstrap_base + mm->vidmem.bootstrap_size;
523 523
524 err = gk20a_ce_execute_ops(g->dev, 524 err = gk20a_ce_execute_ops(g,
525 mm->vidmem.ce_ctx_id, 525 mm->vidmem.ce_ctx_id,
526 0, 526 0,
527 region2_base, 527 region2_base,
@@ -765,7 +765,7 @@ void gk20a_init_mm_ce_context(struct gk20a *g)
765#if defined(CONFIG_GK20A_VIDMEM) 765#if defined(CONFIG_GK20A_VIDMEM)
766 if (g->mm.vidmem.size && (g->mm.vidmem.ce_ctx_id == (u32)~0)) { 766 if (g->mm.vidmem.size && (g->mm.vidmem.ce_ctx_id == (u32)~0)) {
767 g->mm.vidmem.ce_ctx_id = 767 g->mm.vidmem.ce_ctx_id =
768 gk20a_ce_create_context_with_cb(g->dev, 768 gk20a_ce_create_context_with_cb(g,
769 gk20a_fifo_get_fast_ce_runlist_id(g), 769 gk20a_fifo_get_fast_ce_runlist_id(g),
770 -1, 770 -1,
771 -1, 771 -1,
@@ -1683,7 +1683,7 @@ static int gk20a_gmmu_clear_vidmem_mem(struct gk20a *g, struct nvgpu_mem *mem)
1683 if (gk20a_last_fence) 1683 if (gk20a_last_fence)
1684 gk20a_fence_put(gk20a_last_fence); 1684 gk20a_fence_put(gk20a_last_fence);
1685 1685
1686 err = gk20a_ce_execute_ops(g->dev, 1686 err = gk20a_ce_execute_ops(g,
1687 g->mm.vidmem.ce_ctx_id, 1687 g->mm.vidmem.ce_ctx_id,
1688 0, 1688 0,
1689 chunk->base, 1689 chunk->base,
diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
index dba0bdb4..b7edf3f0 100644
--- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
@@ -478,8 +478,7 @@ long gk20a_sched_dev_ioctl(struct file *filp, unsigned int cmd,
478 (struct nvgpu_sched_tsg_refcount_args *)buf); 478 (struct nvgpu_sched_tsg_refcount_args *)buf);
479 break; 479 break;
480 default: 480 default:
481 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", 481 nvgpu_log_info(g, "unrecognized gpu ioctl cmd: 0x%x", cmd);
482 cmd);
483 err = -ENOTTY; 482 err = -ENOTTY;
484 } 483 }
485 484