diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 23 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 5 |
3 files changed, 18 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8b7315f6..a2b2e53f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -476,6 +476,11 @@ struct gpu_ops { | |||
476 | u32 *priv_addr_table_index); | 476 | u32 *priv_addr_table_index); |
477 | u32 (*fecs_ctxsw_mailbox_size)(void); | 477 | u32 (*fecs_ctxsw_mailbox_size)(void); |
478 | int (*init_sw_bundle64)(struct gk20a *g); | 478 | int (*init_sw_bundle64)(struct gk20a *g); |
479 | int (*alloc_global_ctx_buffers)(struct gk20a *g); | ||
480 | int (*map_global_ctx_buffers)(struct gk20a *g, | ||
481 | struct channel_gk20a *c); | ||
482 | int (*commit_global_ctx_buffers)(struct gk20a *g, | ||
483 | struct channel_gk20a *c, bool patch); | ||
479 | } gr; | 484 | } gr; |
480 | struct { | 485 | struct { |
481 | void (*init_hw)(struct gk20a *g); | 486 | void (*init_hw)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 42e96715..5d9e3218 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <nvgpu/error_notifier.h> | 40 | #include <nvgpu/error_notifier.h> |
41 | 41 | ||
42 | #include "gk20a.h" | 42 | #include "gk20a.h" |
43 | #include "gr_gk20a.h" | ||
43 | #include "gr_ctx_gk20a.h" | 44 | #include "gr_ctx_gk20a.h" |
44 | #include "gr_pri_gk20a.h" | 45 | #include "gr_pri_gk20a.h" |
45 | #include "regops_gk20a.h" | 46 | #include "regops_gk20a.h" |
@@ -73,14 +74,6 @@ | |||
73 | 74 | ||
74 | static int gk20a_init_gr_bind_fecs_elpg(struct gk20a *g); | 75 | static int gk20a_init_gr_bind_fecs_elpg(struct gk20a *g); |
75 | 76 | ||
76 | /* global ctx buffer */ | ||
77 | static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g); | ||
78 | static void gr_gk20a_free_global_ctx_buffers(struct gk20a *g); | ||
79 | static int gr_gk20a_map_global_ctx_buffers(struct gk20a *g, | ||
80 | struct channel_gk20a *c); | ||
81 | static void gr_gk20a_unmap_global_ctx_buffers(struct gk20a *g, | ||
82 | struct vm_gk20a *vm, | ||
83 | struct nvgpu_gr_ctx *gr_ctx); | ||
84 | static void gr_gk20a_free_channel_pm_ctx(struct gk20a *g, | 77 | static void gr_gk20a_free_channel_pm_ctx(struct gk20a *g, |
85 | struct vm_gk20a *vm, | 78 | struct vm_gk20a *vm, |
86 | struct nvgpu_gr_ctx *gr_ctx); | 79 | struct nvgpu_gr_ctx *gr_ctx); |
@@ -1535,7 +1528,7 @@ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, | |||
1535 | gk20a_writel(g, gr_fe_go_idle_timeout_r(), | 1528 | gk20a_writel(g, gr_fe_go_idle_timeout_r(), |
1536 | gr_fe_go_idle_timeout_count_disabled_f()); | 1529 | gr_fe_go_idle_timeout_count_disabled_f()); |
1537 | 1530 | ||
1538 | err = gr_gk20a_commit_global_ctx_buffers(g, c, false); | 1531 | err = g->ops.gr.commit_global_ctx_buffers(g, c, false); |
1539 | if (err) | 1532 | if (err) |
1540 | goto clean_up; | 1533 | goto clean_up; |
1541 | 1534 | ||
@@ -2558,7 +2551,7 @@ static void gr_gk20a_free_global_ctx_buffers(struct gk20a *g) | |||
2558 | nvgpu_log_fn(g, "done"); | 2551 | nvgpu_log_fn(g, "done"); |
2559 | } | 2552 | } |
2560 | 2553 | ||
2561 | static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) | 2554 | int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) |
2562 | { | 2555 | { |
2563 | struct gr_gk20a *gr = &g->gr; | 2556 | struct gr_gk20a *gr = &g->gr; |
2564 | int attr_buffer_size, err; | 2557 | int attr_buffer_size, err; |
@@ -2679,8 +2672,8 @@ static void gr_gk20a_unmap_global_ctx_buffers(struct gk20a *g, | |||
2679 | gr_ctx->global_ctx_buffer_mapped = false; | 2672 | gr_ctx->global_ctx_buffer_mapped = false; |
2680 | } | 2673 | } |
2681 | 2674 | ||
2682 | static int gr_gk20a_map_global_ctx_buffers(struct gk20a *g, | 2675 | int gr_gk20a_map_global_ctx_buffers(struct gk20a *g, |
2683 | struct channel_gk20a *c) | 2676 | struct channel_gk20a *c) |
2684 | { | 2677 | { |
2685 | struct tsg_gk20a *tsg; | 2678 | struct tsg_gk20a *tsg; |
2686 | struct vm_gk20a *ch_vm = c->vm; | 2679 | struct vm_gk20a *ch_vm = c->vm; |
@@ -3004,13 +2997,13 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags) | |||
3004 | } | 2997 | } |
3005 | 2998 | ||
3006 | /* map global buffer to channel gpu_va and commit */ | 2999 | /* map global buffer to channel gpu_va and commit */ |
3007 | err = gr_gk20a_map_global_ctx_buffers(g, c); | 3000 | err = g->ops.gr.map_global_ctx_buffers(g, c); |
3008 | if (err) { | 3001 | if (err) { |
3009 | nvgpu_err(g, | 3002 | nvgpu_err(g, |
3010 | "fail to map global ctx buffer"); | 3003 | "fail to map global ctx buffer"); |
3011 | goto out; | 3004 | goto out; |
3012 | } | 3005 | } |
3013 | gr_gk20a_commit_global_ctx_buffers(g, c, true); | 3006 | g->ops.gr.commit_global_ctx_buffers(g, c, true); |
3014 | 3007 | ||
3015 | /* commit gr ctx buffer */ | 3008 | /* commit gr ctx buffer */ |
3016 | err = g->ops.gr.commit_inst(c, gr_ctx->mem.gpu_va); | 3009 | err = g->ops.gr.commit_inst(c, gr_ctx->mem.gpu_va); |
@@ -4877,7 +4870,7 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) | |||
4877 | if (err) | 4870 | if (err) |
4878 | goto clean_up; | 4871 | goto clean_up; |
4879 | 4872 | ||
4880 | err = gr_gk20a_alloc_global_ctx_buffers(g); | 4873 | err = g->ops.gr.alloc_global_ctx_buffers(g); |
4881 | if (err) | 4874 | if (err) |
4882 | goto clean_up; | 4875 | goto clean_up; |
4883 | 4876 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 43b89b12..32bd41f2 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -806,8 +806,13 @@ void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g, | |||
806 | u32 gr_gk20a_get_patch_slots(struct gk20a *g); | 806 | u32 gr_gk20a_get_patch_slots(struct gk20a *g); |
807 | int gk20a_gr_handle_notify_pending(struct gk20a *g, | 807 | int gk20a_gr_handle_notify_pending(struct gk20a *g, |
808 | struct gr_gk20a_isr_data *isr_data); | 808 | struct gr_gk20a_isr_data *isr_data); |
809 | |||
810 | int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g); | ||
811 | int gr_gk20a_map_global_ctx_buffers(struct gk20a *g, | ||
812 | struct channel_gk20a *c); | ||
809 | int gr_gk20a_commit_global_ctx_buffers(struct gk20a *g, | 813 | int gr_gk20a_commit_global_ctx_buffers(struct gk20a *g, |
810 | struct channel_gk20a *c, bool patch); | 814 | struct channel_gk20a *c, bool patch); |
815 | |||
811 | int gr_gk20a_fecs_ctx_bind_channel(struct gk20a *g, | 816 | int gr_gk20a_fecs_ctx_bind_channel(struct gk20a *g, |
812 | struct channel_gk20a *c); | 817 | struct channel_gk20a *c); |
813 | u32 gk20a_init_sw_bundle(struct gk20a *g); | 818 | u32 gk20a_init_sw_bundle(struct gk20a *g); |