diff --git a/drivers/gpu/nvgpu/hal/init/hal_ga100.c b/drivers/gpu/nvgpu/hal/init/hal_ga100.c index 43019500c..5b3defa5c 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_ga100.c +++ b/drivers/gpu/nvgpu/hal/init/hal_ga100.c @@ -1928,6 +1928,7 @@ int ga100_init_hal(struct gk20a *g) if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { nvgpu_set_enabled(g, NVGPU_SUPPORT_POST_L2_COMPRESSION, false); + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); } else { gops->cbc.init = NULL; gops->cbc.ctrl = NULL; diff --git a/drivers/gpu/nvgpu/hal/init/hal_ga10b.c b/drivers/gpu/nvgpu/hal/init/hal_ga10b.c index 1888f43d4..2c369291d 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_ga10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_ga10b.c @@ -1890,10 +1890,15 @@ int ga10b_init_hal(struct gk20a *g) #endif #ifdef CONFIG_NVGPU_COMPRESSION - nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); + if (nvgpu_is_hypervisor_mode(g)) { + nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, false); + } else { + nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); + } if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { nvgpu_set_enabled(g, NVGPU_SUPPORT_POST_L2_COMPRESSION, true); + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); } else { gops->cbc.init = NULL; gops->cbc.ctrl = NULL; diff --git a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c index ec77fe218..03858ddc2 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c @@ -1225,7 +1225,9 @@ int gm20b_init_hal(struct gk20a *g) #ifdef CONFIG_NVGPU_COMPRESSION nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); - if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); + } else { gops->cbc.init = NULL; gops->cbc.ctrl = NULL; gops->cbc.alloc_comptags = NULL; diff --git a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c index 41d249f36..b040b53d2 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c @@ -1318,7 +1318,9 @@ int gp10b_init_hal(struct gk20a *g) #ifdef CONFIG_NVGPU_COMPRESSION nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); - if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); + } else { gops->cbc.init = NULL; gops->cbc.ctrl = NULL; gops->cbc.alloc_comptags = NULL; diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c index 31b10968d..ae970a336 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c @@ -1596,7 +1596,9 @@ int gv11b_init_hal(struct gk20a *g) #ifdef CONFIG_NVGPU_COMPRESSION nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); - if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); + } else { gops->cbc.init = NULL; gops->cbc.ctrl = NULL; gops->cbc.alloc_comptags = NULL; diff --git a/drivers/gpu/nvgpu/hal/init/hal_tu104.c b/drivers/gpu/nvgpu/hal/init/hal_tu104.c index bcf40d40c..8cb4813b9 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_tu104.c +++ b/drivers/gpu/nvgpu/hal/init/hal_tu104.c @@ -1853,7 +1853,9 @@ int tu104_init_hal(struct gk20a *g) nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); } - if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + if (nvgpu_is_enabled(g, NVGPU_SUPPORT_COMPRESSION)) { + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); + } else { gops->cbc.init = NULL; gops->cbc.ctrl = NULL; gops->cbc.alloc_comptags = NULL; 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 8b5f4bf37..a1684bca0 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_ga10b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_ga10b.c @@ -1206,8 +1206,9 @@ 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, true); - nvgpu_set_enabled(g, NVGPU_SUPPORT_POST_L2_COMPRESSION, true); + nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, false); + nvgpu_set_enabled(g, NVGPU_SUPPORT_POST_L2_COMPRESSION, false); + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, false); #endif #ifdef CONFIG_NVGPU_RECOVERY diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c index 5335c1263..d82b3bfc3 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c @@ -1175,6 +1175,7 @@ int vgpu_gv11b_init_hal(struct gk20a *g) #ifdef CONFIG_NVGPU_COMPRESSION nvgpu_set_enabled(g, NVGPU_SUPPORT_COMPRESSION, true); + nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); #endif #ifdef CONFIG_NVGPU_RECOVERY diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 861f021cd..3c88ef31d 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -330,9 +330,6 @@ void gk20a_init_linux_characteristics(struct gk20a *g) nvgpu_set_enabled(g, NVGPU_SUPPORT_DETERMINISTIC_OPTS, true); nvgpu_set_enabled(g, NVGPU_SUPPORT_USERSPACE_MANAGED_AS, true); nvgpu_set_enabled(g, NVGPU_SUPPORT_REMAP, true); -#ifdef CONFIG_NVGPU_COMPRESSION - nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); -#endif if (!IS_ENABLED(CONFIG_NVGPU_SYNCFD_NONE)) { nvgpu_set_enabled(g, NVGPU_SUPPORT_SYNC_FENCE_FDS, true);