mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add .init_golden_image HAL
golden image is created differently on native and VF. Jira GVSCI-15772 Change-Id: I8d78d1214d8aac1d39d6529b68adef1dd6f8a516 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863440 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
067e3590d5
commit
41823694a3
@@ -1151,10 +1151,6 @@ int nvgpu_gr_obj_ctx_init_golden_context_image(struct gk20a *g)
|
|||||||
struct nvgpu_gr_ctx gr_ctx = {};
|
struct nvgpu_gr_ctx gr_ctx = {};
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (g->is_virtual) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = gk20a_busy(g);
|
err = gk20a_busy(g);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
nvgpu_err(g, "failed to power on, %d", err);
|
nvgpu_err(g, "failed to power on, %d", err);
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
#include <nvgpu/gr/gr_falcon.h>
|
#include <nvgpu/gr/gr_falcon.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
#include <nvgpu/gr/gr_intr.h>
|
#include <nvgpu/gr/gr_intr.h>
|
||||||
|
#include <nvgpu/gr/obj_ctx.h>
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
#include <nvgpu/nvgpu_init.h>
|
#include <nvgpu/nvgpu_init.h>
|
||||||
#include <nvgpu/sbr.h>
|
#include <nvgpu/sbr.h>
|
||||||
@@ -563,6 +564,7 @@ static const struct gops_gr_fecs_trace ga100_ops_gr_fecs_trace = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct gops_gr_setup ga100_ops_gr_setup = {
|
static const struct gops_gr_setup ga100_ops_gr_setup = {
|
||||||
|
.init_golden_image = nvgpu_gr_obj_ctx_init_golden_context_image,
|
||||||
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
||||||
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
||||||
.free_subctx = nvgpu_gr_setup_free_subctx,
|
.free_subctx = nvgpu_gr_setup_free_subctx,
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <nvgpu/gr/gr_falcon.h>
|
#include <nvgpu/gr/gr_falcon.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
#include <nvgpu/gr/fs_state.h>
|
#include <nvgpu/gr/fs_state.h>
|
||||||
|
#include <nvgpu/gr/obj_ctx.h>
|
||||||
#include <nvgpu/nvhost.h>
|
#include <nvgpu/nvhost.h>
|
||||||
#ifdef CONFIG_NVGPU_LS_PMU
|
#ifdef CONFIG_NVGPU_LS_PMU
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
@@ -556,6 +557,7 @@ static const struct gops_gr_fecs_trace ga10b_ops_gr_fecs_trace = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct gops_gr_setup ga10b_ops_gr_setup = {
|
static const struct gops_gr_setup ga10b_ops_gr_setup = {
|
||||||
|
.init_golden_image = nvgpu_gr_obj_ctx_init_golden_context_image,
|
||||||
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
||||||
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
||||||
.free_subctx = nvgpu_gr_setup_free_subctx,
|
.free_subctx = nvgpu_gr_setup_free_subctx,
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
#include <nvgpu/gr/gr_intr.h>
|
#include <nvgpu/gr/gr_intr.h>
|
||||||
#include <nvgpu/gr/gr_falcon.h>
|
#include <nvgpu/gr/gr_falcon.h>
|
||||||
|
#include <nvgpu/gr/obj_ctx.h>
|
||||||
#include <nvgpu/gr/setup.h>
|
#include <nvgpu/gr/setup.h>
|
||||||
#ifdef CONFIG_NVGPU_LS_PMU
|
#ifdef CONFIG_NVGPU_LS_PMU
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
@@ -293,6 +294,7 @@ static const struct gops_gr_fecs_trace gm20b_ops_gr_fecs_trace = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct gops_gr_setup gm20b_ops_gr_setup = {
|
static const struct gops_gr_setup gm20b_ops_gr_setup = {
|
||||||
|
.init_golden_image = nvgpu_gr_obj_ctx_init_golden_context_image,
|
||||||
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
||||||
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
||||||
#ifdef CONFIG_NVGPU_GRAPHICS
|
#ifdef CONFIG_NVGPU_GRAPHICS
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <nvgpu/regops.h>
|
#include <nvgpu/regops.h>
|
||||||
#include <nvgpu/gr/gr_falcon.h>
|
#include <nvgpu/gr/gr_falcon.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
|
#include <nvgpu/gr/obj_ctx.h>
|
||||||
#include <nvgpu/nvhost.h>
|
#include <nvgpu/nvhost.h>
|
||||||
#ifdef CONFIG_NVGPU_LS_PMU
|
#ifdef CONFIG_NVGPU_LS_PMU
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
@@ -448,6 +449,7 @@ static const struct gops_gr_fecs_trace gv11b_ops_gr_fecs_trace = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct gops_gr_setup gv11b_ops_gr_setup = {
|
static const struct gops_gr_setup gv11b_ops_gr_setup = {
|
||||||
|
.init_golden_image = nvgpu_gr_obj_ctx_init_golden_context_image,
|
||||||
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
||||||
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
||||||
.free_subctx = nvgpu_gr_setup_free_subctx,
|
.free_subctx = nvgpu_gr_setup_free_subctx,
|
||||||
|
|||||||
@@ -243,6 +243,7 @@
|
|||||||
#include <nvgpu/gr/gr_falcon.h>
|
#include <nvgpu/gr/gr_falcon.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
#include <nvgpu/gr/gr_intr.h>
|
#include <nvgpu/gr/gr_intr.h>
|
||||||
|
#include <nvgpu/gr/obj_ctx.h>
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
#include <nvgpu/nvgpu_init.h>
|
#include <nvgpu/nvgpu_init.h>
|
||||||
#include <nvgpu/sbr.h>
|
#include <nvgpu/sbr.h>
|
||||||
@@ -491,6 +492,7 @@ static const struct gops_gr_fecs_trace tu104_ops_gr_fecs_trace = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct gops_gr_setup tu104_ops_gr_setup = {
|
static const struct gops_gr_setup tu104_ops_gr_setup = {
|
||||||
|
.init_golden_image = nvgpu_gr_obj_ctx_init_golden_context_image,
|
||||||
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
.alloc_obj_ctx = nvgpu_gr_setup_alloc_obj_ctx,
|
||||||
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
.free_gr_ctx = nvgpu_gr_setup_free_gr_ctx,
|
||||||
.free_subctx = nvgpu_gr_setup_free_subctx,
|
.free_subctx = nvgpu_gr_setup_free_subctx,
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ struct gops_gr_ecc {
|
|||||||
* @see gops_gr
|
* @see gops_gr
|
||||||
*/
|
*/
|
||||||
struct gops_gr_setup {
|
struct gops_gr_setup {
|
||||||
|
int (*init_golden_image)(struct gk20a *g);
|
||||||
/**
|
/**
|
||||||
* @brief Allocate and setup object context s/w image
|
* @brief Allocate and setup object context s/w image
|
||||||
* for GPU channel.
|
* for GPU channel.
|
||||||
|
|||||||
@@ -984,19 +984,18 @@ static int nvgpu_ioctl_channel_alloc_obj_ctx(struct nvgpu_channel *ch,
|
|||||||
u32 class_num, u32 user_flags)
|
u32 class_num, u32 user_flags)
|
||||||
{
|
{
|
||||||
struct gk20a *g = ch->g;
|
struct gk20a *g = ch->g;
|
||||||
int err;
|
|
||||||
|
|
||||||
/*
|
if (g->ops.gr.setup.init_golden_image != NULL) {
|
||||||
* Allocate VEID0 channel and initialize the golden context image.
|
int err = g->ops.gr.setup.init_golden_image(g);
|
||||||
*/
|
|
||||||
err = nvgpu_gr_obj_ctx_init_golden_context_image(g);
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
nvgpu_err(g, "golden context image init failed (%d).",
|
nvgpu_err(g, "golden context image init failed (%d).",
|
||||||
err);
|
err);
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ch->g->ops.gr.setup.alloc_obj_ctx(ch, class_num,
|
return g->ops.gr.setup.alloc_obj_ctx(ch, class_num,
|
||||||
nvgpu_obj_ctx_user_flags_to_common_flags(user_flags));
|
nvgpu_obj_ctx_user_flags_to_common_flags(user_flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user