From: kbuild test robot <lkp@intel.com>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: kbuild-all@01.org, laurent.pinchart@ideasonboard.com,
magnus.damm@gmail.com, geert@glider.be, hverkuil@xs4all.nl,
mchehab@kernel.org, festevam@gmail.com, sakari.ailus@iki.fi,
robh+dt@kernel.org, mark.rutland@arm.com, pombredanne@nexb.com,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org,
linux-sh@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 07/11] media: i2c: ov772x: Support frame interval handling
Date: Tue, 20 Feb 2018 12:25:00 +0800 [thread overview]
Message-ID: <201802201256.tgrxFaAu%fengguang.wu@intel.com> (raw)
In-Reply-To: <1519059584-30844-8-git-send-email-jacopo+renesas@jmondi.org>
[-- Attachment #1: Type: text/plain, Size: 4395 bytes --]
Hi Jacopo,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.16-rc2 next-20180220]
[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/Jacopo-Mondi/Renesas-Capture-Engine-Unit-CEU-V4L2-driver/20180220-101027
base: git://linuxtv.org/media_tree.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
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/i2c/ov772x.c: In function 'ov772x_set_frame_rate.isra.2':
>> drivers/media/i2c/ov772x.c:643:7: warning: 'fsize' may be used uninitialized in this function [-Wmaybe-uninitialized]
pclk = fps * fsize;
~~~~~^~~~~~~~~~~~~
vim +/fsize +643 drivers/media/i2c/ov772x.c
604
605 static int ov772x_set_frame_rate(struct ov772x_priv *priv,
606 struct v4l2_fract *tpf,
607 const struct ov772x_color_format *cfmt,
608 const struct ov772x_win_size *win)
609 {
610 struct i2c_client *client = v4l2_get_subdevdata(&priv->subdev);
611 unsigned long fin = clk_get_rate(priv->clk);
612 unsigned int fps = tpf->numerator ?
613 tpf->denominator / tpf->numerator :
614 tpf->denominator;
615 unsigned int best_diff;
616 unsigned int fsize;
617 unsigned int pclk;
618 unsigned int diff;
619 unsigned int idx;
620 unsigned int i;
621 u8 clkrc = 0;
622 u8 com4 = 0;
623 int ret;
624
625 /* Approximate to the closest supported frame interval. */
626 best_diff = ~0L;
627 for (i = 0, idx = 0; i < OV772X_N_FRAME_INTERVALS; i++) {
628 diff = abs(fps - ov772x_frame_intervals[i]);
629 if (diff < best_diff) {
630 idx = i;
631 best_diff = diff;
632 }
633 }
634 fps = ov772x_frame_intervals[idx];
635
636 /* Use image size (with blankings) to calculate desired pixel clock. */
637 if ((cfmt->com7 & OFMT_MASK) == OFMT_RGB ||
638 (cfmt->com7 & OFMT_MASK) == OFMT_YUV)
639 fsize = win->sizeimage * 2;
640 else if ((cfmt->com7 & OFMT_MASK) == OFMT_BRAW)
641 fsize = win->sizeimage;
642
> 643 pclk = fps * fsize;
644
645 /*
646 * Pixel clock generation circuit is pretty simple:
647 *
648 * Fin -> [ / CLKRC_div] -> [ * PLL_mult] -> pclk
649 *
650 * Try to approximate the desired pixel clock testing all available
651 * PLL multipliers (1x, 4x, 6x, 8x) and calculate corresponding
652 * divisor with:
653 *
654 * div = PLL_mult * Fin / pclk
655 *
656 * and re-calculate the pixel clock using it:
657 *
658 * pclk = Fin * PLL_mult / CLKRC_div
659 *
660 * Choose the PLL_mult and CLKRC_div pair that gives a pixel clock
661 * closer to the desired one.
662 *
663 * The desired pixel clock is calculated using a known frame size
664 * (blanking included) and FPS.
665 */
666 best_diff = ~0L;
667 for (i = 0; i < ARRAY_SIZE(ov772x_pll); i++) {
668 unsigned int pll_mult = ov772x_pll[i].mult;
669 unsigned int pll_out = pll_mult * fin;
670 unsigned int t_pclk;
671 unsigned int div;
672
673 if (pll_out < pclk)
674 continue;
675
676 div = DIV_ROUND_CLOSEST(pll_out, pclk);
677 t_pclk = DIV_ROUND_CLOSEST(fin * pll_mult, div);
678 diff = abs(pclk - t_pclk);
679 if (diff < best_diff) {
680 best_diff = diff;
681 clkrc = CLKRC_DIV(div);
682 com4 = ov772x_pll[i].com4;
683 }
684 }
685
686 ret = ov772x_write(client, COM4, com4 | COM4_RESERVED);
687 if (ret < 0)
688 return ret;
689
690 ret = ov772x_write(client, CLKRC, clkrc | CLKRC_RESERVED);
691 if (ret < 0)
692 return ret;
693
694 tpf->numerator = 1;
695 tpf->denominator = fps;
696 priv->fps = tpf->denominator;
697
698 return 0;
699 }
700
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 63087 bytes --]
next prev parent reply other threads:[~2018-02-20 4:26 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 16:59 [PATCH v9 00/11] Renesas Capture Engine Unit (CEU) V4L2 driver Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 01/11] dt-bindings: media: Add Renesas CEU bindings Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 02/11] include: media: Add Renesas CEU driver interface Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 03/11] media: platform: Add Renesas CEU driver Jacopo Mondi
2018-02-20 3:35 ` kbuild test robot
2018-02-21 12:03 ` Hans Verkuil
2018-02-21 12:29 ` Laurent Pinchart
2018-02-21 13:02 ` Hans Verkuil
2018-02-21 16:43 ` jacopo mondi
2018-02-19 16:59 ` [PATCH v9 04/11] ARM: dts: r7s72100: Add Capture Engine Unit (CEU) Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 05/11] media: i2c: Copy ov772x soc_camera sensor driver Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 06/11] media: i2c: ov772x: Remove soc_camera dependencies Jacopo Mondi
2018-02-21 12:08 ` Hans Verkuil
2018-02-19 16:59 ` [PATCH v9 07/11] media: i2c: ov772x: Support frame interval handling Jacopo Mondi
2018-02-20 4:25 ` kbuild test robot [this message]
2018-02-20 5:22 ` kbuild test robot
2018-02-20 5:22 ` [RFC PATCH] media: i2c: ov772x: ov772x_frame_intervals[] can be static kbuild test robot
2018-02-21 12:12 ` [PATCH v9 07/11] media: i2c: ov772x: Support frame interval handling Hans Verkuil
2018-02-21 15:16 ` jacopo mondi
2018-02-21 15:23 ` Hans Verkuil
2018-02-19 16:59 ` [PATCH v9 08/11] media: i2c: Copy tw9910 soc_camera sensor driver Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 09/11] media: i2c: tw9910: Remove soc_camera dependencies Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 10/11] arch: sh: migor: Use new renesas-ceu camera driver Jacopo Mondi
2018-02-19 16:59 ` [PATCH v9 11/11] media: i2c: ov7670: Fully set mbus frame fmt Jacopo Mondi
2018-02-19 19:19 ` Laurent Pinchart
2018-02-20 8:58 ` jacopo mondi
2018-02-21 15:47 ` jacopo mondi
2018-02-21 16:28 ` Hans Verkuil
2018-02-21 20:28 ` Laurent Pinchart
2018-02-22 12:04 ` jacopo mondi
2018-02-22 12:14 ` Laurent Pinchart
2018-02-22 12:36 ` jacopo mondi
2018-02-22 12:47 ` Laurent Pinchart
2018-02-22 14:26 ` jacopo mondi
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=201802201256.tgrxFaAu%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=geert@glider.be \
--cc=hverkuil@xs4all.nl \
--cc=jacopo+renesas@jmondi.org \
--cc=kbuild-all@01.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=pombredanne@nexb.com \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@iki.fi \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®