AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 9/9] drm/amd/powerplay: delete dupicated function and definition.
Date: Fri, 9 Sep 2016 21:37:39 +0800	[thread overview]
Message-ID: <1473428259-580-10-git-send-email-Rex.Zhu@amd.com> (raw)
In-Reply-To: <1473428259-580-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>

Change-Id: I9a03c3aac811259e32edbf7c20ef3eeca69d0252
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c             | 7 +++++--
 drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c     | 8 --------
 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c   | 5 -----
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c       | 9 ---------
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h               | 4 ++++
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 -
 drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c           | 1 +
 7 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
index f1b1c34..e64b6a2 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
@@ -35,8 +35,6 @@
 #include "pp_acpi.h"
 #include "amd_acpi.h"
 
-#define VOLTAGE_SCALE               4
-
 extern int cz_hwmgr_init(struct pp_hwmgr *hwmgr);
 extern int tonga_hwmgr_init(struct pp_hwmgr *hwmgr);
 extern int fiji_hwmgr_init(struct pp_hwmgr *hwmgr);
@@ -46,6 +44,11 @@ extern int iceland_hwmgr_init(struct pp_hwmgr *hwmgr);
 static void hwmgr_init_default_caps(struct pp_hwmgr *hwmgr);
 static int hwmgr_set_user_specify_caps(struct pp_hwmgr *hwmgr);
 
+uint8_t convert_to_vid(uint16_t vddc)
+{
+	return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25);
+}
+
 int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle)
 {
 	struct pp_hwmgr *hwmgr;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
index be29ff4..3128228 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
@@ -1355,14 +1355,6 @@ static int iceland_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr,
 	return 0;
 }
 
-/**
- * Convert a voltage value in mv unit to VID number required by SMU firmware
- */
-static uint8_t convert_to_vid(uint16_t vddc)
-{
-	return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25);
-}
-
 int iceland_populate_bapm_vddc_vid_sidd(struct pp_hwmgr *hwmgr)
 {
 	int i;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
index f7e0626..8058aa6 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
@@ -736,11 +736,6 @@ int polaris10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
 	return 0;
 }
 
-uint8_t convert_to_vid(uint16_t vddc)
-{
-	return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25);
-}
-
 /**
  * Mvdd table preparation for SMC.
  *
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
index a7d1028..0e1919d 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
@@ -1319,15 +1319,6 @@ static int tonga_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr,
 }
 
 /**
- * Convert a voltage value in mv unit to VID number required by SMU firmware
- */
-static uint8_t convert_to_vid(uint16_t vddc)
-{
-	return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25);
-}
-
-
-/**
  * Preparation of vddc and vddgfx CAC tables for SMC.
  *
  * @param    hwmgr      the address of the hardware manager
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index 09c6e7e..0665c8c 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -42,6 +42,10 @@ extern int amdgpu_powercontainment;
 extern int amdgpu_sclk_deep_sleep_en;
 extern unsigned amdgpu_pp_feature_mask;
 
+#define VOLTAGE_SCALE 4
+
+uint8_t convert_to_vid(uint16_t vddc);
+
 enum DISPLAY_GAP {
 	DISPLAY_GAP_VBLANK_OR_WM = 0,   /* Wait for vblank or MCHG watermark. */
 	DISPLAY_GAP_VBLANK       = 1,   /* Wait for vblank. */
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
index 704ff4c..8047ad2 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -40,7 +40,6 @@
 #include "cgs_common.h"
 
 #define POLARIS10_SMC_SIZE 0x20000
-#define VOLTAGE_SCALE 4
 
 /* Microcode file is stored in this buffer */
 #define BUFFER_SIZE                 80000
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c
index 83d8f7e..bbeb786 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c
@@ -29,6 +29,7 @@
 #include "cgs_common.h"
 #include "linux/delay.h"
 
+
 int smum_init(struct amd_pp_init *pp_init, struct pp_instance *handle)
 {
 	struct pp_smumgr *smumgr;
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2016-09-09 13:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 13:37 [PATCH 0/9] misc patches related to powerplay Rex Zhu
     [not found] ` <1473428259-580-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2016-09-09 13:37   ` [PATCH 1/9] drm/amd/powerplay: mark symbols static where possible on tonga/iceland Rex Zhu
2016-09-09 13:37   ` [PATCH 2/9] drm/amd/powerplay: add feature flags in hwmgr to enable/disable special features Rex Zhu
2016-09-09 13:37   ` [PATCH 3/9] drm/amd/powerplay: add module parameter for mask pp feature Rex Zhu
2016-09-09 13:37   ` [PATCH 4/9] drm/amd/powerplay: initialize platform caps in hwmgr_init Rex Zhu
2016-09-09 13:37   ` [PATCH 5/9] drm/amd/powerplay: add common functiones for visiting pp table Rex Zhu
2016-09-09 13:37   ` [PATCH 6/9] drm/amd/powerplay: wrap get evv voltage of fiji and polaris Rex Zhu
2016-09-09 13:37   ` [PATCH 7/9] drm/amd/powerplay: move smu related variable definitions to smumgr Rex Zhu
2016-09-09 13:37   ` [PATCH 8/9] drm/amd/powerplay: delete const flag of hwmgr_funcs for overload Rex Zhu
2016-09-09 13:37   ` Rex Zhu [this message]
2016-09-09 14:23   ` [PATCH 0/9] misc patches related to powerplay Christian König
     [not found]     ` <ead74fd5-6d6f-ba4e-d0a1-fea21e7296dd-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-09 16:29       ` Zhu, Rex
     [not found]         ` <CY4PR12MB16872A6C90804AF1D368A194FBFA0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-09 17:51           ` Christian König
     [not found]             ` <bf78afe1-9829-2316-2922-7e04d9babb75-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-09 22:45               ` Zhu, Rex

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=1473428259-580-10-git-send-email-Rex.Zhu@amd.com \
    --to=rex.zhu-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox