From ad92d2d8cf3a2a7654e459da24a89cd065820e37 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Mon, 10 Jun 2019 11:28:03 -0700 Subject: [PATCH] gpu: nvgpu: Add doxygen documentation in preempt.h Jira NVGPU-3593 Change-Id: Ia4491e6cd123a571b528eccb23727f747895ea86 Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/2133849 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/preempt.h | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/gpu/nvgpu/include/nvgpu/preempt.h b/drivers/gpu/nvgpu/include/nvgpu/preempt.h index 863d6ca44..2cfa7cd38 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/preempt.h +++ b/drivers/gpu/nvgpu/include/nvgpu/preempt.h @@ -24,13 +24,52 @@ #include +/** + * @file + * + * Preemption interface. + */ struct gk20a; struct nvgpu_channel; struct nvgpu_tsg; +/** + * @brief Get preemption timeout (ms). This timeout is defined by s/w. + * + * @param g[in] The GPU driver struct to query preempt timeout for. + * + * @return Maximum amount of time in ms to wait for preemption completion, + * i.e. context non resident on PBDMAs and engines. + */ u32 nvgpu_preempt_get_timeout(struct gk20a *g); + +/** + * @brief Preempts TSG if channel is bound to TSG. + * + * @param g[in] The GPU driver struct which owns this channel. + * @param ch[in] Pointer to channel to be preempted. + * + * Preempts TSG if channel is bound to TSG. Preemption implies that the + * context's state is saved out and also that the context cannot remain parked + * either in Host or in any engine. + * + * After triggering a preempt request for channel's TSG, pbdmas and engines + * are polled to make sure preemption completed, i.e. context is not loaded + * on any pbdma or engine. + * + * @return 0 in case of success, <0 in case of failure + * @retval 0 if channel was not bound to TSG. + * @retval 0 if TSG was not loaded on pbdma or engine. + * @retval 0 if TSG was loaded (pbdma or engine) and could be preempted. + * @retval non-zero value if preemption did not complete within s/w defined + * timeout. + */ int nvgpu_preempt_channel(struct gk20a *g, struct nvgpu_channel *ch); +/** + * Called from recovery handling for volta onwards. This will + * not be part of safety build after recovery is not supported in safety build. + */ void nvgpu_preempt_poll_tsg_on_pbdma(struct gk20a *g, struct nvgpu_tsg *tsg); #endif /* NVGPU_PREEMPT_H */