Re: [PATCH 28/30] IMG DEC V4L2 Interface function implementations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on staging/staging-testing driver-core/driver-core-testing linus/master v5.14-rc6 next-20210818]
[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/sidraya-bj-pathpartnertech-com/TI-Video-Decoder-driver-upstreaming-to-v5-14-rc6-kernel/20210818-221811
base:   git://linuxtv.org/media_tree.git master
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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/ed83bf9b395e58893b5d92675196aee8f619efc9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review sidraya-bj-pathpartnertech-com/TI-Video-Decoder-driver-upstreaming-to-v5-14-rc6-kernel/20210818-221811
        git checkout ed83bf9b395e58893b5d92675196aee8f619efc9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

   drivers/staging/media/vxd/decoder/vxd_core.c: In function 'stream_worker':
>> drivers/staging/media/vxd/decoder/vxd_core.c:549:25: warning: variable 'vxd' set but not used [-Wunused-but-set-variable]
     549 |         struct vxd_dev *vxd = NULL;
         |                         ^~~
--
   drivers/staging/media/vxd/decoder/vxd_v4l2.c: In function 'vxd_dec_buf_prepare':
>> drivers/staging/media/vxd/decoder/vxd_v4l2.c:712:36: error: implicit declaration of function 'phys_to_page'; did you mean 'pfn_to_page'? [-Werror=implicit-function-declaration]
     712 |                         new_page = phys_to_page(vb2_dma_contig_plane_dma_addr(vb, plane));
         |                                    ^~~~~~~~~~~~
         |                                    pfn_to_page
>> drivers/staging/media/vxd/decoder/vxd_v4l2.c:712:34: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     712 |                         new_page = phys_to_page(vb2_dma_contig_plane_dma_addr(vb, plane));
         |                                  ^
>> drivers/staging/media/vxd/decoder/vxd_v4l2.c:618:13: warning: variable 'pages' set but not used [-Wunused-but-set-variable]
     618 |         int pages;
         |             ^~~~~
   In file included from drivers/staging/media/vxd/decoder/vxd_props.h:19,
                    from drivers/staging/media/vxd/decoder/decoder.h:29,
                    from drivers/staging/media/vxd/decoder/core.h:20,
                    from drivers/staging/media/vxd/decoder/vxd_v4l2.c:52:
   At top level:
   drivers/staging/media/vxd/common/imgmmu.h:65:28: warning: 'VIRT_DIR_IDX_MASK' defined but not used [-Wunused-const-variable=]
      65 | static const unsigned long VIRT_DIR_IDX_MASK = (~((1 << MMU_DIR_SHIFT) - 1));
         |                            ^~~~~~~~~~~~~~~~~
   drivers/staging/media/vxd/common/imgmmu.h:62:28: warning: 'VIRT_PAGE_TBL_MASK' defined but not used [-Wunused-const-variable=]
      62 | static const unsigned long VIRT_PAGE_TBL_MASK =
         |                            ^~~~~~~~~~~~~~~~~~
   drivers/staging/media/vxd/common/imgmmu.h:60:28: warning: 'VIRT_PAGE_OFF_MASK' defined but not used [-Wunused-const-variable=]
      60 | static const unsigned long VIRT_PAGE_OFF_MASK = ((1 << MMU_PAGE_SHIFT) - 1);
         |                            ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/staging/media/vxd/decoder/hevc_secure_parser.c: In function 'bspp_hevc_parse_vps':
>> drivers/staging/media/vxd/decoder/hevc_secure_parser.c:594:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
     594 | }
         | ^


