From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c:342:3: warning: Value stored to 'src_buf' is never read [clang-analyzer-deadcode.DeadStores]
Date: Wed, 15 Dec 2021 08:21:00 +0800 [thread overview]
Message-ID: <202112150808.bMnC6chn-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 25675 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Yunfei Dong <yunfei.dong@mediatek.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Alexandre Courbot <acourbot@chromium.org>
CC: "Tzung-Bi Shih" <tzungbi@google.com>
CC: Hans Verkuil <hverkuil@xs4all.nl>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5472f14a37421d1bca3dddf33cabd3bd6dbefbbc
commit: fd00d90330d1d2a962d010fc93515e2d77739ad8 media: mtk-vcodec: vdec: move stateful ops into their own file
date: 3 months ago
:::::: branch date: 26 hours ago
:::::: commit date: 3 months ago
config: riscv-randconfig-c006-20211213 (https://download.01.org/0day-ci/archive/20211215/202112150808.bMnC6chn-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fd00d90330d1d2a962d010fc93515e2d77739ad8
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout fd00d90330d1d2a962d010fc93515e2d77739ad8
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:837:19: note: Calling 'devm_kcalloc'
adc->iio_chans = devm_kcalloc(adc->dev, adc->nchans,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:223:9: note: Calling 'devm_kmalloc_array'
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:215:2: note: Taking false branch
if (unlikely(check_mul_overflow(n, size, &bytes)))
^
include/linux/device.h:218:2: note: Returning pointer, which participates in a condition later
return devm_kmalloc(dev, bytes, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:223:9: note: Returning from 'devm_kmalloc_array'
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:223:2: note: Returning pointer, which participates in a condition later
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:837:19: note: Returning from 'devm_kcalloc'
adc->iio_chans = devm_kcalloc(adc->dev, adc->nchans,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:839:6: note: Assuming field 'iio_chans' is non-null
if (!adc->iio_chans)
^~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:839:2: note: Taking false branch
if (!adc->iio_chans)
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:842:15: note: Calling 'devm_kcalloc'
adc->chans = devm_kcalloc(adc->dev, adc->nchans,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:223:9: note: Calling 'devm_kmalloc_array'
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:215:2: note: Taking false branch
if (unlikely(check_mul_overflow(n, size, &bytes)))
^
include/linux/device.h:218:2: note: Returning pointer, which participates in a condition later
return devm_kmalloc(dev, bytes, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:223:9: note: Returning from 'devm_kmalloc_array'
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:223:2: note: Returning pointer, which participates in a condition later
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:842:15: note: Returning from 'devm_kcalloc'
adc->chans = devm_kcalloc(adc->dev, adc->nchans,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:844:6: note: Assuming field 'chans' is non-null
if (!adc->chans)
^~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:844:2: note: Taking false branch
if (!adc->chans)
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:848:39: note: Assuming 'child' is not equal to null
for_each_available_child_of_node(np, child) {
^
include/linux/of.h:1304:58: note: expanded from macro 'for_each_available_child_of_node'
for (child = of_get_next_available_child(parent, NULL); child != NULL; \
^~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:848:2: note: Loop condition is true. Entering loop body
for_each_available_child_of_node(np, child) {
^
include/linux/of.h:1304:2: note: expanded from macro 'for_each_available_child_of_node'
for (child = of_get_next_available_child(parent, NULL); child != NULL; \
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:851:8: note: Passing value via 3rd parameter 'hw_channels'
adc->variant->channels,
^~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:850:9: note: Calling 'pm8xxx_xoadc_parse_channel'
ret = pm8xxx_xoadc_parse_channel(adc->dev, child,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:746:6: note: Assuming 'ret' is 0
if (ret) {
^~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:746:2: note: Taking false branch
if (ret) {
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:751:6: note: Assuming 'ret' is 0
if (ret) {
^~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:751:2: note: Taking false branch
if (ret) {
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:758:2: note: Value assigned to 'hwchan'
hwchan = &hw_channels[0];
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:759:9: note: Assuming 'hwchan' is null
while (hwchan && hwchan->datasheet_name) {
^~~~~~
drivers/iio/adc/qcom-pm8xxx-xoadc.c:759:16: note: Left side of '&&' is false
while (hwchan && hwchan->datasheet_name) {
^
drivers/iio/adc/qcom-pm8xxx-xoadc.c:767:7: note: Access to field 'datasheet_name' results in a dereference of a null pointer (loaded from variable 'hwchan')
if (!hwchan->datasheet_name) {
^~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
11 warnings generated.
>> drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c:342:3: warning: Value stored to 'src_buf' is never read [clang-analyzer-deadcode.DeadStores]
src_buf = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c:342:3: note: Value stored to 'src_buf' is never read
src_buf = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c:405:2: warning: Value stored to 'dst_buf' is never read [clang-analyzer-deadcode.DeadStores]
dst_buf = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c:405:2: note: Value stored to 'dst_buf' is never read
dst_buf = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/iio/imu/fxos8700_core.c:167:8: warning: Excessive padding in 'struct fxos8700_data' (106 padding bytes, where 42 is optimal).
Optimal fields order:
buf,
regmap,
trig,
consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
struct fxos8700_data {
~~~~~~~^~~~~~~~~~~~~~~
drivers/iio/imu/fxos8700_core.c:167:8: note: Excessive padding in 'struct fxos8700_data' (106 padding bytes, where 42 is optimal). Optimal fields order: buf, regmap, trig, consider reordering the fields or adding explicit padding members
struct fxos8700_data {
~~~~~~~^~~~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
drivers/iio/light/adux1020.c:384:9: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
*val = buf[0];
^ ~~~~~~
drivers/iio/light/adux1020.c:372:2: note: Control jumps to 'case IIO_CHAN_INFO_RAW:' at line 373
switch (mask) {
^
drivers/iio/light/adux1020.c:374:3: note: Control jumps to 'case IIO_PROXIMITY:' at line 375
switch (chan->type) {
^
drivers/iio/light/adux1020.c:377:8: note: 'ret' is >= 0
if (ret < 0)
^~~
drivers/iio/light/adux1020.c:377:4: note: Taking false branch
if (ret < 0)
^
drivers/iio/light/adux1020.c:380:10: note: Calling 'adux1020_measure'
ret = adux1020_measure(data, ADUX1020_MODE_PROX_I, buf);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/light/adux1020.c:320:6: note: Assuming 'ret' is >= 0
if (ret < 0)
^~~~~~~
drivers/iio/light/adux1020.c:320:2: note: Taking false branch
if (ret < 0)
^
drivers/iio/light/adux1020.c:327:6: note: Assuming 'ret' is >= 0
if (ret < 0)
^~~~~~~
drivers/iio/light/adux1020.c:327:2: note: Taking false branch
if (ret < 0)
^
drivers/iio/light/adux1020.c:330:2: note: Loop condition is true. Entering loop body
while (tries--) {
^
drivers/iio/light/adux1020.c:333:7: note: Assuming 'ret' is >= 0
if (ret < 0)
^~~~~~~
drivers/iio/light/adux1020.c:333:3: note: Taking false branch
if (ret < 0)
^
drivers/iio/light/adux1020.c:337:7: note: Assuming 'status' is >= field 'bytes'
if (status >= adux1020_modes[mode].bytes)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/light/adux1020.c:337:3: note: Taking true branch
if (status >= adux1020_modes[mode].bytes)
^
drivers/iio/light/adux1020.c:338:4: note: Execution continues on line 342
break;
^
drivers/iio/light/adux1020.c:342:6: note: 'tries' is >= 0
if (tries < 0)
^~~~~
vim +/src_buf +342 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c
fd00d90330d1d2a Yunfei Dong 2021-08-06 292
fd00d90330d1d2a Yunfei Dong 2021-08-06 293 static void mtk_vdec_worker(struct work_struct *work)
fd00d90330d1d2a Yunfei Dong 2021-08-06 294 {
fd00d90330d1d2a Yunfei Dong 2021-08-06 295 struct mtk_vcodec_ctx *ctx =
fd00d90330d1d2a Yunfei Dong 2021-08-06 296 container_of(work, struct mtk_vcodec_ctx, decode_work);
fd00d90330d1d2a Yunfei Dong 2021-08-06 297 struct mtk_vcodec_dev *dev = ctx->dev;
fd00d90330d1d2a Yunfei Dong 2021-08-06 298 struct vb2_v4l2_buffer *src_buf, *dst_buf;
fd00d90330d1d2a Yunfei Dong 2021-08-06 299 struct mtk_vcodec_mem buf;
fd00d90330d1d2a Yunfei Dong 2021-08-06 300 struct vdec_fb *pfb;
fd00d90330d1d2a Yunfei Dong 2021-08-06 301 bool res_chg = false;
fd00d90330d1d2a Yunfei Dong 2021-08-06 302 int ret;
fd00d90330d1d2a Yunfei Dong 2021-08-06 303 struct mtk_video_dec_buf *dst_buf_info, *src_buf_info;
fd00d90330d1d2a Yunfei Dong 2021-08-06 304
fd00d90330d1d2a Yunfei Dong 2021-08-06 305 src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 306 if (!src_buf) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 307 v4l2_m2m_job_finish(dev->m2m_dev_dec, ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 308 mtk_v4l2_debug(1, "[%d] src_buf empty!!", ctx->id);
fd00d90330d1d2a Yunfei Dong 2021-08-06 309 return;
fd00d90330d1d2a Yunfei Dong 2021-08-06 310 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 311
fd00d90330d1d2a Yunfei Dong 2021-08-06 312 dst_buf = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 313 if (!dst_buf) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 314 v4l2_m2m_job_finish(dev->m2m_dev_dec, ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 315 mtk_v4l2_debug(1, "[%d] dst_buf empty!!", ctx->id);
fd00d90330d1d2a Yunfei Dong 2021-08-06 316 return;
fd00d90330d1d2a Yunfei Dong 2021-08-06 317 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 318
fd00d90330d1d2a Yunfei Dong 2021-08-06 319 dst_buf_info =
fd00d90330d1d2a Yunfei Dong 2021-08-06 320 container_of(dst_buf, struct mtk_video_dec_buf, m2m_buf.vb);
fd00d90330d1d2a Yunfei Dong 2021-08-06 321
fd00d90330d1d2a Yunfei Dong 2021-08-06 322 pfb = &dst_buf_info->frame_buffer;
fd00d90330d1d2a Yunfei Dong 2021-08-06 323 pfb->base_y.va = vb2_plane_vaddr(&dst_buf->vb2_buf, 0);
fd00d90330d1d2a Yunfei Dong 2021-08-06 324 pfb->base_y.dma_addr =
fd00d90330d1d2a Yunfei Dong 2021-08-06 325 vb2_dma_contig_plane_dma_addr(&dst_buf->vb2_buf, 0);
fd00d90330d1d2a Yunfei Dong 2021-08-06 326 pfb->base_y.size = ctx->picinfo.fb_sz[0];
fd00d90330d1d2a Yunfei Dong 2021-08-06 327
fd00d90330d1d2a Yunfei Dong 2021-08-06 328 pfb->base_c.va = vb2_plane_vaddr(&dst_buf->vb2_buf, 1);
fd00d90330d1d2a Yunfei Dong 2021-08-06 329 pfb->base_c.dma_addr =
fd00d90330d1d2a Yunfei Dong 2021-08-06 330 vb2_dma_contig_plane_dma_addr(&dst_buf->vb2_buf, 1);
fd00d90330d1d2a Yunfei Dong 2021-08-06 331 pfb->base_c.size = ctx->picinfo.fb_sz[1];
fd00d90330d1d2a Yunfei Dong 2021-08-06 332 pfb->status = 0;
fd00d90330d1d2a Yunfei Dong 2021-08-06 333 mtk_v4l2_debug(3, "===>[%d] vdec_if_decode() ===>", ctx->id);
fd00d90330d1d2a Yunfei Dong 2021-08-06 334
fd00d90330d1d2a Yunfei Dong 2021-08-06 335 mtk_v4l2_debug(3,
fd00d90330d1d2a Yunfei Dong 2021-08-06 336 "id=%d Framebuf pfb=%p VA=%p Y_DMA=%pad C_DMA=%pad Size=%zx",
fd00d90330d1d2a Yunfei Dong 2021-08-06 337 dst_buf->vb2_buf.index, pfb, pfb->base_y.va,
fd00d90330d1d2a Yunfei Dong 2021-08-06 338 &pfb->base_y.dma_addr, &pfb->base_c.dma_addr, pfb->base_y.size);
fd00d90330d1d2a Yunfei Dong 2021-08-06 339
fd00d90330d1d2a Yunfei Dong 2021-08-06 340 if (src_buf == &ctx->empty_flush_buf.vb) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 341 mtk_v4l2_debug(1, "Got empty flush input buffer.");
fd00d90330d1d2a Yunfei Dong 2021-08-06 @342 src_buf = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 343
fd00d90330d1d2a Yunfei Dong 2021-08-06 344 /* update dst buf status */
fd00d90330d1d2a Yunfei Dong 2021-08-06 345 dst_buf = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 346 mutex_lock(&ctx->lock);
fd00d90330d1d2a Yunfei Dong 2021-08-06 347 dst_buf_info->used = false;
fd00d90330d1d2a Yunfei Dong 2021-08-06 348 mutex_unlock(&ctx->lock);
fd00d90330d1d2a Yunfei Dong 2021-08-06 349
fd00d90330d1d2a Yunfei Dong 2021-08-06 350 vdec_if_decode(ctx, NULL, NULL, &res_chg);
fd00d90330d1d2a Yunfei Dong 2021-08-06 351 clean_display_buffer(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 352 vb2_set_plane_payload(&dst_buf->vb2_buf, 0, 0);
fd00d90330d1d2a Yunfei Dong 2021-08-06 353 if (ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 2)
fd00d90330d1d2a Yunfei Dong 2021-08-06 354 vb2_set_plane_payload(&dst_buf->vb2_buf, 1, 0);
fd00d90330d1d2a Yunfei Dong 2021-08-06 355 dst_buf->flags |= V4L2_BUF_FLAG_LAST;
fd00d90330d1d2a Yunfei Dong 2021-08-06 356 v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_DONE);
fd00d90330d1d2a Yunfei Dong 2021-08-06 357 clean_free_buffer(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 358 v4l2_m2m_job_finish(dev->m2m_dev_dec, ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 359 return;
fd00d90330d1d2a Yunfei Dong 2021-08-06 360 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 361
fd00d90330d1d2a Yunfei Dong 2021-08-06 362 src_buf_info =
fd00d90330d1d2a Yunfei Dong 2021-08-06 363 container_of(src_buf, struct mtk_video_dec_buf, m2m_buf.vb);
fd00d90330d1d2a Yunfei Dong 2021-08-06 364
fd00d90330d1d2a Yunfei Dong 2021-08-06 365 buf.va = vb2_plane_vaddr(&src_buf->vb2_buf, 0);
fd00d90330d1d2a Yunfei Dong 2021-08-06 366 buf.dma_addr = vb2_dma_contig_plane_dma_addr(&src_buf->vb2_buf, 0);
fd00d90330d1d2a Yunfei Dong 2021-08-06 367 buf.size = (size_t)src_buf->vb2_buf.planes[0].bytesused;
fd00d90330d1d2a Yunfei Dong 2021-08-06 368 if (!buf.va) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 369 v4l2_m2m_job_finish(dev->m2m_dev_dec, ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 370 mtk_v4l2_err("[%d] id=%d src_addr is NULL!!", ctx->id,
fd00d90330d1d2a Yunfei Dong 2021-08-06 371 src_buf->vb2_buf.index);
fd00d90330d1d2a Yunfei Dong 2021-08-06 372 return;
fd00d90330d1d2a Yunfei Dong 2021-08-06 373 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 374 mtk_v4l2_debug(3, "[%d] Bitstream VA=%p DMA=%pad Size=%zx vb=%p",
fd00d90330d1d2a Yunfei Dong 2021-08-06 375 ctx->id, buf.va, &buf.dma_addr, buf.size, src_buf);
fd00d90330d1d2a Yunfei Dong 2021-08-06 376 dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
fd00d90330d1d2a Yunfei Dong 2021-08-06 377 dst_buf->timecode = src_buf->timecode;
fd00d90330d1d2a Yunfei Dong 2021-08-06 378 mutex_lock(&ctx->lock);
fd00d90330d1d2a Yunfei Dong 2021-08-06 379 dst_buf_info->used = true;
fd00d90330d1d2a Yunfei Dong 2021-08-06 380 mutex_unlock(&ctx->lock);
fd00d90330d1d2a Yunfei Dong 2021-08-06 381 src_buf_info->used = true;
fd00d90330d1d2a Yunfei Dong 2021-08-06 382
fd00d90330d1d2a Yunfei Dong 2021-08-06 383 ret = vdec_if_decode(ctx, &buf, pfb, &res_chg);
fd00d90330d1d2a Yunfei Dong 2021-08-06 384
fd00d90330d1d2a Yunfei Dong 2021-08-06 385 if (ret) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 386 mtk_v4l2_err(" <===[%d], src_buf[%d] sz=0x%zx pts=%llu dst_buf[%d] vdec_if_decode() ret=%d res_chg=%d===>",
fd00d90330d1d2a Yunfei Dong 2021-08-06 387 ctx->id, src_buf->vb2_buf.index, buf.size,
fd00d90330d1d2a Yunfei Dong 2021-08-06 388 src_buf->vb2_buf.timestamp, dst_buf->vb2_buf.index, ret, res_chg);
fd00d90330d1d2a Yunfei Dong 2021-08-06 389 src_buf = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 390 if (ret == -EIO) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 391 mutex_lock(&ctx->lock);
fd00d90330d1d2a Yunfei Dong 2021-08-06 392 src_buf_info->error = true;
fd00d90330d1d2a Yunfei Dong 2021-08-06 393 mutex_unlock(&ctx->lock);
fd00d90330d1d2a Yunfei Dong 2021-08-06 394 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 395 v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_ERROR);
fd00d90330d1d2a Yunfei Dong 2021-08-06 396 } else if (!res_chg) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 397 /*
fd00d90330d1d2a Yunfei Dong 2021-08-06 398 * we only return src buffer with VB2_BUF_STATE_DONE
fd00d90330d1d2a Yunfei Dong 2021-08-06 399 * when decode success without resolution change
fd00d90330d1d2a Yunfei Dong 2021-08-06 400 */
fd00d90330d1d2a Yunfei Dong 2021-08-06 401 src_buf = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 402 v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);
fd00d90330d1d2a Yunfei Dong 2021-08-06 403 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 404
fd00d90330d1d2a Yunfei Dong 2021-08-06 @405 dst_buf = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 406 clean_display_buffer(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 407 clean_free_buffer(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 408
fd00d90330d1d2a Yunfei Dong 2021-08-06 409 if (!ret && res_chg) {
fd00d90330d1d2a Yunfei Dong 2021-08-06 410 mtk_vdec_pic_info_update(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 411 /*
fd00d90330d1d2a Yunfei Dong 2021-08-06 412 * On encountering a resolution change in the stream.
fd00d90330d1d2a Yunfei Dong 2021-08-06 413 * The driver must first process and decode all
fd00d90330d1d2a Yunfei Dong 2021-08-06 414 * remaining buffers from before the resolution change
fd00d90330d1d2a Yunfei Dong 2021-08-06 415 * point, so call flush decode here
fd00d90330d1d2a Yunfei Dong 2021-08-06 416 */
fd00d90330d1d2a Yunfei Dong 2021-08-06 417 mtk_vdec_flush_decoder(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 418 /*
fd00d90330d1d2a Yunfei Dong 2021-08-06 419 * After all buffers containing decoded frames from
fd00d90330d1d2a Yunfei Dong 2021-08-06 420 * before the resolution change point ready to be
fd00d90330d1d2a Yunfei Dong 2021-08-06 421 * dequeued on the CAPTURE queue, the driver sends a
fd00d90330d1d2a Yunfei Dong 2021-08-06 422 * V4L2_EVENT_SOURCE_CHANGE event for source change
fd00d90330d1d2a Yunfei Dong 2021-08-06 423 * type V4L2_EVENT_SRC_CH_RESOLUTION
fd00d90330d1d2a Yunfei Dong 2021-08-06 424 */
fd00d90330d1d2a Yunfei Dong 2021-08-06 425 mtk_vdec_queue_res_chg_event(ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 426 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 427 v4l2_m2m_job_finish(dev->m2m_dev_dec, ctx->m2m_ctx);
fd00d90330d1d2a Yunfei Dong 2021-08-06 428 }
fd00d90330d1d2a Yunfei Dong 2021-08-06 429
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2021-12-15 0:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-15 0:21 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-11-07 5:55 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c:342:3: warning: Value stored to 'src_buf' is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202112150808.bMnC6chn-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.