Skip to contentSkip to conversation

drm/amd/pp: Delete dead code on cz_clockpowergating.c

PATCH In review Rex Zhu 3 participants 7 messages Mar 13, 2018 – Mar 14, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/5 drm/amd/pp: Delete dead code on cz_clockpowergating.c

Change-Id Ia4a121435c4860b1703d3647ef7220ee97f52d03
---
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c  | 78 ----------------------
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.h  |  3 -
 2 files changed, 81 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +0 -78
index 416abeb..01e5612 100644
@@ -25,84 +25,6 @@
 #include "cz_clockpowergating.h"
 #include "cz_ppsmc.h"
 
-/* PhyID -> Status Mapping in DDI_PHY_GEN_STATUS
-    0    GFX0L (3:0),                  (27:24),
-    1    GFX0H (7:4),                  (31:28),
-    2    GFX1L (3:0),                  (19:16),
-    3    GFX1H (7:4),                  (23:20),
-    4    DDIL   (3:0),                   (11: 8),
-    5    DDIH  (7:4),                   (15:12),
-    6    DDI2L (3:0),                   ( 3: 0),
-    7    DDI2H (7:4),                   ( 7: 4),
-*/
-#define DDI_PHY_GEN_STATUS_VAL(phyID)   (1 << ((3 - ((phyID & 0x07)/2))*8 + (phyID & 0x01)*4))
-#define IS_PHY_ID_USED_BY_PLL(PhyID)    (((0xF3 & (1 << PhyID)) & 0xFF) ? true : false)
-
-
-int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating)
-{
-	int ret = 0;
-
-	switch (block) {
-	case PHM_AsicBlock_UVD_MVC:
-	case PHM_AsicBlock_UVD:
-	case PHM_AsicBlock_UVD_HD:
-	case PHM_AsicBlock_UVD_SD:
-		if (gating == PHM_ClockGateSetting_StaticOff)
-			ret = cz_dpm_powerdown_uvd(hwmgr);
-		else
-			ret = cz_dpm_powerup_uvd(hwmgr);
-		break;
-	case PHM_AsicBlock_GFX:
-	default:
-		break;
-	}
-
-	return ret;
-}
-
-
-bool cz_phm_is_safe_for_asic_block(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *state, enum PHM_AsicBlock block)
-{
-	return true;
-}
-
-
-int cz_phm_enable_disable_gfx_power_gating(struct pp_hwmgr *hwmgr, bool enable)
-{
-	return 0;
-}
-
-int cz_phm_smu_power_up_down_pcie(struct pp_hwmgr *hwmgr, uint32_t target, bool up, uint32_t args)
-{
-	/* TODO */
-	return 0;
-}
-
-int cz_phm_initialize_display_phy_access(struct pp_hwmgr *hwmgr, bool initialize, bool accesshw)
-{
-	/* TODO */
-	return 0;
-}
-
-int cz_phm_get_display_phy_access_info(struct pp_hwmgr *hwmgr)
-{
-	/* TODO */
-	return 0;
-}
-
-int cz_phm_gate_unused_display_phys(struct pp_hwmgr *hwmgr)
-{
-	/* TODO */
-	return 0;
-}
-
-int cz_phm_ungate_all_display_phys(struct pp_hwmgr *hwmgr)
-{
-	/* TODO */
-	return 0;
-}
-
 int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
 {
 	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h +0 -3
index 92f707b..08d393f 100644
@@ -25,10 +25,7 @@
 #define _CZ_CLOCK_POWER_GATING_H_
 
 #include "cz_hwmgr.h"
-#include "pp_asicblocks.h"
 
-extern int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating);
-extern const struct phm_master_table_header cz_phm_enable_clock_power_gatings_master;
 extern void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);
 extern void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);
 extern int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable);
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1520935279-17471-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/5 drm/amd/pp: Remove dead header file pp_asicblocks.h

Change-Id If3d78436df312a7d2f0da629f9ea4a8d3ba462c7
---
 .../amd/powerplay/hwmgr/smu7_clockpowergating.h    |  1 -
 drivers/gpu/drm/amd/powerplay/inc/pp_asicblocks.h  | 47 ----------------------
 2 files changed, 48 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/powerplay/inc/pp_asicblocks.h
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h +0 -1
index 7b54d48..1ddce02 100644
@@ -25,7 +25,6 @@
 #define _SMU7_CLOCK_POWER_GATING_H_
 
 #include "smu7_hwmgr.h"
-#include "pp_asicblocks.h"
 
 void smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);
 void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);
drivers/gpu/drm/amd/powerplay/inc/pp_asicblocks.h deleted +0 -47

47 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 3/5 drm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c

In reply to a message not in the archive

1. delete cz_clockpowergating.c/.h files
2. make uvd/vce dpm/pg functions static

Change-Id I605e0121823a3dd10f9e970ebc90ac26b7fddae7
---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile       |   2 +-
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c  | 131 ---------------
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.h  |  33 ----
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c     | 175 ++++++++++++++++-----
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h     |   8 -
 5 files changed, 140 insertions(+), 209 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
 delete mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
index 455e572..094949d 100644
@@ -25,7 +25,7 @@
 
 HARDWARE_MGR = hwmgr.o processpptables.o \
 		hardwaremanager.o cz_hwmgr.o \
-		cz_clockpowergating.o pppcielanes.o\
+		pppcielanes.o\
 		process_pptables_v1_0.o ppatomctrl.o ppatomfwctrl.o \
 		smu7_hwmgr.o smu7_powertune.o smu7_thermal.o \
 		smu7_clockpowergating.o \
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c deleted +0 -131

131 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h deleted +0 -33
deleted file mode 100644
index 08d393f..0000000
@@ -1,33 +0,0 @@
-/*
- * Copyright 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#ifndef _CZ_CLOCK_POWER_GATING_H_
-#define _CZ_CLOCK_POWER_GATING_H_
-
-#include "cz_hwmgr.h"
-
-extern void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);
-extern void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);
-extern int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable);
-extern int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable);
-#endif /* _CZ_CLOCK_POWER_GATING_H_ */
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +139 -36

