[{"id":3934,"web_url":"https://patchwork.libcamera.org/comment/3934/","msgid":"<20200304232939.GE28814@pendragon.ideasonboard.com>","date":"2020-03-04T23:29:39","subject":"Re: [libcamera-devel] [PATCH v3 5/7] libcamera: V4L2BufferCache:\n\tCheck for hot hit first","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Thu, Mar 05, 2020 at 12:22:44AM +0100, Niklas Söderlund wrote:\n> Check for a hot cache hit before updating which buffer is best to evict\n> in case no hot hit is found.\n\nYou can add \"This doesn't change the behaviour, by follows a more\nlogical flow.\".\n\n> \n> Suggested-by: Jacopo Mondi <jacopo@jmondi.org>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 268de60bc7965f58..c495de85f26efe14 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -212,15 +212,15 @@ int V4L2BufferCache::get(const FrameBuffer &buffer)\n>  \t\tif (!entry.free)\n>  \t\t\tcontinue;\n>  \n> -\t\tif (use < 0)\n> -\t\t\tuse = index;\n> -\n>  \t\t/* Try to find a cache hit by comparing the planes. */\n>  \t\tif (entry == buffer) {\n>  \t\t\thit = true;\n>  \t\t\tuse = index;\n>  \t\t\tbreak;\n>  \t\t}\n> +\n> +\t\tif (use < 0)\n> +\t\t\tuse = index;\n>  \t}\n>  \n>  \tif (!hit)","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 05B8662734\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Mar 2020 00:29:44 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0C08E33E;\n\tThu,  5 Mar 2020 00:29:42 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1583364583;\n\tbh=Z/rkDa+bmtO368f0faL+tegRI2ce0VO37FY86IfbmwM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Nv2/1kCU9flAbTnWtte9hV4M8MSGU2jETKqeaBBfsJsXLN5VH+aY3Z9YEafetH1He\n\tcNQnFsFddW+OvyCAynpjmNzG4guP8gCceLBsdcMMwaF6mWUMZac8ObducNFFlLtVLD\n\tc4TQJWl+mMPhNFUSqc5ZzPg1XZx2LsUmmn1lSi8s=","Date":"Thu, 5 Mar 2020 01:29:39 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200304232939.GE28814@pendragon.ideasonboard.com>","References":"<20200304232246.325384-1-niklas.soderlund@ragnatech.se>\n\t<20200304232246.325384-6-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200304232246.325384-6-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v3 5/7] libcamera: V4L2BufferCache:\n\tCheck for hot hit first","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>","X-List-Received-Date":"Wed, 04 Mar 2020 23:29:44 -0000"}}]