All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Scott Bruce <smbruce@gmail.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Chris Hixon <linux-kernel-bugs@hixontech.com>,
	spasswolf@web.de
Subject: [PATCH v4 1/3] drm/amd/display: Add power_state member into current_state
Date: Thu, 6 Jan 2022 10:30:52 -0600	[thread overview]
Message-ID: <20220106163054.13781-1-mario.limonciello@amd.com> (raw)

This can be used by the display core to let decisions be made based
upon the requested power state.

Cc: Qingqing Zhuo <qingqing.zhuo@amd.com>
Cc: Scott Bruce <smbruce@gmail.com>
Cc: Chris Hixon <linux-kernel-bugs@hixontech.com>
Cc: spasswolf@web.de
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
changes from v3->v4:
 * Initialize power_state when context is created (0 shouldn't be a valid state)
changes from v2->v3:
 * New patch
 drivers/gpu/drm/amd/display/dc/core/dc.c        | 3 +++
 drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 91c4874473d6..8edbb6c70512 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1960,6 +1960,7 @@ static void init_state(struct dc *dc, struct dc_state *context)
 #ifdef CONFIG_DRM_AMD_DC_DCN
 	memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
 #endif
+	context->power_state = DC_ACPI_CM_POWER_STATE_D0;
 }
 
 struct dc_state *dc_create_state(struct dc *dc)
@@ -3281,6 +3282,8 @@ void dc_set_power_state(
 	if (!dc->current_state)
 		return;
 
+	dc->current_state->power_state = power_state;
+
 	switch (power_state) {
 	case DC_ACPI_CM_POWER_STATE_D0:
 		dc_resource_state_construct(dc, dc->current_state);
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index 943240e2809e..6bd0aeed1856 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -506,6 +506,7 @@ struct dc_state {
 	struct {
 		unsigned int stutter_period_us;
 	} perf_params;
+	enum dc_acpi_cm_power_state power_state;
 };
 
 #endif /* _CORE_TYPES_H_ */
-- 
2.25.1


             reply	other threads:[~2022-01-06 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 16:30 Mario Limonciello [this message]
2022-01-06 16:30 ` [PATCH v4 2/3] drm/amd/display: Split out checks for applying HPD WA into a separate function Mario Limonciello
2022-01-06 16:30 ` [PATCH v4 3/3] drm/amd/display: Use requested power state to avoid HPD WA during s0ix Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220106163054.13781-1-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=linux-kernel-bugs@hixontech.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=smbruce@gmail.com \
    --cc=spasswolf@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.