[{"id":25287,"web_url":"https://patchwork.libcamera.org/comment/25287/","msgid":"<CAEmqJPqbi3iTBiyp7tSoFHRXq3zNjznx2s4+-pZFrsrrRHEqcw@mail.gmail.com>","date":"2022-10-05T09:36:02","subject":"Re: [libcamera-devel] [PATCH v2 0/4] libcamera: Fix kernel\n\tdeprecation warning with output buffers","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nOn Tue, 4 Oct 2022 at 23:29, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hello,\n>\n> This patch series fixes a warning printed by videobuf2.\n>\n> The V4L2 API specification indicates that, for an output video device,\n> the driver will interpret a zero bytesused value as the buffer length\n> (for v4l2_buffer) or the plane length (for v4l2_plane). The videobuf2\n> framework implements this behaviour, but also considers this case as\n> deprecated and prints a warning:\n>\n> [   54.375534] use of bytesused == 0 is deprecated and will be removed in\n> the future,\n> [   54.388026] use the actual size instead.\n>\n> This is triggered by the RkISP1 and IPU3 pipeline handlers, which don't\n> set bytesused for the parameters buffers.\n>\n> As the FrameBuffer metadata is private and only accessible in const form\n> outside of the class (with the exception of V4L2VideoDevice that is\n> listed as a friend), patch 1/4 first makes mutable access to the\n> metadata possible. In order to avoid exposing mutable access to\n> applications, it moves the metadata (and the other remaining private\n> members of the FrameBuffer class) to the FrameBuffer::Private class, and\n> exposes a mutable accessor there.\n>\n> Patches 2/4 and 3/4 then use this new metadata accessor to set the\n> bytesused values in the RkISP1 and IPU3 pipeline handlers. Finally,\n> patch 4/4 prints a warning message in V4L2VideoDevice::queueBuffer() to\n> catch callers that still use the deprecated API.\n>\n> One nice side effect of patch 1/4 is that the V4L2VideoDevice class\n> doesn't need to be listed as a friend of the FrameBuffer class anymore.\n>\n> 2/4 and 3/4 currently hardcode the bytesused value to the size of the\n> parameters buffer structure. This works fine with the RkISP1 and IPU3\n> pipeline handlers as the parameters buffers have a fixed size, but other\n> devices in the future may use a variable-size buffer which would require\n> the IPA module to pass the data size to the pipeline handler. I was\n> tempted to do the same for RkISP1 and IPU3 for correctness, but decided\n> it was probably not worth it.\n>\n> As far as I can tell, the Raspberry Pi pipeline handler doesn't need any\n> change. Naush, would you be able to test this series to confirm that it\n> doesn't introduce any regression for you ?\n>\n\nDone some testing on this series, and I cannot see any obvious regressions\nfor our platform.  So...\n\nTested-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n\n> Laurent Pinchart (4):\n>   libcamera: framebuffer: Move remaining private data to Private class\n>   pipeline: ipu3: Set bytesused before queuing parameters buffer\n>   pipeline: rkisp1: Set bytesused before queuing parameters buffer\n>   libcamera: v4l2_videodevice: Warn if bytesused == 0 when queuing\n>     output buffer\n>\n>  include/libcamera/framebuffer.h               | 19 ++----\n>  include/libcamera/internal/framebuffer.h      | 10 +++-\n>  .../mm/cros_frame_buffer_allocator.cpp        |  8 +--\n>  .../mm/generic_frame_buffer_allocator.cpp     |  9 +--\n>  src/libcamera/framebuffer.cpp                 | 58 ++++++++++++-------\n>  src/libcamera/pipeline/ipu3/ipu3.cpp          |  4 ++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  4 ++\n>  src/libcamera/v4l2_videodevice.cpp            | 25 +++++---\n>  8 files changed, 84 insertions(+), 53 deletions(-)\n>\n>\n> base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\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 C1FFBC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 09:36:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 13550621BC;\n\tWed,  5 Oct 2022 11:36:20 +0200 (CEST)","from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com\n\t[IPv6:2a00:1450:4864:20::22b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A6AF60A88\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 11:36:18 +0200 (CEST)","by mail-lj1-x22b.google.com with SMTP id by36so362280ljb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 05 Oct 2022 02:36:18 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664962580;\n\tbh=H3HsufHACSQq4LIIApUmr7S/4WxnSlRXRUpajThD/ro=;\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=JiOCjkf+yceYAdhQJ0MOLfHvfqRw9zO7p9uMNLHGoBAomICL8xyeGq2lOS9TecZv1\n\t/CbMdz0A4cW/hB9cXS+LYHBTdusIncXOmqIljY39zdaWSXqOzVXqf6r7NhALC5Bzyb\n\tAmRrI4WdYY48TKEtzwAxFmKiofnyETjJ8CH4ojtQdxxCUydwbmQVRoJCAp4dE9VFys\n\tIhl1dNaHFd/c7cVvnWhSCzTF2nMMRVJuTtHMbjN+iCtmzyPZX83Yd3kkPVAa+m1K7Q\n\tdm4BwyGlo/45Ski1ThqIqk2mYG77JCx0mK37GFQLfwEqzFv4UybvssW/pvsxeihMOr\n\tXJnbogYIYyoAw==","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=5onMmmqNVnvA3xU+KfJm/IY1R37jjOswCIoW4wyk/LI=;\n\tb=kCdSNEdZBPPHj6QPXwdeHgaPGQmKjFympNw8BBsJFzXMSW4yVC5F9PjOketEt5Zcqa\n\t+WSWSBnZbmos0P/+RpQHKkNcqo23XDCS0A7GfNiJ56dS4BcqmV/j2W93sgSACFnQXCHu\n\trlt6/EFQHQe8CxcHvGzml1x2pzvZmq2xHb0ef5F4/3S4Z32eN/OcsGxc1Bk0OY4+oLwV\n\t9e+w9jkiIXf85Sfv1LV1xu606iECTX3RDsv0iOBGnwmzS7snZspa0PaGHSBeoXLl7BSt\n\teq4T1vbTyL5R6CDDRCH6UxpoUsZMsmQSm30S0Gt1AqLgwPb9r7S1An1A6YeZnr5174c7\n\tigUw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"kCdSNEdZ\"; 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=5onMmmqNVnvA3xU+KfJm/IY1R37jjOswCIoW4wyk/LI=;\n\tb=RBMvG3YiXD7I5fKVSbVlJDWYD17i0M3yWmME9BNYEW6fYbFkEBBjSgcgBOaFg/GBq3\n\tDLS+7OAqCndrQovP+77Nv6Q8TotVdhrp4twzSRqdmUAtlqM8lGmGvA5IbxAwfiKTga2T\n\t1lsZeLGzxxXtw6VxiM7/w9kUaUCNerGfhbflSE3NTqJk9iY1ydwXQ2GkNJJjV7X/ML0f\n\tm/j0VMMclzeNXJutjbU5zFcRr1NUd7fsYf2p1GaKyDq5SDwTlypXmCZLTconiSP6xnZB\n\tXI6uJjhyx0HP7LDL7qdpX+1IIsru1eTbp3YtIZDziCL8Wphc4hFmSml2lkDOokOpOiva\n\tOlzw==","X-Gm-Message-State":"ACrzQf3n1C5QeGVuGmcp0NF9yrvw2JVODQ74997p1aAq8i+Mr3I/K3/j\n\th36yGQY+SkSoVTUsh7R1lL4w0M59WyLXdduxTxvr9ymHFnY=","X-Google-Smtp-Source":"AMsMyM42odESmA79hNfdd8gf/AD/3/lmBem4ktyDAA+XykdwZ0gjKmtIjGDkZgScVixYGqUlQEfzz8QhhRwv5TLvoeM=","X-Received":"by 2002:a2e:8049:0:b0:26d:cd1d:1640 with SMTP id\n\tp9-20020a2e8049000000b0026dcd1d1640mr6553708ljg.279.1664962577891;\n\tWed, 05 Oct 2022 02:36:17 -0700 (PDT)","MIME-Version":"1.0","References":"<20221004222903.6393-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221004222903.6393-1-laurent.pinchart@ideasonboard.com>","Date":"Wed, 5 Oct 2022 10:36:02 +0100","Message-ID":"<CAEmqJPqbi3iTBiyp7tSoFHRXq3zNjznx2s4+-pZFrsrrRHEqcw@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"0000000000000518cf05ea464f34\"","Subject":"Re: [libcamera-devel] [PATCH v2 0/4] libcamera: Fix kernel\n\tdeprecation warning with output buffers","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@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>"}}]