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: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
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
make W=1 ARCH=i386
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: In function
'i915_ttm_resource_get_st':
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:272:56: error:
'struct ttm_resource' has no member named 'mm_node'
272 |
return intel_region_ttm_node_to_st(obj->mm.region, res->mm_node);
| ^~
drivers/gpu/drm/i915/gem/i915_gem_ttm.c: In function 'i915_ttm_move':
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:309:25: error: passing
argument 2 of 'ttm_resource_free' from incompatible pointer type
[-Werror=incompatible-pointer-types]
309 | ttm_resource_free(bo, dst_mem);
| ^~~~~~~
| |
| struct ttm_resource *
In file included from include/drm/ttm/ttm_device.h:30,
from include/drm/ttm/ttm_bo_driver.h:40,
from drivers/gpu/drm/i915/gem/i915_gem_ttm.c:6:
include/drm/ttm/ttm_resource.h:268:76: note: expected 'struct ttm_resource **'
but argument is of type 'struct ttm_resource *'
268 | void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource
**res);
| ~~~~~~~~~~~~~~~~~~~~~~^~~
drivers/gpu/drm/i915/gem/i915_gem_ttm.c: In function
'i915_ttm_resource_get_st':
drivers/gpu/drm/i915/gem/i915_gem_ttm.c:273:1: error: control reaches end of non-void
function [-Werror=return-type]
273 | }
| ^
cc1: all warnings being treated as errors
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