From 4c451b06bd0b771da2ff4612626a81adea0e3be2 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 7 Nov 2017 10:41:09 -0800 Subject: gpu: nvgpu: Move max_css_buffer_size to gr_gk20a max_css_buffer_size was accessed directly from GPU characteristics, which added a dependency to Linux. Move the field to gr_gk20a and copy it to GPU characteristics at query time. JIRA NVGPU-259 Change-Id: Ied19e33bf1a79a9ce45e33df57fe5bbe3a3c4f9d Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1593689 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu Reviewed-by: Peter Daifuku GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 2 ++ drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 1 + drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 2 +- drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c | 5 ++--- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index cff889fb..3c6b1b26 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -230,6 +230,8 @@ gk20a_ctrl_ioctl_gpu_characteristics( pgpu->sm_arch_spa_version = g->params.sm_arch_spa_version; pgpu->sm_arch_warp_count = g->params.sm_arch_warp_count; + pgpu->max_css_buffer_size = g->gr.max_css_buffer_size; + if (request->gpu_characteristics_buf_size > 0) { size_t write_size = sizeof(*pgpu); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index d411a2fa..2b3b74bc 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -417,6 +417,7 @@ struct gr_gk20a { struct nvgpu_mutex cs_lock; struct gk20a_cs_snapshot *cs_data; #endif + u32 max_css_buffer_size; }; void gk20a_fecs_dump_falcon_stats(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 61f608f4..4c49f734 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -1126,7 +1126,7 @@ void gr_gm20b_init_cyclestats(struct gk20a *g) #if defined(CONFIG_GK20A_CYCLE_STATS) __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, true); __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT, true); - g->gpu_characteristics.max_css_buffer_size = 0xffffffff; + g->gr.max_css_buffer_size = 0xffffffff; #else (void)g; #endif diff --git a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c index fca6525a..0e440241 100644 --- a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c +++ b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c @@ -35,11 +35,10 @@ void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g) /* cyclestats not supported on vgpu */ __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, false); - g->gpu_characteristics.max_css_buffer_size = - vgpu_css_get_buffer_size(g); + g->gr.max_css_buffer_size = vgpu_css_get_buffer_size(g); /* snapshots not supported if the buffer size is 0 */ - if (g->gpu_characteristics.max_css_buffer_size == 0) + if (g->gr.max_css_buffer_size == 0) snapshots_supported = false; __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT, -- cgit v1.2.2