diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2018-01-18 14:02:08 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-22 18:29:54 -0500 |
commit | 193a2ed38ca51d898ac811820ab86237c84e18eb (patch) | |
tree | da672582c2322fc91c7b5c600deb5a60f3068a8d /drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |
parent | f6d898656a6d7c197aa27ee53f5f0151fb6dfcf5 (diff) |
gpu: nvgpu: add sw method for SET_BES_CROP_DEBUG4
Added sw method support for SET_BES_CROP_DEBUG4.
In this sw method:
CLAMP_FP_BLEND_TO_MAXVAL forces overflow and
CLAMP_FP_BLEND_TO_INF blend results to clamp to FP maxval.
Added support for this sw method in gp10b/gp106/gv11b
and gv100.
Bug 2046636
Change-Id: I3a9e97587aca76718f7f504ea3b853f87409092a
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1641529
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 549a4da4..17685f59 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -695,6 +695,30 @@ void gr_gp10b_set_bes_crop_debug3(struct gk20a *g, u32 data) | |||
695 | gk20a_writel(g, gr_bes_crop_debug3_r(), val); | 695 | gk20a_writel(g, gr_bes_crop_debug3_r(), val); |
696 | } | 696 | } |
697 | 697 | ||
698 | void gr_gp10b_set_bes_crop_debug4(struct gk20a *g, u32 data) | ||
699 | { | ||
700 | u32 val; | ||
701 | |||
702 | nvgpu_log_fn(g, " "); | ||
703 | |||
704 | val = gk20a_readl(g, gr_bes_crop_debug4_r()); | ||
705 | if (data & NVC097_BES_CROP_DEBUG4_CLAMP_FP_BLEND_TO_MAXVAL) { | ||
706 | val = set_field(val, | ||
707 | gr_bes_crop_debug4_clamp_fp_blend_m(), | ||
708 | gr_bes_crop_debug4_clamp_fp_blend_to_maxval_f()); | ||
709 | } else if (data & NVC097_BES_CROP_DEBUG4_CLAMP_FP_BLEND_TO_INF) { | ||
710 | val = set_field(val, | ||
711 | gr_bes_crop_debug4_clamp_fp_blend_m(), | ||
712 | gr_bes_crop_debug4_clamp_fp_blend_to_inf_f()); | ||
713 | } else { | ||
714 | nvgpu_warn(g, | ||
715 | "gr_gp10b_set_bes_crop_debug4: wrong data sent!"); | ||
716 | return; | ||
717 | } | ||
718 | gk20a_writel(g, gr_bes_crop_debug4_r(), val); | ||
719 | } | ||
720 | |||
721 | |||
698 | int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, | 722 | int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, |
699 | u32 class_num, u32 offset, u32 data) | 723 | u32 class_num, u32 offset, u32 data) |
700 | { | 724 | { |
@@ -736,6 +760,9 @@ int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, | |||
736 | case NVC097_SET_BES_CROP_DEBUG3: | 760 | case NVC097_SET_BES_CROP_DEBUG3: |
737 | g->ops.gr.set_bes_crop_debug3(g, data); | 761 | g->ops.gr.set_bes_crop_debug3(g, data); |
738 | break; | 762 | break; |
763 | case NVC097_SET_BES_CROP_DEBUG4: | ||
764 | g->ops.gr.set_bes_crop_debug4(g, data); | ||
765 | break; | ||
739 | default: | 766 | default: |
740 | goto fail; | 767 | goto fail; |
741 | } | 768 | } |