summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2015-04-16 14:57:10 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-06-06 10:24:40 -0400
commitdf67ff6a75cba1fc96ae5fbe7dba260250eae9fd (patch)
tree7a14ec613736d295d4d06da8e2bf11609290102a /drivers/gpu/nvgpu/gk20a
parentcb28a538cfbec71b441b29290166c114145d6d60 (diff)
gpu: nvgpu: add zbc support to vgpu
For both adding and querying zbc entry, added callbacks in gr ops. Native gpu driver (gk20a) and vgpu will both hook there. For vgpu, it will add or query zbc entry from RM server. Bug 1558561 Change-Id: If8a4850ecfbff41d8592664f5f93ad8c25f6fbce Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: http://git-master/r/732775 (cherry picked from commit a3787cf971128904c2712338087685b02673065d) Reviewed-on: http://git-master/r/737880 (cherry picked from commit fca2a0457c968656dc29455608f35acab094d816) Reviewed-on: http://git-master/r/753278 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c8
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index d73eae86..88a933b8 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -588,10 +588,6 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
588 case NVGPU_GPU_IOCTL_ZBC_SET_TABLE: 588 case NVGPU_GPU_IOCTL_ZBC_SET_TABLE:
589 set_table_args = (struct nvgpu_gpu_zbc_set_table_args *)buf; 589 set_table_args = (struct nvgpu_gpu_zbc_set_table_args *)buf;
590 590
591 /* not supported for vgpu */
592 if (gk20a_gpu_is_virtual(dev))
593 return -ENOMEM;
594
595 zbc_val = kzalloc(sizeof(struct zbc_entry), GFP_KERNEL); 591 zbc_val = kzalloc(sizeof(struct zbc_entry), GFP_KERNEL);
596 if (zbc_val == NULL) 592 if (zbc_val == NULL)
597 return -ENOMEM; 593 return -ENOMEM;
@@ -616,7 +612,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
616 if (!err) { 612 if (!err) {
617 err = gk20a_busy(dev); 613 err = gk20a_busy(dev);
618 if (!err) { 614 if (!err) {
619 err = gk20a_gr_zbc_set_table(g, &g->gr, 615 err = g->ops.gr.zbc_set_table(g, &g->gr,
620 zbc_val); 616 zbc_val);
621 gk20a_idle(dev); 617 gk20a_idle(dev);
622 } 618 }
@@ -635,7 +631,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
635 zbc_tbl->type = query_table_args->type; 631 zbc_tbl->type = query_table_args->type;
636 zbc_tbl->index_size = query_table_args->index_size; 632 zbc_tbl->index_size = query_table_args->index_size;
637 633
638 err = gr_gk20a_query_zbc(g, &g->gr, zbc_tbl); 634 err = g->ops.gr.zbc_query_table(g, &g->gr, zbc_tbl);
639 635
640 if (!err) { 636 if (!err) {
641 switch (zbc_tbl->type) { 637 switch (zbc_tbl->type) {
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 29fa4021..a52d97f3 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -152,6 +152,10 @@ struct gpu_ops {
152 struct zbc_entry *color_val, u32 index); 152 struct zbc_entry *color_val, u32 index);
153 int (*add_zbc_depth)(struct gk20a *g, struct gr_gk20a *gr, 153 int (*add_zbc_depth)(struct gk20a *g, struct gr_gk20a *gr,
154 struct zbc_entry *depth_val, u32 index); 154 struct zbc_entry *depth_val, u32 index);
155 int (*zbc_set_table)(struct gk20a *g, struct gr_gk20a *gr,
156 struct zbc_entry *zbc_val);
157 int (*zbc_query_table)(struct gk20a *g, struct gr_gk20a *gr,
158 struct zbc_query_params *query_params);
155 u32 (*pagepool_default_size)(struct gk20a *g); 159 u32 (*pagepool_default_size)(struct gk20a *g);
156 int (*init_ctx_state)(struct gk20a *g); 160 int (*init_ctx_state)(struct gk20a *g);
157 int (*alloc_gr_ctx)(struct gk20a *g, 161 int (*alloc_gr_ctx)(struct gk20a *g,
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 85d1a886..603fc3a4 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -7325,6 +7325,8 @@ void gk20a_init_gr_ops(struct gpu_ops *gops)
7325 gops->gr.detect_sm_arch = gr_gk20a_detect_sm_arch; 7325 gops->gr.detect_sm_arch = gr_gk20a_detect_sm_arch;
7326 gops->gr.add_zbc_color = gr_gk20a_add_zbc_color; 7326 gops->gr.add_zbc_color = gr_gk20a_add_zbc_color;
7327 gops->gr.add_zbc_depth = gr_gk20a_add_zbc_depth; 7327 gops->gr.add_zbc_depth = gr_gk20a_add_zbc_depth;
7328 gops->gr.zbc_set_table = gk20a_gr_zbc_set_table;
7329 gops->gr.zbc_query_table = gr_gk20a_query_zbc;
7328 gops->gr.pagepool_default_size = gr_gk20a_pagepool_default_size; 7330 gops->gr.pagepool_default_size = gr_gk20a_pagepool_default_size;
7329 gops->gr.init_ctx_state = gr_gk20a_init_ctx_state; 7331 gops->gr.init_ctx_state = gr_gk20a_init_ctx_state;
7330 gops->gr.alloc_gr_ctx = gr_gk20a_alloc_gr_ctx; 7332 gops->gr.alloc_gr_ctx = gr_gk20a_alloc_gr_ctx;