All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Quan <evan.quan@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alexander.Deucher@amd.com, lijo.lazar@amd.com,
	Kenneth.Feng@amd.com, christian.koenig@amd.com,
	Evan Quan <evan.quan@amd.com>
Subject: [PATCH V2 08/17] drm/amd/pm: move pp_force_state_enabled member to amdgpu_pm structure
Date: Tue, 30 Nov 2021 15:42:50 +0800	[thread overview]
Message-ID: <20211130074259.1271965-9-evan.quan@amd.com> (raw)
In-Reply-To: <20211130074259.1271965-1-evan.quan@amd.com>

As it lables an internal pm state and amdgpu_pm structure is the more
proper place than amdgpu_device structure for it.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Change-Id: I7890e8fe7af2ecd8591d30442340deb8773bacc3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 1 -
 drivers/gpu/drm/amd/pm/amdgpu_pm.c      | 6 +++---
 drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 2 ++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index c5cfe2926ca1..c987813a4996 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -950,7 +950,6 @@ struct amdgpu_device {
 
 	/* powerplay */
 	struct amd_powerplay		powerplay;
-	bool				pp_force_state_enabled;
 
 	/* smu */
 	struct smu_context		smu;
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 3382d30b5d90..fa2f4e11e94e 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -469,7 +469,7 @@ static ssize_t amdgpu_get_pp_force_state(struct device *dev,
 	if (adev->in_suspend && !adev->in_runpm)
 		return -EPERM;
 
-	if (adev->pp_force_state_enabled)
+	if (adev->pm.pp_force_state_enabled)
 		return amdgpu_get_pp_cur_state(dev, attr, buf);
 	else
 		return sysfs_emit(buf, "\n");
@@ -492,7 +492,7 @@ static ssize_t amdgpu_set_pp_force_state(struct device *dev,
 	if (adev->in_suspend && !adev->in_runpm)
 		return -EPERM;
 
-	adev->pp_force_state_enabled = false;
+	adev->pm.pp_force_state_enabled = false;
 
 	if (strlen(buf) == 1)
 		return count;
@@ -523,7 +523,7 @@ static ssize_t amdgpu_set_pp_force_state(struct device *dev,
 		if (ret)
 			goto err_out;
 
-		adev->pp_force_state_enabled = true;
+		adev->pm.pp_force_state_enabled = true;
 	}
 
 	pm_runtime_mark_last_busy(ddev->dev);
diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
index 295d2902aef7..1462c4933ca1 100644
--- a/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
+++ b/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
@@ -335,6 +335,8 @@ struct amdgpu_pm {
 	struct list_head	pm_attr_list;
 
 	atomic_t		pwr_state[AMD_IP_BLOCK_TYPE_NUM];
+
+	bool			pp_force_state_enabled;
 };
 
 #define R600_SSTU_DFLT                               0
-- 
2.29.0


  parent reply	other threads:[~2021-11-30  7:43 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  7:42 [PATCH V2 00/17] Unified entry point for other blocks to interact with power Evan Quan
2021-11-30  7:42 ` [PATCH V2 01/17] drm/amd/pm: do not expose implementation details to other blocks out of power Evan Quan
2021-11-30  8:09   ` Lazar, Lijo
2021-12-01  1:59     ` Quan, Evan
2021-12-01  3:33       ` Lazar, Lijo
2021-12-01  7:07         ` Quan, Evan
2021-12-01  3:37     ` Lazar, Lijo
2021-11-30  7:42 ` [PATCH V2 02/17] drm/amd/pm: do not expose power implementation details to amdgpu_pm.c Evan Quan
2021-11-30 13:04   ` Chen, Guchun
2021-12-01  2:06     ` Quan, Evan
2021-11-30  7:42 ` [PATCH V2 03/17] drm/amd/pm: do not expose power implementation details to display Evan Quan
2021-11-30  7:42 ` [PATCH V2 04/17] drm/amd/pm: do not expose those APIs used internally only in amdgpu_dpm.c Evan Quan
2021-11-30  7:42 ` [PATCH V2 05/17] drm/amd/pm: do not expose those APIs used internally only in si_dpm.c Evan Quan
2021-11-30 12:22   ` Lazar, Lijo
2021-12-01  2:07     ` Quan, Evan
2021-11-30  7:42 ` [PATCH V2 06/17] drm/amd/pm: do not expose the API used internally only in kv_dpm.c Evan Quan
2021-11-30 12:27   ` Lazar, Lijo
2021-12-01  2:47     ` Quan, Evan
2021-11-30  7:42 ` [PATCH V2 07/17] drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv) Evan Quan
2021-11-30 13:21   ` Lazar, Lijo
2021-12-01  3:13     ` Quan, Evan
2021-12-01  4:19       ` Lazar, Lijo
2021-12-01  7:17         ` Quan, Evan
2021-12-01  7:36           ` Lazar, Lijo
2021-12-02  1:24             ` Quan, Evan
2021-11-30  7:42 ` Evan Quan [this message]
2021-11-30  7:42 ` [PATCH V2 09/17] drm/amd/pm: optimize the amdgpu_pm_compute_clocks() implementations Evan Quan
2021-11-30  7:42 ` [PATCH V2 10/17] drm/amd/pm: move those code piece used by Stoney only to smu8_hwmgr.c Evan Quan
2021-11-30  7:42 ` [PATCH V2 11/17] drm/amd/pm: correct the usage for amdgpu_dpm_dispatch_task() Evan Quan
2021-11-30 13:48   ` Lazar, Lijo
2021-12-01  3:50     ` Quan, Evan
2021-11-30  7:42 ` [PATCH V2 12/17] drm/amd/pm: drop redundant or unused APIs and data structures Evan Quan
2021-11-30  7:42 ` [PATCH V2 13/17] drm/amd/pm: do not expose the smu_context structure used internally in power Evan Quan
2021-11-30 13:57   ` Lazar, Lijo
2021-12-01  5:39     ` Quan, Evan
2021-12-01  6:38       ` Lazar, Lijo
2021-12-01  7:24         ` Quan, Evan
2021-11-30  7:42 ` [PATCH V2 14/17] drm/amd/pm: relocate the power related headers Evan Quan
2021-11-30 14:07   ` Lazar, Lijo
2021-12-01  6:22     ` Quan, Evan
2021-11-30  7:42 ` [PATCH V2 15/17] drm/amd/pm: drop unnecessary gfxoff controls Evan Quan
2021-11-30  7:42 ` [PATCH V2 16/17] drm/amd/pm: revise the performance level setting APIs Evan Quan
2021-11-30  7:42 ` [PATCH V2 17/17] drm/amd/pm: unified lock protections in amdgpu_dpm.c Evan Quan
2021-11-30  9:58 ` [PATCH V2 00/17] Unified entry point for other blocks to interact with power Christian König

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=20211130074259.1271965-9-evan.quan@amd.com \
    --to=evan.quan@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Kenneth.Feng@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=lijo.lazar@amd.com \
    /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.