Blob Blame History Raw
From 2c1e69f58ffd5d92d63f4f7d2ff8fc31a99f0289 Mon Sep 17 00:00:00 2001
From: Wyatt Wood <wyatt.wood@amd.com>
Date: Sun, 5 Apr 2020 16:40:49 -0400
Subject: drm/amd/display: Use config flag to disable dmcu obj creation
Git-commit: 501b4026c95e5f6e8cdbad186b7f70714fdec4a7
Patch-mainline: v5.8-rc1
References: jsc#SLE-12680, jsc#SLE-12880, jsc#SLE-12882, jsc#SLE-12883, jsc#SLE-13496, jsc#SLE-15322

[Why]
When dmcub is the default we no longer wish to create the psr and dmcu
objects. Currently a dc debug flag is used to implement this, but these
flags aren't populated until after dcn21_resource_construct is called.
This means the dmcub objects will never be created. Therefore we must
use a dc config flag, which is populated before dc resource construct.

[How]
Add a dc config flag.

Signed-off-by: Wyatt Wood <wyatt.wood@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/amd/display/dc/dc.h                   | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 9ff239d35519..fa0724435a3e 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -230,7 +230,7 @@ struct dc_config {
 	bool forced_clocks;
 	bool disable_extended_timeout_support; // Used to disable extended timeout and lttpr feature as well
 	bool multi_mon_pp_mclk_switch;
-	bool psr_on_dmub;
+	bool disable_dmcu;
 };
 
 enum visual_confirm {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
index 1a9255626a14..ca16d1efa180 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
@@ -997,7 +997,7 @@ static void dcn21_resource_destruct(struct dcn21_resource_pool *pool)
 	}
 
 	if (pool->base.abm != NULL) {
-		if (pool->base.abm->ctx->dc->debug.disable_dmcu)
+		if (pool->base.abm->ctx->dc->config.disable_dmcu)
 			dmub_abm_destroy(&pool->base.abm);
 		else
 			dce_abm_destroy(&pool->base.abm);
@@ -1835,7 +1835,7 @@ static bool dcn21_resource_construct(
 		goto create_fail;
 	}
 
-	if (!dc->debug.disable_dmcu) {
+	if (!dc->config.disable_dmcu) {
 		pool->base.dmcu = dcn21_dmcu_create(ctx,
 				&dmcu_regs,
 				&dmcu_shift,
@@ -1847,7 +1847,7 @@ static bool dcn21_resource_construct(
 		}
 	}
 
-	if (dc->debug.disable_dmcu) {
+	if (dc->config.disable_dmcu) {
 		pool->base.psr = dmub_psr_create(ctx);
 
 		if (pool->base.psr == NULL) {
@@ -1857,7 +1857,7 @@ static bool dcn21_resource_construct(
 		}
 	}
 
-	if (dc->debug.disable_dmcu)
+	if (dc->config.disable_dmcu)
 		pool->base.abm = dmub_abm_create(ctx,
 			&abm_regs,
 			&abm_shift,
-- 
2.28.0