From 193a2ed38ca51d898ac811820ab86237c84e18eb Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Thu, 18 Jan 2018 11:02:08 -0800 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1641529 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c') 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) gk20a_writel(g, gr_bes_crop_debug3_r(), val); } +void gr_gp10b_set_bes_crop_debug4(struct gk20a *g, u32 data) +{ + u32 val; + + nvgpu_log_fn(g, " "); + + val = gk20a_readl(g, gr_bes_crop_debug4_r()); + if (data & NVC097_BES_CROP_DEBUG4_CLAMP_FP_BLEND_TO_MAXVAL) { + val = set_field(val, + gr_bes_crop_debug4_clamp_fp_blend_m(), + gr_bes_crop_debug4_clamp_fp_blend_to_maxval_f()); + } else if (data & NVC097_BES_CROP_DEBUG4_CLAMP_FP_BLEND_TO_INF) { + val = set_field(val, + gr_bes_crop_debug4_clamp_fp_blend_m(), + gr_bes_crop_debug4_clamp_fp_blend_to_inf_f()); + } else { + nvgpu_warn(g, + "gr_gp10b_set_bes_crop_debug4: wrong data sent!"); + return; + } + gk20a_writel(g, gr_bes_crop_debug4_r(), val); +} + + int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, u32 class_num, u32 offset, u32 data) { @@ -736,6 +760,9 @@ int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, case NVC097_SET_BES_CROP_DEBUG3: g->ops.gr.set_bes_crop_debug3(g, data); break; + case NVC097_SET_BES_CROP_DEBUG4: + g->ops.gr.set_bes_crop_debug4(g, data); + break; default: goto fail; } -- cgit v1.2.2