From e8b658095393a4a719f35af698dbead8628ca144 Mon Sep 17 00:00:00 2001 From: Vinod G Date: Mon, 11 Mar 2019 13:25:22 -0700 Subject: [PATCH] gpu: nvgpu: remove pd_max_batches support remove unused pd_max_batches implementation. remove pd_max_batches support from gr_gk20a struct and sysfs Bug 200492671 Change-Id: Ibfd81a6aec88610175495018759c27341b637e52 Signed-off-by: Vinod G Reviewed-on: https://git-master.nvidia.com/r/2070058 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 1 - drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 20 ++++---------------- drivers/gpu/nvgpu/os/linux/sysfs.c | 29 ----------------------------- 3 files changed, 4 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index f3ab6fd60..6694b0456 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -224,7 +224,6 @@ struct gr_gk20a { u32 attrib_cb_gfxp_size; u32 alpha_cb_default_size; u32 alpha_cb_size; - u32 pd_max_batches; u32 gfxp_wfi_timeout_count; u32 gfxp_wfi_timeout_unit; diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 2e6d361a1..1f9210ac5 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -426,15 +426,9 @@ int gr_gp10b_commit_global_cb_manager(struct gk20a *g, gr_gpc0_ppc0_cbm_beta_cb_size_v_granularity_v()) / gr_pd_ab_dist_cfg1_max_output_granularity_v(); - if (g->gr.pd_max_batches != 0U) { - nvgpu_gr_ctx_patch_write(g, gr_ctx, gr_pd_ab_dist_cfg1_r(), - gr_pd_ab_dist_cfg1_max_output_f(pd_ab_max_output) | - gr_pd_ab_dist_cfg1_max_batches_f(g->gr.pd_max_batches), patch); - } else { - nvgpu_gr_ctx_patch_write(g, gr_ctx, gr_pd_ab_dist_cfg1_r(), - gr_pd_ab_dist_cfg1_max_output_f(pd_ab_max_output) | - gr_pd_ab_dist_cfg1_max_batches_init_f(), patch); - } + nvgpu_gr_ctx_patch_write(g, gr_ctx, gr_pd_ab_dist_cfg1_r(), + gr_pd_ab_dist_cfg1_max_output_f(pd_ab_max_output) | + gr_pd_ab_dist_cfg1_max_batches_init_f(), patch); attrib_offset_in_chunk = alpha_offset_in_chunk + nvgpu_gr_config_get_tpc_count(gr->config) * gr->alpha_cb_size; @@ -719,15 +713,9 @@ void gr_gp10b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data) gr_gpc0_ppc0_cbm_alpha_cb_size_v_granularity_v() / gr_pd_ab_dist_cfg1_max_output_granularity_v(); - if (g->gr.pd_max_batches != 0U) { - gk20a_writel(g, gr_pd_ab_dist_cfg1_r(), - gr_pd_ab_dist_cfg1_max_output_f(pd_ab_max_output) | - gr_pd_ab_dist_cfg1_max_batches_f(g->gr.pd_max_batches)); - } else { - gk20a_writel(g, gr_pd_ab_dist_cfg1_r(), + nvgpu_writel(g, gr_pd_ab_dist_cfg1_r(), gr_pd_ab_dist_cfg1_max_output_f(pd_ab_max_output) | gr_pd_ab_dist_cfg1_max_batches_init_f()); - } for (gpc_index = 0; gpc_index < nvgpu_gr_config_get_gpc_count(gr->config); diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index 66ecaf521..21261f3b0 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c @@ -984,33 +984,6 @@ static ssize_t max_timeslice_us_store(struct device *dev, static DEVICE_ATTR(max_timeslice_us, ROOTRW, max_timeslice_us_read, max_timeslice_us_store); -static ssize_t pd_max_batches_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) -{ - struct gk20a *g = get_gk20a(dev); - unsigned long val; - - if (kstrtoul(buf, 10, &val) < 0) - return -EINVAL; - - if (val > 64) - return -EINVAL; - - g->gr.pd_max_batches = val; - - return count; -} - -static ssize_t pd_max_batches_read(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct gk20a *g = get_gk20a(dev); - - return sprintf(buf, "%d\n", g->gr.pd_max_batches); -} - -static DEVICE_ATTR(pd_max_batches, ROOTRW, pd_max_batches_read, pd_max_batches_store); - static ssize_t gfxp_wfi_timeout_count_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -1174,7 +1147,6 @@ void nvgpu_remove_sysfs(struct device *dev) nvgpu_nvhost_remove_symlink(get_gk20a(dev)); #endif - device_remove_file(dev, &dev_attr_pd_max_batches); device_remove_file(dev, &dev_attr_gfxp_wfi_timeout_count); device_remove_file(dev, &dev_attr_gfxp_wfi_timeout_unit); device_remove_file(dev, &dev_attr_gpu_powered_on); @@ -1228,7 +1200,6 @@ int nvgpu_create_sysfs(struct device *dev) error |= nvgpu_nvhost_create_symlink(g); #endif - error |= device_create_file(dev, &dev_attr_pd_max_batches); error |= device_create_file(dev, &dev_attr_gfxp_wfi_timeout_count); error |= device_create_file(dev, &dev_attr_gfxp_wfi_timeout_unit); error |= device_create_file(dev, &dev_attr_gpu_powered_on);