* [drm-tegra:for-next 30/32] drivers/gpu/drm/tegra/fbdev.c:103:29: error: implicit declaration of function 'vmap'; did you mean 'kmap'?
@ 2023-04-06 0:56 kernel test robot
2023-04-06 7:55 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-04-06 0:56 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: oe-kbuild-all, Thierry Reding
Hi Thomas,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://gitlab.freedesktop.org/drm/tegra for-next
head: e064bf8eeedb78439bed33990f93c7213294e005
commit: 914cfac73e230064656a42047a6f5546ee69a14f [30/32] drm/tegra: Hide fbdev support behind config option
config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20230406/202304060835.oYBkVjMC-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 12.1.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
git remote add drm-tegra https://gitlab.freedesktop.org/drm/tegra
git fetch --no-tags drm-tegra for-next
git checkout 914cfac73e230064656a42047a6f5546ee69a14f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/gpu/drm/tegra/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304060835.oYBkVjMC-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/gpu/drm/tegra/fbdev.c: In function 'tegra_fbdev_probe':
>> drivers/gpu/drm/tegra/fbdev.c:103:29: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
103 | bo->vaddr = vmap(bo->pages, bo->num_pages, VM_MAP,
| ^~~~
| kmap
>> drivers/gpu/drm/tegra/fbdev.c:103:60: error: 'VM_MAP' undeclared (first use in this function); did you mean 'VM_MTE'?
103 | bo->vaddr = vmap(bo->pages, bo->num_pages, VM_MAP,
| ^~~~~~
| VM_MTE
drivers/gpu/drm/tegra/fbdev.c:103:60: note: each undeclared identifier is reported only once for each function it appears in
drivers/gpu/drm/tegra/fbdev.c: In function 'tegra_fbdev_exit':
>> drivers/gpu/drm/tegra/fbdev.c:186:25: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
186 | vunmap(bo->vaddr);
| ^~~~~~
| kunmap
cc1: some warnings being treated as errors
vim +103 drivers/gpu/drm/tegra/fbdev.c
45
46 static int tegra_fbdev_probe(struct drm_fb_helper *helper,
47 struct drm_fb_helper_surface_size *sizes)
48 {
49 struct tegra_drm *tegra = helper->dev->dev_private;
50 struct drm_device *drm = helper->dev;
51 struct drm_mode_fb_cmd2 cmd = { 0 };
52 unsigned int bytes_per_pixel;
53 struct drm_framebuffer *fb;
54 unsigned long offset;
55 struct fb_info *info;
56 struct tegra_bo *bo;
57 size_t size;
58 int err;
59
60 bytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8);
61
62 cmd.width = sizes->surface_width;
63 cmd.height = sizes->surface_height;
64 cmd.pitches[0] = round_up(sizes->surface_width * bytes_per_pixel,
65 tegra->pitch_align);
66
67 cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
68 sizes->surface_depth);
69
70 size = cmd.pitches[0] * cmd.height;
71
72 bo = tegra_bo_create(drm, size, 0);
73 if (IS_ERR(bo))
74 return PTR_ERR(bo);
75
76 info = drm_fb_helper_alloc_info(helper);
77 if (IS_ERR(info)) {
78 dev_err(drm->dev, "failed to allocate framebuffer info\n");
79 drm_gem_object_put(&bo->gem);
80 return PTR_ERR(info);
81 }
82
83 fb = tegra_fb_alloc(drm, &cmd, &bo, 1);
84 if (IS_ERR(fb)) {
85 err = PTR_ERR(fb);
86 dev_err(drm->dev, "failed to allocate DRM framebuffer: %d\n",
87 err);
88 drm_gem_object_put(&bo->gem);
89 return PTR_ERR(fb);
90 }
91
92 helper->fb = fb;
93 helper->info = info;
94
95 info->fbops = &tegra_fb_ops;
96
97 drm_fb_helper_fill_info(info, helper, sizes);
98
99 offset = info->var.xoffset * bytes_per_pixel +
100 info->var.yoffset * fb->pitches[0];
101
102 if (bo->pages) {
> 103 bo->vaddr = vmap(bo->pages, bo->num_pages, VM_MAP,
104 pgprot_writecombine(PAGE_KERNEL));
105 if (!bo->vaddr) {
106 dev_err(drm->dev, "failed to vmap() framebuffer\n");
107 err = -ENOMEM;
108 goto destroy;
109 }
110 }
111
112 info->screen_base = (void __iomem *)bo->vaddr + offset;
113 info->screen_size = size;
114 info->fix.smem_start = (unsigned long)(bo->iova + offset);
115 info->fix.smem_len = size;
116
117 return 0;
118
119 destroy:
120 drm_framebuffer_remove(fb);
121 return err;
122 }
123
124 static const struct drm_fb_helper_funcs tegra_fb_helper_funcs = {
125 .fb_probe = tegra_fbdev_probe,
126 };
127
128 static struct drm_fb_helper *tegra_fbdev_create(struct drm_device *drm)
129 {
130 struct drm_fb_helper *helper;
131
132 helper = kzalloc(sizeof(*helper), GFP_KERNEL);
133 if (!helper)
134 return ERR_PTR(-ENOMEM);
135
136 drm_fb_helper_prepare(drm, helper, 32, &tegra_fb_helper_funcs);
137
138 return helper;
139 }
140
141 static void tegra_fbdev_free(struct drm_fb_helper *helper)
142 {
143 drm_fb_helper_unprepare(helper);
144 kfree(helper);
145 }
146
147 static int tegra_fbdev_init(struct drm_fb_helper *helper,
148 unsigned int num_crtc,
149 unsigned int max_connectors)
150 {
151 struct drm_device *drm = helper->dev;
152 int err;
153
154 err = drm_fb_helper_init(drm, helper);
155 if (err < 0) {
156 dev_err(drm->dev, "failed to initialize DRM FB helper: %d\n",
157 err);
158 return err;
159 }
160
161 err = drm_fb_helper_initial_config(helper);
162 if (err < 0) {
163 dev_err(drm->dev, "failed to set initial configuration: %d\n",
164 err);
165 goto fini;
166 }
167
168 return 0;
169
170 fini:
171 drm_fb_helper_fini(helper);
172 return err;
173 }
174
175 static void tegra_fbdev_exit(struct drm_fb_helper *helper)
176 {
177 struct drm_framebuffer *fb = helper->fb;
178
179 drm_fb_helper_unregister_info(helper);
180
181 if (fb) {
182 struct tegra_bo *bo = tegra_fb_get_plane(fb, 0);
183
184 /* Undo the special mapping we made in fbdev probe. */
185 if (bo && bo->pages) {
> 186 vunmap(bo->vaddr);
187 bo->vaddr = NULL;
188 }
189
190 drm_framebuffer_remove(fb);
191 }
192
193 drm_fb_helper_fini(helper);
194 tegra_fbdev_free(helper);
195 }
196
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [drm-tegra:for-next 30/32] drivers/gpu/drm/tegra/fbdev.c:103:29: error: implicit declaration of function 'vmap'; did you mean 'kmap'?
2023-04-06 0:56 [drm-tegra:for-next 30/32] drivers/gpu/drm/tegra/fbdev.c:103:29: error: implicit declaration of function 'vmap'; did you mean 'kmap'? kernel test robot
@ 2023-04-06 7:55 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2023-04-06 7:55 UTC (permalink / raw)
To: kernel test robot; +Cc: Thomas Zimmermann, oe-kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3245 bytes --]
On Thu, Apr 06, 2023 at 08:56:17AM +0800, kernel test robot wrote:
> Hi Thomas,
>
> FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
>
> tree: https://gitlab.freedesktop.org/drm/tegra for-next
> head: e064bf8eeedb78439bed33990f93c7213294e005
> commit: 914cfac73e230064656a42047a6f5546ee69a14f [30/32] drm/tegra: Hide fbdev support behind config option
> config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20230406/202304060835.oYBkVjMC-lkp@intel.com/config)
> compiler: mips-linux-gcc (GCC) 12.1.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
> git remote add drm-tegra https://gitlab.freedesktop.org/drm/tegra
> git fetch --no-tags drm-tegra for-next
> git checkout 914cfac73e230064656a42047a6f5546ee69a14f
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips olddefconfig
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/gpu/drm/tegra/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/202304060835.oYBkVjMC-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> drivers/gpu/drm/tegra/fbdev.c: In function 'tegra_fbdev_probe':
> >> drivers/gpu/drm/tegra/fbdev.c:103:29: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
> 103 | bo->vaddr = vmap(bo->pages, bo->num_pages, VM_MAP,
> | ^~~~
> | kmap
> >> drivers/gpu/drm/tegra/fbdev.c:103:60: error: 'VM_MAP' undeclared (first use in this function); did you mean 'VM_MTE'?
> 103 | bo->vaddr = vmap(bo->pages, bo->num_pages, VM_MAP,
> | ^~~~~~
> | VM_MTE
> drivers/gpu/drm/tegra/fbdev.c:103:60: note: each undeclared identifier is reported only once for each function it appears in
> drivers/gpu/drm/tegra/fbdev.c: In function 'tegra_fbdev_exit':
> >> drivers/gpu/drm/tegra/fbdev.c:186:25: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
> 186 | vunmap(bo->vaddr);
> | ^~~~~~
> | kunmap
> cc1: some warnings being treated as errors
This looks like an unfortunate interaction between this patch and
Christian's to enable compilation on !TEGRA. I think this is just a
matter of moving the linux/vmalloc.h include from fb.c to fbdev.c
because the vmap()/vunmap() calls have moved.
I'll do a MIPS allmodconfig test build to make sure this actually
fixes the problem and push out a fixed version.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-06 7:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-06 0:56 [drm-tegra:for-next 30/32] drivers/gpu/drm/tegra/fbdev.c:103:29: error: implicit declaration of function 'vmap'; did you mean 'kmap'? kernel test robot
2023-04-06 7:55 ` Thierry Reding
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.