[{"id":19097,"web_url":"https://patchwork.libcamera.org/comment/19097/","msgid":"<YSeSv05n+MEAJ8R0@pendragon.ideasonboard.com>","date":"2021-08-26T13:10:23","subject":"Re: [libcamera-devel] [PATCH v3 0/9] Add offset to\n\tFrameBuffer::Plane","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nOn Thu, Aug 26, 2021 at 08:25:30PM +0900, Hirokazu Honda wrote:\n> Since FrameBuffer::Plane doesn't have an offset variable, it is\n> impossible to map the FrameBuffer::Plane correctly. This series fixes\n> the issue by adding an offset and aligns some code of mapping and\n> creating FrameBuffer::Plane with the new offset.\n> \n> One of the pateches fixes V4L2Device to make a returned FrameBuffer\n> color format planes from v4l2 format planes. However, V4L2 API doesn't\n> provide a way of getting a dmabuf plane offset, so a multi planar\n> format e.g. V4L2_PIX_FMT_NV12M is not supported with this patch series.\n> \n> This series must be applied on top of the pacth series whose id is 2384.\n> cf.) https://patchwork.libcamera.org/project/libcamera/list/?series=2384\n\nVery nice series. I've replied with a few minor comments on patches 1/9\nto 6/9, and 8/9 to 9/9. I can handle those when pushing the series.\n\nPatch 7/9 is still problematic, as it breaks a unit test. If it's the\nonly patch that needs a new version, you can resubmit that one only (for\ninstance as v3.1, in a reply to v3) if it's easier for you. If you\nprefer sending a v4 of the whole series, please address the minor\ncomments on the other patches as well.\n\n> Change in v3:\n> - address review comments to v2\n> - squash 01/10 and 02/10 (serialization change) of v2\n> \n> Change in v2:\n> - adress review comments to v1\n> \n> Hirokazu Honda (9):\n>   libcamera: framebuffer: Add offset to FrameBuffer::Plane\n>   libcamera: mapped_framebuffer: Return plane begin address by\n>     MappedBuffer::maps()\n>   cam: file_sink: Use offset in mapping FrameBuffer\n>   ipa: rkisp1: Use offset in mapping IPABuffer\n>   qcam: main_window: Use offset mapping FrameBuffer\n>   gstreamer: gstlibcameraallocator: Use offset in creating a buffer\n>   V4L2VideDevice::createBuffer() creates the same number of\n>     FrameBuffer::Planes as V4L2 format planes. Therefore, if the v4l2\n>     format single is single-planar format, the created number of\n>     FrameBuffer::Planes is 1. It should rather create the same number of\n>     FrameBuffer::Planes as the color format planes.\n>   android: camera_device: Fill offset and right length in\n>     CreateFrameBuffer()\n>   libcamera: framebuffer: Add assertion to detect offset is unfilled\n> \n>  include/libcamera/framebuffer.h               |  12 +-\n>  .../libcamera/internal/mapped_framebuffer.h   |   4 +-\n>  include/libcamera/internal/v4l2_videodevice.h |  10 +-\n>  src/android/camera_device.cpp                 |  52 ++++---\n>  src/android/camera_device.h                   |   6 +-\n>  src/android/mm/generic_camera_buffer.cpp      |   2 -\n>  src/cam/file_sink.cpp                         |  20 ++-\n>  src/cam/file_sink.h                           |   1 +\n>  src/gstreamer/gstlibcameraallocator.cpp       |   4 +-\n>  src/ipa/rkisp1/rkisp1.cpp                     |  33 ++--\n>  src/libcamera/framebuffer.cpp                 |  29 +++-\n>  src/libcamera/ipa_data_serializer.cpp         |   5 +-\n>  src/libcamera/mapped_framebuffer.cpp          |  71 +++++++--\n>  src/libcamera/v4l2_videodevice.cpp            | 147 ++++++++++++++----\n>  src/qcam/main_window.cpp                      |  15 +-\n>  src/qcam/main_window.h                        |   1 +\n>  test/v4l2_videodevice/buffer_cache.cpp        |   6 +-\n>  17 files changed, 311 insertions(+), 107 deletions(-)","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 D566CBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Aug 2021 13:10:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5CE0568920;\n\tThu, 26 Aug 2021 15:10:38 +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 3D21B6888F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Aug 2021 15:10:36 +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 A564A191F;\n\tThu, 26 Aug 2021 15:10:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hyaxhpnZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629983435;\n\tbh=fw1oxGIdqSgDqc+PsiwXuW3tPPOordT6b7+rKWGqMrE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hyaxhpnZUuSWrZg219Ro9GqVLgl7FFQKx6nSzBNiHOqnl9507G75jvKxCtBJHWql0\n\tUt8gP+lQS5cnkc9xRF2rBWFEZ57uPFtqadgxJ3YvF9ccXE5tpOMYXQpXt0/S81N5Qb\n\t+ztX+87fom7OWBTWrEfyP8bdfI1ORFDLeaBg1xWk=","Date":"Thu, 26 Aug 2021 16:10:23 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YSeSv05n+MEAJ8R0@pendragon.ideasonboard.com>","References":"<20210826112539.170694-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210826112539.170694-1-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH v3 0/9] Add offset to\n\tFrameBuffer::Plane","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19122,"web_url":"https://patchwork.libcamera.org/comment/19122/","msgid":"<CAO5uPHMgTg6nZn3ntZToyTQ2fHqH5mP_L+MQ4gFMUcKy_WmfkA@mail.gmail.com>","date":"2021-08-27T06:46:27","subject":"Re: [libcamera-devel] [PATCH v3 0/9] Add offset to\n\tFrameBuffer::Plane","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent,\n\nOn Thu, Aug 26, 2021 at 10:11 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Hiro,\n>\n> On Thu, Aug 26, 2021 at 08:25:30PM +0900, Hirokazu Honda wrote:\n> > Since FrameBuffer::Plane doesn't have an offset variable, it is\n> > impossible to map the FrameBuffer::Plane correctly. This series fixes\n> > the issue by adding an offset and aligns some code of mapping and\n> > creating FrameBuffer::Plane with the new offset.\n> >\n> > One of the pateches fixes V4L2Device to make a returned FrameBuffer\n> > color format planes from v4l2 format planes. However, V4L2 API doesn't\n> > provide a way of getting a dmabuf plane offset, so a multi planar\n> > format e.g. V4L2_PIX_FMT_NV12M is not supported with this patch series.\n> >\n> > This series must be applied on top of the pacth series whose id is 2384.\n> > cf.) https://patchwork.libcamera.org/project/libcamera/list/?series=2384\n>\n> Very nice series. I've replied with a few minor comments on patches 1/9\n> to 6/9, and 8/9 to 9/9. I can handle those when pushing the series.\n>\n> Patch 7/9 is still problematic, as it breaks a unit test. If it's the\n> only patch that needs a new version, you can resubmit that one only (for\n> instance as v3.1, in a reply to v3) if it's easier for you. If you\n> prefer sending a v4 of the whole series, please address the minor\n> comments on the other patches as well.\n>\n\nThanks for testing. I uploaded 7/9 patch only in v4.\n\n-Hiro\n\n\n> > Change in v3:\n> > - address review comments to v2\n> > - squash 01/10 and 02/10 (serialization change) of v2\n> >\n> > Change in v2:\n> > - adress review comments to v1\n> >\n> > Hirokazu Honda (9):\n> >   libcamera: framebuffer: Add offset to FrameBuffer::Plane\n> >   libcamera: mapped_framebuffer: Return plane begin address by\n> >     MappedBuffer::maps()\n> >   cam: file_sink: Use offset in mapping FrameBuffer\n> >   ipa: rkisp1: Use offset in mapping IPABuffer\n> >   qcam: main_window: Use offset mapping FrameBuffer\n> >   gstreamer: gstlibcameraallocator: Use offset in creating a buffer\n> >   V4L2VideDevice::createBuffer() creates the same number of\n> >     FrameBuffer::Planes as V4L2 format planes. Therefore, if the v4l2\n> >     format single is single-planar format, the created number of\n> >     FrameBuffer::Planes is 1. It should rather create the same number of\n> >     FrameBuffer::Planes as the color format planes.\n> >   android: camera_device: Fill offset and right length in\n> >     CreateFrameBuffer()\n> >   libcamera: framebuffer: Add assertion to detect offset is unfilled\n> >\n> >  include/libcamera/framebuffer.h               |  12 +-\n> >  .../libcamera/internal/mapped_framebuffer.h   |   4 +-\n> >  include/libcamera/internal/v4l2_videodevice.h |  10 +-\n> >  src/android/camera_device.cpp                 |  52 ++++---\n> >  src/android/camera_device.h                   |   6 +-\n> >  src/android/mm/generic_camera_buffer.cpp      |   2 -\n> >  src/cam/file_sink.cpp                         |  20 ++-\n> >  src/cam/file_sink.h                           |   1 +\n> >  src/gstreamer/gstlibcameraallocator.cpp       |   4 +-\n> >  src/ipa/rkisp1/rkisp1.cpp                     |  33 ++--\n> >  src/libcamera/framebuffer.cpp                 |  29 +++-\n> >  src/libcamera/ipa_data_serializer.cpp         |   5 +-\n> >  src/libcamera/mapped_framebuffer.cpp          |  71 +++++++--\n> >  src/libcamera/v4l2_videodevice.cpp            | 147 ++++++++++++++----\n> >  src/qcam/main_window.cpp                      |  15 +-\n> >  src/qcam/main_window.h                        |   1 +\n> >  test/v4l2_videodevice/buffer_cache.cpp        |   6 +-\n> >  17 files changed, 311 insertions(+), 107 deletions(-)\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 6A8D8BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Aug 2021 06:46:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BCCBD68939;\n\tFri, 27 Aug 2021 08:46:39 +0200 (CEST)","from mail-ej1-x634.google.com (mail-ej1-x634.google.com\n\t[IPv6:2a00:1450:4864:20::634])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 48BF660288\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Aug 2021 08:46:38 +0200 (CEST)","by mail-ej1-x634.google.com with SMTP id bt14so11684623ejb.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Aug 2021 23:46:38 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"bB5HpxSl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=2ZQa1TEYH5fdGRcFfYW4K56Cz+pcu9fvlhy6fYRV+Ww=;\n\tb=bB5HpxSlhl9SwQPFy7J7725jO0k9BYU/bD2wMNSVM8D1xpgksirhelB3mZWoc4siDM\n\tYgHoB21XKa0H6PHQnvKkBQbtSU+AylQ0i7S3TjQHd1I8/ZH9S346InJw67piVYUwCnvI\n\tcK5ARAODyEHDr1B4oVuq7sp8e88wqBiK3VSiA=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=2ZQa1TEYH5fdGRcFfYW4K56Cz+pcu9fvlhy6fYRV+Ww=;\n\tb=Ig5ouatSeTU+f+cIVaNkEo/yMcS+ZTYPEdooDB4BC0VXkVVzJYRllAUWb9GBHnCmU8\n\t9E8CmJur5/NBTlX3xJ45cZOwyTPHOYOk3xkPzD6V6QTgXXV04y+nM2dv3MBD0Y4vHV25\n\t0D/FTa7bB+nyIqvbVJ0YRbhe10RwjxEUOuAQLyuA+iC8p63C1Gb0UIVtzAtvN9bbgvYC\n\tn/HYxXToLkWxbSNTP8sViq9vi0AOkxYbKuk+nQbTbnwL6onwPJbKuqZ7EiLff15bhj8j\n\twtsaUJIvBHRzT1fFXix/yetETxn6EyWKwftMI4TyDSi4bDahanpJbgELjMPu212YsESd\n\tk9Jw==","X-Gm-Message-State":"AOAM533AIidMlANKt504QTLowETyZO0OaPG/JnXH8J7yjs+SOveBt+a3\n\t8zxJ5skt08E49YQAPVXG+K1SOd7SY1KXHnMCOMwPl2+cMyU=","X-Google-Smtp-Source":"ABdhPJzMjoaCF1x/T2qicYWlIT3bTIm8RnXWjqNXULmZld2r1iDa16Y4Mv24mxJPJtc3jXaABQjYL5pzzfn4vFdOff8=","X-Received":"by 2002:a17:906:e104:: with SMTP id\n\tgj4mr8117177ejb.306.1630046797875; \n\tThu, 26 Aug 2021 23:46:37 -0700 (PDT)","MIME-Version":"1.0","References":"<20210826112539.170694-1-hiroh@chromium.org>\n\t<YSeSv05n+MEAJ8R0@pendragon.ideasonboard.com>","In-Reply-To":"<YSeSv05n+MEAJ8R0@pendragon.ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Fri, 27 Aug 2021 15:46:27 +0900","Message-ID":"<CAO5uPHMgTg6nZn3ntZToyTQ2fHqH5mP_L+MQ4gFMUcKy_WmfkA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v3 0/9] Add offset to\n\tFrameBuffer::Plane","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]