Re: [PATCH] drm/i915: Flush all user surfaces prior to first use

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

 



Hi Chris,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on next-20190719]
[cannot apply to v5.2]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-i915-Flush-all-user-surfaces-prior-to-first-use/20190718-191329
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-b002-201928 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All errors (new ones prefixed by >>):

   drivers/gpu/drm/i915/gem/i915_gem_shmem.c: In function 'i915_gem_object_create_shmem':
>> drivers/gpu/drm/i915/gem/i915_gem_shmem.c:462:15: error: unused variable 'cache_level' [-Werror=unused-variable]
     unsigned int cache_level;
                  ^~~~~~~~~~~
   cc1: all warnings being treated as errors

vim +/cache_level +462 drivers/gpu/drm/i915/gem/i915_gem_shmem.c

8475355f Chris Wilson 2019-05-28  456  
8475355f Chris Wilson 2019-05-28  457  struct drm_i915_gem_object *
8475355f Chris Wilson 2019-05-28  458  i915_gem_object_create_shmem(struct drm_i915_private *i915, u64 size)
8475355f Chris Wilson 2019-05-28  459  {
8475355f Chris Wilson 2019-05-28  460  	struct drm_i915_gem_object *obj;
8475355f Chris Wilson 2019-05-28  461  	struct address_space *mapping;
8475355f Chris Wilson 2019-05-28 @462  	unsigned int cache_level;
8475355f Chris Wilson 2019-05-28  463  	gfp_t mask;
8475355f Chris Wilson 2019-05-28  464  	int ret;
8475355f Chris Wilson 2019-05-28  465  
8475355f Chris Wilson 2019-05-28  466  	/* There is a prevalence of the assumption that we fit the object's
8475355f Chris Wilson 2019-05-28  467  	 * page count inside a 32bit _signed_ variable. Let's document this and
8475355f Chris Wilson 2019-05-28  468  	 * catch if we ever need to fix it. In the meantime, if you do spot
8475355f Chris Wilson 2019-05-28  469  	 * such a local variable, please consider fixing!
8475355f Chris Wilson 2019-05-28  470  	 */
8475355f Chris Wilson 2019-05-28  471  	if (size >> PAGE_SHIFT > INT_MAX)
8475355f Chris Wilson 2019-05-28  472  		return ERR_PTR(-E2BIG);
8475355f Chris Wilson 2019-05-28  473  
8475355f Chris Wilson 2019-05-28  474  	if (overflows_type(size, obj->base.size))
8475355f Chris Wilson 2019-05-28  475  		return ERR_PTR(-E2BIG);
8475355f Chris Wilson 2019-05-28  476  
8475355f Chris Wilson 2019-05-28  477  	obj = i915_gem_object_alloc();
8475355f Chris Wilson 2019-05-28  478  	if (!obj)
8475355f Chris Wilson 2019-05-28  479  		return ERR_PTR(-ENOMEM);
8475355f Chris Wilson 2019-05-28  480  
8475355f Chris Wilson 2019-05-28  481  	ret = create_shmem(i915, &obj->base, size);
8475355f Chris Wilson 2019-05-28  482  	if (ret)
8475355f Chris Wilson 2019-05-28  483  		goto fail;
8475355f Chris Wilson 2019-05-28  484  
8475355f Chris Wilson 2019-05-28  485  	mask = GFP_HIGHUSER | __GFP_RECLAIMABLE;
8475355f Chris Wilson 2019-05-28  486  	if (IS_I965GM(i915) || IS_I965G(i915)) {
8475355f Chris Wilson 2019-05-28  487  		/* 965gm cannot relocate objects above 4GiB. */
8475355f Chris Wilson 2019-05-28  488  		mask &= ~__GFP_HIGHMEM;
8475355f Chris Wilson 2019-05-28  489  		mask |= __GFP_DMA32;
8475355f Chris Wilson 2019-05-28  490  	}
8475355f Chris Wilson 2019-05-28  491  
8475355f Chris Wilson 2019-05-28  492  	mapping = obj->base.filp->f_mapping;
8475355f Chris Wilson 2019-05-28  493  	mapping_set_gfp_mask(mapping, mask);
8475355f Chris Wilson 2019-05-28  494  	GEM_BUG_ON(!(mapping_gfp_mask(mapping) & __GFP_RECLAIM));
8475355f Chris Wilson 2019-05-28  495  
8475355f Chris Wilson 2019-05-28  496  	i915_gem_object_init(obj, &i915_gem_shmem_ops);
8475355f Chris Wilson 2019-05-28  497  
8475355f Chris Wilson 2019-05-28  498  	obj->write_domain = I915_GEM_DOMAIN_CPU;
8475355f Chris Wilson 2019-05-28  499  	obj->read_domains = I915_GEM_DOMAIN_CPU;
8475355f Chris Wilson 2019-05-28  500  
fb172dbb Chris Wilson 2019-07-18  501  	/*
fb172dbb Chris Wilson 2019-07-18  502  	 * Note that userspace has control over cache-bypass
fb172dbb Chris Wilson 2019-07-18  503  	 * via its command stream, so even on LLC architectures
fb172dbb Chris Wilson 2019-07-18  504  	 * we have to flush out the CPU cache to memory to
fb172dbb Chris Wilson 2019-07-18  505  	 * clear previous contents.
8475355f Chris Wilson 2019-05-28  506  	 */
fb172dbb Chris Wilson 2019-07-18  507  	i915_gem_object_set_cache_coherency(obj, I915_CACHE_NONE);
8475355f Chris Wilson 2019-05-28  508  
8475355f Chris Wilson 2019-05-28  509  	trace_i915_gem_object_create(obj);
8475355f Chris Wilson 2019-05-28  510  
8475355f Chris Wilson 2019-05-28  511  	return obj;
8475355f Chris Wilson 2019-05-28  512  
8475355f Chris Wilson 2019-05-28  513  fail:
8475355f Chris Wilson 2019-05-28  514  	i915_gem_object_free(obj);
8475355f Chris Wilson 2019-05-28  515  	return ERR_PTR(ret);
8475355f Chris Wilson 2019-05-28  516  }
8475355f Chris Wilson 2019-05-28  517  

:::::: The code at line 462 was first introduced by commit
:::::: 8475355f7a2645a022288301c03555c31fb4de17 drm/i915: Move shmem object setup to its own file

:::::: TO: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
:::::: CC: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux