diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-27 18:09:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-27 19:34:37 -0400 |
commit | 9907b97985c47003a179c4357274b737cc0699ee (patch) | |
tree | 2b40019669007c9bbbdcad29b5f57b27f13df84f /drivers/gpu/nvgpu/gp10b | |
parent | 1552e3fb09741309ea2d5cc4433e247bae7265e1 (diff) |
gpu: nvgpu: Reorg ce2 HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the ce2
sub-module of the gpu_ops struct.
Perform HAL function assignments in hal_gxxxx.c through the
population of a chip-specific copy of gpu_ops.
Jira NVGPU-74
Change-Id: I7dfd5e8dcd4d6f3623d1b795b6b2e15ff356a13a
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1509632
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/ce_gp10b.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/ce_gp10b.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 6 |
3 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/ce_gp10b.c b/drivers/gpu/nvgpu/gp10b/ce_gp10b.c index 1fff37fb..59a6ee21 100644 --- a/drivers/gpu/nvgpu/gp10b/ce_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/ce_gp10b.c | |||
@@ -54,7 +54,7 @@ void gp10b_ce_isr(struct gk20a *g, u32 inst_id, u32 pri_base) | |||
54 | return; | 54 | return; |
55 | } | 55 | } |
56 | 56 | ||
57 | static int gp10b_ce_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base) | 57 | int gp10b_ce_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base) |
58 | { | 58 | { |
59 | int ops = 0; | 59 | int ops = 0; |
60 | u32 ce_intr = gk20a_readl(g, ce_intr_status_r(inst_id)); | 60 | u32 ce_intr = gk20a_readl(g, ce_intr_status_r(inst_id)); |
@@ -70,8 +70,3 @@ static int gp10b_ce_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base) | |||
70 | 70 | ||
71 | return ops; | 71 | return ops; |
72 | } | 72 | } |
73 | void gp10b_init_ce(struct gpu_ops *gops) | ||
74 | { | ||
75 | gops->ce2.isr_stall = gp10b_ce_isr; | ||
76 | gops->ce2.isr_nonstall = gp10b_ce_nonstall_isr; | ||
77 | } | ||
diff --git a/drivers/gpu/nvgpu/gp10b/ce_gp10b.h b/drivers/gpu/nvgpu/gp10b/ce_gp10b.h index 134c2ddb..f88e0ae1 100644 --- a/drivers/gpu/nvgpu/gp10b/ce_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/ce_gp10b.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Pascal GPU series Copy Engine. | 2 | * Pascal GPU series Copy Engine. |
3 | * | 3 | * |
4 | * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -21,7 +21,7 @@ | |||
21 | #include "gk20a/channel_gk20a.h" | 21 | #include "gk20a/channel_gk20a.h" |
22 | #include "gk20a/tsg_gk20a.h" | 22 | #include "gk20a/tsg_gk20a.h" |
23 | 23 | ||
24 | void gp10b_init_ce(struct gpu_ops *gops); | ||
25 | void gp10b_ce_isr(struct gk20a *g, u32 inst_id, u32 pri_base); | 24 | void gp10b_ce_isr(struct gk20a *g, u32 inst_id, u32 pri_base); |
25 | int gp10b_ce_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base); | ||
26 | 26 | ||
27 | #endif /*__CE2_GP10B_H__*/ | 27 | #endif /*__CE2_GP10B_H__*/ |
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 6b4fbf40..feac284b 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -165,6 +165,10 @@ static const struct gpu_ops gp10b_ops = { | |||
165 | .sync_debugfs = gp10b_ltc_sync_debugfs, | 165 | .sync_debugfs = gp10b_ltc_sync_debugfs, |
166 | #endif | 166 | #endif |
167 | }, | 167 | }, |
168 | .ce2 = { | ||
169 | .isr_stall = gp10b_ce_isr, | ||
170 | .isr_nonstall = gp10b_ce_nonstall_isr, | ||
171 | }, | ||
168 | .clock_gating = { | 172 | .clock_gating = { |
169 | .slcg_bus_load_gating_prod = | 173 | .slcg_bus_load_gating_prod = |
170 | gp10b_slcg_bus_load_gating_prod, | 174 | gp10b_slcg_bus_load_gating_prod, |
@@ -345,6 +349,7 @@ int gp10b_init_hal(struct gk20a *g) | |||
345 | u32 val; | 349 | u32 val; |
346 | 350 | ||
347 | gops->ltc = gp10b_ops.ltc; | 351 | gops->ltc = gp10b_ops.ltc; |
352 | gops->ce2 = gp10b_ops.ce2; | ||
348 | gops->clock_gating = gp10b_ops.clock_gating; | 353 | gops->clock_gating = gp10b_ops.clock_gating; |
349 | gops->fifo = gp10b_ops.fifo; | 354 | gops->fifo = gp10b_ops.fifo; |
350 | gops->mc = gp10b_ops.mc; | 355 | gops->mc = gp10b_ops.mc; |
@@ -407,7 +412,6 @@ int gp10b_init_hal(struct gk20a *g) | |||
407 | gp10b_init_gr(g); | 412 | gp10b_init_gr(g); |
408 | gp10b_init_fecs_trace_ops(gops); | 413 | gp10b_init_fecs_trace_ops(gops); |
409 | gp10b_init_fb(gops); | 414 | gp10b_init_fb(gops); |
410 | gp10b_init_ce(gops); | ||
411 | gp10b_init_gr_ctx(gops); | 415 | gp10b_init_gr_ctx(gops); |
412 | gp10b_init_mm(gops); | 416 | gp10b_init_mm(gops); |
413 | gp10b_init_pmu_ops(g); | 417 | gp10b_init_pmu_ops(g); |