217 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h +0 -8
index b56720a..604102b 100644
@@ -311,12 +311,4 @@ struct cz_hwmgr {
 	uint32_t num_of_clk_entries;
 };
 
-struct pp_hwmgr;
-
-int cz_dpm_powerdown_uvd(struct pp_hwmgr *hwmgr);
-int cz_dpm_powerup_uvd(struct pp_hwmgr *hwmgr);
-int cz_dpm_powerdown_vce(struct pp_hwmgr *hwmgr);
-int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr);
-int cz_dpm_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate);
-int  cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr);
 #endif /* _CZ_HWMGR_H_ */
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#4 lore raw

PATCH 4/5 drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c

In reply to a message not in the archive

Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend

Change-Id I6d56858625c58433cd5a35fc03e3aa6003a6e449
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c   | 86 ++++++++++++------------
 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 34 +++++-----
 2 files changed, 60 insertions(+), 60 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +43 -43
index 4b73f07..055a4ec 100644
@@ -159,7 +159,7 @@ static uint32_t cz_get_uvd_level(struct pp_hwmgr *hwmgr,
 
 static uint32_t cz_get_max_sclk_level(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	if (cz_hwmgr->max_sclk_level == 0) {
 		smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxSclkLevel);
@@ -171,7 +171,7 @@ static uint32_t cz_get_max_sclk_level(struct pp_hwmgr *hwmgr)
 
 static int cz_initialize_dpm_defaults(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct amdgpu_device *adev = hwmgr->adev;
 
 	cz_hwmgr->gfx_ramp_step = 256*25/100;
@@ -253,7 +253,7 @@ static uint32_t cz_convert_8Bit_index_to_voltage(
 static int cz_construct_max_power_limits_table(struct pp_hwmgr *hwmgr,
 			struct phm_clock_and_voltage_limits *table)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)hwmgr->backend;
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct cz_sys_info *sys_info = &cz_hwmgr->sys_info;
 	struct phm_clock_voltage_dependency_table *dep_table =
 				hwmgr->dyn_state.vddc_dependency_on_sclk;
@@ -307,7 +307,7 @@ static int cz_init_dynamic_state_adjustment_rule_settings(
 
 static int cz_get_system_info_data(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)hwmgr->backend;
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	ATOM_INTEGRATED_SYSTEM_INFO_V1_9 *info = NULL;
 	uint32_t i;
 	int result = 0;
@@ -412,7 +412,7 @@ static int cz_get_system_info_data(struct pp_hwmgr *hwmgr)
 
 static int cz_construct_boot_state(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->boot_power_level.engineClock =
 				cz_hwmgr->sys_info.bootup_engine_clock;
@@ -553,7 +553,7 @@ static int cz_upload_pptable_to_smu(struct pp_hwmgr *hwmgr)
 
 static int cz_init_sclk_limit(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_clock_voltage_dependency_table *table =
 					hwmgr->dyn_state.vddc_dependency_on_sclk;
 	unsigned long clock = 0, level;
@@ -579,7 +579,7 @@ static int cz_init_sclk_limit(struct pp_hwmgr *hwmgr)
 
 static int cz_init_uvd_limit(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_uvd_clock_voltage_dependency_table *table =
 				hwmgr->dyn_state.uvd_clock_voltage_dependency_table;
 	unsigned long clock = 0, level;
@@ -606,7 +606,7 @@ static int cz_init_uvd_limit(struct pp_hwmgr *hwmgr)
 
 static int cz_init_vce_limit(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_vce_clock_voltage_dependency_table *table =
 				hwmgr->dyn_state.vce_clock_voltage_dependency_table;
 	unsigned long clock = 0, level;
@@ -633,7 +633,7 @@ static int cz_init_vce_limit(struct pp_hwmgr *hwmgr)
 
 static int cz_init_acp_limit(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_acp_clock_voltage_dependency_table *table =
 				hwmgr->dyn_state.acp_clock_voltage_dependency_table;
 	unsigned long clock = 0, level;
@@ -659,7 +659,7 @@ static int cz_init_acp_limit(struct pp_hwmgr *hwmgr)
 
 static void cz_init_power_gate_state(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->uvd_power_gated = false;
 	cz_hwmgr->vce_power_gated = false;
@@ -670,14 +670,14 @@ static void cz_init_power_gate_state(struct pp_hwmgr *hwmgr)
 
 static void cz_init_sclk_threshold(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->low_sclk_interrupt_threshold = 0;
 }
 
 static int cz_update_sclk_limit(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_clock_voltage_dependency_table *table =
 					hwmgr->dyn_state.vddc_dependency_on_sclk;
 
@@ -766,7 +766,7 @@ static int cz_set_deep_sleep_sclk_threshold(struct pp_hwmgr *hwmgr)
 static int cz_set_watermark_threshold(struct pp_hwmgr *hwmgr)
 {
 	struct cz_hwmgr *cz_hwmgr =
-				  (struct cz_hwmgr *)(hwmgr->backend);
+				  hwmgr->backend;
 
 	smum_send_msg_to_smc_with_parameter(hwmgr,
 					PPSMC_MSG_SetWatermarkFrequency,
@@ -777,7 +777,7 @@ static int cz_set_watermark_threshold(struct pp_hwmgr *hwmgr)
 
 static int cz_nbdpm_pstate_enable_disable(struct pp_hwmgr *hwmgr, bool enable, bool lock)
 {
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 
 	if (hw_data->is_nb_dpm_enabled) {
 		if (enable) {
@@ -802,7 +802,7 @@ static int cz_disable_nb_dpm(struct pp_hwmgr *hwmgr)
 {
 	int ret = 0;
 
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	unsigned long dpm_features = 0;
 
 	if (cz_hwmgr->is_nb_dpm_enabled) {
@@ -823,7 +823,7 @@ static int cz_enable_nb_dpm(struct pp_hwmgr *hwmgr)
 {
 	int ret = 0;
 
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	unsigned long dpm_features = 0;
 
 	if (!cz_hwmgr->is_nb_dpm_enabled) {
@@ -844,7 +844,7 @@ static int cz_update_low_mem_pstate(struct pp_hwmgr *hwmgr, const void *input)
 {
 	bool disable_switch;
 	bool enable_low_mem_state;
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 	const struct phm_set_power_state_input *states = (struct phm_set_power_state_input *)input;
 	const struct cz_power_state *pnew_state = cast_const_PhwCzPowerState(states->pnew_state);
 
@@ -906,7 +906,7 @@ static int cz_setup_asic_task(struct pp_hwmgr *hwmgr)
 
 static void cz_power_up_display_clock_sys_pll(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 
 	hw_data->disp_clk_bypass_pending = false;
 	hw_data->disp_clk_bypass = false;
@@ -914,14 +914,14 @@ static void cz_power_up_display_clock_sys_pll(struct pp_hwmgr *hwmgr)
 
 static void cz_clear_nb_dpm_flag(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 
 	hw_data->is_nb_dpm_enabled = false;
 }
 
 static void cz_reset_cc6_data(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 
 	hw_data->cc6_settings.cc6_setting_changed = false;
 	hw_data->cc6_settings.cpu_pstate_separation_time = 0;
@@ -950,7 +950,7 @@ static void cz_clear_voting_clients(struct pp_hwmgr *hwmgr)
 
 static int cz_start_dpm(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->dpm_flags |= DPMFlags_SCLK_Enabled;
 
@@ -962,7 +962,7 @@ static int cz_start_dpm(struct pp_hwmgr *hwmgr)
 static int cz_stop_dpm(struct pp_hwmgr *hwmgr)
 {
 	int ret = 0;
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	unsigned long dpm_features = 0;
 
 	if (cz_hwmgr->dpm_flags & DPMFlags_SCLK_Enabled) {
@@ -977,7 +977,7 @@ static int cz_stop_dpm(struct pp_hwmgr *hwmgr)
 
 static int cz_program_bootup_state(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->sclk_dpm.soft_min_clk = cz_hwmgr->sys_info.bootup_engine_clock;
 	cz_hwmgr->sclk_dpm.soft_max_clk = cz_hwmgr->sys_info.bootup_engine_clock;
@@ -999,7 +999,7 @@ static int cz_program_bootup_state(struct pp_hwmgr *hwmgr)
 
 static void cz_reset_acp_boot_level(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->acp_boot_level = 0xff;
 }
@@ -1036,7 +1036,7 @@ static int cz_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
 	const struct cz_power_state *cz_current_ps =
 				cast_const_PhwCzPowerState(&pcurrent_ps->hardware);
 
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct PP_Clocks clocks = {0, 0, 0, 0};
 	bool force_high;
 	uint32_t  num_of_active_displays = 0;
@@ -1119,7 +1119,7 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 
 static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	smum_send_msg_to_smc_with_parameter(hwmgr,
 					PPSMC_MSG_SetSclkSoftMin,
@@ -1138,7 +1138,7 @@ static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
 
 static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_clock_voltage_dependency_table *table =
 				hwmgr->dyn_state.vddc_dependency_on_sclk;
 	unsigned long clock = 0, level;
@@ -1178,7 +1178,7 @@ static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 
 static int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	smum_send_msg_to_smc_with_parameter(hwmgr,
 			PPSMC_MSG_SetSclkSoftMax,
@@ -1243,7 +1243,7 @@ static int cz_dpm_powerup_uvd(struct pp_hwmgr *hwmgr)
 
 static int  cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_vce_clock_voltage_dependency_table *ptable =
 		hwmgr->dyn_state.vce_clock_voltage_dependency_table;
 
@@ -1288,7 +1288,7 @@ static int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr)
 
 static uint32_t cz_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	return cz_hwmgr->sys_info.bootup_uma_clock;
 }
@@ -1317,7 +1317,7 @@ static uint32_t cz_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low)
 static int cz_dpm_patch_boot_state(struct pp_hwmgr *hwmgr,
 					struct pp_hw_power_state *hw_ps)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct cz_power_state *cz_ps = cast_PhwCzPowerState(hw_ps);
 
 	cz_ps->level = 1;
@@ -1409,7 +1409,7 @@ static void cz_hw_print_display_cfg(
 
  static int cz_set_cpu_power_state(struct pp_hwmgr *hwmgr)
 {
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 	uint32_t data = 0;
 
 	if (hw_data->cc6_settings.cc6_setting_changed) {
@@ -1443,7 +1443,7 @@ static void cz_hw_print_display_cfg(
 static int cz_store_cc6_data(struct pp_hwmgr *hwmgr, uint32_t separation_time,
 			bool cc6_disable, bool pstate_disable, bool pstate_switch_disable)
 {
-	struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *hw_data = hwmgr->backend;
 
 	if (separation_time !=
 	    hw_data->cc6_settings.cpu_pstate_separation_time ||
@@ -1510,7 +1510,7 @@ static int cz_force_clock_level(struct pp_hwmgr *hwmgr,
 static int cz_print_clock_levels(struct pp_hwmgr *hwmgr,
 		enum pp_clock_type type, char *buf)
 {
-	struct cz_hwmgr *data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *data = hwmgr->backend;
 	struct phm_clock_voltage_dependency_table *sclk_table =
 			hwmgr->dyn_state.vddc_dependency_on_sclk;
 	int i, now, size = 0;
@@ -1558,7 +1558,7 @@ static int cz_get_performance_level(struct pp_hwmgr *hwmgr, const struct pp_hw_p
 	if (level == NULL || hwmgr == NULL || state == NULL)
 		return -EINVAL;
 
-	data = (struct cz_hwmgr *)(hwmgr->backend);
+	data = hwmgr->backend;
 	ps = cast_const_PhwCzPowerState(state);
 
 	level_index = index > ps->level - 1 ? ps->level - 1 : index;
@@ -1599,7 +1599,7 @@ static int cz_get_current_shallow_sleep_clocks(struct pp_hwmgr *hwmgr,
 static int cz_get_clock_by_type(struct pp_hwmgr *hwmgr, enum amd_pp_clock_type type,
 						struct amd_pp_clocks *clocks)
 {
-	struct cz_hwmgr *data = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *data = hwmgr->backend;
 	int i;
 	struct phm_clock_voltage_dependency_table *table;
 
@@ -1667,7 +1667,7 @@ static int cz_thermal_get_temperature(struct pp_hwmgr *hwmgr)
 static int cz_read_sensor(struct pp_hwmgr *hwmgr, int idx,
 			  void *value, int *size)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	struct phm_clock_voltage_dependency_table *table =
 				hwmgr->dyn_state.vddc_dependency_on_sclk;
@@ -1803,7 +1803,7 @@ static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
 static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
 		struct PP_TemperatureRange *thermal_data)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));
 
@@ -1816,7 +1816,7 @@ static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
 
 static int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	uint32_t dpm_features = 0;
 
 	if (enable &&
@@ -1837,7 +1837,7 @@ static int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
 
 int cz_dpm_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	struct phm_uvd_clock_voltage_dependency_table *ptable =
 		hwmgr->dyn_state.uvd_clock_voltage_dependency_table;
 
@@ -1867,7 +1867,7 @@ int cz_dpm_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate)
 
 static int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 	uint32_t dpm_features = 0;
 
 	if (enable && phm_cap_enabled(
@@ -1890,7 +1890,7 @@ static int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable)
 
 static void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	cz_hwmgr->uvd_power_gated = bgate;
 
@@ -1918,7 +1918,7 @@ static void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
 
 static void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
 {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	if (bgate) {
 		cgs_set_powergating_state(
drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c +17 -17
index 957739a..25e5e2e 100644
@@ -181,7 +181,7 @@ static int cz_load_mec_firmware(struct pp_hwmgr *hwmgr)
 	if (hwmgr == NULL || hwmgr->device == NULL)
 		return -EINVAL;
 
-	cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	cz_smu = hwmgr->smu_backend;
 	ret = cgs_get_firmware_info(hwmgr->device,
 						CGS_UCODE_ID_CP_MEC, &info);
 
@@ -330,7 +330,7 @@ static int cz_smu_populate_single_scratch_task(
 			uint8_t type, bool is_last)
 {
 	uint8_t i;
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 	struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++];
 
@@ -367,7 +367,7 @@ static int cz_smu_populate_single_ucode_load_task(
 					bool is_last)
 {
 	uint8_t i;
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 	struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++];
 
@@ -393,7 +393,7 @@ static int cz_smu_populate_single_ucode_load_task(
 
 static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 
 	cz_smu->toc_entry_aram = cz_smu->toc_entry_used_count;
 	cz_smu_populate_single_scratch_task(hwmgr,
@@ -406,7 +406,7 @@ static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr)
 static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr)
 {
 	int i;
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 
 	for (i = 0; i < NUM_JOBLIST_ENTRIES; i++)
@@ -417,7 +417,7 @@ static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 
 	toc->JobList[JOB_GFX_SAVE] = (uint8_t)cz_smu->toc_entry_used_count;
@@ -435,7 +435,7 @@ static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 
 	toc->JobList[JOB_GFX_RESTORE] = (uint8_t)cz_smu->toc_entry_used_count;
@@ -477,7 +477,7 @@ static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 
 	cz_smu->toc_entry_power_profiling_index = cz_smu->toc_entry_used_count;
 
@@ -489,7 +489,7 @@ static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 
 	cz_smu->toc_entry_initialize_index = cz_smu->toc_entry_used_count;
 
@@ -517,7 +517,7 @@ static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 
 	cz_smu->toc_entry_clock_table = cz_smu->toc_entry_used_count;
 
@@ -530,7 +530,7 @@ static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 
 	cz_smu->toc_entry_used_count = 0;
 	cz_smu_initialize_toc_empty_job_list(hwmgr);
@@ -546,7 +546,7 @@ static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_populate_firmware_entries(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	uint32_t firmware_type;
 	uint32_t i;
 	int ret;
@@ -584,7 +584,7 @@ static int cz_smu_populate_single_scratch_entry(
 				uint32_t ulsize_byte,
 				struct cz_buffer_entry *entry)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	uint32_t ulsize_aligned = SIZE_ALIGN_32(ulsize_byte);
 
 	entry->data_size = ulsize_byte;
@@ -600,7 +600,7 @@ static int cz_smu_populate_single_scratch_entry(
 
 static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	unsigned long i;
 
 	for (i = 0; i < cz_smu->scratch_buffer_length; i++) {
@@ -629,7 +629,7 @@ static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)
 
 static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	unsigned long i;
 
 	for (i = 0; i < cz_smu->scratch_buffer_length; i++) {
@@ -656,7 +656,7 @@ static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr)
 
 static int cz_request_smu_load_fw(struct pp_hwmgr *hwmgr)
 {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)(hwmgr->smu_backend);
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	uint32_t smc_address;
 
 	if (!hwmgr->reload_fw) {
@@ -829,7 +829,7 @@ static int cz_smu_fini(struct pp_hwmgr *hwmgr)
 	if (hwmgr == NULL || hwmgr->device == NULL)
 		return -EINVAL;
 
-	cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	cz_smu = hwmgr->smu_backend;
 	if (cz_smu) {
 		amdgpu_bo_free_kernel(&cz_smu->toc_buffer.handle,
 					&cz_smu->toc_buffer.mc_addr,
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1520935279-17471-4-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Reviewed-by Evan Quan
#6 lore raw

RE: [PATCH 4/5] drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c

Is there any compile warning with the casting stripped?
There is similar casting in other files. Should I expect more similar patches?

Other patches in the serial are

Regards,
Evan
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Tuesday, March 13, 2018 6:01 PM
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 4/5] drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c

Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend

Change-Id I6d56858625c58433cd5a35fc03e3aa6003a6e449
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c   | 86 ++++++++++++------------
 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 34 +++++-----
 2 files changed, 60 insertions(+), 60 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +1 -1
index 4b73f07..055a4ec 100644
@@ -159,7 +159,7 @@ static uint32_t cz_get_uvd_level(struct pp_hwmgr *hwmgr,
 
 static uint32_t cz_get_max_sclk_level(struct pp_hwmgr *hwmgr)  {
-	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+	struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
 
 	if (cz_hwmgr->max_sclk_level == 0) {
 		smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxSclkLevel); @@ -171,7 +171,7 @@ static uint32_t cz_get_max_sclk_level(struct pp_hwmgr *hwmgr)
 

static int cz_initialize_dpm_defaults(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct amdgpu_device *adev = hwmgr->adev;

cz_hwmgr->gfx_ramp_step = 256*25/100;
@@ -253,7 +253,7 @@ static uint32_t cz_convert_8Bit_index_to_voltage( static int cz_construct_max_power_limits_table(struct pp_hwmgr *hwmgr,
struct phm_clock_and_voltage_limits *table) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)hwmgr->backend;
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct cz_sys_info *sys_info = &cz_hwmgr->sys_info;
struct phm_clock_voltage_dependency_table *dep_table =
hwmgr->dyn_state.vddc_dependency_on_sclk;
@@ -307,7 +307,7 @@ static int cz_init_dynamic_state_adjustment_rule_settings(

static int cz_get_system_info_data(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)hwmgr->backend;
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
ATOM_INTEGRATED_SYSTEM_INFO_V1_9 *info = NULL;
uint32_t i;
int result = 0;
@@ -412,7 +412,7 @@ static int cz_get_system_info_data(struct pp_hwmgr *hwmgr)

static int cz_construct_boot_state(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->boot_power_level.engineClock =
cz_hwmgr->sys_info.bootup_engine_clock;
@@ -553,7 +553,7 @@ static int cz_upload_pptable_to_smu(struct pp_hwmgr *hwmgr)

static int cz_init_sclk_limit(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_clock_voltage_dependency_table *table =
hwmgr->dyn_state.vddc_dependency_on_sclk;
unsigned long clock = 0, level;
@@ -579,7 +579,7 @@ static int cz_init_sclk_limit(struct pp_hwmgr *hwmgr)

static int cz_init_uvd_limit(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_uvd_clock_voltage_dependency_table *table =
hwmgr->dyn_state.uvd_clock_voltage_dependency_table;
unsigned long clock = 0, level;
@@ -606,7 +606,7 @@ static int cz_init_uvd_limit(struct pp_hwmgr *hwmgr)

static int cz_init_vce_limit(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_vce_clock_voltage_dependency_table *table =
hwmgr->dyn_state.vce_clock_voltage_dependency_table;
unsigned long clock = 0, level;
@@ -633,7 +633,7 @@ static int cz_init_vce_limit(struct pp_hwmgr *hwmgr)

static int cz_init_acp_limit(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_acp_clock_voltage_dependency_table *table =
hwmgr->dyn_state.acp_clock_voltage_dependency_table;
unsigned long clock = 0, level;
@@ -659,7 +659,7 @@ static int cz_init_acp_limit(struct pp_hwmgr *hwmgr)

static void cz_init_power_gate_state(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->uvd_power_gated = false;
cz_hwmgr->vce_power_gated = false;
@@ -670,14 +670,14 @@ static void cz_init_power_gate_state(struct pp_hwmgr *hwmgr)

static void cz_init_sclk_threshold(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->low_sclk_interrupt_threshold = 0; }

static int cz_update_sclk_limit(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_clock_voltage_dependency_table *table =
hwmgr->dyn_state.vddc_dependency_on_sclk;

@@ -766,7 +766,7 @@ static int cz_set_deep_sleep_sclk_threshold(struct pp_hwmgr *hwmgr) static int cz_set_watermark_threshold(struct pp_hwmgr *hwmgr) {
struct cz_hwmgr *cz_hwmgr =
- (struct cz_hwmgr *)(hwmgr->backend);
+ hwmgr->backend;

smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetWatermarkFrequency,
@@ -777,7 +777,7 @@ static int cz_set_watermark_threshold(struct pp_hwmgr *hwmgr)

static int cz_nbdpm_pstate_enable_disable(struct pp_hwmgr *hwmgr, bool enable, bool lock) {
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;

if (hw_data->is_nb_dpm_enabled) {
if (enable) {
@@ -802,7 +802,7 @@ static int cz_disable_nb_dpm(struct pp_hwmgr *hwmgr) {
int ret = 0;

- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
unsigned long dpm_features = 0;

if (cz_hwmgr->is_nb_dpm_enabled) {
@@ -823,7 +823,7 @@ static int cz_enable_nb_dpm(struct pp_hwmgr *hwmgr) {
int ret = 0;

- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
unsigned long dpm_features = 0;

if (!cz_hwmgr->is_nb_dpm_enabled) {
@@ -844,7 +844,7 @@ static int cz_update_low_mem_pstate(struct pp_hwmgr *hwmgr, const void *input) {
bool disable_switch;
bool enable_low_mem_state;
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;
const struct phm_set_power_state_input *states = (struct phm_set_power_state_input *)input; const struct cz_power_state *pnew_state = cast_const_PhwCzPowerState(states->pnew_state);

@@ -906,7 +906,7 @@ static int cz_setup_asic_task(struct pp_hwmgr *hwmgr)

static void cz_power_up_display_clock_sys_pll(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;

hw_data->disp_clk_bypass_pending = false;
hw_data->disp_clk_bypass = false;
@@ -914,14 +914,14 @@ static void cz_power_up_display_clock_sys_pll(struct pp_hwmgr *hwmgr)

static void cz_clear_nb_dpm_flag(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;

hw_data->is_nb_dpm_enabled = false;
}

static void cz_reset_cc6_data(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;

hw_data->cc6_settings.cc6_setting_changed = false;
hw_data->cc6_settings.cpu_pstate_separation_time = 0; @@ -950,7 +950,7 @@ static void cz_clear_voting_clients(struct pp_hwmgr *hwmgr)

static int cz_start_dpm(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->dpm_flags |= DPMFlags_SCLK_Enabled;

@@ -962,7 +962,7 @@ static int cz_start_dpm(struct pp_hwmgr *hwmgr) static int cz_stop_dpm(struct pp_hwmgr *hwmgr) {
int ret = 0;
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
unsigned long dpm_features = 0;

if (cz_hwmgr->dpm_flags & DPMFlags_SCLK_Enabled) { @@ -977,7 +977,7 @@ static int cz_stop_dpm(struct pp_hwmgr *hwmgr)

static int cz_program_bootup_state(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->sclk_dpm.soft_min_clk = cz_hwmgr->sys_info.bootup_engine_clock; cz_hwmgr->sclk_dpm.soft_max_clk = cz_hwmgr->sys_info.bootup_engine_clock;
@@ -999,7 +999,7 @@ static int cz_program_bootup_state(struct pp_hwmgr *hwmgr)

static void cz_reset_acp_boot_level(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->acp_boot_level = 0xff;
}
@@ -1036,7 +1036,7 @@ static int cz_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
const struct cz_power_state *cz_current_ps =
cast_const_PhwCzPowerState(&pcurrent_ps->hardware);

- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct PP_Clocks clocks = {0, 0, 0, 0};
bool force_high;
uint32_t num_of_active_displays = 0;
@@ -1119,7 +1119,7 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)

static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetSclkSoftMin,
@@ -1138,7 +1138,7 @@ static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)

static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_clock_voltage_dependency_table *table =
hwmgr->dyn_state.vddc_dependency_on_sclk;
unsigned long clock = 0, level;
@@ -1178,7 +1178,7 @@ static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)

static int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetSclkSoftMax,
@@ -1243,7 +1243,7 @@ static int cz_dpm_powerup_uvd(struct pp_hwmgr *hwmgr)

static int cz_dpm_update_vce_dpm(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_vce_clock_voltage_dependency_table *ptable =
hwmgr->dyn_state.vce_clock_voltage_dependency_table;

@@ -1288,7 +1288,7 @@ static int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr)

static uint32_t cz_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

return cz_hwmgr->sys_info.bootup_uma_clock;
}
@@ -1317,7 +1317,7 @@ static uint32_t cz_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) static int cz_dpm_patch_boot_state(struct pp_hwmgr *hwmgr,
struct pp_hw_power_state *hw_ps)
{
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct cz_power_state *cz_ps = cast_PhwCzPowerState(hw_ps);

cz_ps->level = 1;
@@ -1409,7 +1409,7 @@ static void cz_hw_print_display_cfg(

static int cz_set_cpu_power_state(struct pp_hwmgr *hwmgr) {
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;
uint32_t data = 0;

if (hw_data->cc6_settings.cc6_setting_changed) { @@ -1443,7 +1443,7 @@ static void cz_hw_print_display_cfg( static int cz_store_cc6_data(struct pp_hwmgr *hwmgr, uint32_t separation_time,
bool cc6_disable, bool pstate_disable, bool pstate_switch_disable) {
- struct cz_hwmgr *hw_data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *hw_data = hwmgr->backend;

if (separation_time !=
hw_data->cc6_settings.cpu_pstate_separation_time || @@ -1510,7 +1510,7 @@ static int cz_force_clock_level(struct pp_hwmgr *hwmgr, static int cz_print_clock_levels(struct pp_hwmgr *hwmgr,
enum pp_clock_type type, char *buf)
{
- struct cz_hwmgr *data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *data = hwmgr->backend;
struct phm_clock_voltage_dependency_table *sclk_table =
hwmgr->dyn_state.vddc_dependency_on_sclk;
int i, now, size = 0;
@@ -1558,7 +1558,7 @@ static int cz_get_performance_level(struct pp_hwmgr *hwmgr, const struct pp_hw_p
if (level == NULL || hwmgr == NULL || state == NULL)
return -EINVAL;

- data = (struct cz_hwmgr *)(hwmgr->backend);
+ data = hwmgr->backend;
ps = cast_const_PhwCzPowerState(state);

level_index = index > ps->level - 1 ? ps->level - 1 : index; @@ -1599,7 +1599,7 @@ static int cz_get_current_shallow_sleep_clocks(struct pp_hwmgr *hwmgr, static int cz_get_clock_by_type(struct pp_hwmgr *hwmgr, enum amd_pp_clock_type type,
struct amd_pp_clocks *clocks)
{
- struct cz_hwmgr *data = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *data = hwmgr->backend;
int i;
struct phm_clock_voltage_dependency_table *table;

@@ -1667,7 +1667,7 @@ static int cz_thermal_get_temperature(struct pp_hwmgr *hwmgr) static int cz_read_sensor(struct pp_hwmgr *hwmgr, int idx,
void *value, int *size)
{
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

struct phm_clock_voltage_dependency_table *table =
hwmgr->dyn_state.vddc_dependency_on_sclk;
@@ -1803,7 +1803,7 @@ static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr, static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
struct PP_TemperatureRange *thermal_data) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));

@@ -1816,7 +1816,7 @@ static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,

static int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
uint32_t dpm_features = 0;

if (enable &&
@@ -1837,7 +1837,7 @@ static int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)

int cz_dpm_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
struct phm_uvd_clock_voltage_dependency_table *ptable =
hwmgr->dyn_state.uvd_clock_voltage_dependency_table;

@@ -1867,7 +1867,7 @@ int cz_dpm_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate)

static int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;
uint32_t dpm_features = 0;

if (enable && phm_cap_enabled(
@@ -1890,7 +1890,7 @@ static int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable)

static void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

cz_hwmgr->uvd_power_gated = bgate;

@@ -1918,7 +1918,7 @@ static void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)

static void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) {
- struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+ struct cz_hwmgr *cz_hwmgr = hwmgr->backend;

if (bgate) {
cgs_set_powergating_state(

drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c +5 -5
index 957739a..25e5e2e 100644
@@ -181,7 +181,7 @@ static int cz_load_mec_firmware(struct pp_hwmgr *hwmgr)
 	if (hwmgr == NULL || hwmgr->device == NULL)
 		return -EINVAL;
 
-	cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	cz_smu = hwmgr->smu_backend;
 	ret = cgs_get_firmware_info(hwmgr->device,
 						CGS_UCODE_ID_CP_MEC, &info);
 
@@ -330,7 +330,7 @@ static int cz_smu_populate_single_scratch_task(
 			uint8_t type, bool is_last)
 {
 	uint8_t i;
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 	struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++];
 
@@ -367,7 +367,7 @@ static int cz_smu_populate_single_ucode_load_task(
 					bool is_last)
 {
 	uint8_t i;
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 	struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++];
 
@@ -393,7 +393,7 @@ static int cz_smu_populate_single_ucode_load_task(
 
 static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr)  {
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 
 	cz_smu->toc_entry_aram = cz_smu->toc_entry_used_count;
 	cz_smu_populate_single_scratch_task(hwmgr,
@@ -406,7 +406,7 @@ static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr)  static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr)  {
 	int i;
-	struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+	struct cz_smumgr *cz_smu = hwmgr->smu_backend;
 	struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
 
 	for (i = 0; i < NUM_JOBLIST_ENTRIES; i++) @@ -417,7 +417,7 @@ static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr)
 
 static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr)  {

- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;

toc->JobList[JOB_GFX_SAVE] = (uint8_t)cz_smu->toc_entry_used_count;
@@ -435,7 +435,7 @@ static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr)

static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;

toc->JobList[JOB_GFX_RESTORE] = (uint8_t)cz_smu->toc_entry_used_count;
@@ -477,7 +477,7 @@ static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr)

static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;

cz_smu->toc_entry_power_profiling_index = cz_smu->toc_entry_used_count;

@@ -489,7 +489,7 @@ static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr)

static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;

cz_smu->toc_entry_initialize_index = cz_smu->toc_entry_used_count;

@@ -517,7 +517,7 @@ static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr)

static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;

cz_smu->toc_entry_clock_table = cz_smu->toc_entry_used_count;

@@ -530,7 +530,7 @@ static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr)

static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;

cz_smu->toc_entry_used_count = 0; cz_smu_initialize_toc_empty_job_list(hwmgr);
@@ -546,7 +546,7 @@ static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr)

static int cz_smu_populate_firmware_entries(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
uint32_t firmware_type;
uint32_t i;
int ret;
@@ -584,7 +584,7 @@ static int cz_smu_populate_single_scratch_entry(
uint32_t ulsize_byte,
struct cz_buffer_entry *entry)
{
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
uint32_t ulsize_aligned = SIZE_ALIGN_32(ulsize_byte);

entry->data_size = ulsize_byte;
@@ -600,7 +600,7 @@ static int cz_smu_populate_single_scratch_entry(

static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
unsigned long i;

for (i = 0; i < cz_smu->scratch_buffer_length; i++) { @@ -629,7 +629,7 @@ static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)

static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
unsigned long i;

for (i = 0; i < cz_smu->scratch_buffer_length; i++) { @@ -656,7 +656,7 @@ static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr)

static int cz_request_smu_load_fw(struct pp_hwmgr *hwmgr) {
- struct cz_smumgr *cz_smu = (struct cz_smumgr *)(hwmgr->smu_backend);
+ struct cz_smumgr *cz_smu = hwmgr->smu_backend;
uint32_t smc_address;

if (!hwmgr->reload_fw) {
@@ -829,7 +829,7 @@ static int cz_smu_fini(struct pp_hwmgr *hwmgr)
if (hwmgr == NULL || hwmgr->device == NULL)
return -EINVAL;

- cz_smu = (struct cz_smumgr *)hwmgr->smu_backend;
+ cz_smu = hwmgr->smu_backend;
if (cz_smu) {
amdgpu_bo_free_kernel(&cz_smu->toc_buffer.handle,
&cz_smu->toc_buffer.mc_addr,
--
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#7 lore raw

PATCH 5/5 drm/amd/pp: Replace files name cz_* with smu8_*

In reply to a message not in the archive

Powerplay is for the hw ip smu, smu8 was used on CZ/ST, so use smu8 as the prefix of the files name.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile       |    2 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c     | 1989 -------------------
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h     |  314 ---
 drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c        |    8 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c   | 1991 ++++++++++++++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.h   |  311 +++
 drivers/gpu/drm/amd/powerplay/smumgr/Makefile      |    2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c   |  883 ---------
 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.h   |   99 -
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c |  883 +++++++++
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.h |   99 +
 11 files changed, 3290 insertions(+), 3291 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
 delete mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.h
 delete mode 100644 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
 delete mode 100644 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.h
 create mode 100644 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
index 094949d..f868b95 100644
@@ -24,7 +24,7 @@
 # It provides the hardware management services for the driver.
 
 HARDWARE_MGR = hwmgr.o processpptables.o \
-		hardwaremanager.o cz_hwmgr.o \
+		hardwaremanager.o smu8_hwmgr.o \
 		pppcielanes.o\
 		process_pptables_v1_0.o ppatomctrl.o ppatomfwctrl.o \
 		smu7_hwmgr.o smu7_powertune.o smu7_thermal.o \
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c deleted +0 -1989

1,989 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h deleted +0 -314

314 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +4 -4
index 238dd59..2290300 100644
@@ -35,7 +35,7 @@
 #include "pp_psm.h"
 
 extern const struct pp_smumgr_func ci_smu_funcs;
-extern const struct pp_smumgr_func cz_smu_funcs;
+extern const struct pp_smumgr_func smu8_smu_funcs;
 extern const struct pp_smumgr_func iceland_smu_funcs;
 extern const struct pp_smumgr_func tonga_smu_funcs;
 extern const struct pp_smumgr_func fiji_smu_funcs;
@@ -44,7 +44,7 @@
 extern const struct pp_smumgr_func smu10_smu_funcs;
 
 extern int smu7_init_function_pointers(struct pp_hwmgr *hwmgr);
-extern int cz_init_function_pointers(struct pp_hwmgr *hwmgr);
+extern int smu8_init_function_pointers(struct pp_hwmgr *hwmgr);
 extern int vega10_hwmgr_init(struct pp_hwmgr *hwmgr);
 extern int smu10_init_function_pointers(struct pp_hwmgr *hwmgr);
 
@@ -144,8 +144,8 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
 		break;
 	case AMDGPU_FAMILY_CZ:
 		hwmgr->od_enabled = false;
-		hwmgr->smumgr_funcs = &cz_smu_funcs;
-		cz_init_function_pointers(hwmgr);
+		hwmgr->smumgr_funcs = &smu8_smu_funcs;
+		smu8_init_function_pointers(hwmgr);
 		break;
 	case AMDGPU_FAMILY_VI:
 		switch (hwmgr->chip_id) {
drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c new file +1991 -0

663 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.h new file +311 -0

311 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/smumgr/Makefile +1 -1
index f5c4542..735c386 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c deleted +0 -883

883 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.h deleted +0 -99

99 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c new file +883 -0

883 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.h new file +99 -0

99 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Part of the diff is not shown here. View the raw message.

Reviewed-by
#8 lore raw
In reply to a message not in the archive

Series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <[email protected]>
Sent: Tuesday, March 13, 2018 6:01 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 1/5] drm/amd/pp: Delete dead code on cz_clockpowergating.c

Change-Id Ia4a121435c4860b1703d3647ef7220ee97f52d03
---
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c  | 78 ----------------------
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.h  |  3 -
 2 files changed, 81 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +0 -78
index 416abeb..01e5612 100644
@@ -25,84 +25,6 @@
 #include "cz_clockpowergating.h"
 #include "cz_ppsmc.h"
 
-/* PhyID -> Status Mapping in DDI_PHY_GEN_STATUS
-    0    GFX0L (3:0),                  (27:24),
-    1    GFX0H (7:4),                  (31:28),
-    2    GFX1L (3:0),                  (19:16),
-    3    GFX1H (7:4),                  (23:20),
-    4    DDIL   (3:0),                   (11: 8),
-    5    DDIH  (7:4),                   (15:12),
-    6    DDI2L (3:0),                   ( 3: 0),
-    7    DDI2H (7:4),                   ( 7: 4),
-*/
-#define DDI_PHY_GEN_STATUS_VAL(phyID)   (1 << ((3 - ((phyID & 0x07)/2))*8 + (phyID & 0x01)*4))
-#define IS_PHY_ID_USED_BY_PLL(PhyID)    (((0xF3 & (1 << PhyID)) & 0xFF) ? true : false)
-
-
-int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating)
-{
-       int ret = 0;
-
-       switch (block) {
-       case PHM_AsicBlock_UVD_MVC:
-       case PHM_AsicBlock_UVD:
-       case PHM_AsicBlock_UVD_HD:
-       case PHM_AsicBlock_UVD_SD:
-               if (gating == PHM_ClockGateSetting_StaticOff)
-                       ret = cz_dpm_powerdown_uvd(hwmgr);
-               else
-                       ret = cz_dpm_powerup_uvd(hwmgr);
-               break;
-       case PHM_AsicBlock_GFX:
-       default:
-               break;
-       }
-
-       return ret;
-}
-
-
-bool cz_phm_is_safe_for_asic_block(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *state, enum PHM_AsicBlock block)
-{
-       return true;
-}
-
-
-int cz_phm_enable_disable_gfx_power_gating(struct pp_hwmgr *hwmgr, bool enable)
-{
-       return 0;
-}
-
-int cz_phm_smu_power_up_down_pcie(struct pp_hwmgr *hwmgr, uint32_t target, bool up, uint32_t args)
-{
-       /* TODO */
-       return 0;
-}
-
-int cz_phm_initialize_display_phy_access(struct pp_hwmgr *hwmgr, bool initialize, bool accesshw)
-{
-       /* TODO */
-       return 0;
-}
-
-int cz_phm_get_display_phy_access_info(struct pp_hwmgr *hwmgr)
-{
-       /* TODO */
-       return 0;
-}
-
-int cz_phm_gate_unused_display_phys(struct pp_hwmgr *hwmgr)
-{
-       /* TODO */
-       return 0;
-}
-
-int cz_phm_ungate_all_display_phys(struct pp_hwmgr *hwmgr)
-{
-       /* TODO */
-       return 0;
-}
-
 int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
 {
         struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h +0 -3
index 92f707b..08d393f 100644
@@ -25,10 +25,7 @@
 #define _CZ_CLOCK_POWER_GATING_H_
 
 #include "cz_hwmgr.h"
-#include "pp_asicblocks.h"
 
-extern int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating);
-extern const struct phm_master_table_header cz_phm_enable_clock_power_gatings_master;
 extern void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);
 extern void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);
 extern int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable);

--
1.9.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx