[radeon-alex:amd-staging-drm-next 29/33] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:323:71: sparse: missing braces around initializer

kbuild test robot lkp at intel.com
Fri Apr 27 00:28:56 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   a11008ca87d737a3b1ffbe7f32af7d74d78a9aa8
commit: 2493ccc491879761baffb7a66a7bbb86b3cff7ad [29/33] drm/amd/powerplay: update ppatomctrl.c (v2)
reproduce:
        # apt-get install sparse
        git checkout 2493ccc491879761baffb7a66a7bbb86b3cff7ad
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:55:66: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:84:48: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:106:42: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:119:36: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:157:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:182:53: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulTargetEngineClock @@    got ed int [unsigned] [usertype] ulTargetEngineClock @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:182:53:    expected unsigned int [unsigned] [usertype] ulTargetEngineClock
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:182:53:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:187:51: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock @@    got ed int [unsigned] [usertype] ulClock @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:187:51:    expected unsigned int [unsigned] [usertype] ulClock
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:187:51:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:222:29: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:234:27: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:257:33: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock @@    got ed int [unsigned] [usertype] ulClock @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:257:33:    expected unsigned int [unsigned] [usertype] ulClock
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:257:33:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:266:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:268:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:305:41: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock:24 @@    got ed int [unsigned] [usertype] ulClock:24 @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:305:41:    expected unsigned int [unsigned] [usertype] ulClock:24
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:305:41:    got restricted __le32 [usertype] <noident>
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:323:71: sparse: missing braces around initializer
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:326:41: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock:24 @@    got ed int [unsigned] [usertype] ulClock:24 @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:326:41:    expected unsigned int [unsigned] [usertype] ulClock:24
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:326:41:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:337:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:339:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:341:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:356:32: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock:24 @@    got ed int [unsigned] [usertype] ulClock:24 @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:356:32:    expected unsigned int [unsigned] [usertype] ulClock:24
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:356:32:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:364:40: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:379:40: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock:24 @@    got ed int [unsigned] [usertype] ulClock:24 @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:379:40:    expected unsigned int [unsigned] [usertype] ulClock:24
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:379:40:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:390:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:393:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:395:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:416:40: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock:24 @@    got ed int [unsigned] [usertype] ulClock:24 @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:416:40:    expected unsigned int [unsigned] [usertype] ulClock:24
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:416:40:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:424:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:425:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:430:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:431:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:432:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:433:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:434:49: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:448:40: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [unsigned] [usertype] ulClock:24 @@    got ed int [unsigned] [usertype] ulClock:24 @@
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:448:40:    expected unsigned int [unsigned] [usertype] ulClock:24
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:448:40:    got restricted __le32 [usertype] <noident>
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:460:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:463:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:465:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:496:36: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:554:25: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:556:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:560:17: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:574:29: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:586:33: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:697:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:698:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:701:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:702:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:705:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:706:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:709:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:710:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:713:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:714:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:717:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:718:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:721:55: sparse: cast to restricted __le16
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:722:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:727:48: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:751:23: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:752:34: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:753:36: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:771:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:772:34: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:773:36: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:791:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:792:34: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:793:36: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:812:28: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:813:38: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:814:36: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:833:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:834:38: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:835:37: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:855:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:856:38: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:857:36: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:886:28: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:887:43: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:888:34: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:898:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:900:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:902:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:904:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:906:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:908:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:910:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:912:46: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:915:42: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:916:42: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:917:42: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:919:43: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:922:17: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:924:17: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:926:17: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:928:17: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:931:17: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:943:34: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:944:37: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:945:41: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:946:35: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:948:33: sparse: too many warnings

vim +323 drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c

   217	
   218	static const ATOM_VOLTAGE_OBJECT_V3 *atomctrl_lookup_voltage_type_v3(
   219			const ATOM_VOLTAGE_OBJECT_INFO_V3_1 * voltage_object_info_table,
   220			uint8_t voltage_type, uint8_t voltage_mode)
   221	{
   222		unsigned int size = le16_to_cpu(voltage_object_info_table->sHeader.usStructureSize);
   223		unsigned int offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO_V3_1, asVoltageObj[0]);
   224		uint8_t *start = (uint8_t *)voltage_object_info_table;
   225	
   226		while (offset < size) {
   227			const ATOM_VOLTAGE_OBJECT_V3 *voltage_object =
   228				(const ATOM_VOLTAGE_OBJECT_V3 *)(start + offset);
   229	
   230			if (voltage_type == voltage_object->asGpioVoltageObj.sHeader.ucVoltageType &&
   231				voltage_mode == voltage_object->asGpioVoltageObj.sHeader.ucVoltageMode)
   232				return voltage_object;
   233	
 > 234			offset += le16_to_cpu(voltage_object->asGpioVoltageObj.sHeader.usSize);
   235		}
   236	
   237		return NULL;
   238	}
   239	
   240	/** atomctrl_get_memory_pll_dividers_si().
   241	 *
   242	 * @param hwmgr                 input parameter: pointer to HwMgr
   243	 * @param clock_value             input parameter: memory clock
   244	 * @param dividers                 output parameter: memory PLL dividers
   245	 * @param strobe_mode            input parameter: 1 for strobe mode,  0 for performance mode
   246	 */
   247	int atomctrl_get_memory_pll_dividers_si(
   248			struct pp_hwmgr *hwmgr,
   249			uint32_t clock_value,
   250			pp_atomctrl_memory_clock_param *mpll_param,
   251			bool strobe_mode)
   252	{
   253		struct amdgpu_device *adev = hwmgr->adev;
   254		COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_1 mpll_parameters;
   255		int result;
   256	
   257		mpll_parameters.ulClock = cpu_to_le32(clock_value);
   258		mpll_parameters.ucInputFlag = (uint8_t)((strobe_mode) ? 1 : 0);
   259	
   260		result = amdgpu_atom_execute_table(adev->mode_info.atom_context,
   261			 GetIndexIntoMasterTable(COMMAND, ComputeMemoryClockParam),
   262			(uint32_t *)&mpll_parameters);
   263	
   264		if (0 == result) {
   265			mpll_param->mpll_fb_divider.clk_frac =
   266				le16_to_cpu(mpll_parameters.ulFbDiv.usFbDivFrac);
   267			mpll_param->mpll_fb_divider.cl_kf =
   268				le16_to_cpu(mpll_parameters.ulFbDiv.usFbDiv);
   269			mpll_param->mpll_post_divider =
   270				(uint32_t)mpll_parameters.ucPostDiv;
   271			mpll_param->vco_mode =
   272				(uint32_t)(mpll_parameters.ucPllCntlFlag &
   273						MPLL_CNTL_FLAG_VCO_MODE_MASK);
   274			mpll_param->yclk_sel =
   275				(uint32_t)((mpll_parameters.ucPllCntlFlag &
   276							MPLL_CNTL_FLAG_BYPASS_DQ_PLL) ? 1 : 0);
   277			mpll_param->qdr =
   278				(uint32_t)((mpll_parameters.ucPllCntlFlag &
   279							MPLL_CNTL_FLAG_QDR_ENABLE) ? 1 : 0);
   280			mpll_param->half_rate =
   281				(uint32_t)((mpll_parameters.ucPllCntlFlag &
   282							MPLL_CNTL_FLAG_AD_HALF_RATE) ? 1 : 0);
   283			mpll_param->dll_speed =
   284				(uint32_t)(mpll_parameters.ucDllSpeed);
   285			mpll_param->bw_ctrl =
   286				(uint32_t)(mpll_parameters.ucBWCntl);
   287		}
   288	
   289		return result;
   290	}
   291	
   292	/** atomctrl_get_memory_pll_dividers_vi().
   293	 *
   294	 * @param hwmgr                 input parameter: pointer to HwMgr
   295	 * @param clock_value             input parameter: memory clock
   296	 * @param dividers               output parameter: memory PLL dividers
   297	 */
   298	int atomctrl_get_memory_pll_dividers_vi(struct pp_hwmgr *hwmgr,
   299			uint32_t clock_value, pp_atomctrl_memory_clock_param *mpll_param)
   300	{
   301		struct amdgpu_device *adev = hwmgr->adev;
   302		COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_2 mpll_parameters;
   303		int result;
   304	
   305		mpll_parameters.ulClock.ulClock = cpu_to_le32(clock_value);
   306	
   307		result = amdgpu_atom_execute_table(adev->mode_info.atom_context,
   308				GetIndexIntoMasterTable(COMMAND, ComputeMemoryClockParam),
   309				(uint32_t *)&mpll_parameters);
   310	
   311		if (!result)
   312			mpll_param->mpll_post_divider =
   313					(uint32_t)mpll_parameters.ulClock.ucPostDiv;
   314	
   315		return result;
   316	}
   317	
   318	int atomctrl_get_memory_pll_dividers_ai(struct pp_hwmgr *hwmgr,
   319						uint32_t clock_value,
   320						pp_atomctrl_memory_clock_param_ai *mpll_param)
   321	{
   322		struct amdgpu_device *adev = hwmgr->adev;
 > 323		COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_3 mpll_parameters = {0};
   324		int result;
   325	
   326		mpll_parameters.ulClock.ulClock = cpu_to_le32(clock_value);
   327	
   328		result = amdgpu_atom_execute_table(adev->mode_info.atom_context,
   329				GetIndexIntoMasterTable(COMMAND, ComputeMemoryClockParam),
   330				(uint32_t *)&mpll_parameters);
   331	
   332		/* VEGAM's mpll takes sometime to finish computing */
   333		udelay(10);
   334	
   335		if (!result) {
   336			mpll_param->ulMclk_fcw_int =
   337				le16_to_cpu(mpll_parameters.usMclk_fcw_int);
   338			mpll_param->ulMclk_fcw_frac =
   339				le16_to_cpu(mpll_parameters.usMclk_fcw_frac);
   340			mpll_param->ulClock =
   341				le32_to_cpu(mpll_parameters.ulClock.ulClock);
   342			mpll_param->ulPostDiv = mpll_parameters.ulClock.ucPostDiv;
   343		}
   344	
   345		return result;
   346	}
   347	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list