Re: [PATCH v2 2/2] media: coda: Add i.MX51 (CodaHx4) support

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

 




Hi Philipp,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.15-rc4 next-20171220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Philipp-Zabel/media-dt-bindings-coda-Add-compatible-for-CodaHx4-on-i-MX51/20171221-050217
base:   git://linuxtv.org/media_tree.git master
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/media/platform/coda/coda-bit.c: In function 'coda_setup_iram':
>> drivers/media/platform/coda/coda-bit.c:648:28: warning: 'me_bits' may be used uninitialized in this function [-Wmaybe-uninitialized]
       iram_info->axi_sram_use |= me_bits;
                               ^~

vim +/me_bits +648 drivers/media/platform/coda/coda-bit.c

   588	
   589	static void coda_setup_iram(struct coda_ctx *ctx)
   590	{
   591		struct coda_iram_info *iram_info = &ctx->iram_info;
   592		struct coda_dev *dev = ctx->dev;
   593		int w64, w128;
   594		int mb_width;
   595		int dbk_bits;
   596		int bit_bits;
   597		int ip_bits;
   598		int me_bits;
   599	
   600		memset(iram_info, 0, sizeof(*iram_info));
   601		iram_info->next_paddr = dev->iram.paddr;
   602		iram_info->remaining = dev->iram.size;
   603	
   604		if (!dev->iram.vaddr)
   605			return;
   606	
   607		switch (dev->devtype->product) {
   608		case CODA_HX4:
   609			dbk_bits = CODA7_USE_HOST_DBK_ENABLE;
   610			bit_bits = CODA7_USE_HOST_BIT_ENABLE;
   611			ip_bits = CODA7_USE_HOST_IP_ENABLE;
   612			me_bits = CODA7_USE_HOST_ME_ENABLE;
   613			break;
   614		case CODA_7541:
   615			dbk_bits = CODA7_USE_HOST_DBK_ENABLE | CODA7_USE_DBK_ENABLE;
   616			bit_bits = CODA7_USE_HOST_BIT_ENABLE | CODA7_USE_BIT_ENABLE;
   617			ip_bits = CODA7_USE_HOST_IP_ENABLE | CODA7_USE_IP_ENABLE;
   618			me_bits = CODA7_USE_HOST_ME_ENABLE | CODA7_USE_ME_ENABLE;
   619			break;
   620		case CODA_960:
   621			dbk_bits = CODA9_USE_HOST_DBK_ENABLE | CODA9_USE_DBK_ENABLE;
   622			bit_bits = CODA9_USE_HOST_BIT_ENABLE | CODA7_USE_BIT_ENABLE;
   623			ip_bits = CODA9_USE_HOST_IP_ENABLE | CODA7_USE_IP_ENABLE;
   624			break;
   625		default: /* CODA_DX6 */
   626			return;
   627		}
   628	
   629		if (ctx->inst_type == CODA_INST_ENCODER) {
   630			struct coda_q_data *q_data_src;
   631	
   632			q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
   633			mb_width = DIV_ROUND_UP(q_data_src->width, 16);
   634			w128 = mb_width * 128;
   635			w64 = mb_width * 64;
   636	
   637			/* Prioritize in case IRAM is too small for everything */
   638			if (dev->devtype->product == CODA_HX4 ||
   639			    dev->devtype->product == CODA_7541) {
   640				iram_info->search_ram_size = round_up(mb_width * 16 *
   641								      36 + 2048, 1024);
   642				iram_info->search_ram_paddr = coda_iram_alloc(iram_info,
   643							iram_info->search_ram_size);
   644				if (!iram_info->search_ram_paddr) {
   645					pr_err("IRAM is smaller than the search ram size\n");
   646					goto out;
   647				}
 > 648				iram_info->axi_sram_use |= me_bits;
   649			}
   650	
   651			/* Only H.264BP and H.263P3 are considered */
   652			iram_info->buf_dbk_y_use = coda_iram_alloc(iram_info, w64);
   653			iram_info->buf_dbk_c_use = coda_iram_alloc(iram_info, w64);
   654			if (!iram_info->buf_dbk_c_use)
   655				goto out;
   656			iram_info->axi_sram_use |= dbk_bits;
   657	
   658			iram_info->buf_bit_use = coda_iram_alloc(iram_info, w128);
   659			if (!iram_info->buf_bit_use)
   660				goto out;
   661			iram_info->axi_sram_use |= bit_bits;
   662	
   663			iram_info->buf_ip_ac_dc_use = coda_iram_alloc(iram_info, w128);
   664			if (!iram_info->buf_ip_ac_dc_use)
   665				goto out;
   666			iram_info->axi_sram_use |= ip_bits;
   667	
   668			/* OVL and BTP disabled for encoder */
   669		} else if (ctx->inst_type == CODA_INST_DECODER) {
   670			struct coda_q_data *q_data_dst;
   671	
   672			q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
   673			mb_width = DIV_ROUND_UP(q_data_dst->width, 16);
   674			w128 = mb_width * 128;
   675	
   676			iram_info->buf_dbk_y_use = coda_iram_alloc(iram_info, w128);
   677			iram_info->buf_dbk_c_use = coda_iram_alloc(iram_info, w128);
   678			if (!iram_info->buf_dbk_c_use)
   679				goto out;
   680			iram_info->axi_sram_use |= dbk_bits;
   681	
   682			iram_info->buf_bit_use = coda_iram_alloc(iram_info, w128);
   683			if (!iram_info->buf_bit_use)
   684				goto out;
   685			iram_info->axi_sram_use |= bit_bits;
   686	
   687			iram_info->buf_ip_ac_dc_use = coda_iram_alloc(iram_info, w128);
   688			if (!iram_info->buf_ip_ac_dc_use)
   689				goto out;
   690			iram_info->axi_sram_use |= ip_bits;
   691	
   692			/* OVL and BTP unused as there is no VC1 support yet */
   693		}
   694	
   695	out:
   696		if (!(iram_info->axi_sram_use & CODA7_USE_HOST_IP_ENABLE))
   697			v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
   698				 "IRAM smaller than needed\n");
   699	
   700		if (dev->devtype->product == CODA_HX4 ||
   701		    dev->devtype->product == CODA_7541) {
   702			/* TODO - Enabling these causes picture errors on CODA7541 */
   703			if (ctx->inst_type == CODA_INST_DECODER) {
   704				/* fw 1.4.50 */
   705				iram_info->axi_sram_use &= ~(CODA7_USE_HOST_IP_ENABLE |
   706							     CODA7_USE_IP_ENABLE);
   707			} else {
   708				/* fw 13.4.29 */
   709				iram_info->axi_sram_use &= ~(CODA7_USE_HOST_IP_ENABLE |
   710							     CODA7_USE_HOST_DBK_ENABLE |
   711							     CODA7_USE_IP_ENABLE |
   712							     CODA7_USE_DBK_ENABLE);
   713			}
   714		}
   715	}
   716	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux