Hi Dafna,
I love your patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on v5.16-rc1 next-20211115]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Dafna-Hirschfeld/media-videobuf2...
base:
git://linuxtv.org/media_tree.git master
config: microblaze-randconfig-r013-20211115 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.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/0day-ci/linux/commit/6934ed79a3550b00a9f9a6ae14a283a59...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Dafna-Hirschfeld/media-videobuf2-make-sure-bytesused-is-smaller-than-the-buffer-size/20211111-232720
git checkout 6934ed79a3550b00a9f9a6ae14a283a59a10f566
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=microblaze SHELL=/bin/bash drivers/staging/media/meson/vdec/
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 >>):
drivers/staging/media/meson/vdec/vdec_helpers.c: In function 'dst_buf_done':
> drivers/staging/media/meson/vdec/vdec_helpers.c:279:43: error:
incompatible type for argument 1 of 'vb2_set_plane_payload'
279 |
vb2_set_plane_payload(vbuf->vb2_buf, 0, output_size);
| ~~~~^~~~~~~~~
| |
| struct vb2_buffer
In file included from include/media/videobuf2-v4l2.h:16,
from include/media/v4l2-mem2mem.h:16,
from drivers/staging/media/meson/vdec/vdec_helpers.c:8:
include/media/videobuf2-core.h:1155:61: note: expected 'struct vb2_buffer *'
but argument is of type 'struct vb2_buffer'
1155 | static inline void vb2_set_plane_payload(struct vb2_buffer *vb,
| ~~~~~~~~~~~~~~~~~~~^~
drivers/staging/media/meson/vdec/vdec_helpers.c:280:43: error: incompatible type for
argument 1 of 'vb2_set_plane_payload'
280 | vb2_set_plane_payload(vbuf->vb2_buf, 1, output_size / 2);
| ~~~~^~~~~~~~~
| |
| struct vb2_buffer
In file included from include/media/videobuf2-v4l2.h:16,
from include/media/v4l2-mem2mem.h:16,
from drivers/staging/media/meson/vdec/vdec_helpers.c:8:
include/media/videobuf2-core.h:1155:61: note: expected 'struct vb2_buffer *'
but argument is of type 'struct vb2_buffer'
1155 | static inline void vb2_set_plane_payload(struct vb2_buffer *vb,
| ~~~~~~~~~~~~~~~~~~~^~
drivers/staging/media/meson/vdec/vdec_helpers.c:283:43: error: incompatible type for
argument 1 of 'vb2_set_plane_payload'
283 | vb2_set_plane_payload(vbuf->vb2_buf, 0, output_size);
| ~~~~^~~~~~~~~
| |
| struct vb2_buffer
In file included from include/media/videobuf2-v4l2.h:16,
from include/media/v4l2-mem2mem.h:16,
from drivers/staging/media/meson/vdec/vdec_helpers.c:8:
include/media/videobuf2-core.h:1155:61: note: expected 'struct vb2_buffer *'
but argument is of type 'struct vb2_buffer'
1155 | static inline void vb2_set_plane_payload(struct vb2_buffer *vb,
| ~~~~~~~~~~~~~~~~~~~^~
drivers/staging/media/meson/vdec/vdec_helpers.c:284:43: error: incompatible type for
argument 1 of 'vb2_set_plane_payload'
284 | vb2_set_plane_payload(vbuf->vb2_buf, 1, output_size / 4);
| ~~~~^~~~~~~~~
| |
| struct vb2_buffer
In file included from include/media/videobuf2-v4l2.h:16,
from include/media/v4l2-mem2mem.h:16,
from drivers/staging/media/meson/vdec/vdec_helpers.c:8:
include/media/videobuf2-core.h:1155:61: note: expected 'struct vb2_buffer *'
but argument is of type 'struct vb2_buffer'
1155 | static inline void vb2_set_plane_payload(struct vb2_buffer *vb,
| ~~~~~~~~~~~~~~~~~~~^~
drivers/staging/media/meson/vdec/vdec_helpers.c:285:43: error: incompatible type for
argument 1 of 'vb2_set_plane_payload'
285 | vb2_set_plane_payload(vbuf->vb2_buf, 2, output_size / 4);
| ~~~~^~~~~~~~~
| |
| struct vb2_buffer
In file included from include/media/videobuf2-v4l2.h:16,
from include/media/v4l2-mem2mem.h:16,
from drivers/staging/media/meson/vdec/vdec_helpers.c:8:
include/media/videobuf2-core.h:1155:61: note: expected 'struct vb2_buffer *'
but argument is of type 'struct vb2_buffer'
1155 | static inline void vb2_set_plane_payload(struct vb2_buffer *vb,
| ~~~~~~~~~~~~~~~~~~~^~
vim +/vb2_set_plane_payload +279 drivers/staging/media/meson/vdec/vdec_helpers.c
268
269 static void dst_buf_done(struct amvdec_session *sess,
270 struct vb2_v4l2_buffer *vbuf,
271 u32 field, u64 timestamp,
272 struct v4l2_timecode timecode, u32 flags)
273 {
274 struct device *dev = sess->core->dev_dec;
275 u32 output_size = amvdec_get_output_size(sess);
276
277 switch (sess->pixfmt_cap) {
278 case V4L2_PIX_FMT_NV12M:
279 vb2_set_plane_payload(vbuf->vb2_buf, 0, output_size);
280 vb2_set_plane_payload(vbuf->vb2_buf, 1, output_size / 2);
281 break;
282 case V4L2_PIX_FMT_YUV420M:
283 vb2_set_plane_payload(vbuf->vb2_buf, 0, output_size);
284 vb2_set_plane_payload(vbuf->vb2_buf, 1, output_size / 4);
285 vb2_set_plane_payload(vbuf->vb2_buf, 2, output_size / 4);
286 break;
287 }
288
289 vbuf->vb2_buf.timestamp = timestamp;
290 vbuf->sequence = sess->sequence_cap++;
291 vbuf->flags = flags;
292 vbuf->timecode = timecode;
293
294 if (sess->should_stop &&
295 atomic_read(&sess->esparser_queued_bufs) <= 1) {
296 const struct v4l2_event ev = { .type = V4L2_EVENT_EOS };
297
298 dev_dbg(dev, "Signaling EOS, sequence_cap = %u\n",
299 sess->sequence_cap - 1);
300 v4l2_event_queue_fh(&sess->fh, &ev);
301 vbuf->flags |= V4L2_BUF_FLAG_LAST;
302 } else if (sess->status == STATUS_NEEDS_RESUME) {
303 /* Mark LAST for drained show frames during a source change */
304 vbuf->flags |= V4L2_BUF_FLAG_LAST;
305 sess->sequence_cap = 0;
306 } else if (sess->should_stop)
307 dev_dbg(dev, "should_stop, %u bufs remain\n",
308 atomic_read(&sess->esparser_queued_bufs));
309
310 dev_dbg(dev, "Buffer %u done, ts = %llu, flags = %08X\n",
311 vbuf->vb2_buf.index, timestamp, flags);
312 vbuf->field = field;
313 v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_DONE);
314
315 /* Buffer done probably means the vififo got freed */
316 schedule_work(&sess->esparser_queue_work);
317 }
318
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org