diff --git a/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c index 6a4b4bd78..6ddf93c6d 100644 --- a/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c @@ -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 diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_ga10b.c b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_ga10b.c index e6339416e..0ca1533bc 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_ga10b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_ga10b.c @@ -130,6 +130,7 @@ #include #include #include +#include #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