summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
diff options
context:
space:
mode:
authorAingara Paramakuru <aparamakuru@nvidia.com>2015-03-10 11:17:05 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:59:50 -0400
commitf45d33e5f2b1e36363f32bbbeeeba462486cc6cd (patch)
tree8a100fe62fce6c0bffbbca40448712249b8f8afb /drivers/gpu/nvgpu/vgpu/gr_vgpu.c
parentfdb92d41af195eb1bfcee6d768bb0d3c9a6e2faf (diff)
gpu: nvgpu: vgpu: add new attributes
Add support for reading num FBPs and FBP enable mask. Bug 1621056 Change-Id: I92ec1123373308ed280d4ffd30fe77ae6073ac45 Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-on: http://git-master/r/715826 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index 8c41c3d9..60880f6d 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -629,6 +629,34 @@ static u32 vgpu_gr_get_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
629 return 0x1; 629 return 0x1;
630} 630}
631 631
632static u32 vgpu_gr_get_max_fbps_count(struct gk20a *g)
633{
634 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
635 u32 max_fbps_count = 0;
636
637 gk20a_dbg_fn("");
638
639 if (vgpu_get_attribute(platform->virt_handle,
640 TEGRA_VGPU_ATTRIB_NUM_FBPS, &max_fbps_count))
641 gk20a_err(dev_from_gk20a(g), "failed to retrieve num fbps");
642
643 return max_fbps_count;
644}
645
646static u32 vgpu_gr_get_fbp_en_mask(struct gk20a *g)
647{
648 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
649 u32 fbp_en_mask = 0;
650
651 gk20a_dbg_fn("");
652
653 if (vgpu_get_attribute(platform->virt_handle,
654 TEGRA_VGPU_ATTRIB_FBP_EN_MASK, &fbp_en_mask))
655 gk20a_err(dev_from_gk20a(g), "failed to retrieve fbp en mask");
656
657 return fbp_en_mask;
658}
659
632static void vgpu_remove_gr_support(struct gr_gk20a *gr) 660static void vgpu_remove_gr_support(struct gr_gk20a *gr)
633{ 661{
634 gk20a_dbg_fn(""); 662 gk20a_dbg_fn("");
@@ -748,4 +776,6 @@ void vgpu_init_gr_ops(struct gpu_ops *gops)
748 gops->gr.get_zcull_info = vgpu_gr_get_zcull_info; 776 gops->gr.get_zcull_info = vgpu_gr_get_zcull_info;
749 gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch; 777 gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch;
750 gops->gr.get_gpc_tpc_mask = vgpu_gr_get_gpc_tpc_mask; 778 gops->gr.get_gpc_tpc_mask = vgpu_gr_get_gpc_tpc_mask;
779 gops->gr.get_max_fbps_count = vgpu_gr_get_max_fbps_count;
780 gops->gr.get_fbp_en_mask = vgpu_gr_get_fbp_en_mask;
751} 781}