vim +712 drivers/staging/media/vxd/decoder/vxd_v4l2.c

   604	
   605	static int vxd_dec_buf_prepare(struct vb2_buffer *vb)
   606	{
   607		struct vxd_dec_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);
   608		struct device *dev = ctx->dev->dev;
   609		struct vxd_dec_q_data *q_data;
   610		void *sgt;
   611	#ifdef CAPTURE_CONTIG_ALLOC
   612		struct page *new_page;
   613	#else
   614		void *sgl;
   615	#endif
   616		struct sg_table *sgt_new;
   617		void *sgl_new;
 > 618		int pages;
   619		int nents = 0;
   620		int size = 0;
   621		int plane, num_planes, ret = 0;
   622		struct vxd_buffer *buf =
   623			container_of(vb, struct vxd_buffer, buffer.vb.vb2_buf);
   624	
   625		q_data = get_q_data(ctx, vb->vb2_queue->type);
   626		if (!q_data)
   627			return -EINVAL;
   628	
   629		num_planes = q_data->fmt->num_planes;
   630	
   631		for (plane = 0; plane < num_planes; plane++) {
   632			if (vb2_plane_size(vb, plane) < q_data->size_image[plane]) {
   633				dev_err(dev, "data will not fit into plane (%lu < %lu)\n",
   634					vb2_plane_size(vb, plane),
   635					(long)q_data->size_image[plane]);
   636				return -EINVAL;
   637			}
   638		}
   639	
   640		if (buf->mapped)
   641			return 0;
   642	
   643		buf->buf_info.cpu_linear_addr = vb2_plane_vaddr(vb, 0);
   644		buf->buf_info.buf_size = vb2_plane_size(vb, 0);
   645		buf->buf_info.fd = -1;
   646		sgt = vb2_dma_sg_plane_desc(vb, 0);
   647		if (!sgt) {
   648			dev_err(dev, "Could not get sg_table from plane 0\n");
   649			return -EINVAL;
   650		}
   651	
   652		if (V4L2_TYPE_IS_OUTPUT(vb->type)) {
   653			ret = core_stream_map_buf_sg(ctx->res_str_id,
   654						     VDEC_BUFTYPE_BITSTREAM,
   655						     &buf->buf_info, sgt,
   656						     &buf->buf_map_id);
   657			if (ret) {
   658				dev_err(dev, "OUTPUT core_stream_map_buf_sg failed\n");
   659				return ret;
   660			}
   661	
   662			buf->bstr_info.buf_size = q_data->size_image[0];
   663			buf->bstr_info.cpu_virt_addr = buf->buf_info.cpu_linear_addr;
   664			buf->bstr_info.mem_attrib =
   665				SYS_MEMATTRIB_UNCACHED | SYS_MEMATTRIB_WRITECOMBINE |
   666				SYS_MEMATTRIB_INPUT | SYS_MEMATTRIB_CPU_WRITE;
   667			buf->bstr_info.bufmap_id = buf->buf_map_id;
   668			lst_init(&buf->seq_unit.bstr_seg_list);
   669			lst_init(&buf->pic_unit.bstr_seg_list);
   670			lst_init(&buf->end_unit.bstr_seg_list);
   671	
   672			list_add_tail(&buf->list, &ctx->out_buffers);
   673		} else {
   674			/* Create a single sgt from the plane(s) */
   675			sgt_new = kmalloc(sizeof(*sgt_new), GFP_KERNEL);
   676			if (!sgt_new)
   677				return -EINVAL;
   678	
   679			for (plane = 0; plane < num_planes; plane++) {
   680				size += ALIGN(vb2_plane_size(vb, plane), PAGE_SIZE);
   681				sgt = vb2_dma_sg_plane_desc(vb, plane);
   682				if (!sgt) {
   683					dev_err(dev, "Could not get sg_table from plane %d\n", plane);
   684					kfree(sgt_new);
   685					return -EINVAL;
   686				}
   687	#ifdef CAPTURE_CONTIG_ALLOC
   688				nents += 1;
   689	#else
   690				nents += sg_nents(img_mmu_get_sgl(sgt));
   691	#endif
   692			}
   693			buf->buf_info.buf_size = size;
   694	
   695			pages = (size + PAGE_SIZE - 1) / PAGE_SIZE;
   696			ret = sg_alloc_table(sgt_new, nents, GFP_KERNEL);
   697			if (ret) {
   698				kfree(sgt_new);
   699				return -EINVAL;
   700			}
   701			sgl_new = img_mmu_get_sgl(sgt_new);
   702	
   703			for (plane = 0; plane < num_planes; plane++) {
   704				sgt = vb2_dma_sg_plane_desc(vb, plane);
   705				if (!sgt) {
   706					dev_err(dev, "Could not get sg_table from plane %d\n", plane);
   707					sg_free_table(sgt_new);
   708					kfree(sgt_new);
   709					return -EINVAL;
   710				}
   711	#ifdef CAPTURE_CONTIG_ALLOC
 > 712				new_page = phys_to_page(vb2_dma_contig_plane_dma_addr(vb, plane));
   713				sg_set_page(sgl_new, new_page, ALIGN(vb2_plane_size(vb, plane),
   714								     PAGE_SIZE), 0);
   715				sgl_new = sg_next(sgl_new);
   716	#else
   717				sgl = img_mmu_get_sgl(sgt);
   718	
   719				while (sgl) {
   720					sg_set_page(sgl_new, sg_page(sgl), img_mmu_get_sgl_length(sgl), 0);
   721					sgl = sg_next(sgl);
   722					sgl_new = sg_next(sgl_new);
   723				}
   724	#endif
   725			}
   726	
   727			buf->buf_info.pictbuf_cfg = ctx->pict_bufcfg;
   728			ret = core_stream_map_buf_sg(ctx->res_str_id,
   729						     VDEC_BUFTYPE_PICTURE,
   730						     &buf->buf_info, sgt_new,
   731						     &buf->buf_map_id);
   732			sg_free_table(sgt_new);
   733			kfree(sgt_new);
   734			if (ret) {
   735				dev_err(dev, "CAPTURE core_stream_map_buf_sg failed\n");
   736				return ret;
   737			}
   738			list_add_tail(&buf->list, &ctx->cap_buffers);
   739		}
   740		buf->mapped = TRUE;
   741		buf->reuse = TRUE;
   742	
   743		return 0;
   744	}
   745	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux