[{"id":24166,"web_url":"https://patchwork.libcamera.org/comment/24166/","msgid":"<YuCYtOQMm76M90/a@pendragon.ideasonboard.com>","date":"2022-07-27T01:45:24","subject":"Re: [libcamera-devel] [PATCH 01/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Tue, Jul 26, 2022 at 01:45:33PM +0100, Naushir Patuck via libcamera-devel wrote:\n> Refactor the source files in src/ipa/raspberrypi/ to match the\n> recommended formatting guidelines for the libcamera project. The vast majority\n> of changes in this commit comprise of switching from snake_case to CamelCase,\n> and starting class member functions with a lower case character.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  .../controller/sharpen_algorithm.hpp          |   2 +-\n>  .../raspberrypi/controller/sharpen_status.h   |   2 +-\n>  src/ipa/raspberrypi/md_parser.hpp             |  44 +--\n>  src/ipa/raspberrypi/md_parser_smia.cpp        | 108 +++----\n>  src/ipa/raspberrypi/raspberrypi.cpp           | 272 +++++++++---------\n>  5 files changed, 214 insertions(+), 214 deletions(-)\n\n[snip]","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 41580C3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 01:45:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EA07963312;\n\tWed, 27 Jul 2022 03:45:27 +0200 (CEST)","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 7E5D0603E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 03:45:26 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1ACC956D;\n\tWed, 27 Jul 2022 03:45:26 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658886327;\n\tbh=3U0tPM+7Z/tbjijYb0k5LHlsbkQ99LkLIXYXHPJ/U8k=;\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=vjZEMVe8/zJB6z18UiDwDBUwPWMZGCqLE1azwB+dTjYLk4WpZxKmTCr40DRrmCk6L\n\tuL+gtwmuBvvVXgmrX4/SpMpHUUyJaRybO/+fR59uqKmWpgM1JomgPS0UZFa3mJMP7Z\n\t8tjXTh83NI6GPB34M0yHRivU35Ky1syOuTH47s8+ooVSfSr8r8MsGrfJ7LAs9GeT91\n\t4nJ6rVrKeSqfo4Vc3wpEio2gWrhv3Qgs+tKZJcJiohouMLbxrtgeuZttXe0CHbNPhW\n\taNadx7FRDFcH7opBE7FF9mOtuGEQ6QB56JfqgBlLThholW5QVfZyQ5CCK8FZufJ+/Q\n\tF2fSe6GwEXXug==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658886326;\n\tbh=3U0tPM+7Z/tbjijYb0k5LHlsbkQ99LkLIXYXHPJ/U8k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=lK2Qc0WV+oBt2u/H3HWTeGB6xCpbtSgxF6avmZ2thfyWqHMMzmy6mjMYmN40IvGwD\n\tLKCo+5bUPVUB/dTBc66BiVSsVanBvCgxO/M5G2Z6QH+9j8DkRcHCkNThbOKsCb6YOT\n\ttG2b2fOFfo+UT9yPoYm3FYadPG/C5GtVSkSpKFrk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"lK2Qc0WV\"; dkim-atps=neutral","Date":"Wed, 27 Jul 2022 04:45:24 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YuCYtOQMm76M90/a@pendragon.ideasonboard.com>","References":"<20220726124549.1646-1-naush@raspberrypi.com>\n\t<20220726124549.1646-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220726124549.1646-2-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 01/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24167,"web_url":"https://patchwork.libcamera.org/comment/24167/","msgid":"<YuCZKN45lYpZSQB6@pendragon.ideasonboard.com>","date":"2022-07-27T01:47:20","subject":"Re: [libcamera-devel] [PATCH 01/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Actually, one comment.\n\nOn Tue, Jul 26, 2022 at 01:45:33PM +0100, Naushir Patuck via libcamera-devel wrote:\n> Refactor the source files in src/ipa/raspberrypi/ to match the\n> recommended formatting guidelines for the libcamera project. The vast majority\n> of changes in this commit comprise of switching from snake_case to CamelCase,\n> and starting class member functions with a lower case character.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  .../controller/sharpen_algorithm.hpp          |   2 +-\n>  .../raspberrypi/controller/sharpen_status.h   |   2 +-\n>  src/ipa/raspberrypi/md_parser.hpp             |  44 +--\n>  src/ipa/raspberrypi/md_parser_smia.cpp        | 108 +++----\n>  src/ipa/raspberrypi/raspberrypi.cpp           | 272 +++++++++---------\n>  5 files changed, 214 insertions(+), 214 deletions(-)\n\n[snip]\n\n> diff --git a/src/ipa/raspberrypi/md_parser_smia.cpp b/src/ipa/raspberrypi/md_parser_smia.cpp\n> index ea5eac414b36..9fab6594baac 100644\n> --- a/src/ipa/raspberrypi/md_parser_smia.cpp\n> +++ b/src/ipa/raspberrypi/md_parser_smia.cpp\n\n[snip]\n\n> @@ -76,74 +76,74 @@ MdParserSmia::ParseStatus MdParserSmia::findRegs(libcamera::Span<const uint8_t>\n>  {\n>  \tASSERT(offsets_.size());\n>  \n> -\tif (buffer[0] != LINE_START)\n> -\t\treturn NO_LINE_START;\n> +\tif (buffer[0] != LineStart)\n> +\t\treturn NoLineStart;\n>  \n> -\tunsigned int current_offset = 1; /* after the LINE_START */\n> -\tunsigned int current_line_start = 0, current_line = 0;\n> -\tunsigned int reg_num = 0, regs_done = 0;\n> +\tunsigned int currentOffset = 1; /* after the LineStart */\n> +\tunsigned int currentLineStart = 0, currentLine = 0;\n> +\tunsigned int regNum = 0, regsDone = 0;\n>  \n>  \twhile (1) {\n> -\t\tint tag = buffer[current_offset++];\n> -\n> -\t\tif ((bits_per_pixel_ == 10 &&\n> -\t\t     (current_offset + 1 - current_line_start) % 5 == 0) ||\n> -\t\t    (bits_per_pixel_ == 12 &&\n> -\t\t     (current_offset + 1 - current_line_start) % 3 == 0)) {\n> -\t\t\tif (buffer[current_offset++] != REG_SKIP)\n> -\t\t\t\treturn BAD_DUMMY;\n> +\t\tint tag = buffer[currentOffset++];\n> +\n> +\t\tif ((bitsPerPixel_ == 10 &&\n> +\t\t     (currentOffset + 1 - currentLineStart) % 5 == 0) ||\n> +\t\t    (bitsPerPixel_ == 12 &&\n> +\t\t     (currentOffset + 1 - currentLineStart) % 3 == 0)) {\n> +\t\t\tif (buffer[currentOffset++] != RegSkip)\n> +\t\t\t\treturn BadDummy;\n>  \t\t}\n>  \n> -\t\tint data_byte = buffer[current_offset++];\n> +\t\tint dataByte = buffer[currentOffset++];\n>  \n> -\t\tif (tag == LINE_END_TAG) {\n> -\t\t\tif (data_byte != LINE_END_TAG)\n> -\t\t\t\treturn BAD_LINE_END;\n> +\t\tif (tag == LineEndTag) {\n> +\t\t\tif (dataByte != LineEndTag)\n> +\t\t\t\treturn BadLineEnd;\n>  \n> -\t\t\tif (num_lines_ && ++current_line == num_lines_)\n> -\t\t\t\treturn MISSING_REGS;\n> +\t\t\tif (numLines_ && ++currentLine == numLines_)\n> +\t\t\t\treturn MissingRegs;\n>  \n> -\t\t\tif (line_length_bytes_) {\n> -\t\t\t\tcurrent_offset = current_line_start + line_length_bytes_;\n> +\t\t\tif (lineLengthBytes_) {\n> +\t\t\t\tcurrentOffset = currentLineStart + lineLengthBytes_;\n>  \n>  \t\t\t\t/* Require whole line to be in the buffer (if buffer size set). */\n>  \t\t\t\tif (buffer.size() &&\n> -\t\t\t\t    current_offset + line_length_bytes_ > buffer.size())\n> -\t\t\t\t\treturn MISSING_REGS;\n> +\t\t\t\t    currentOffset + lineLengthBytes_ > buffer.size())\n> +\t\t\t\t\treturn MissingRegs;\n>  \n> -\t\t\t\tif (buffer[current_offset] != LINE_START)\n> -\t\t\t\t\treturn NO_LINE_START;\n> +\t\t\t\tif (buffer[currentOffset] != LineStart)\n> +\t\t\t\t\treturn NoLineStart;\n>  \t\t\t} else {\n>  \t\t\t\t/* allow a zero line length to mean \"hunt for the next line\" */\n> -\t\t\t\twhile (current_offset < buffer.size() &&\n> -\t\t\t\t       buffer[current_offset] != LINE_START)\n> -\t\t\t\t\tcurrent_offset++;\n> +\t\t\t\twhile (currentOffset < buffer.size() &&\n> +\t\t\t\t       buffer[currentOffset] != LineStart)\n> +\t\t\t\t\tcurrentOffset++;\n>  \n> -\t\t\t\tif (current_offset == buffer.size())\n> -\t\t\t\t\treturn NO_LINE_START;\n> +\t\t\t\tif (currentOffset == buffer.size())\n> +\t\t\t\t\treturn NoLineStart;\n>  \t\t\t}\n>  \n> -\t\t\t/* inc current_offset to after LINE_START */\n> -\t\t\tcurrent_line_start = current_offset++;\n> +\t\t\t/* inc current_offset to after LineStart */\n\ns/current_offset/currentOffset*/\n\n> +\t\t\tcurrentLineStart = currentOffset++;\n>  \t\t} else {\n> -\t\t\tif (tag == REG_HI_BITS)\n> -\t\t\t\treg_num = (reg_num & 0xff) | (data_byte << 8);\n> -\t\t\telse if (tag == REG_LOW_BITS)\n> -\t\t\t\treg_num = (reg_num & 0xff00) | data_byte;\n> -\t\t\telse if (tag == REG_SKIP)\n> -\t\t\t\treg_num++;\n> -\t\t\telse if (tag == REG_VALUE) {\n> -\t\t\t\tauto reg = offsets_.find(reg_num);\n> +\t\t\tif (tag == RegHiBits)\n> +\t\t\t\tregNum = (regNum & 0xff) | (dataByte << 8);\n> +\t\t\telse if (tag == RegLowBits)\n> +\t\t\t\tregNum = (regNum & 0xff00) | dataByte;\n> +\t\t\telse if (tag == RegSkip)\n> +\t\t\t\tregNum++;\n> +\t\t\telse if (tag == RegValue) {\n> +\t\t\t\tauto reg = offsets_.find(regNum);\n>  \n>  \t\t\t\tif (reg != offsets_.end()) {\n> -\t\t\t\t\toffsets_[reg_num] = current_offset - 1;\n> +\t\t\t\t\toffsets_[regNum] = currentOffset - 1;\n>  \n> -\t\t\t\t\tif (++regs_done == offsets_.size())\n> -\t\t\t\t\t\treturn PARSE_OK;\n> +\t\t\t\t\tif (++regsDone == offsets_.size())\n> +\t\t\t\t\t\treturn ParseOk;\n>  \t\t\t\t}\n> -\t\t\t\treg_num++;\n> +\t\t\t\tregNum++;\n>  \t\t\t} else\n> -\t\t\t\treturn ILLEGAL_TAG;\n> +\t\t\t\treturn IllegalTag;\n>  \t\t}\n>  \t}\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 2C36EC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 01:47:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 852B363312;\n\tWed, 27 Jul 2022 03:47:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 19CAF603E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 03:47:22 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8546656D;\n\tWed, 27 Jul 2022 03:47:21 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658886443;\n\tbh=4PvPfK6xiwTf5I9h75EWbNi5dfH13rjvzWcdutl/z2g=;\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=VCGSbnkPdwx+cEH2bc1rWICsJMU5vPh5pp3+p7lFt2ouDbbQHW8t/LqPorINbnGac\n\ty6L5Eu6Cnt/ElwSgZ5U6f0fUolaqLndykPzKhq0NR1flbHS8PJrozfoVZdWfikj54L\n\tMvWZeibj8thcYXl+v1iohL7ridEhNZKYay+04/g5DeVRIYHeWm28N3XKfgUNWGJfbh\n\tuKNhPOWSNaKzgKDBdKzruRkW0JvmLVLIz1P3mRPPQQrBxKHkjhmmfq+mEH3aOouZdT\n\tIIxcT2Xq74bRYrYKynS+qeR9JeDaOuxFs3L+6RiMScW2cjYB5jwAlGNoVjm+JZls88\n\twwWk8WuP4jCEA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658886441;\n\tbh=4PvPfK6xiwTf5I9h75EWbNi5dfH13rjvzWcdutl/z2g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AJfiOu5R5/tuRNEfqfoYGoua5Drgq97PISsUqMabtfbiQCp5oOBcT9dnevNtt8Eh1\n\tsYzYs8srPppAgML+2kodP8aiGokzEP2iECmAqueIi90MOC4K86skGxEhdgk0Bbwbhq\n\t6ZRAcRXNccA8n5jqpPbv79r9EJtcxUuqrTi+UilM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AJfiOu5R\"; dkim-atps=neutral","Date":"Wed, 27 Jul 2022 04:47:20 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YuCZKN45lYpZSQB6@pendragon.ideasonboard.com>","References":"<20220726124549.1646-1-naush@raspberrypi.com>\n\t<20220726124549.1646-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220726124549.1646-2-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 01/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]