tree:
git://people.freedesktop.org/~thomash/linux topic/ttm_rebased
head: 21fce66d6d391244c310bd760d4fc35b7ed8c70f
commit: c807845af4e34522dcd176904759f597bc6c75cf [10/13] drm/i915/ttm: Introduce a TTM
i915 gem object backend
config: x86_64-randconfig-a005-20210607 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
ae973380c5f6be77ce395022be40350942260be9)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add thomash
git://people.freedesktop.org/~thomash/linux
git fetch --no-tags thomash topic/ttm_rebased
git checkout c807845af4e34522dcd176904759f597bc6c75cf
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:272:58: error: no member
named 'mm_node' in 'struct ttm_resource'
return
intel_region_ttm_node_to_st(obj->mm.region, res->mm_node);
~~~ ^
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:309:25: error:
incompatible pointer types passing 'struct ttm_resource *' to parameter of type
'struct ttm_resource **'; take the address with &
[-Werror,-Wincompatible-pointer-types]
ttm_resource_free(bo,
dst_mem);
^~~~~~~
&
include/drm/ttm/ttm_resource.h:268:76: note: passing argument to parameter
'res' here
void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource **res);
^
2 errors generated.
vim +272 drivers/gpu/drm/i915/gem/i915_gem_ttm.c
260
261 static struct sg_table *
262 i915_ttm_resource_get_st(struct drm_i915_gem_object *obj,
263 struct ttm_resource *res)
264 {
265 struct ttm_buffer_object *bo = i915_gem_to_ttm(obj);
266 struct ttm_resource_manager *man =
267 ttm_manager_type(bo->bdev, res->mem_type);
268
269 if (man->use_tt)
270 return i915_ttm_tt_get_st(bo->ttm);
271
272 return intel_region_ttm_node_to_st(obj->mm.region,
res->mm_node);
273 }
274
275 static int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
276 struct ttm_operation_ctx *ctx,
277 struct ttm_resource *dst_mem,
278 struct ttm_place *hop)
279 {
280 struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
281 struct ttm_resource_manager *dst_man =
282 ttm_manager_type(bo->bdev, dst_mem->mem_type);
283 struct ttm_resource_manager *src_man =
284 ttm_manager_type(bo->bdev, bo->resource->mem_type);
285 struct intel_memory_region *dst_reg, *src_reg;
286 union {
287 struct ttm_kmap_iter_tt tt;
288 struct ttm_kmap_iter_iomap io;
289 } _dst_iter, _src_iter;
290 struct ttm_kmap_iter *dst_iter, *src_iter;
291 struct sg_table *dst_st;
292 int ret;
293
294 dst_reg = i915_ttm_region(bo->bdev, dst_mem->mem_type);
295 src_reg = i915_ttm_region(bo->bdev, bo->resource->mem_type);
296 GEM_BUG_ON(!dst_reg || !src_reg);
297
298 /* Sync for now. We could do the actual copy async. */
299 ret = ttm_bo_wait_ctx(bo, ctx);
300 if (ret)
301 return ret;
302
303 ret = i915_ttm_move_notify(bo);
304 if (ret)
305 return ret;
306
307 if (obj->mm.madv != I915_MADV_WILLNEED) {
308 i915_ttm_purge(obj);
309 ttm_resource_free(bo, dst_mem);
310 return 0;
311 }
312
313 /* Populate ttm with pages if needed. Typically system memory. */
314 if (bo->ttm && (dst_man->use_tt ||
315 (bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED))) {
316 ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
317 if (ret)
318 return ret;
319 }
320
321 dst_st = i915_ttm_resource_get_st(obj, dst_mem);
322 if (IS_ERR(dst_st))
323 return PTR_ERR(dst_st);
324
325 /* If we start mapping GGTT, we can no longer use man::use_tt here. */
326 dst_iter = dst_man->use_tt ?
327 ttm_kmap_iter_tt_init(&_dst_iter.tt, bo->ttm) :
328 ttm_kmap_iter_iomap_init(&_dst_iter.io, &dst_reg->iomap,
329 dst_st, dst_reg->region.start);
330
331 src_iter = src_man->use_tt ?
332 ttm_kmap_iter_tt_init(&_src_iter.tt, bo->ttm) :
333 ttm_kmap_iter_iomap_init(&_src_iter.io, &src_reg->iomap,
334 obj->ttm.cached_io_st,
335 src_reg->region.start);
336
337 ttm_move_memcpy(bo, dst_mem->num_pages, dst_iter, src_iter);
338 ttm_bo_move_sync_cleanup(bo, dst_mem);
339 i915_ttm_free_cached_io_st(obj);
340
341 if (!dst_man->use_tt)
342 obj->ttm.cached_io_st = dst_st;
343
344 return 0;
345 }
346
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org