diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 34b7a4e66..db740ec5c 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -393,6 +393,7 @@ struct gr_gk20a { struct gk20a_cs_snapshot *cs_data; #endif u32 max_css_buffer_size; + u32 max_ctxsw_ring_buffer_size; }; void gk20a_fecs_dump_falcon_stats(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c b/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c index 958ee2b6b..b657b1239 100644 --- a/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c +++ b/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c @@ -580,6 +580,8 @@ int gk20a_ctxsw_trace_init(struct gk20a *g) if (unlikely(err)) goto fail; + g->gr.max_ctxsw_ring_buffer_size = GK20A_CTXSW_TRACE_MAX_VM_RING_SIZE; + return 0; fail: diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 90e506fc6..08c3fd281 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -326,6 +326,7 @@ gk20a_ctrl_ioctl_gpu_characteristics( gpu.sm_arch_warp_count = g->params.sm_arch_warp_count; gpu.max_css_buffer_size = g->gr.max_css_buffer_size; + gpu.max_ctxsw_ring_buffer_size = g->gr.max_ctxsw_ring_buffer_size; gpu.gpu_ioctl_nr_last = NVGPU_GPU_IOCTL_LAST; gpu.tsg_ioctl_nr_last = NVGPU_TSG_IOCTL_LAST; diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 031321e34..79c8bed08 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -283,6 +283,9 @@ struct nvgpu_gpu_characteristics { __s16 ctxsw_ioctl_nr_last; __u8 reserved2[6]; + __u32 max_ctxsw_ring_buffer_size; + __u32 reserved3; + /* Notes: - This struct can be safely appended with new fields. However, always keep the structure size multiple of 8 and make sure that the binary