[PATCH v2 2/2] drm/lima: driver for ARM Mali4xx GPUs

kbuild test robot lkp at intel.com
Mon Feb 25 17:40:25 UTC 2019


Hi Qiang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.0-rc8 next-20190225]
[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/Qiang-Yu/drm-export-drm_timeout_abs_to_jiffies/20190226-010350
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=m68k 

All error/warnings (new ones prefixed by >>):

   In file included from drivers/gpu//drm/lima/lima_object.c:8:
   drivers/gpu//drm/lima/lima_object.h:31:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
              struct reservation_object *resv);
                     ^~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/lima/lima_object.c: In function 'lima_bo_destroy':
>> drivers/gpu//drm/lima/lima_object.c:14:4: error: implicit declaration of function 'kfree'; did you mean 'vfree'? [-Werror=implicit-function-declaration]
       kfree(bo->pages);
       ^~~~~
       vfree
   drivers/gpu//drm/lima/lima_object.c: At top level:
   drivers/gpu//drm/lima/lima_object.c:42:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
              struct reservation_object *resv)
                     ^~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/lima/lima_object.c: In function 'lima_bo_create_struct':
>> drivers/gpu//drm/lima/lima_object.c:49:7: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration]
     bo = kzalloc(sizeof(*bo), GFP_KERNEL);
          ^~~~~~~
          vzalloc
   drivers/gpu//drm/lima/lima_object.c:49:5: warning: assignment to 'struct lima_bo *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     bo = kzalloc(sizeof(*bo), GFP_KERNEL);
        ^
   drivers/gpu//drm/lima/lima_object.c:55:10: error: 'struct drm_gem_object' has no member named 'resv'; did you mean 'dev'?
     bo->gem.resv = resv;
             ^~~~
             dev
   drivers/gpu//drm/lima/lima_object.c: At top level:
   drivers/gpu//drm/lima/lima_object.c:68:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
              struct reservation_object *resv)
                     ^~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/lima/lima_object.c:66:17: error: conflicting types for 'lima_bo_create'
    struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
                    ^~~~~~~~~~~~~~
   In file included from drivers/gpu//drm/lima/lima_object.c:8:
   drivers/gpu//drm/lima/lima_object.h:29:17: note: previous declaration of 'lima_bo_create' was here
    struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
                    ^~~~~~~~~~~~~~
   drivers/gpu//drm/lima/lima_object.c: In function 'lima_bo_create':
   drivers/gpu//drm/lima/lima_object.c:74:47: error: passing argument 4 of 'lima_bo_create_struct' from incompatible pointer type [-Werror=incompatible-pointer-types]
     bo = lima_bo_create_struct(dev, size, flags, resv);
                                                  ^~~~
   drivers/gpu//drm/lima/lima_object.c:42:38: note: expected 'struct reservation_object *' but argument is of type 'struct reservation_object *'
              struct reservation_object *resv)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>> drivers/gpu//drm/lima/lima_object.c:80:21: warning: assignment to 'dma_addr_t *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
     bo->pages_dma_addr = kzalloc(npages * sizeof(dma_addr_t), GFP_KERNEL);
                        ^
   drivers/gpu//drm/lima/lima_object.c:89:13: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      bo->pages = kzalloc(npages * sizeof(*bo->pages), GFP_KERNEL);
                ^
   cc1: some warnings being treated as errors

vim +80 drivers/gpu//drm/lima/lima_object.c

     7	
   > 8	#include "lima_object.h"
     9	
    10	void lima_bo_destroy(struct lima_bo *bo)
    11	{
    12	        if (bo->sgt) {
    13			if (bo->pages)
  > 14				kfree(bo->pages);
    15	
    16			drm_prime_gem_destroy(&bo->gem, bo->sgt);
    17		}
    18		else {
    19			if (bo->pages_dma_addr) {
    20				int i, npages = bo->gem.size >> PAGE_SHIFT;
    21	
    22				for (i = 0; i < npages; i++) {
    23					if (bo->pages_dma_addr[i])
    24						dma_unmap_page(bo->gem.dev->dev,
    25							       bo->pages_dma_addr[i],
    26							       PAGE_SIZE, DMA_BIDIRECTIONAL);
    27				}
    28			}
    29	
    30			if (bo->pages)
    31				drm_gem_put_pages(&bo->gem, bo->pages, true, true);
    32		}
    33	
    34		if (bo->pages_dma_addr)
    35			kfree(bo->pages_dma_addr);
    36	
    37		drm_gem_object_release(&bo->gem);
    38		kfree(bo);
    39	}
    40	
    41	static struct lima_bo *lima_bo_create_struct(struct lima_device *dev, u32 size, u32 flags,
    42						     struct reservation_object *resv)
    43	{
    44		struct lima_bo *bo;
    45		int err;
    46	
    47		size = PAGE_ALIGN(size);
    48	
  > 49		bo = kzalloc(sizeof(*bo), GFP_KERNEL);
    50		if (!bo)
    51			return ERR_PTR(-ENOMEM);
    52	
    53		mutex_init(&bo->lock);
    54		INIT_LIST_HEAD(&bo->va);
    55		bo->gem.resv = resv;
    56	
    57		err = drm_gem_object_init(dev->ddev, &bo->gem, size);
    58		if (err) {
    59			kfree(bo);
    60			return ERR_PTR(err);
    61		}
    62	
    63		return bo;
    64	}
    65	
    66	struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
    67				       u32 flags, struct sg_table *sgt,
    68				       struct reservation_object *resv)
    69	{
    70		int i, err;
    71		size_t npages;
    72		struct lima_bo *bo, *ret;
    73	
  > 74		bo = lima_bo_create_struct(dev, size, flags, resv);
    75		if (IS_ERR(bo))
    76			return bo;
    77	
    78		npages = bo->gem.size >> PAGE_SHIFT;
    79	
  > 80		bo->pages_dma_addr = kzalloc(npages * sizeof(dma_addr_t), GFP_KERNEL);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 48744 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190226/4c163f0d/attachment-0001.gz>


More information about the dri-devel mailing list