nvgpu: vgpu: ga10b: enable compression

- contiguous mempool has been added on server side.
- init cbc support only on compression flag enabled
- enable compression flag only on silicon

Jira GVSCI-12883

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I339f25b81224b55124928231be65070660e27080
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2676951
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Richard Zhao
2022-03-02 15:41:53 -08:00
committed by mobile promotions
parent 30c434efc1
commit cf43371073
2 changed files with 21 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2014-2022, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -266,10 +266,12 @@ int vgpu_finalize_poweron_common(struct gk20a *g)
}
#ifdef CONFIG_NVGPU_COMPRESSION
err = nvgpu_cbc_init_support(g);
if (err != 0) {
nvgpu_err(g, "failed to init cbc");
return err;
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) {
err = nvgpu_cbc_init_support(g);
if (err != 0) {
nvgpu_err(g, "failed to init cbc");
return err;
}
}
#endif

View File

@@ -130,6 +130,7 @@
#include <nvgpu/clk_arb.h>
#include <nvgpu/grmgr.h>
#include <nvgpu/perfbuf.h>
#include <nvgpu/soc.h>
#include "common/vgpu/init/init_vgpu.h"
#include "common/vgpu/fb/fb_vgpu.h"
@@ -1213,8 +1214,19 @@ int vgpu_ga10b_init_hal(struct gk20a *g)
priv->constants.max_sm_diversity_config_count;
#ifdef CONFIG_NVGPU_COMPRESSION
nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, false);
nvgpu_set_enabled(g, NVGPU_SUPPORT_POST_L2_COMPRESSION, false);
if (nvgpu_platform_is_silicon(g)) {
nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true);
} else {
nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, false);
}
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) {
nvgpu_set_enabled(g, NVGPU_SUPPORT_POST_L2_COMPRESSION, true);
} else {
gops->cbc.init = NULL;
gops->cbc.ctrl = NULL;
gops->cbc.alloc_comptags = NULL;
}
#endif
#ifdef CONFIG_NVGPU_RECOVERY