mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: Skip graphics CB programming for MIG
Added logic to skip the following graphics CB allocation, map and programming sequence when MIG is enabled. Global CB: 1) NVGPU_GR_GLOBAL_CTX_CIRCULAR 2) NVGPU_GR_GLOBAL_CTX_PAGEPOOL 3) NVGPU_GR_GLOBAL_CTX_ATTRIBUTE 4) NVGPU_GR_GLOBAL_CTX_CIRCULAR_VPR 5) NVGPU_GR_GLOBAL_CTX_PAGEPOOL_VPR 6) NVGPU_GR_GLOBAL_CTX_ATTRIBUTE_VPR 7) NVGPU_GR_GLOBAL_CTX_RTV_CIRCULAR_BUFFER CTX CB: 1) NVGPU_GR_CTX_CIRCULAR_VA 2) NVGPU_GR_CTX_PAGEPOOL_VA 3) NVGPU_GR_CTX_ATTRIBUTE_VA 4) NVGPU_GR_CTX_RTV_CIRCULAR_BUFFER_VA JIRA NVGPU-5650 Change-Id: I38c2859ce57ad76c58a772fdf9f589f2106149af Signed-off-by: Lakshmanan M <lm@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2423450 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com> Reviewed-by: Dinesh T <dt@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
c9a964aefd
commit
2ecb5feaad
@@ -355,28 +355,50 @@ int nvgpu_gr_ctx_map_global_ctx_buffers(struct gk20a *g,
|
||||
|
||||
nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gr, " ");
|
||||
|
||||
/* Circular Buffer */
|
||||
err = nvgpu_gr_ctx_map_ctx_circular_buffer(g, gr_ctx,
|
||||
global_ctx_buffer, vm, vpr);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx circular buffer");
|
||||
goto fail;
|
||||
}
|
||||
/*
|
||||
* MIG supports only compute class.
|
||||
* Allocate BUNDLE_CB, PAGEPOOL, ATTRIBUTE_CB and RTV_CB
|
||||
* if 2D/3D/I2M classes(graphics) are supported.
|
||||
*/
|
||||
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_MIG)) {
|
||||
/* Circular Buffer */
|
||||
err = nvgpu_gr_ctx_map_ctx_circular_buffer(g, gr_ctx,
|
||||
global_ctx_buffer, vm, vpr);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx circular buffer");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Attribute Buffer */
|
||||
err = nvgpu_gr_ctx_map_ctx_attribute_buffer(g, gr_ctx,
|
||||
global_ctx_buffer, vm, vpr);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx attribute buffer");
|
||||
goto fail;
|
||||
}
|
||||
/* Attribute Buffer */
|
||||
err = nvgpu_gr_ctx_map_ctx_attribute_buffer(g, gr_ctx,
|
||||
global_ctx_buffer, vm, vpr);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx attribute buffer");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Page Pool */
|
||||
err = nvgpu_gr_ctx_map_ctx_pagepool_buffer(g, gr_ctx,
|
||||
global_ctx_buffer, vm, vpr);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx pagepool buffer");
|
||||
goto fail;
|
||||
/* Page Pool */
|
||||
err = nvgpu_gr_ctx_map_ctx_pagepool_buffer(g, gr_ctx,
|
||||
global_ctx_buffer, vm, vpr);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx pagepool buffer");
|
||||
goto fail;
|
||||
}
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
/* RTV circular buffer */
|
||||
if (nvgpu_gr_global_ctx_buffer_ready(global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_RTV_CIRCULAR_BUFFER)) {
|
||||
err = nvgpu_gr_ctx_map_ctx_buffer(g,
|
||||
NVGPU_GR_GLOBAL_CTX_RTV_CIRCULAR_BUFFER,
|
||||
NVGPU_GR_CTX_RTV_CIRCULAR_BUFFER_VA,
|
||||
gr_ctx, global_ctx_buffer, vm);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g,
|
||||
"cannot map ctx rtv circular buffer");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Priv register Access Map */
|
||||
@@ -403,21 +425,6 @@ int nvgpu_gr_ctx_map_global_ctx_buffers(struct gk20a *g,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
/* RTV circular buffer */
|
||||
if (nvgpu_gr_global_ctx_buffer_ready(global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_RTV_CIRCULAR_BUFFER)) {
|
||||
err = nvgpu_gr_ctx_map_ctx_buffer(g,
|
||||
NVGPU_GR_GLOBAL_CTX_RTV_CIRCULAR_BUFFER,
|
||||
NVGPU_GR_CTX_RTV_CIRCULAR_BUFFER_VA,
|
||||
gr_ctx, global_ctx_buffer, vm);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "cannot map ctx rtv circular buffer");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
gr_ctx->global_ctx_buffer_mapped = true;
|
||||
|
||||
nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gr, "done");
|
||||
|
||||
Reference in New Issue
Block a user