tree:
https://github.com/Freescale/linux-fslc pr/257
head: 5df3672236fb7ca1b04a8e8fa65bf039400b5020
commit: 0cbc4419bd2f810d1689d81f24884bb527bbe5fd [15408/17025] MGS-4929 [#imx-2382] enable
vivante drm for linux build
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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
#
https://github.com/Freescale/linux-fslc/commit/0cbc4419bd2f810d1689d81f24...
git remote add freescale-fslc
https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/257
git checkout 0cbc4419bd2f810d1689d81f24884bb527bbe5fd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
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 >>):
cc1: error: arch/arm/mm: No such file or directory [-Werror=missing-include-dirs]
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:79:17: error: no previous
prototype for 'viv_gem_prime_export' [-Werror=missing-prototypes]
79 |
struct dma_buf *viv_gem_prime_export(struct drm_gem_object *gem_obj,
| ^~~~~~~~~~~~~~~~~~~~
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:103:24: error: no previous
prototype for 'viv_gem_prime_import' [-Werror=missing-prototypes]
103 |
struct drm_gem_object *viv_gem_prime_import(struct drm_device *drm,
| ^~~~~~~~~~~~~~~~~~~~
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:145:6: error: no previous
prototype for 'viv_gem_free_object' [-Werror=missing-prototypes]
145 |
void viv_gem_free_object(struct drm_gem_object *gem_obj)
| ^~~~~~~~~~~~~~~~~~~
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c: In function
'viv_ioctl_gem_create':
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:166:9: error: variable
'ret' set but not used [-Werror=unused-but-set-variable]
166 | int
ret = 0;
| ^~~
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c: At top level:
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:739:5: error: no previous
prototype for 'viv_drm_open' [-Werror=missing-prototypes]
739 | int
viv_drm_open(struct drm_device *drm, struct drm_file *file)
| ^~~~~~~~~~~~
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:759:6: error: no previous
prototype for 'viv_drm_postclose' [-Werror=missing-prototypes]
759 |
void viv_drm_postclose(struct drm_device *drm, struct drm_file *file)
| ^~~~~~~~~~~~~~~~~
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:814:5: error: no previous
prototype for 'viv_drm_probe' [-Werror=missing-prototypes]
814 | int
viv_drm_probe(struct device *dev)
| ^~~~~~~~~~~~~
>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c:856:5: error: no previous
prototype for 'viv_drm_remove' [-Werror=missing-prototypes]
856 | int
viv_drm_remove(struct device *dev)
| ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/viv_gem_prime_export +79
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_drm.c
30638182fdab7c Xianzhong 2019-01-29 77
9821cda5105e7d Richard Liu 2019-12-25 78 #if LINUX_VERSION_CODE >=
KERNEL_VERSION(5,4,0)
9821cda5105e7d Richard Liu 2019-12-25 @79 struct dma_buf *viv_gem_prime_export(struct
drm_gem_object *gem_obj,
9821cda5105e7d Richard Liu 2019-12-25 80 int flags)
9821cda5105e7d Richard Liu 2019-12-25 81 {
9821cda5105e7d Richard Liu 2019-12-25 82 struct drm_device *drm =
gem_obj->dev;
9821cda5105e7d Richard Liu 2019-12-25 83 #else
30638182fdab7c Xianzhong 2019-01-29 84 struct dma_buf *viv_gem_prime_export(struct
drm_device *drm,
30638182fdab7c Xianzhong 2019-01-29 85 struct drm_gem_object
*gem_obj,
30638182fdab7c Xianzhong 2019-01-29 86 int flags)
30638182fdab7c Xianzhong 2019-01-29 87 {
9821cda5105e7d Richard Liu 2019-12-25 88 #endif
30638182fdab7c Xianzhong 2019-01-29 89 struct viv_gem_object *viv_obj =
container_of(gem_obj, struct viv_gem_object, base);
30638182fdab7c Xianzhong 2019-01-29 90 struct dma_buf *dmabuf = gcvNULL;
30638182fdab7c Xianzhong 2019-01-29 91 gckGALDEVICE gal_dev =
(gckGALDEVICE)drm->dev_private;
30638182fdab7c Xianzhong 2019-01-29 92
30638182fdab7c Xianzhong 2019-01-29 93 if (gal_dev)
30638182fdab7c Xianzhong 2019-01-29 94 {
30638182fdab7c Xianzhong 2019-01-29 95 gckKERNEL kernel =
gal_dev->device->map[gal_dev->device->defaultHwType].kernels[0];
e9371a70921300 Minjie Zhuang 2019-09-23 96
gcmkVERIFY_OK(gckVIDMEM_NODE_Export(kernel, viv_obj->node_object, flags,
30638182fdab7c Xianzhong 2019-01-29 97
(gctPOINTER*)&dmabuf, gcvNULL));
30638182fdab7c Xianzhong 2019-01-29 98 }
30638182fdab7c Xianzhong 2019-01-29 99
30638182fdab7c Xianzhong 2019-01-29 100 return dmabuf;
30638182fdab7c Xianzhong 2019-01-29 101 }
30638182fdab7c Xianzhong 2019-01-29 102
30638182fdab7c Xianzhong 2019-01-29 @103 struct drm_gem_object
*viv_gem_prime_import(struct drm_device *drm,
30638182fdab7c Xianzhong 2019-01-29 104
struct dma_buf *dmabuf)
30638182fdab7c Xianzhong 2019-01-29 105 {
30638182fdab7c Xianzhong 2019-01-29 106 struct drm_gem_object *gem_obj =
gcvNULL;
30638182fdab7c Xianzhong 2019-01-29 107 struct viv_gem_object *viv_obj;
30638182fdab7c Xianzhong 2019-01-29 108
30638182fdab7c Xianzhong 2019-01-29 109 gcsHAL_INTERFACE iface;
30638182fdab7c Xianzhong 2019-01-29 110 gckGALDEVICE gal_dev;
30638182fdab7c Xianzhong 2019-01-29 111 gckKERNEL kernel;
30638182fdab7c Xianzhong 2019-01-29 112 gctUINT32 processID;
30638182fdab7c Xianzhong 2019-01-29 113 gckVIDMEM_NODE nodeObject;
30638182fdab7c Xianzhong 2019-01-29 114 gceSTATUS status = gcvSTATUS_OK;
30638182fdab7c Xianzhong 2019-01-29 115
30638182fdab7c Xianzhong 2019-01-29 116 gal_dev =
(gckGALDEVICE)drm->dev_private;
30638182fdab7c Xianzhong 2019-01-29 117 if (!gal_dev)
30638182fdab7c Xianzhong 2019-01-29 118 {
30638182fdab7c Xianzhong 2019-01-29 119
gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT);
30638182fdab7c Xianzhong 2019-01-29 120 }
30638182fdab7c Xianzhong 2019-01-29 121
30638182fdab7c Xianzhong 2019-01-29 122 gckOS_ZeroMemory(&iface,
sizeof(iface));
30638182fdab7c Xianzhong 2019-01-29 123 iface.command =
gcvHAL_WRAP_USER_MEMORY;
30638182fdab7c Xianzhong 2019-01-29 124 iface.hardwareType =
gal_dev->device->defaultHwType;
30638182fdab7c Xianzhong 2019-01-29 125 iface.u.WrapUserMemory.desc.flag =
gcvALLOC_FLAG_DMABUF;
30638182fdab7c Xianzhong 2019-01-29 126 iface.u.WrapUserMemory.desc.handle =
-1;
30638182fdab7c Xianzhong 2019-01-29 127 iface.u.WrapUserMemory.desc.dmabuf =
gcmPTR_TO_UINT64(dmabuf);
30638182fdab7c Xianzhong 2019-01-29 128
gcmkONERROR(gckDEVICE_Dispatch(gal_dev->device, &iface));
30638182fdab7c Xianzhong 2019-01-29 129
30638182fdab7c Xianzhong 2019-01-29 130 kernel =
gal_dev->device->map[gal_dev->device->defaultHwType].kernels[0];
30638182fdab7c Xianzhong 2019-01-29 131
gcmkONERROR(gckOS_GetProcessID(&processID));
30638182fdab7c Xianzhong 2019-01-29 132
gcmkONERROR(gckVIDMEM_HANDLE_Lookup(kernel, processID, iface.u.WrapUserMemory.node,
&nodeObject));
30638182fdab7c Xianzhong 2019-01-29 133
30638182fdab7c Xianzhong 2019-01-29 134 /* ioctl output */
30638182fdab7c Xianzhong 2019-01-29 135 gem_obj = kzalloc(sizeof(struct
viv_gem_object), GFP_KERNEL);
30638182fdab7c Xianzhong 2019-01-29 136 drm_gem_private_object_init(drm,
gem_obj, dmabuf->size);
30638182fdab7c Xianzhong 2019-01-29 137 viv_obj = container_of(gem_obj, struct
viv_gem_object, base);
30638182fdab7c Xianzhong 2019-01-29 138 viv_obj->node_handle =
iface.u.WrapUserMemory.node;
30638182fdab7c Xianzhong 2019-01-29 139 viv_obj->node_object = nodeObject;
30638182fdab7c Xianzhong 2019-01-29 140
30638182fdab7c Xianzhong 2019-01-29 141 OnError:
30638182fdab7c Xianzhong 2019-01-29 142 return gem_obj;
30638182fdab7c Xianzhong 2019-01-29 143 }
30638182fdab7c Xianzhong 2019-01-29 144
30638182fdab7c Xianzhong 2019-01-29 @145 void viv_gem_free_object(struct
drm_gem_object *gem_obj)
30638182fdab7c Xianzhong 2019-01-29 146 {
30638182fdab7c Xianzhong 2019-01-29 147 struct viv_gem_object *viv_obj =
container_of(gem_obj, struct viv_gem_object, base);
30638182fdab7c Xianzhong 2019-01-29 148 struct drm_device *drm =
gem_obj->dev;
30638182fdab7c Xianzhong 2019-01-29 149
30638182fdab7c Xianzhong 2019-01-29 150 gcsHAL_INTERFACE iface;
30638182fdab7c Xianzhong 2019-01-29 151 gckGALDEVICE gal_dev =
(gckGALDEVICE)drm->dev_private;
30638182fdab7c Xianzhong 2019-01-29 152
30638182fdab7c Xianzhong 2019-01-29 153 gckOS_ZeroMemory(&iface,
sizeof(iface));
30638182fdab7c Xianzhong 2019-01-29 154 iface.command =
gcvHAL_RELEASE_VIDEO_MEMORY;
30638182fdab7c Xianzhong 2019-01-29 155 iface.hardwareType =
gal_dev->device->defaultHwType;
30638182fdab7c Xianzhong 2019-01-29 156 iface.u.ReleaseVideoMemory.node =
viv_obj->node_handle;
30638182fdab7c Xianzhong 2019-01-29 157
gcmkVERIFY_OK(gckDEVICE_Dispatch(gal_dev->device, &iface));
30638182fdab7c Xianzhong 2019-01-29 158
30638182fdab7c Xianzhong 2019-01-29 159 drm_gem_object_release(gem_obj);
30638182fdab7c Xianzhong 2019-01-29 160 kfree(gem_obj);
30638182fdab7c Xianzhong 2019-01-29 161 }
30638182fdab7c Xianzhong 2019-01-29 162
30638182fdab7c Xianzhong 2019-01-29 163 static int viv_ioctl_gem_create(struct
drm_device *drm, void *data,
30638182fdab7c Xianzhong 2019-01-29 164 struct
drm_file *file)
30638182fdab7c Xianzhong 2019-01-29 165 {
30638182fdab7c Xianzhong 2019-01-29 @166 int ret = 0;
30638182fdab7c Xianzhong 2019-01-29 167 struct drm_viv_gem_create *args =
(struct drm_viv_gem_create*)data;
30638182fdab7c Xianzhong 2019-01-29 168 struct drm_gem_object *gem_obj =
gcvNULL;
30638182fdab7c Xianzhong 2019-01-29 169 struct viv_gem_object *viv_obj =
gcvNULL;
30638182fdab7c Xianzhong 2019-01-29 170
30638182fdab7c Xianzhong 2019-01-29 171 gcsHAL_INTERFACE iface;
30638182fdab7c Xianzhong 2019-01-29 172 gckGALDEVICE gal_dev;
30638182fdab7c Xianzhong 2019-01-29 173 gckKERNEL kernel;
30638182fdab7c Xianzhong 2019-01-29 174 gctUINT32 processID;
30638182fdab7c Xianzhong 2019-01-29 175 gckVIDMEM_NODE nodeObject;
30638182fdab7c Xianzhong 2019-01-29 176 gctUINT32 flags =
gcvALLOC_FLAG_DMABUF_EXPORTABLE;
30638182fdab7c Xianzhong 2019-01-29 177 gceSTATUS status = gcvSTATUS_OK;
e9371a70921300 Minjie Zhuang 2019-09-23 178 gctUINT64 alignSize =
PAGE_ALIGN(args->size);
30638182fdab7c Xianzhong 2019-01-29 179
30638182fdab7c Xianzhong 2019-01-29 180 gal_dev =
(gckGALDEVICE)drm->dev_private;
30638182fdab7c Xianzhong 2019-01-29 181 if (!gal_dev)
30638182fdab7c Xianzhong 2019-01-29 182 {
30638182fdab7c Xianzhong 2019-01-29 183
gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT);
30638182fdab7c Xianzhong 2019-01-29 184 }
30638182fdab7c Xianzhong 2019-01-29 185
30638182fdab7c Xianzhong 2019-01-29 186 if (args->flags &
DRM_VIV_GEM_CONTIGUOUS)
30638182fdab7c Xianzhong 2019-01-29 187 {
30638182fdab7c Xianzhong 2019-01-29 188 flags |= gcvALLOC_FLAG_CONTIGUOUS;
30638182fdab7c Xianzhong 2019-01-29 189 }
30638182fdab7c Xianzhong 2019-01-29 190 if (args->flags &
DRM_VIV_GEM_CACHED)
30638182fdab7c Xianzhong 2019-01-29 191 {
30638182fdab7c Xianzhong 2019-01-29 192 flags |= gcvALLOC_FLAG_CACHEABLE;
30638182fdab7c Xianzhong 2019-01-29 193 }
30638182fdab7c Xianzhong 2019-01-29 194 if (args->flags &
DRM_VIV_GEM_SECURE)
30638182fdab7c Xianzhong 2019-01-29 195 {
30638182fdab7c Xianzhong 2019-01-29 196 flags |= gcvALLOC_FLAG_SECURITY;
30638182fdab7c Xianzhong 2019-01-29 197 }
30638182fdab7c Xianzhong 2019-01-29 198 if (args->flags &
DRM_VIV_GEM_CMA_LIMIT)
30638182fdab7c Xianzhong 2019-01-29 199 {
30638182fdab7c Xianzhong 2019-01-29 200 flags |= gcvALLOC_FLAG_CMA_LIMIT;
30638182fdab7c Xianzhong 2019-01-29 201 }
30638182fdab7c Xianzhong 2019-01-29 202
30638182fdab7c Xianzhong 2019-01-29 203 gckOS_ZeroMemory(&iface,
sizeof(iface));
30638182fdab7c Xianzhong 2019-01-29 204 iface.command =
gcvHAL_ALLOCATE_LINEAR_VIDEO_MEMORY;
30638182fdab7c Xianzhong 2019-01-29 205 iface.hardwareType =
gal_dev->device->defaultHwType;
e9371a70921300 Minjie Zhuang 2019-09-23 206 iface.u.AllocateLinearVideoMemory.bytes
= alignSize;
30638182fdab7c Xianzhong 2019-01-29 207
iface.u.AllocateLinearVideoMemory.alignment = 256;
e9371a70921300 Minjie Zhuang 2019-09-23 208 iface.u.AllocateLinearVideoMemory.type =
gcvVIDMEM_TYPE_GENERIC;
30638182fdab7c Xianzhong 2019-01-29 209 iface.u.AllocateLinearVideoMemory.flag =
flags;
e9371a70921300 Minjie Zhuang 2019-09-23 210 iface.u.AllocateLinearVideoMemory.pool =
gcvPOOL_DEFAULT;
30638182fdab7c Xianzhong 2019-01-29 211
gcmkONERROR(gckDEVICE_Dispatch(gal_dev->device, &iface));
30638182fdab7c Xianzhong 2019-01-29 212
30638182fdab7c Xianzhong 2019-01-29 213 kernel =
gal_dev->device->map[gal_dev->device->defaultHwType].kernels[0];
30638182fdab7c Xianzhong 2019-01-29 214
gcmkONERROR(gckOS_GetProcessID(&processID));
30638182fdab7c Xianzhong 2019-01-29 215
gcmkONERROR(gckVIDMEM_HANDLE_Lookup(kernel, processID,
iface.u.AllocateLinearVideoMemory.node, &nodeObject));
30638182fdab7c Xianzhong 2019-01-29 216
30638182fdab7c Xianzhong 2019-01-29 217 /* ioctl output */
30638182fdab7c Xianzhong 2019-01-29 218 gem_obj = kzalloc(sizeof(struct
viv_gem_object), GFP_KERNEL);
e9371a70921300 Minjie Zhuang 2019-09-23 219 drm_gem_private_object_init(drm,
gem_obj, (size_t)alignSize);
30638182fdab7c Xianzhong 2019-01-29 220 ret = drm_gem_handle_create(file,
gem_obj, &args->handle);
30638182fdab7c Xianzhong 2019-01-29 221
30638182fdab7c Xianzhong 2019-01-29 222 viv_obj = container_of(gem_obj, struct
viv_gem_object, base);
30638182fdab7c Xianzhong 2019-01-29 223 viv_obj->node_handle =
iface.u.AllocateLinearVideoMemory.node;
30638182fdab7c Xianzhong 2019-01-29 224 viv_obj->node_object = nodeObject;
30638182fdab7c Xianzhong 2019-01-29 225 viv_obj->cacheable = flags &
gcvALLOC_FLAG_CACHEABLE;
30638182fdab7c Xianzhong 2019-01-29 226
30638182fdab7c Xianzhong 2019-01-29 227 /* drop reference from allocate - handle
holds it now */
30638182fdab7c Xianzhong 2019-01-29 228
drm_gem_object_unreference_unlocked(gem_obj);
30638182fdab7c Xianzhong 2019-01-29 229
30638182fdab7c Xianzhong 2019-01-29 230 OnError:
30638182fdab7c Xianzhong 2019-01-29 231 return gcmIS_ERROR(status) ? -ENOTTY :
0;
30638182fdab7c Xianzhong 2019-01-29 232 }
30638182fdab7c Xianzhong 2019-01-29 233
:::::: The code at line 79 was first introduced by commit
:::::: 9821cda5105e7d6bf026a4f21f927745a3f6b931 MA-16168 [#imx-1903] Fix GPU driver build
error and not work issue on 5.4 kernel
:::::: TO: Richard Liu <xuegang.liu(a)nxp.com>
:::::: CC: Xianzhong <xianzhong.li(a)nxp.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org