[PATCH 2/2] drm/tinydrm: Switch from CMA to shmem buffers

kbuild test robot lkp at intel.com
Wed Aug 29 10:52:53 UTC 2018


Hi Noralf,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc1 next-20180829]
[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/Noralf-Tr-nnes/drm-Add-shmem-GEM-library/20180828-222625
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/drm_gem_shmem_helper.c:347:31: sparse: expression using sizeof(void)
>> drivers/gpu/drm/drm_gem_shmem_helper.c:347:31: sparse: expression using sizeof(void)
   drivers/gpu/drm/drm_gem_shmem_helper.c:349:30: sparse: expression using sizeof(void)
   drivers/gpu/drm/drm_gem_shmem_helper.c:349:30: sparse: expression using sizeof(void)
   include/linux/mm.h:592:13: sparse: undefined identifier '__builtin_mul_overflow'
   include/linux/mm.h:592:13: sparse: call with no type!

vim +347 drivers/gpu/drm/drm_gem_shmem_helper.c

b37139d4 Noralf Trønnes 2018-08-28  319  
b37139d4 Noralf Trønnes 2018-08-28  320  /**
b37139d4 Noralf Trønnes 2018-08-28  321   * drm_gem_shmem_dumb_create - Create a dumb shmem buffer object
b37139d4 Noralf Trønnes 2018-08-28  322   * @file: DRM file structure to create the dumb buffer for
b37139d4 Noralf Trønnes 2018-08-28  323   * @dev: DRM device
b37139d4 Noralf Trønnes 2018-08-28  324   * @args: IOCTL data
b37139d4 Noralf Trønnes 2018-08-28  325   *
b37139d4 Noralf Trønnes 2018-08-28  326   * This function computes the pitch of the dumb buffer and rounds it up to an
b37139d4 Noralf Trønnes 2018-08-28  327   * integer number of bytes per pixel. Drivers for hardware that doesn't have
b37139d4 Noralf Trønnes 2018-08-28  328   * any additional restrictions on the pitch can directly use this function as
b37139d4 Noralf Trønnes 2018-08-28  329   * their &drm_driver.dumb_create callback.
b37139d4 Noralf Trønnes 2018-08-28  330   *
b37139d4 Noralf Trønnes 2018-08-28  331   * For hardware with additional restrictions, drivers can adjust the fields
b37139d4 Noralf Trønnes 2018-08-28  332   * set up by userspace before calling into this function.
b37139d4 Noralf Trønnes 2018-08-28  333   *
b37139d4 Noralf Trønnes 2018-08-28  334   * Returns:
b37139d4 Noralf Trønnes 2018-08-28  335   * 0 on success or a negative error code on failure.
b37139d4 Noralf Trønnes 2018-08-28  336   */
b37139d4 Noralf Trønnes 2018-08-28  337  int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev,
b37139d4 Noralf Trønnes 2018-08-28  338  			      struct drm_mode_create_dumb *args)
b37139d4 Noralf Trønnes 2018-08-28  339  {
b37139d4 Noralf Trønnes 2018-08-28  340  	struct drm_gem_shmem_object *shmem;
b37139d4 Noralf Trønnes 2018-08-28  341  
b37139d4 Noralf Trønnes 2018-08-28  342  	if (!args->pitch || !args->size) {
b37139d4 Noralf Trønnes 2018-08-28  343  		args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
b37139d4 Noralf Trønnes 2018-08-28  344  		args->size = args->pitch * args->height;
b37139d4 Noralf Trønnes 2018-08-28  345  	} else {
b37139d4 Noralf Trønnes 2018-08-28  346  		/* ensure sane minimum values */
b37139d4 Noralf Trønnes 2018-08-28 @347  		args->pitch = max(args->pitch,
b37139d4 Noralf Trønnes 2018-08-28  348  				  DIV_ROUND_UP(args->width * args->bpp, 8));
b37139d4 Noralf Trønnes 2018-08-28  349  		args->size = max_t(typeof(args->size), args->size,
b37139d4 Noralf Trønnes 2018-08-28  350  				   args->pitch * args->height);
b37139d4 Noralf Trønnes 2018-08-28  351  	}
b37139d4 Noralf Trønnes 2018-08-28  352  
b37139d4 Noralf Trønnes 2018-08-28  353  	shmem = drm_gem_shmem_create_with_handle(file, dev, args->size, &args->handle);
b37139d4 Noralf Trønnes 2018-08-28  354  
b37139d4 Noralf Trønnes 2018-08-28  355  	return PTR_ERR_OR_ZERO(shmem);
b37139d4 Noralf Trønnes 2018-08-28  356  }
b37139d4 Noralf Trønnes 2018-08-28  357  EXPORT_SYMBOL_GPL(drm_gem_shmem_dumb_create);
b37139d4 Noralf Trønnes 2018-08-28  358  

:::::: The code at line 347 was first introduced by commit
:::::: b37139d441f27615aee2a9ef35bb450086d8cf78 drm: Add library for shmem backed GEM objects

:::::: TO: Noralf Trønnes <noralf at tronnes.org>
:::::: CC: 0day robot <lkp at intel.com>

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


More information about the dri-devel mailing list