[{"id":22581,"web_url":"https://patchwork.libcamera.org/comment/22581/","msgid":"<YkxxKTbxWFmIvSL0@pendragon.ideasonboard.com>","date":"2022-04-05T16:41:13","subject":"Re: [libcamera-devel] [PATCH v2 0/5] generate and use fixed-sized\n\tSpan Control types","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Christian,\n\nOn Tue, Apr 05, 2022 at 01:42:10AM +0100, Christian Rauch via libcamera-devel wrote:\n> Hello,\n> \n> This is version 2 of my fixed-sized Span patch set. The changes from\n> version 1 include changes to the code style in \"gen-controls.py\" and\n> the way how memory for default constructed fixed-sized Spans is\n> allocated.\n> \n> The default Span constructor in version 1 used a temporarily\n> constructed \"std::array<>\" resulting in the Span storing a pointer to\n> deallocated memory. Version 2 replaced this with an empty Span. In\n> practice, this means that a Span will store its target fixed-size as\n> the \"extent\" and its current storage capacity by \"size_\".\n\nThat's not how std::span<> is meant to work. Spans can have a fixed\nextent or a dynamic extent, and when they have fixed extents, the number\nof elements (the size) is always equal to the extent. There's no size_\nmember to the fixed extent span for that reason. As explained in another\ne-mail in this series, I'd like to avoid departing from the std::span\nAPI in order to be able to switch to that class in the future.\n\n> Christian Rauch (5):\n>   define Span size as shape vector\n>   generate fixed- and variable-sized Span Controls\n>   provide a default fixed-sized Span constructor\n>   apply clang-format style\n>   apply explicit fixed-sized Span type casts\n> \n>  include/libcamera/base/span.h                 |  47 +++---\n>  include/libcamera/controls.h                  |   2 +-\n>  src/ipa/raspberrypi/raspberrypi.cpp           |  21 +--\n>  src/libcamera/control_ids.yaml                |   2 +-\n>  .../pipeline/raspberrypi/raspberrypi.cpp      |  36 +++--\n>  src/libcamera/property_ids.yaml               |   4 +-\n>  src/qcam/dng_writer.cpp                       | 142 +++++++++---------\n>  test/span.cpp                                 |   4 +-\n>  utils/gen-controls.py                         |  33 ++--\n>  9 files changed, 154 insertions(+), 137 deletions(-)\n> \n> --\n> 2.25.1","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 74FADC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Apr 2022 16:41:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D36DD65642;\n\tTue,  5 Apr 2022 18:41:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A97FA604BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Apr 2022 18:41:16 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 155925D;\n\tTue,  5 Apr 2022 18:41:16 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649176877;\n\tbh=tpXOVFhFIitdU89EcBegdmqOv0LxXcj9hB64lt0mUTc=;\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=u5atJukoHYQHIEeFoVLZQvOD4oFTOREjW3q/0YsNheH1zhtJ7QRbPYxD5f/S1BSDs\n\tegYHEnjp5Nz1B5gWBYCtz0cvbTavbiBCojE7fX+WR6xGWlRm/dCqoXBHVLxSmZ+bIq\n\twTRW2EgSzjARFRM2BjSQd+yZX5cvNGF84CbxRDpKs8Db2vk5/hADj3pZS7jSpEVs0w\n\t5ZfdY2teUyoH4V00wf5HbGCnAjwh0TUdN500EzZL4MyGaQoffeUg56EsBpIHYEgHl+\n\tmLU4EXv5m9C1ulLrEZfxSW2wpQRGhU9Qpj09RH8qCFnRbCC+/5FShdegaBdx0RitKu\n\tz315uSVXeZoWQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649176876;\n\tbh=tpXOVFhFIitdU89EcBegdmqOv0LxXcj9hB64lt0mUTc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CiZyrE0XApRJOnnLewh+RiaESHY9kKzVEGPLZVa0EKryyBnq/6g8J459UK3ZO7CFs\n\tetk3h/fYZEgqmR86MPn1o4ULn3b1FUw/gopcoCayp/DadfS88+TT7cI2zitVzGov5T\n\tiRxZqpIHCUusHBeFTVT9RxAqETP4nuyKH8PfrGtc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"CiZyrE0X\"; dkim-atps=neutral","Date":"Tue, 5 Apr 2022 19:41:13 +0300","To":"Christian Rauch <Rauch.Christian@gmx.de>","Message-ID":"<YkxxKTbxWFmIvSL0@pendragon.ideasonboard.com>","References":"<20220405004215.86340-1-Rauch.Christian@gmx.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220405004215.86340-1-Rauch.Christian@gmx.de>","Subject":"Re: [libcamera-devel] [PATCH v2 0/5] generate and use fixed-sized\n\tSpan Control types","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>"}}]