mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: move non-safe functions from fusa hal to non-fusa hal
Multiple non-safe functions under NVGPU_DEBUGGER, NVGPU_CILP and other config flags were moved to fusa files. Although they are guarded by the C flags, it makes sense to keep those functions in non-fusa files. Make this change for all hals. JIRA NVGPU-3853 Change-Id: I8151b55a60cb50c5058af48bab9e8068f929ac3b Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2204352 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
e5259f5819
commit
ec293030c1
@@ -46,3 +46,70 @@ void gp10b_ctxsw_prog_set_full_preemption_ptr(struct gk20a *g,
|
||||
ctxsw_prog_main_image_full_preemption_ptr_o(), u64_lo32(addr));
|
||||
}
|
||||
#endif /* CONFIG_NVGPU_GRAPHICS */
|
||||
|
||||
#ifdef CONFIG_NVGPU_CILP
|
||||
void gp10b_ctxsw_prog_set_compute_preemption_mode_cilp(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem)
|
||||
{
|
||||
nvgpu_mem_wr(g, ctx_mem,
|
||||
ctxsw_prog_main_image_compute_preemption_options_o(),
|
||||
ctxsw_prog_main_image_compute_preemption_options_control_cilp_f());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NVGPU_DEBUGGER
|
||||
void gp10b_ctxsw_prog_set_pmu_options_boost_clock_frequencies(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem, u32 boosted_ctx)
|
||||
{
|
||||
u32 data = ctxsw_prog_main_image_pmu_options_boost_clock_frequencies_f(boosted_ctx);
|
||||
|
||||
nvgpu_mem_wr(g, ctx_mem, ctxsw_prog_main_image_pmu_options_o(), data);
|
||||
}
|
||||
#endif /* CONFIG_NVGPU_DEBUGGER */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
void gp10b_ctxsw_prog_dump_ctxsw_stats(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem)
|
||||
{
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_magic_value_o : %x (expect %x)",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_magic_value_o()),
|
||||
ctxsw_prog_main_image_magic_value_v_value_v());
|
||||
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi : %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_o()));
|
||||
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_context_timestamp_buffer_ptr : %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_context_timestamp_buffer_ptr_o()));
|
||||
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_context_timestamp_buffer_control : %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_context_timestamp_buffer_control_o()));
|
||||
|
||||
nvgpu_err(g, "NUM_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_save_ops_o()));
|
||||
nvgpu_err(g, "WFI_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_wfi_save_ops_o()));
|
||||
nvgpu_err(g, "CTA_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_cta_save_ops_o()));
|
||||
nvgpu_err(g, "GFXP_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_gfxp_save_ops_o()));
|
||||
nvgpu_err(g, "CILP_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_cilp_save_ops_o()));
|
||||
nvgpu_err(g,
|
||||
"image gfx preemption option (GFXP is 1) %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_graphics_preemption_options_o()));
|
||||
nvgpu_err(g,
|
||||
"image compute preemption option (CTA is 1) %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_compute_preemption_options_o()));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -29,72 +29,6 @@
|
||||
|
||||
#include <nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h>
|
||||
|
||||
#ifdef CONFIG_NVGPU_CILP
|
||||
void gp10b_ctxsw_prog_set_compute_preemption_mode_cilp(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem)
|
||||
{
|
||||
nvgpu_mem_wr(g, ctx_mem,
|
||||
ctxsw_prog_main_image_compute_preemption_options_o(),
|
||||
ctxsw_prog_main_image_compute_preemption_options_control_cilp_f());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NVGPU_DEBUGGER
|
||||
void gp10b_ctxsw_prog_set_pmu_options_boost_clock_frequencies(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem, u32 boosted_ctx)
|
||||
{
|
||||
u32 data = ctxsw_prog_main_image_pmu_options_boost_clock_frequencies_f(boosted_ctx);
|
||||
nvgpu_mem_wr(g, ctx_mem, ctxsw_prog_main_image_pmu_options_o(), data);
|
||||
}
|
||||
#endif /* CONFIG_NVGPU_DEBUGGER */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
void gp10b_ctxsw_prog_dump_ctxsw_stats(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem)
|
||||
{
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_magic_value_o : %x (expect %x)",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_magic_value_o()),
|
||||
ctxsw_prog_main_image_magic_value_v_value_v());
|
||||
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi : %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_o()));
|
||||
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_context_timestamp_buffer_ptr : %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_context_timestamp_buffer_ptr_o()));
|
||||
|
||||
nvgpu_err(g, "ctxsw_prog_main_image_context_timestamp_buffer_control : %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_context_timestamp_buffer_control_o()));
|
||||
|
||||
nvgpu_err(g, "NUM_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_save_ops_o()));
|
||||
nvgpu_err(g, "WFI_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_wfi_save_ops_o()));
|
||||
nvgpu_err(g, "CTA_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_cta_save_ops_o()));
|
||||
nvgpu_err(g, "GFXP_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_gfxp_save_ops_o()));
|
||||
nvgpu_err(g, "CILP_SAVE_OPERATIONS : %d",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_num_cilp_save_ops_o()));
|
||||
nvgpu_err(g,
|
||||
"image gfx preemption option (GFXP is 1) %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_graphics_preemption_options_o()));
|
||||
nvgpu_err(g,
|
||||
"image compute preemption option (CTA is 1) %x",
|
||||
nvgpu_mem_rd(g, ctx_mem,
|
||||
ctxsw_prog_main_image_compute_preemption_options_o()));
|
||||
}
|
||||
#endif
|
||||
|
||||
void gp10b_ctxsw_prog_set_compute_preemption_mode_cta(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem)
|
||||
{
|
||||
|
||||
@@ -64,3 +64,25 @@ void gv11b_ctxsw_prog_set_full_preemption_ptr_veid0(struct gk20a *g,
|
||||
u64_hi32(addr));
|
||||
}
|
||||
#endif /* CONFIG_NVGPU_GRAPHICS */
|
||||
|
||||
#ifdef CONFIG_NVGPU_DEBUGGER
|
||||
void gv11b_ctxsw_prog_set_pm_ptr(struct gk20a *g, struct nvgpu_mem *ctx_mem,
|
||||
u64 addr)
|
||||
{
|
||||
addr = addr >> 8;
|
||||
nvgpu_mem_wr(g, ctx_mem, ctxsw_prog_main_image_pm_ptr_o(),
|
||||
u64_lo32(addr));
|
||||
nvgpu_mem_wr(g, ctx_mem, ctxsw_prog_main_image_pm_ptr_hi_o(),
|
||||
u64_hi32(addr));
|
||||
}
|
||||
|
||||
u32 gv11b_ctxsw_prog_hw_get_pm_mode_stream_out_ctxsw(void)
|
||||
{
|
||||
return ctxsw_prog_main_image_pm_mode_stream_out_ctxsw_f();
|
||||
}
|
||||
|
||||
u32 gv11b_ctxsw_prog_hw_get_perf_counter_register_stride(void)
|
||||
{
|
||||
return ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v();
|
||||
}
|
||||
#endif /* CONFIG_NVGPU_DEBUGGER */
|
||||
|
||||
@@ -29,28 +29,6 @@
|
||||
|
||||
#include <nvgpu/hw/gv11b/hw_ctxsw_prog_gv11b.h>
|
||||
|
||||
#ifdef CONFIG_NVGPU_DEBUGGER
|
||||
void gv11b_ctxsw_prog_set_pm_ptr(struct gk20a *g, struct nvgpu_mem *ctx_mem,
|
||||
u64 addr)
|
||||
{
|
||||
addr = addr >> 8;
|
||||
nvgpu_mem_wr(g, ctx_mem, ctxsw_prog_main_image_pm_ptr_o(),
|
||||
u64_lo32(addr));
|
||||
nvgpu_mem_wr(g, ctx_mem, ctxsw_prog_main_image_pm_ptr_hi_o(),
|
||||
u64_hi32(addr));
|
||||
}
|
||||
|
||||
u32 gv11b_ctxsw_prog_hw_get_pm_mode_stream_out_ctxsw(void)
|
||||
{
|
||||
return ctxsw_prog_main_image_pm_mode_stream_out_ctxsw_f();
|
||||
}
|
||||
|
||||
u32 gv11b_ctxsw_prog_hw_get_perf_counter_register_stride(void)
|
||||
{
|
||||
return ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v();
|
||||
}
|
||||
#endif /* CONFIG_NVGPU_DEBUGGER */
|
||||
|
||||
void gv11b_ctxsw_prog_set_context_buffer_ptr(struct gk20a *g,
|
||||
struct nvgpu_mem *ctx_mem, u64 addr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user