Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4695017imm; Mon, 18 Jun 2018 21:05:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJAqmgTDmwCYTSbF6lV84yzot8YfjgxQiewYrfWl6v6yOpwIZa+EhmSv7ervDeFX+NUqrUu X-Received: by 2002:a65:5a4f:: with SMTP id z15-v6mr12884345pgs.283.1529381142031; Mon, 18 Jun 2018 21:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529381142; cv=none; d=google.com; s=arc-20160816; b=zHbq5GNBBewNky+moCEaEcQtrVs4Y/kmJyboSIs85UD7pNv7rezz04LtFsHbOBlWXX NiF0buR3QcRPBqWtNWU1BDL24h/Y3phurzRcz0oFXS38Av3tIWpLQX9zK58bUnR1xiDs yYBh3FI4c26n0d0SfL6MNtj7boY3PLdX3RzKdfBODyOKsJ1rfWdwepAA4Amht/J8/ICI CJy1UZhL8XM0ZdrkMArhSBChYjRr737ontdH7O7CO3SPyy2iUUdqSBRdAgmqzSofnkQo n6e7HzXdSyHZ8OQTGRWtEV4psWxOMqzSR6IJ3b/Te5QFRqBgrNEaRpuOx7LFG7fhC2tg hWHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=6lHHq5StT3DE6W7889heYnf/juNNozka0k+yvjZYazE=; b=zf/V7kp9GHG753Ob4yaaQZeUiBU7JuaQX/hVJD3pTKvz4Q0FMMhjw4av+Qa5t5cDCp 4I+JWZL+e5m1KFG/WNt0jgQHSV+v+1v+uYh7oo98JmaOA5569VxT7Jp6bPrIP1CSXkbf kvEAojyeN34BZ2WpqrdZyCokKb/sQC4VTANnFOQkb3Kb5IdAXna6zkzt9C/N74vu703B L4To33r52WV0ltGiviuDyzM+uF8/27XKPXOEh1MyGWYdVhTrJuQUwBJx3YpsppjnPSAJ SsSbzbFPT51BRBx6BtBpUbH6hGLBNNjSKD7/jTDVWNhEoLTeigDIaKolnPC/5zEbj4Sq rh/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si17876264plb.381.2018.06.18.21.05.27; Mon, 18 Jun 2018 21:05:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750770AbeFSEEx (ORCPT + 99 others); Tue, 19 Jun 2018 00:04:53 -0400 Received: from mga03.intel.com ([134.134.136.65]:36973 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750718AbeFSEEw (ORCPT ); Tue, 19 Jun 2018 00:04:52 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 21:04:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,241,1526367600"; d="scan'208";a="48777636" Received: from aosowska-mobl2.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.252.34.137]) by fmsmga008.fm.intel.com with ESMTP; 18 Jun 2018 21:04:33 -0700 Received: by kekkonen.fi.intel.com (Postfix, from userid 1000) id A964B21E18; Tue, 19 Jun 2018 07:04:32 +0300 (EEST) Date: Tue, 19 Jun 2018 07:04:32 +0300 From: Sakari Ailus To: Todor Tomov Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] media: ov5645: Report number of skip frames Message-ID: <20180619040432.xbcrkgof6rycg3db@kekkonen.localdomain> References: <1529309219-27404-1-git-send-email-todor.tomov@linaro.org> <1529309219-27404-2-git-send-email-todor.tomov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529309219-27404-2-git-send-email-todor.tomov@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Todor, On Mon, Jun 18, 2018 at 11:06:59AM +0300, Todor Tomov wrote: > The OV5645 supports automatic exposure (AE) and automatic white > balance (AWB). When streaming is started it takes up to 5 frames > until the AE and AWB converge and output a frame with good quality. The frames aren't bad as such; it's just that the AE hasn't converged yet. I presume the number of the frames needed depends on the lighting conditions. The g_skip_frames is intended to tell the frames really are bad, i.e. distorted or broken somehow. I wouldn't discard them on the grounds of unconverged exposure. If we did, then on which other grounds should the frames be discarded as well? Does the white balance and focus need to be converged as well before considering the frames good, for instance? If you need this, I'd use a control instead to tell AE has converged. I wonder what others think. > > Implement g_skip_frames to report number of frames to be skipped > when streaming is started. > > Signed-off-by: Todor Tomov > --- > drivers/media/i2c/ov5645.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c > index 1722cda..00bc3c0 100644 > --- a/drivers/media/i2c/ov5645.c > +++ b/drivers/media/i2c/ov5645.c > @@ -70,6 +70,9 @@ > #define OV5645_SDE_SAT_U 0x5583 > #define OV5645_SDE_SAT_V 0x5584 > > +/* Number of frames needed for AE and AWB to converge */ > +#define OV5645_NUM_OF_SKIP_FRAMES 5 > + > struct reg_value { > u16 reg; > u8 val; > @@ -1071,6 +1074,13 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) > return 0; > } > > +static int ov5645_get_skip_frames(struct v4l2_subdev *sd, u32 *frames) > +{ > + *frames = OV5645_NUM_OF_SKIP_FRAMES; > + > + return 0; > +} > + > static const struct v4l2_subdev_core_ops ov5645_core_ops = { > .s_power = ov5645_s_power, > }; > @@ -1088,10 +1098,15 @@ static const struct v4l2_subdev_pad_ops ov5645_subdev_pad_ops = { > .get_selection = ov5645_get_selection, > }; > > +static const struct v4l2_subdev_sensor_ops ov5645_sensor_ops = { > + .g_skip_frames = ov5645_get_skip_frames, > +}; > + > static const struct v4l2_subdev_ops ov5645_subdev_ops = { > .core = &ov5645_core_ops, > .video = &ov5645_video_ops, > .pad = &ov5645_subdev_pad_ops, > + .sensor = &ov5645_sensor_ops, > }; > > static int ov5645_probe(struct i2c_client *client, > -- > 2.7.4 > -- Sakari Ailus sakari.ailus@linux.intel.com