summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index 6f8baa4b..3e0f9dc3 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -15,6 +15,7 @@
15 15
16#include "vgpu/vgpu.h" 16#include "vgpu/vgpu.h"
17#include "gk20a/hw_gr_gk20a.h" 17#include "gk20a/hw_gr_gk20a.h"
18#include "gr_ops.h"
18 19
19static int vgpu_gr_commit_inst(struct channel_gk20a *c, u64 gpu_va) 20static int vgpu_gr_commit_inst(struct channel_gk20a *c, u64 gpu_va)
20{ 21{
@@ -104,7 +105,7 @@ static int vgpu_gr_alloc_global_ctx_buffers(struct gk20a *g)
104 105
105 gk20a_dbg_fn(""); 106 gk20a_dbg_fn("");
106 107
107 attr_buffer_size = g->ops.gr.calc_global_ctx_buffer_size(g); 108 attr_buffer_size = g->ops.gr->calc_global_ctx_buffer_size(g);
108 109
109 gk20a_dbg_info("cb_buffer_size : %d", cb_buffer_size); 110 gk20a_dbg_info("cb_buffer_size : %d", cb_buffer_size);
110 gr->global_ctx_buffer[CIRCULAR].size = cb_buffer_size; 111 gr->global_ctx_buffer[CIRCULAR].size = cb_buffer_size;
@@ -397,7 +398,7 @@ static int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c,
397 return -EINVAL; 398 return -EINVAL;
398 } 399 }
399 400
400 if (!g->ops.gr.is_valid_class(g, args->class_num)) { 401 if (!g->ops.gr->is_valid_class(g, args->class_num)) {
401 gk20a_err(dev_from_gk20a(g), 402 gk20a_err(dev_from_gk20a(g),
402 "invalid obj class 0x%x", args->class_num); 403 "invalid obj class 0x%x", args->class_num);
403 err = -EINVAL; 404 err = -EINVAL;
@@ -524,9 +525,9 @@ static int vgpu_gr_init_gr_config(struct gk20a *g, struct gr_gk20a *gr)
524 &gr->max_tpc_count)) 525 &gr->max_tpc_count))
525 return -ENOMEM; 526 return -ENOMEM;
526 527
527 g->ops.gr.bundle_cb_defaults(g); 528 g->ops.gr->bundle_cb_defaults(g);
528 g->ops.gr.cb_size_default(g); 529 g->ops.gr->cb_size_default(g);
529 g->ops.gr.calc_global_ctx_buffer_size(g); 530 g->ops.gr->calc_global_ctx_buffer_size(g);
530 return 0; 531 return 0;
531} 532}
532 533
@@ -612,7 +613,7 @@ static int vgpu_gr_init_gr_setup_sw(struct gk20a *g)
612 if (err) 613 if (err)
613 goto clean_up; 614 goto clean_up;
614 615
615 err = g->ops.ltc.init_comptags(g, gr); 616 err = g->ops.ltc->init_comptags(g, gr);
616 if (err) 617 if (err)
617 goto clean_up; 618 goto clean_up;
618 619
@@ -677,11 +678,15 @@ int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info)
677 return 0; 678 return 0;
678} 679}
679 680
681static struct gpu_gr_ops vgpu_gr_ops = {
682 .free_channel_ctx = vgpu_gr_free_channel_ctx,
683 .alloc_obj_ctx = vgpu_gr_alloc_obj_ctx,
684 .free_obj_ctx = vgpu_gr_free_obj_ctx,
685 .bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull,
686 .get_zcull_info = vgpu_gr_get_zcull_info,
687};
688
680void vgpu_init_gr_ops(struct gpu_ops *gops) 689void vgpu_init_gr_ops(struct gpu_ops *gops)
681{ 690{
682 gops->gr.free_channel_ctx = vgpu_gr_free_channel_ctx; 691 gops->gr = &vgpu_gr_ops;
683 gops->gr.alloc_obj_ctx = vgpu_gr_alloc_obj_ctx;
684 gops->gr.free_obj_ctx = vgpu_gr_free_obj_ctx;
685 gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull;
686 gops->gr.get_zcull_info = vgpu_gr_get_zcull_info;
687} 692}