[jimc:folio-pool-v2-lockdep 7/21] drivers/gpu/drm/drm_gpuvm.c:1113:36: error: 'gpuvm_scratchpad_key' undeclared

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://github.com/jimc/linux.git folio-pool-v2-lockdep
head:   e77ee8289ea0755b0ee299348504d4568f942d71
commit: 67cc13f51c541db3cb7b164a0213776c3ea871db [7/21] drm/gpuvm: Route gpuva_op allocations to folio_scratchpad
config: alpha-allmodconfig (https://download.01.org/0day-ci/archive/20260818/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260818/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/drm_gpuvm.c: In function 'drm_gpuvm_init':
>> drivers/gpu/drm/drm_gpuvm.c:1113:36: error: 'gpuvm_scratchpad_key' undeclared (first use in this function)
    1113 |                                   &gpuvm_scratchpad_key);
         |                                    ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_gpuvm.c:1113:36: note: each undeclared identifier is reported only once for each function it appears in


vim +/gpuvm_scratchpad_key +1113 drivers/gpu/drm/drm_gpuvm.c

  1074	
  1075	/**
  1076	 * drm_gpuvm_init() - initialize a &drm_gpuvm
  1077	 * @gpuvm: pointer to the &drm_gpuvm to initialize
  1078	 * @name: the name of the GPU VA space
  1079	 * @flags: the &drm_gpuvm_flags for this GPUVM
  1080	 * @drm: the &drm_device this VM resides in
  1081	 * @r_obj: the resv &drm_gem_object providing the GPUVM's common &dma_resv
  1082	 * @start_offset: the start offset of the GPU VA space
  1083	 * @range: the size of the GPU VA space
  1084	 * @reserve_offset: the start of the kernel reserved GPU VA area
  1085	 * @reserve_range: the size of the kernel reserved GPU VA area
  1086	 * @ops: &drm_gpuvm_ops called on &drm_gpuvm_sm_map / &drm_gpuvm_sm_unmap
  1087	 *
  1088	 * The &drm_gpuvm must be initialized with this function before use.
  1089	 *
  1090	 * Note that @gpuvm must be cleared to 0 before calling this function. The given
  1091	 * &name is expected to be managed by the surrounding driver structures.
  1092	 */
  1093	void
  1094	drm_gpuvm_init(struct drm_gpuvm *gpuvm, const char *name,
  1095		       enum drm_gpuvm_flags flags,
  1096		       struct drm_device *drm,
  1097		       struct drm_gem_object *r_obj,
  1098		       u64 start_offset, u64 range,
  1099		       u64 reserve_offset, u64 reserve_range,
  1100		       const struct drm_gpuvm_ops *ops)
  1101	{
  1102		gpuvm->rb.tree = RB_ROOT_CACHED;
  1103		INIT_LIST_HEAD(&gpuvm->rb.list);
  1104	
  1105		INIT_LIST_HEAD(&gpuvm->extobj.list);
  1106		spin_lock_init(&gpuvm->extobj.lock);
  1107	
  1108		INIT_LIST_HEAD(&gpuvm->evict.list);
  1109		spin_lock_init(&gpuvm->evict.lock);
  1110	
  1111		init_llist_head(&gpuvm->bo_defer);
  1112		folio_scratchpad_init_key(&gpuvm->va_scratchpad, get_order(SZ_64K),
> 1113					  &gpuvm_scratchpad_key);
  1114	
  1115		kref_init(&gpuvm->kref);
  1116	
  1117		gpuvm->name = name ? name : "unknown";
  1118		gpuvm->flags = flags;
  1119		gpuvm->ops = ops;
  1120		gpuvm->drm = drm;
  1121		gpuvm->r_obj = r_obj;
  1122	
  1123		drm_dev_get(drm);
  1124		drm_gem_object_get(r_obj);
  1125	
  1126		drm_gpuvm_warn_check_overflow(gpuvm, start_offset, range);
  1127		gpuvm->mm_start = start_offset;
  1128		gpuvm->mm_range = range;
  1129	
  1130		memset(&gpuvm->kernel_alloc_node, 0, sizeof(struct drm_gpuva));
  1131		if (reserve_range) {
  1132			gpuvm->kernel_alloc_node.va.addr = reserve_offset;
  1133			gpuvm->kernel_alloc_node.va.range = reserve_range;
  1134	
  1135			if (likely(!drm_gpuvm_warn_check_overflow(gpuvm, reserve_offset,
  1136								  reserve_range)))
  1137				__drm_gpuva_insert(gpuvm, &gpuvm->kernel_alloc_node);
  1138		}
  1139	}
  1140	EXPORT_SYMBOL_GPL(drm_gpuvm_init);
  1141	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.