From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [chrome-os:chromeos-5.4 12/43] drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c:464:18: warning: variable 'dpb_fields' set but not used
Date: Fri, 02 Apr 2021 23:13:53 +0800 [thread overview]
Message-ID: <202104022349.Pw6OAFZS-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9508 bytes --]
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 885f54059e5be0bbd38287623c841b1e4db1aa57
commit: 5fa56a01339db0586f27519d81aa226f1bb49f03 [12/43] FROMLIST: media: mtk-vcodec: vdec: support stateless H.264 decoding
config: m68k-randconfig-r011-20210402 (attached as .config)
compiler: m68k-linux-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
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout 5fa56a01339db0586f27519d81aa226f1bb49f03
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/module.h:9,
from drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_no.h:33:50: warning: ordered comparison of pointer with null pointer [-Wextra]
33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c: In function 'get_vdec_decode_parameters':
>> drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c:464:18: warning: variable 'dpb_fields' set but not used [-Wunused-but-set-variable]
464 | enum v4l2_field dpb_fields[V4L2_H264_NUM_DPB_ENTRIES];
| ^~~~~~~~~~
drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c: In function 'get_pic_info':
>> drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c:569:27: warning: parameter 'pic' set but not used [-Wunused-but-set-parameter]
569 | struct vdec_pic_info *pic)
| ~~~~~~~~~~~~~~~~~~~~~~^~~
drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c: In function 'vdec_h264_slice_decode':
>> drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c:701:28: warning: variable 'src_buf_info' set but not used [-Wunused-but-set-variable]
701 | struct mtk_video_dec_buf *src_buf_info;
| ^~~~~~~~~~~~
vim +/dpb_fields +464 drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c
451
452 static void get_vdec_decode_parameters(struct vdec_h264_slice_inst *inst)
453 {
454 const struct v4l2_ctrl_h264_decode_params *dec_params =
455 get_ctrl_ptr(inst->ctx, V4L2_CID_STATELESS_H264_DECODE_PARAMS);
456 const struct v4l2_ctrl_h264_sps *sps =
457 get_ctrl_ptr(inst->ctx, V4L2_CID_STATELESS_H264_SPS);
458 const struct v4l2_ctrl_h264_pps *pps =
459 get_ctrl_ptr(inst->ctx, V4L2_CID_STATELESS_H264_PPS);
460 const struct v4l2_ctrl_h264_scaling_matrix *scaling_matrix =
461 get_ctrl_ptr(inst->ctx, V4L2_CID_STATELESS_H264_SCALING_MATRIX);
462 struct mtk_h264_dec_slice_param *slice_param = &inst->h264_slice_param;
463 struct v4l2_h264_reflist_builder reflist_builder;
> 464 enum v4l2_field dpb_fields[V4L2_H264_NUM_DPB_ENTRIES];
465 u8 *p0_reflist = slice_param->decode_params.ref_pic_list_p0;
466 u8 *b0_reflist = slice_param->decode_params.ref_pic_list_b0;
467 u8 *b1_reflist = slice_param->decode_params.ref_pic_list_b1;
468 int i;
469
470 update_dpb(dec_params, inst->dpb);
471
472 get_h264_sps_parameters(&slice_param->sps, sps);
473 get_h264_pps_parameters(&slice_param->pps, pps);
474 get_h264_scaling_matrix(&slice_param->scaling_matrix, scaling_matrix);
475 get_h264_decode_parameters(&slice_param->decode_params, dec_params,
476 inst->dpb);
477 get_h264_dpb_list(inst, slice_param);
478
479 /* Prepare the fields for our reference lists */
480 for (i = 0; i < V4L2_H264_NUM_DPB_ENTRIES; i++)
481 dpb_fields[i] = slice_param->h264_dpb_info[i].field;
482 /* Build the reference lists */
483 v4l2_h264_init_reflist_builder(&reflist_builder, dec_params, sps,
484 inst->dpb);
485 v4l2_h264_build_p_ref_list(&reflist_builder, p0_reflist);
486 v4l2_h264_build_b_ref_lists(&reflist_builder, b0_reflist, b1_reflist);
487 /* Adapt the built lists to the firmware's expectations */
488 fixup_ref_list(p0_reflist, reflist_builder.num_valid);
489 fixup_ref_list(b0_reflist, reflist_builder.num_valid);
490 fixup_ref_list(b1_reflist, reflist_builder.num_valid);
491
492 memcpy(&inst->vsi_ctx.h264_slice_params, slice_param,
493 sizeof(inst->vsi_ctx.h264_slice_params));
494 }
495
496 static unsigned int get_mv_buf_size(unsigned int width, unsigned int height)
497 {
498 int unit_size = (width / MB_UNIT_LEN) * (height / MB_UNIT_LEN) + 8;
499
500 return HW_MB_STORE_SZ * unit_size;
501 }
502
503 static int allocate_predication_buf(struct vdec_h264_slice_inst *inst)
504 {
505 int err = 0;
506
507 inst->pred_buf.size = BUF_PREDICTION_SZ;
508 err = mtk_vcodec_mem_alloc(inst->ctx, &inst->pred_buf);
509 if (err) {
510 mtk_vcodec_err(inst, "failed to allocate ppl buf");
511 return err;
512 }
513
514 inst->vsi_ctx.pred_buf_dma = inst->pred_buf.dma_addr;
515 return 0;
516 }
517
518 static void free_predication_buf(struct vdec_h264_slice_inst *inst)
519 {
520 struct mtk_vcodec_mem *mem = NULL;
521
522 mtk_vcodec_debug_enter(inst);
523
524 inst->vsi_ctx.pred_buf_dma = 0;
525 mem = &inst->pred_buf;
526 if (mem->va)
527 mtk_vcodec_mem_free(inst->ctx, mem);
528 }
529
530 static int alloc_mv_buf(struct vdec_h264_slice_inst *inst,
531 struct vdec_pic_info *pic)
532 {
533 int i;
534 int err;
535 struct mtk_vcodec_mem *mem = NULL;
536 unsigned int buf_sz = get_mv_buf_size(pic->buf_w, pic->buf_h);
537
538 mtk_v4l2_debug(3, "size = 0x%lx", buf_sz);
539 for (i = 0; i < H264_MAX_MV_NUM; i++) {
540 mem = &inst->mv_buf[i];
541 if (mem->va)
542 mtk_vcodec_mem_free(inst->ctx, mem);
543 mem->size = buf_sz;
544 err = mtk_vcodec_mem_alloc(inst->ctx, mem);
545 if (err) {
546 mtk_vcodec_err(inst, "failed to allocate mv buf");
547 return err;
548 }
549 inst->vsi_ctx.mv_buf_dma[i] = mem->dma_addr;
550 }
551
552 return 0;
553 }
554
555 static void free_mv_buf(struct vdec_h264_slice_inst *inst)
556 {
557 int i;
558 struct mtk_vcodec_mem *mem = NULL;
559
560 for (i = 0; i < H264_MAX_MV_NUM; i++) {
561 inst->vsi_ctx.mv_buf_dma[i] = 0;
562 mem = &inst->mv_buf[i];
563 if (mem->va)
564 mtk_vcodec_mem_free(inst->ctx, mem);
565 }
566 }
567
568 static void get_pic_info(struct vdec_h264_slice_inst *inst,
> 569 struct vdec_pic_info *pic)
570 {
571 struct mtk_vcodec_ctx *ctx = inst->ctx;
572
573 ctx->picinfo.buf_w = (ctx->picinfo.pic_w + 15) & 0xFFFFFFF0;
574 ctx->picinfo.buf_h = (ctx->picinfo.pic_h + 31) & 0xFFFFFFE0;
575 ctx->picinfo.fb_sz[0] = ctx->picinfo.buf_w * ctx->picinfo.buf_h;
576 ctx->picinfo.fb_sz[1] = ctx->picinfo.fb_sz[0] >> 1;
577 inst->vsi_ctx.dec.cap_num_planes =
578 ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes;
579
580 pic = &ctx->picinfo;
581 mtk_vcodec_debug(inst, "pic(%d, %d), buf(%d, %d)",
582 ctx->picinfo.pic_w, ctx->picinfo.pic_h,
583 ctx->picinfo.buf_w, ctx->picinfo.buf_h);
584 mtk_vcodec_debug(inst, "Y/C(%d, %d)", ctx->picinfo.fb_sz[0],
585 ctx->picinfo.fb_sz[1]);
586
587 if ((ctx->last_decoded_picinfo.pic_w != ctx->picinfo.pic_w) ||
588 (ctx->last_decoded_picinfo.pic_h != ctx->picinfo.pic_h)) {
589 inst->vsi_ctx.dec.resolution_changed = true;
590 if ((ctx->last_decoded_picinfo.buf_w != ctx->picinfo.buf_w) ||
591 (ctx->last_decoded_picinfo.buf_h != ctx->picinfo.buf_h))
592 inst->vsi_ctx.dec.realloc_mv_buf = true;
593
594 mtk_v4l2_debug(1, "ResChg: (%d %d) : old(%d, %d) -> new(%d, %d)",
595 inst->vsi_ctx.dec.resolution_changed,
596 inst->vsi_ctx.dec.realloc_mv_buf,
597 ctx->last_decoded_picinfo.pic_w,
598 ctx->last_decoded_picinfo.pic_h,
599 ctx->picinfo.pic_w, ctx->picinfo.pic_h);
600 }
601 }
602
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23721 bytes --]
reply other threads:[~2021-04-02 15:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202104022349.Pw6OAFZS-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@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.