mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: vgpu: force gpu preepmtion policy
Query the RM server to retrieve gpu preemption policy
of guest based on pct configuration. If guest is not
allowed to request wfi preemption mode then set context
with either gfxp or cta preemption mode only.
Jira VFND-3079
Jira VFND-3081
Change-Id: I60cbf121d6f0e2373568cf40b3dfdb4df76fe02d
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: http://git-master/r/1280903
(cherry picked from commit 16ee09bb59)
Reviewed-on: http://git-master/r/1321661
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
4deb494ad1
commit
b6a2aa3631
@@ -56,6 +56,7 @@ static int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g,
|
|||||||
struct gr_ctx_desc *gr_ctx;
|
struct gr_ctx_desc *gr_ctx;
|
||||||
u32 graphics_preempt_mode = 0;
|
u32 graphics_preempt_mode = 0;
|
||||||
u32 compute_preempt_mode = 0;
|
u32 compute_preempt_mode = 0;
|
||||||
|
struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
gk20a_dbg_fn("");
|
gk20a_dbg_fn("");
|
||||||
@@ -71,6 +72,14 @@ static int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g,
|
|||||||
if (flags & NVGPU_ALLOC_OBJ_FLAGS_CILP)
|
if (flags & NVGPU_ALLOC_OBJ_FLAGS_CILP)
|
||||||
compute_preempt_mode = NVGPU_COMPUTE_PREEMPTION_MODE_CILP;
|
compute_preempt_mode = NVGPU_COMPUTE_PREEMPTION_MODE_CILP;
|
||||||
|
|
||||||
|
if (priv->constants.force_preempt_mode && !graphics_preempt_mode &&
|
||||||
|
!compute_preempt_mode) {
|
||||||
|
graphics_preempt_mode = PASCAL_A == class ?
|
||||||
|
NVGPU_GRAPHICS_PREEMPTION_MODE_GFXP : 0;
|
||||||
|
compute_preempt_mode = PASCAL_COMPUTE_A == class ?
|
||||||
|
NVGPU_COMPUTE_PREEMPTION_MODE_CTA : 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (graphics_preempt_mode || compute_preempt_mode) {
|
if (graphics_preempt_mode || compute_preempt_mode) {
|
||||||
if (g->ops.gr.set_ctxsw_preemption_mode) {
|
if (g->ops.gr.set_ctxsw_preemption_mode) {
|
||||||
err = g->ops.gr.set_ctxsw_preemption_mode(g, gr_ctx, vm,
|
err = g->ops.gr.set_ctxsw_preemption_mode(g, gr_ctx, vm,
|
||||||
|
|||||||
@@ -442,6 +442,7 @@ struct tegra_vgpu_constants_params {
|
|||||||
*/
|
*/
|
||||||
u16 gpc_tpc_mask[TEGRA_VGPU_MAX_GPC_COUNT];
|
u16 gpc_tpc_mask[TEGRA_VGPU_MAX_GPC_COUNT];
|
||||||
u32 hwpm_ctx_size;
|
u32 hwpm_ctx_size;
|
||||||
|
u8 force_preempt_mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct tegra_vgpu_channel_cyclestats_snapshot_params {
|
struct tegra_vgpu_channel_cyclestats_snapshot_params {
|
||||||
|
|||||||
Reference in New Issue
Block a user