[{"id":25148,"web_url":"https://patchwork.libcamera.org/comment/25148/","msgid":"<20220928070916.ken4hmql67jlreft@uno.localdomain>","date":"2022-09-28T07:09:16","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Limit minimum\n\texposure time for the IMX296","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Naush\n\nOn Mon, Sep 26, 2022 at 10:36:39AM +0100, Naushir Patuck via libcamera-devel wrote:\n> Limit the minimum allowable exposure time to a single line in the IMX296 camera\n> helper. This equates to approximately 30us.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n>  src/ipa/raspberrypi/cam_helper_imx296.cpp | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp\n> index 09f828ea6249..66d21e36ecd0 100644\n> --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp\n> @@ -26,6 +26,7 @@ public:\n>  \tvoid getDelays(int &exposureDelay, int &gainDelay, int &vblankDelay) const override;\n>\n>  private:\n> +\tstatic constexpr uint32_t minExposureLines = 1;\n>  \tstatic constexpr uint32_t maxGainCode = 239;\n>  \tstatic constexpr Duration timePerLine = 550.0 / 37.125e6 * 1.0s;\n>\n> @@ -54,12 +55,12 @@ double CamHelperImx296::gain(uint32_t gainCode) const\n>\n>  uint32_t CamHelperImx296::exposureLines(Duration exposure) const\n>  {\n> -\treturn (exposure - 14.26us) / timePerLine;\n> +\treturn std::max<uint32_t>(minExposureLines, (exposure - 14.26us) / timePerLine);\n>  }\n>\n>  Duration CamHelperImx296::exposure(uint32_t exposureLines) const\n>  {\n> -\treturn exposureLines * timePerLine + 14.26us;\n> +\treturn std::max<uint32_t>(minExposureLines, exposureLines) * timePerLine + 14.26us;\n>  }\n>\n>  void CamHelperImx296::getDelays(int &exposureDelay, int &gainDelay,\n> --\n> 2.25.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5DD44BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Sep 2022 07:09:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 147C762295;\n\tWed, 28 Sep 2022 09:09:21 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0BD3761F7A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Sep 2022 09:09:19 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 87242FF813;\n\tWed, 28 Sep 2022 07:09:18 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664348961;\n\tbh=6Zwdh9A6Uy+SutOA+wWKIQYbktCdp2jvtyaqcrJucSE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Dn5e87LwaeYIAIbmiBR/7yXlC9FIy0fbZ1jO8JfbjFgKiZKr/AdGuakG9fqK8Y+AF\n\ttlK6NTgsRvIqV9QwahfMx6k6fNEk6AuwGTzpBio0o945rSxdQzEE4G/0RQf+hscQzA\n\t6/I/sR+lsAYIBvc5iyI1OBtlyuGg8WG4ilBUORKjHXTzFVjiu2LPPnDBwDdwcMsGlE\n\tYm7f+DdHtXsgrhlNIiEVAtwmquTipE9lxT60KnLs0LtdzhEYLzHxJRdXW7QbAdjGID\n\tOC5J+sPXnExxPZ4DTYTkWKIdyrJ3w0Dry3PQHJVaI81hkwToScPmgKuhQ5oJsWQ7vy\n\tOWQEbQ5F183xg==","Date":"Wed, 28 Sep 2022 09:09:16 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20220928070916.ken4hmql67jlreft@uno.localdomain>","References":"<20220926093639.29946-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220926093639.29946-1-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Limit minimum\n\texposure time for the IMX296","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25229,"web_url":"https://patchwork.libcamera.org/comment/25229/","msgid":"<CAHW6GY+ci8kDiZRqd93mg4_XujW_ECU7qu3uQkKFVU+39y0WSw@mail.gmail.com>","date":"2022-10-03T09:27:50","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Limit minimum\n\texposure time for the IMX296","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch!\n\nOn Wed, 28 Sept 2022 at 08:09, Jacopo Mondi via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> Hi Naush\n>\n> On Mon, Sep 26, 2022 at 10:36:39AM +0100, Naushir Patuck via libcamera-devel wrote:\n> > Limit the minimum allowable exposure time to a single line in the IMX296 camera\n> > helper. This equates to approximately 30us.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n>\n> Thanks\n>   j\n>\n> > ---\n> >  src/ipa/raspberrypi/cam_helper_imx296.cpp | 5 +++--\n> >  1 file changed, 3 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp\n> > index 09f828ea6249..66d21e36ecd0 100644\n> > --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp\n> > +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp\n> > @@ -26,6 +26,7 @@ public:\n> >       void getDelays(int &exposureDelay, int &gainDelay, int &vblankDelay) const override;\n> >\n> >  private:\n> > +     static constexpr uint32_t minExposureLines = 1;\n> >       static constexpr uint32_t maxGainCode = 239;\n> >       static constexpr Duration timePerLine = 550.0 / 37.125e6 * 1.0s;\n> >\n> > @@ -54,12 +55,12 @@ double CamHelperImx296::gain(uint32_t gainCode) const\n> >\n> >  uint32_t CamHelperImx296::exposureLines(Duration exposure) const\n> >  {\n> > -     return (exposure - 14.26us) / timePerLine;\n> > +     return std::max<uint32_t>(minExposureLines, (exposure - 14.26us) / timePerLine);\n> >  }\n> >\n> >  Duration CamHelperImx296::exposure(uint32_t exposureLines) const\n> >  {\n> > -     return exposureLines * timePerLine + 14.26us;\n> > +     return std::max<uint32_t>(minExposureLines, exposureLines) * timePerLine + 14.26us;\n> >  }\n> >\n> >  void CamHelperImx296::getDelays(int &exposureDelay, int &gainDelay,\n> > --\n> > 2.25.1\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 98AE9C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 09:28:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4DC8E61F74;\n\tMon,  3 Oct 2022 11:28:04 +0200 (CEST)","from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com\n\t[IPv6:2607:f8b0:4864:20::1035])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2A7161F74\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 11:28:02 +0200 (CEST)","by mail-pj1-x1035.google.com with SMTP id b15so1341949pje.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 03 Oct 2022 02:28:02 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664789284;\n\tbh=1Re2iAIHVVwZ5xHh2KgQMMERd3cplaKYrQ5HoKAwiXg=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=TIbuf8tjsMmzMjLyvMumAUe9eZenE+13Nr9vNK5BJrrCG5avyAE9S906XAuab74Wh\n\t8Mx15kdR6Q0Rwz3Z6/hpvUEWfr9gGZZc9/CExbhnvea2wLzK6VVo8I49mhK5BwZYu7\n\tvve/2LnBGidiEcid7xCOi7phiTzKHzCUk00cL7EMoehJve0VRnZ1gk5bjx8ekg/Y+a\n\tsYb0mRWa66wHyXSkesrBU3ImECGIq7pHrcc7a6JaKfuk7S07m/6pLSNSfVPEc/PuFZ\n\tWuPaWF/9e4eAYl5kWZ1gOR2F3skFIRMrJZN3zffXW4KVYEgU0WI7lbFOuWH6ELWwgY\n\tdKpfYglCrJnjQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date;\n\tbh=cZpkU6qXH+U7BMD1F3uahxlrm4CNMDULzbzdAyL5sW4=;\n\tb=HKT/5d1UFRorjPF31RmbTECaCq/3y5SVE1cIxAF3zkjRnYSa0y+1Xu21n/4k/fZ/+w\n\tGtfGVZU4SbPJrewc7Lph91ZPg2wzJShrmKJGcWeAadRnxqHyMXtHJU3pe7RMViosAn37\n\tEXhOLuAyAoUwXguAqJT/QGFwtt6jaeK5Js3NEJjBywP9A7VffADMr6yCDoQyuGcaHhkA\n\tUi3xZ3PaEmi+NfAYB9mj1yr4dUpM2I46boBngXji/crjpsZudYt9Fk65GBd/r2m9LqWt\n\t7oVqsJ+RrRAtUzsL1Bw7J0wkAwgotZmskHpmUuhAATno5uolaVtEg5ewd66euy1SL8vI\n\tVfAA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"HKT/5d1U\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date;\n\tbh=cZpkU6qXH+U7BMD1F3uahxlrm4CNMDULzbzdAyL5sW4=;\n\tb=DfKbRm5w7r/+3subFAdFGp7W5ZRxNpLf123K6hpGh4HpRBuUIyu9F1pbeM0Nh6D5pa\n\t/gkE2OSDoTjUoF0mTHOvu265wJJmUJesQJKo7TArVlkz+Ynp07P3Rkmb7sigp4J7+tlu\n\t9Ao4plcS4avp/CZdD1YJiGaaB9gnS8fPd3UJZcnDGt8xQR+1wO3GMgVBy6S42PsnY8SZ\n\tyBjqqKFE512fRcAPUfxi8N8G3FldyTA6EsEzqt8+mpYGNZ0d27Gh5qG2mgJMcBU/VdEa\n\tRei52fdCb7K/p9hlb2cI7gZ4kfOaHY3hldEP28ub2mxIVDNvYTMt23yEHcBntP7ZObBD\n\tr/xw==","X-Gm-Message-State":"ACrzQf0OvQkOD+ddBlh4aQ+UNz5Or4fOM90ZB24dShpzB8NQO4gRLMj1\n\tM1SM4Sg3JjHkCxCVzgCOwu/Hwh3A74gxHwJrwjGVTg==","X-Google-Smtp-Source":"AMsMyM5ZdDRwpyKwGaO0fUVuT5eKBXdqWCPkYUf4EEdYHUCTu9Kp2DLsPaw04zuXxYnZunIxFX9XRRenyz/n4skPVuk=","X-Received":"by 2002:a17:90b:4f45:b0:203:1cf4:6a54 with SMTP id\n\tpj5-20020a17090b4f4500b002031cf46a54mr11179472pjb.235.1664789281443;\n\tMon, 03 Oct 2022 02:28:01 -0700 (PDT)","MIME-Version":"1.0","References":"<20220926093639.29946-1-naush@raspberrypi.com>\n\t<20220928070916.ken4hmql67jlreft@uno.localdomain>","In-Reply-To":"<20220928070916.ken4hmql67jlreft@uno.localdomain>","Date":"Mon, 3 Oct 2022 10:27:50 +0100","Message-ID":"<CAHW6GY+ci8kDiZRqd93mg4_XujW_ECU7qu3uQkKFVU+39y0WSw@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Limit minimum\n\texposure time for the IMX296","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]