diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-06-19 17:13:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-20 14:35:29 -0400 |
commit | 9f65627d0edaa45d914d2d180caf1b687e3c0d09 (patch) | |
tree | ed7afd33e5b87f0952c534b239b39fbd816705e4 /drivers/gpu/nvgpu/gk20a | |
parent | 2525dc37967077554520f20c95c0a25080e3b872 (diff) |
gpu: nvgpu: Pass struct gk20a to busy and resume
Pass struct gk20a pointer to gk20a_busy_noresume() and
gk20a_idle_nosuspend(). This reduces the number of dependencies to
Linux specific struct device.
JIRA NVGPU-38
Change-Id: I5e05be32e2376bc8be5402bb973c20e28c35a1c3
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1505177
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/gk20a.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 843a9e91..f91e86df 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1475,8 +1475,8 @@ void gk20a_remove_sysfs(struct device *dev); | |||
1475 | #define GK20A_BAR1_IORESOURCE_MEM 1 | 1475 | #define GK20A_BAR1_IORESOURCE_MEM 1 |
1476 | #define GK20A_SIM_IORESOURCE_MEM 2 | 1476 | #define GK20A_SIM_IORESOURCE_MEM 2 |
1477 | 1477 | ||
1478 | void gk20a_busy_noresume(struct device *dev); | 1478 | void gk20a_busy_noresume(struct gk20a *g); |
1479 | void gk20a_idle_nosuspend(struct device *dev); | 1479 | void gk20a_idle_nosuspend(struct gk20a *g); |
1480 | int __must_check gk20a_busy(struct gk20a *g); | 1480 | int __must_check gk20a_busy(struct gk20a *g); |
1481 | void gk20a_idle(struct gk20a *g); | 1481 | void gk20a_idle(struct gk20a *g); |
1482 | int __gk20a_do_idle(struct gk20a *g, bool force_reset); | 1482 | int __gk20a_do_idle(struct gk20a *g, bool force_reset); |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index e7bcf6f0..5ffa3e2f 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -2283,9 +2283,9 @@ int gk20a_mm_fb_flush(struct gk20a *g) | |||
2283 | 2283 | ||
2284 | gk20a_dbg_fn(""); | 2284 | gk20a_dbg_fn(""); |
2285 | 2285 | ||
2286 | gk20a_busy_noresume(g->dev); | 2286 | gk20a_busy_noresume(g); |
2287 | if (!g->power_on) { | 2287 | if (!g->power_on) { |
2288 | gk20a_idle_nosuspend(g->dev); | 2288 | gk20a_idle_nosuspend(g); |
2289 | return 0; | 2289 | return 0; |
2290 | } | 2290 | } |
2291 | 2291 | ||
@@ -2325,7 +2325,7 @@ int gk20a_mm_fb_flush(struct gk20a *g) | |||
2325 | 2325 | ||
2326 | nvgpu_mutex_release(&mm->l2_op_lock); | 2326 | nvgpu_mutex_release(&mm->l2_op_lock); |
2327 | 2327 | ||
2328 | gk20a_idle_nosuspend(g->dev); | 2328 | gk20a_idle_nosuspend(g); |
2329 | 2329 | ||
2330 | return ret; | 2330 | return ret; |
2331 | } | 2331 | } |
@@ -2367,13 +2367,13 @@ static void gk20a_mm_l2_invalidate_locked(struct gk20a *g) | |||
2367 | void gk20a_mm_l2_invalidate(struct gk20a *g) | 2367 | void gk20a_mm_l2_invalidate(struct gk20a *g) |
2368 | { | 2368 | { |
2369 | struct mm_gk20a *mm = &g->mm; | 2369 | struct mm_gk20a *mm = &g->mm; |
2370 | gk20a_busy_noresume(g->dev); | 2370 | gk20a_busy_noresume(g); |
2371 | if (g->power_on) { | 2371 | if (g->power_on) { |
2372 | nvgpu_mutex_acquire(&mm->l2_op_lock); | 2372 | nvgpu_mutex_acquire(&mm->l2_op_lock); |
2373 | gk20a_mm_l2_invalidate_locked(g); | 2373 | gk20a_mm_l2_invalidate_locked(g); |
2374 | nvgpu_mutex_release(&mm->l2_op_lock); | 2374 | nvgpu_mutex_release(&mm->l2_op_lock); |
2375 | } | 2375 | } |
2376 | gk20a_idle_nosuspend(g->dev); | 2376 | gk20a_idle_nosuspend(g); |
2377 | } | 2377 | } |
2378 | 2378 | ||
2379 | void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) | 2379 | void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) |
@@ -2384,7 +2384,7 @@ void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) | |||
2384 | 2384 | ||
2385 | gk20a_dbg_fn(""); | 2385 | gk20a_dbg_fn(""); |
2386 | 2386 | ||
2387 | gk20a_busy_noresume(g->dev); | 2387 | gk20a_busy_noresume(g); |
2388 | if (!g->power_on) | 2388 | if (!g->power_on) |
2389 | goto hw_was_off; | 2389 | goto hw_was_off; |
2390 | 2390 | ||
@@ -2421,7 +2421,7 @@ void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) | |||
2421 | nvgpu_mutex_release(&mm->l2_op_lock); | 2421 | nvgpu_mutex_release(&mm->l2_op_lock); |
2422 | 2422 | ||
2423 | hw_was_off: | 2423 | hw_was_off: |
2424 | gk20a_idle_nosuspend(g->dev); | 2424 | gk20a_idle_nosuspend(g); |
2425 | } | 2425 | } |
2426 | 2426 | ||
2427 | void gk20a_mm_cbc_clean(struct gk20a *g) | 2427 | void gk20a_mm_cbc_clean(struct gk20a *g) |
@@ -2432,7 +2432,7 @@ void gk20a_mm_cbc_clean(struct gk20a *g) | |||
2432 | 2432 | ||
2433 | gk20a_dbg_fn(""); | 2433 | gk20a_dbg_fn(""); |
2434 | 2434 | ||
2435 | gk20a_busy_noresume(g->dev); | 2435 | gk20a_busy_noresume(g); |
2436 | if (!g->power_on) | 2436 | if (!g->power_on) |
2437 | goto hw_was_off; | 2437 | goto hw_was_off; |
2438 | 2438 | ||
@@ -2461,7 +2461,7 @@ void gk20a_mm_cbc_clean(struct gk20a *g) | |||
2461 | nvgpu_mutex_release(&mm->l2_op_lock); | 2461 | nvgpu_mutex_release(&mm->l2_op_lock); |
2462 | 2462 | ||
2463 | hw_was_off: | 2463 | hw_was_off: |
2464 | gk20a_idle_nosuspend(g->dev); | 2464 | gk20a_idle_nosuspend(g); |
2465 | } | 2465 | } |
2466 | 2466 | ||
2467 | int nvgpu_vm_find_buf(struct vm_gk20a *vm, u64 gpu_va, | 2467 | int nvgpu_vm_find_buf(struct vm_gk20a *vm, u64 gpu_va, |