[radeon-alex:drm-next-4.18-wip 169/185] drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:917:39: sparse: constant 0x1B8000000 is so big it is long

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

 



tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.18-wip
head:   42386402a815771c50788038c101dd530ac729d2
commit: 7bdb3db410d25b815a0b8d9387accee3da12b376 [169/185] drm/amdgpu: Reserved vram for smu to save debug info.
reproduce:
        # apt-get install sparse
        git checkout 7bdb3db410d25b815a0b8d9387accee3da12b376
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:917:39: sparse: constant 0x1B8000000 is so big it is long
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:320:39: sparse: cast removes address space of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:340:31: sparse: cast removes address space of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1425:65: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1427:55: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1428:50: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1429:50: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1430:56: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1432:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1433:45: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1434:51: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1435:55: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1436:57: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1438:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1439:53: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1441:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1443:25: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1444:46: sparse: cast to restricted __le32

vim +917 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

   911	
   912	static void amdgpu_device_check_smu_prv_buffer_size(struct amdgpu_device *adev)
   913	{
   914		struct sysinfo si;
   915		bool is_os_64 = (sizeof(void *) == 8) ? true : false;
   916		uint64_t total_memory;
 > 917		uint64_t dram_size_seven_GB = 0x1B8000000;
   918		uint64_t dram_size_three_GB = 0xB8000000;
   919	
   920		if (amdgpu_smu_memory_pool_size == 0)
   921			return;
   922	
   923		if (!is_os_64) {
   924			DRM_WARN("Not 64-bit OS, feature not supported\n");
   925			goto def_value;
   926		}
   927		si_meminfo(&si);
   928		total_memory = (uint64_t)si.totalram * si.mem_unit;
   929	
   930		if ((amdgpu_smu_memory_pool_size == 1) ||
   931			(amdgpu_smu_memory_pool_size == 2)) {
   932			if (total_memory < dram_size_three_GB)
   933				goto def_value1;
   934		} else if ((amdgpu_smu_memory_pool_size == 4) ||
   935			(amdgpu_smu_memory_pool_size == 8)) {
   936			if (total_memory < dram_size_seven_GB)
   937				goto def_value1;
   938		} else {
   939			DRM_WARN("Smu memory pool size not supported\n");
   940			goto def_value;
   941		}
   942		adev->pm.smu_prv_buffer_size = amdgpu_smu_memory_pool_size << 28;
   943	
   944		return;
   945	
   946	def_value1:
   947		DRM_WARN("No enough system memory\n");
   948	def_value:
   949		adev->pm.smu_prv_buffer_size = 0;
   950	}
   951	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
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