[radeon-alex:amd-staging-drm-next 440/442] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:802:6: warning: no previous prototype for 'kgd_gfx_v9_get_cu_occupancy'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   26803606c5d6137fb24d8ecec9b326a99f890c91
commit: 3fe0f6b91eba324db40436d61064ec8f00a080a3 [440/442] drm/amd/amdgpu: Enable arcturus devices to access the method kgd_gfx_v9_get_cu_occupancy that is already defined
config: x86_64-randconfig-a012-20201104 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
        git fetch --no-tags radeon-alex amd-staging-drm-next
        git checkout 3fe0f6b91eba324db40436d61064ec8f00a080a3
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:94:6: warning: no previous prototype for 'kgd_gfx_v9_program_sh_mem_settings' [-Wmissing-prototypes]
      94 | void kgd_gfx_v9_program_sh_mem_settings(struct kgd_dev *kgd, uint32_t vmid,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:111:5: warning: no previous prototype for 'kgd_gfx_v9_set_pasid_vmid_mapping' [-Wmissing-prototypes]
     111 | int kgd_gfx_v9_set_pasid_vmid_mapping(struct kgd_dev *kgd, unsigned int pasid,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:172:5: warning: no previous prototype for 'kgd_gfx_v9_init_interrupts' [-Wmissing-prototypes]
     172 | int kgd_gfx_v9_init_interrupts(struct kgd_dev *kgd, uint32_t pipe_id)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:234:5: warning: no previous prototype for 'kgd_gfx_v9_hqd_load' [-Wmissing-prototypes]
     234 | int kgd_gfx_v9_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id,
         |     ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:314:5: warning: no previous prototype for 'kgd_gfx_v9_hiq_mqd_load' [-Wmissing-prototypes]
     314 | int kgd_gfx_v9_hiq_mqd_load(struct kgd_dev *kgd, void *mqd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:367:5: warning: no previous prototype for 'kgd_gfx_v9_hqd_dump' [-Wmissing-prototypes]
     367 | int kgd_gfx_v9_hqd_dump(struct kgd_dev *kgd,
         |     ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:501:6: warning: no previous prototype for 'kgd_gfx_v9_hqd_is_occupied' [-Wmissing-prototypes]
     501 | bool kgd_gfx_v9_hqd_is_occupied(struct kgd_dev *kgd, uint64_t queue_address,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:542:5: warning: no previous prototype for 'kgd_gfx_v9_hqd_destroy' [-Wmissing-prototypes]
     542 | int kgd_gfx_v9_hqd_destroy(struct kgd_dev *kgd, void *mqd,
         |     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:632:6: warning: no previous prototype for 'kgd_gfx_v9_get_atc_vmid_pasid_mapping_info' [-Wmissing-prototypes]
     632 | bool kgd_gfx_v9_get_atc_vmid_pasid_mapping_info(struct kgd_dev *kgd,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:645:5: warning: no previous prototype for 'kgd_gfx_v9_address_watch_disable' [-Wmissing-prototypes]
     645 | int kgd_gfx_v9_address_watch_disable(struct kgd_dev *kgd)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:650:5: warning: no previous prototype for 'kgd_gfx_v9_address_watch_execute' [-Wmissing-prototypes]
     650 | int kgd_gfx_v9_address_watch_execute(struct kgd_dev *kgd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:659:5: warning: no previous prototype for 'kgd_gfx_v9_wave_control_execute' [-Wmissing-prototypes]
     659 | int kgd_gfx_v9_wave_control_execute(struct kgd_dev *kgd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:684:10: warning: no previous prototype for 'kgd_gfx_v9_address_watch_get_offset' [-Wmissing-prototypes]
     684 | uint32_t kgd_gfx_v9_address_watch_get_offset(struct kgd_dev *kgd,
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:691:6: warning: no previous prototype for 'kgd_gfx_v9_set_vm_context_page_table_base' [-Wmissing-prototypes]
     691 | void kgd_gfx_v9_set_vm_context_page_table_base(struct kgd_dev *kgd,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:802:6: warning: no previous prototype for 'kgd_gfx_v9_get_cu_occupancy' [-Wmissing-prototypes]
     802 | void kgd_gfx_v9_get_cu_occupancy(struct kgd_dev *kgd, int pasid,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:67,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:22:
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: 'dc_fixpt_ln2_div_2' defined but not used [-Wunused-const-variable=]
      76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
         |                                ^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: 'dc_fixpt_ln2' defined but not used [-Wunused-const-variable=]
      75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
         |                                ^~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: 'dc_fixpt_e' defined but not used [-Wunused-const-variable=]
      74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
         |                                ^~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: 'dc_fixpt_two_pi' defined but not used [-Wunused-const-variable=]
      73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
         |                                ^~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: 'dc_fixpt_pi' defined but not used [-Wunused-const-variable=]
      72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
         |                                ^~~~~~~~~~~

vim +/kgd_gfx_v9_get_cu_occupancy +802 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c

   755	
   756	/**
   757	 * @kgd_gfx_v9_get_cu_occupancy: Reads relevant registers associated with each
   758	 * shader engine and aggregates the number of waves that are in flight for the
   759	 * process whose pasid is provided as a parameter. The process could have ZERO
   760	 * or more queues running and submitting waves to compute units.
   761	 *
   762	 * @kgd: Handle of device from which to get number of waves in flight
   763	 * @pasid: Identifies the process for which this query call is invoked
   764	 * @wave_cnt: Output parameter updated with number of waves in flight that
   765	 * belong to process with given pasid
   766	 * @max_waves_per_cu: Output parameter updated with maximum number of waves
   767	 * possible per Compute Unit
   768	 *
   769	 * @note: It's possible that the device has too many queues (oversubscription)
   770	 * in which case a VMID could be remapped to a different PASID. This could lead
   771	 * to an iaccurate wave count. Following is a high-level sequence:
   772	 *    Time T1: vmid = getVmid(); vmid is associated with Pasid P1
   773	 *    Time T2: passId = getPasId(vmid); vmid is associated with Pasid P2
   774	 * In the sequence above wave count obtained from time T1 will be incorrectly
   775	 * lost or added to total wave count.
   776	 *
   777	 * The registers that provide the waves in flight are:
   778	 *
   779	 *  SPI_CSQ_WF_ACTIVE_STATUS - bit-map of queues per pipe. The bit is ON if a
   780	 *  queue is slotted, OFF if there is no queue. A process could have ZERO or
   781	 *  more queues slotted and submitting waves to be run on compute units. Even
   782	 *  when there is a queue it is possible there could be zero wave fronts, this
   783	 *  can happen when queue is waiting on top-of-pipe events - e.g. waitRegMem
   784	 *  command
   785	 *
   786	 *  For each bit that is ON from above:
   787	 *
   788	 *    Read (SPI_CSQ_WF_ACTIVE_COUNT_0 + queue_idx) register. It provides the
   789	 *    number of waves that are in flight for the queue at specified index. The
   790	 *    index ranges from 0 to 7.
   791	 *
   792	 *    If non-zero waves are in flight, read CP_HQD_VMID register to obtain VMID
   793	 *    of the wave(s).
   794	 *
   795	 *    Determine if VMID from above step maps to pasid provided as parameter. If
   796	 *    it matches agrregate the wave count. That the VMID will not match pasid is
   797	 *    a normal condition i.e. a device is expected to support multiple queues
   798	 *    from multiple proceses.
   799	 *
   800	 *  Reading registers referenced above involves programming GRBM appropriately
   801	 */
 > 802	void kgd_gfx_v9_get_cu_occupancy(struct kgd_dev *kgd, int pasid,
   803			int *pasid_wave_cnt, int *max_waves_per_cu)
   804	{
   805		int qidx;
   806		int vmid;
   807		int se_idx;
   808		int sh_idx;
   809		int se_cnt;
   810		int sh_cnt;
   811		int wave_cnt;
   812		int queue_map;
   813		int pasid_tmp;
   814		int max_queue_cnt;
   815		int vmid_wave_cnt = 0;
   816		struct amdgpu_device *adev;
   817		DECLARE_BITMAP(cp_queue_bitmap, KGD_MAX_QUEUES);
   818	
   819		adev = get_amdgpu_device(kgd);
   820		lock_spi_csq_mutexes(adev);
   821		soc15_grbm_select(adev, 1, 0, 0, 0);
   822	
   823		/*
   824		 * Iterate through the shader engines and arrays of the device
   825		 * to get number of waves in flight
   826		 */
   827		bitmap_complement(cp_queue_bitmap, adev->gfx.mec.queue_bitmap,
   828				  KGD_MAX_QUEUES);
   829		max_queue_cnt = adev->gfx.mec.num_pipe_per_mec *
   830				adev->gfx.mec.num_queue_per_pipe;
   831		sh_cnt = adev->gfx.config.max_sh_per_se;
   832		se_cnt = adev->gfx.config.max_shader_engines;
   833		for (se_idx = 0; se_idx < se_cnt; se_idx++) {
   834			for (sh_idx = 0; sh_idx < sh_cnt; sh_idx++) {
   835	
   836				gfx_v9_0_select_se_sh(adev, se_idx, sh_idx, 0xffffffff);
   837				queue_map = RREG32(SOC15_REG_OFFSET(GC, 0,
   838						   mmSPI_CSQ_WF_ACTIVE_STATUS));
   839	
   840				/*
   841				 * Assumption: queue map encodes following schema: four
   842				 * pipes per each micro-engine, with each pipe mapping
   843				 * eight queues. This schema is true for GFX9 devices
   844				 * and must be verified for newer device families
   845				 */
   846				for (qidx = 0; qidx < max_queue_cnt; qidx++) {
   847	
   848					/* Skip qeueus that are not associated with
   849					 * compute functions
   850					 */
   851					if (!test_bit(qidx, cp_queue_bitmap))
   852						continue;
   853	
   854					if (!(queue_map & (1 << qidx)))
   855						continue;
   856	
   857					/* Get number of waves in flight and aggregate them */
   858					get_wave_count(adev, qidx, &wave_cnt, &vmid);
   859					if (wave_cnt != 0) {
   860						pasid_tmp =
   861						  RREG32(SOC15_REG_OFFSET(OSSSYS, 0,
   862							 mmIH_VMID_0_LUT) + vmid);
   863						if (pasid_tmp == pasid)
   864							vmid_wave_cnt += wave_cnt;
   865					}
   866				}
   867			}
   868		}
   869	
   870		gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
   871		soc15_grbm_select(adev, 0, 0, 0, 0);
   872		unlock_spi_csq_mutexes(adev);
   873	
   874		/* Update the output parameters and return */
   875		*pasid_wave_cnt = vmid_wave_cnt;
   876		*max_waves_per_cu = adev->gfx.cu_info.simd_per_cu *
   877					adev->gfx.cu_info.max_waves_per_simd;
   878	}
   879	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux