gpu: nvgpu: Add doxygen documentation in preempt.h

Jira NVGPU-3593

Change-Id: Ia4491e6cd123a571b528eccb23727f747895ea86
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133849
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2019-06-10 11:28:03 -07:00
committed by mobile promotions
parent 3ca084ae65
commit ad92d2d8cf

View File

@@ -24,13 +24,52 @@
#include <nvgpu/types.h>
/**
* @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 */