[{"id":20284,"web_url":"https://patchwork.libcamera.org/comment/20284/","msgid":"<YW24girTIdU4kxPI@pendragon.ideasonboard.com>","date":"2021-10-18T18:10:10","subject":"Re: [libcamera-devel] [PATCH] Revert \"android: camera_device:\n\tConfigure one stream for identical stream requests\"","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Mon, Oct 18, 2021 at 05:25:24PM +0200, Jacopo Mondi wrote:\n> Commit d165f7da34b8 (\"android: camera_device: Configure one stream for\n> identical stream requests\") introduced the ability to generate through\n> post-processing YUV streams of identical size and format.\n> \n> Howver the change didn't fully take into account the situation\n> where only mapped streams are contained in the request submitted by\n> the camera service to the HAL. In this case the Request will be queued\n> with no buffers and refused by the Camera.\n> \n> Even if this seems a corner case it causes a few CTS to fail, and more\n> problematically it triggers out-of-order completion of requests, causing\n> the camera service to abort.\n> \n> ERROR Camera camera.cpp:1031 Request contains no buffers\n> ERROR HAL camera_device.cpp:1109 '\\_SB_.PCI0.I2C2.CAM0': Out-of-order completion for request 0x00007a1f1800ccd0\n> ERROR cros_camera_service[15706:15711]: [camera_device_adapter.cc(744)] (15711) Notify(): Fatal device error; aborting the camera service\n> \n> Revert the commit until a proper solution is implemented.\n\nSounds fine with me, as there's no urgency to support this use case.\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/android/camera_device.cpp | 29 -----------------------------\n>  1 file changed, 29 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 901867105085..bd34188809da 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -619,35 +619,6 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> -\t\t/*\n> -\t\t * While gralloc usage flags are supposed to report usage\n> -\t\t * patterns to select a suitable buffer allocation strategy, in\n> -\t\t * practice they're also used to make other decisions, such as\n> -\t\t * selecting the actual format for the IMPLEMENTATION_DEFINED\n> -\t\t * HAL pixel format. To avoid issues, we thus have to set the\n> -\t\t * GRALLOC_USAGE_HW_CAMERA_WRITE flag unconditionally, even for\n> -\t\t * streams that will be produced in software.\n> -\t\t */\n> -\t\tstream->usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;\n> -\n> -\t\t/*\n> -\t\t * If a CameraStream with the same size and format of the\n> -\t\t * current stream has already been requested, associate the two.\n> -\t\t */\n> -\t\tauto iter = std::find_if(\n> -\t\t\tstreamConfigs.begin(), streamConfigs.end(),\n> -\t\t\t[size, format](const Camera3StreamConfig &streamConfig) {\n> -\t\t\t\treturn streamConfig.config.size == size &&\n> -\t\t\t\t       streamConfig.config.pixelFormat == format;\n> -\t\t\t});\n> -\t\tif (iter != streamConfigs.end()) {\n> -\t\t\t/* Add usage to copy the buffer in streams[0] to stream. */\n> -\t\t\titer->streams[0].stream->usage |= GRALLOC_USAGE_SW_READ_OFTEN;\n> -\t\t\tstream->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;\n> -\t\t\titer->streams.push_back({ stream, CameraStream::Type::Mapped });\n> -\t\t\tcontinue;\n> -\t\t}\n> -\n>  \t\tCamera3StreamConfig streamConfig;\n>  \t\tstreamConfig.streams = { { stream, CameraStream::Type::Direct } };\n>  \t\tstreamConfig.config.size = size;","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 59F05C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Oct 2021 18:10:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B2EB768F59;\n\tMon, 18 Oct 2021 20:10:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4AA7368F56\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Oct 2021 20:10:28 +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 B68A08C6;\n\tMon, 18 Oct 2021 20:10:27 +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=\"AcvdMMiy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634580627;\n\tbh=lZMMK8lE8IcobwlAxkwDPCbvIZ7KDbrU0o+mD2t1Qlw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AcvdMMiyIsqbWHAh+Pl+WtBhTyWCvHdn5hygu1v/1WTm9oRLKrxLVBsA1tkh49xtr\n\tcHJnpSoAfs8uDRDbm0MJ4viT1L3gXPXM0IC8nZHTZgt/aPb3iNr4zbogkg8C7t9TVo\n\tR3akjq2pcYSN9xF9MkvygooDlq+cuP8Y3mQrUUSw=","Date":"Mon, 18 Oct 2021 21:10:10 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YW24girTIdU4kxPI@pendragon.ideasonboard.com>","References":"<20211018152524.78521-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211018152524.78521-1-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH] Revert \"android: camera_device:\n\tConfigure one stream for identical stream requests\"","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":20285,"web_url":"https://patchwork.libcamera.org/comment/20285/","msgid":"<CAO5uPHOxijW9bQU5nXa7YzU+ahECMGyzaaxs94B1qVsbZfVqNA@mail.gmail.com>","date":"2021-10-19T03:46:56","subject":"Re: [libcamera-devel] [PATCH] Revert \"android: camera_device:\n\tConfigure one stream for identical stream requests\"","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Jacopo, thank you for the patch.\n\nOn Tue, Oct 19, 2021 at 3:10 AM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Mon, Oct 18, 2021 at 05:25:24PM +0200, Jacopo Mondi wrote:\n> > Commit d165f7da34b8 (\"android: camera_device: Configure one stream for\n> > identical stream requests\") introduced the ability to generate through\n> > post-processing YUV streams of identical size and format.\n> >\n> > Howver the change didn't fully take into account the situation\n\ns/Howver/However/\n\n> > where only mapped streams are contained in the request submitted by\n> > the camera service to the HAL. In this case the Request will be queued\n> > with no buffers and refused by the Camera.\n> >\n> > Even if this seems a corner case it causes a few CTS to fail, and more\n> > problematically it triggers out-of-order completion of requests, causing\n> > the camera service to abort.\n> >\n> > ERROR Camera camera.cpp:1031 Request contains no buffers\n> > ERROR HAL camera_device.cpp:1109 '\\_SB_.PCI0.I2C2.CAM0': Out-of-order completion for request 0x00007a1f1800ccd0\n> > ERROR cros_camera_service[15706:15711]: [camera_device_adapter.cc(744)] (15711) Notify(): Fatal device error; aborting the camera service\n> >\n> > Revert the commit until a proper solution is implemented.\n>\n> Sounds fine with me, as there's no urgency to support this use case.\n>\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> > ---\n> >  src/android/camera_device.cpp | 29 -----------------------------\n> >  1 file changed, 29 deletions(-)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index 901867105085..bd34188809da 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -619,35 +619,6 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >                       continue;\n> >               }\n> >\n> > -             /*\n> > -              * While gralloc usage flags are supposed to report usage\n> > -              * patterns to select a suitable buffer allocation strategy, in\n> > -              * practice they're also used to make other decisions, such as\n> > -              * selecting the actual format for the IMPLEMENTATION_DEFINED\n> > -              * HAL pixel format. To avoid issues, we thus have to set the\n> > -              * GRALLOC_USAGE_HW_CAMERA_WRITE flag unconditionally, even for\n> > -              * streams that will be produced in software.\n> > -              */\n> > -             stream->usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;\n> > -\n> > -             /*\n> > -              * If a CameraStream with the same size and format of the\n> > -              * current stream has already been requested, associate the two.\n> > -              */\n> > -             auto iter = std::find_if(\n> > -                     streamConfigs.begin(), streamConfigs.end(),\n> > -                     [size, format](const Camera3StreamConfig &streamConfig) {\n> > -                             return streamConfig.config.size == size &&\n> > -                                    streamConfig.config.pixelFormat == format;\n> > -                     });\n> > -             if (iter != streamConfigs.end()) {\n> > -                     /* Add usage to copy the buffer in streams[0] to stream. */\n> > -                     iter->streams[0].stream->usage |= GRALLOC_USAGE_SW_READ_OFTEN;\n> > -                     stream->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;\n> > -                     iter->streams.push_back({ stream, CameraStream::Type::Mapped });\n> > -                     continue;\n> > -             }\n> > -\n> >               Camera3StreamConfig streamConfig;\n> >               streamConfig.streams = { { stream, CameraStream::Type::Direct } };\n> >               streamConfig.config.size = size;\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 B2773C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Oct 2021 03:47:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FA8F68F58;\n\tTue, 19 Oct 2021 05:47:10 +0200 (CEST)","from mail-ed1-x532.google.com (mail-ed1-x532.google.com\n\t[IPv6:2a00:1450:4864:20::532])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 583EB60126\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Oct 2021 05:47:08 +0200 (CEST)","by mail-ed1-x532.google.com with SMTP id d3so7536085edp.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Oct 2021 20:47:08 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"j/CbfZYN\"; 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=y1lm9LL6zYNaPk/1ysVziIwrUmLNcfilNIBdfd5N800=;\n\tb=j/CbfZYNBiVb242bnTMAX5orlNlJdxN1MQeQvIKtIiEy0P4QQzyj0PR3oT4MM+/wxL\n\twlKgoW7moSisUdihSgEkaJ56hRi4vijGrrqR8A0luHUWDX43Oaibt5uFkQZoTxhI5LM5\n\tgn2XFRTDQCSwCcq7TX1CdNnMjqSVRIJiUCwqU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=y1lm9LL6zYNaPk/1ysVziIwrUmLNcfilNIBdfd5N800=;\n\tb=iUjHskFq36pFpL7Fuw4Etwzv9R/7x8c8V+jcpiU4EiBUrmbgJsLh4upxOgXbTGUS+/\n\t2zSGvaEH+pd5Onq40X9lFfVFBLBddXUuWQXjZnVPCHTGth1Aat9We9+pUg3SZ2/4/knE\n\t2vJNgSSyrR1rPQl1DqAJX9txDBj9GOAtWYqC/a37cPBZ7PoxQ9+a9dVY4GUd9t1t7XvQ\n\tEAU/v8WcTRqDNroFkdPdFhr+/5XuWZ9kpUSB2aG5s3TlWVayeqh6v4FBvgUafZDaMZhU\n\tyP7MjivyG1L3ktZoSHQH9JrfVWl0yG0DIKNTfqTV0XeRy7xPU3XMnPLA3P2Ki0IgTGnF\n\tl3Cw==","X-Gm-Message-State":"AOAM531hk0y3aeC1wc0ofmZtUf33GNEuwl3AeZC5qdoslg++NrnWO7id\n\tiGZtEvDyw804mBMyP9cjfJEmchFgrugUy2L1FLKHdbOxgq4=","X-Google-Smtp-Source":"ABdhPJx9duNRi21dfqklmQcCGPcRMbuvFPQcwfF5HKzAxpptffWOM7ko8jvQla1btZixmw+Z0bVC54COYQWdB+wmjxY=","X-Received":"by 2002:a17:906:c44b:: with SMTP id\n\tck11mr34440720ejb.559.1634615227700; \n\tMon, 18 Oct 2021 20:47:07 -0700 (PDT)","MIME-Version":"1.0","References":"<20211018152524.78521-1-jacopo@jmondi.org>\n\t<YW24girTIdU4kxPI@pendragon.ideasonboard.com>","In-Reply-To":"<YW24girTIdU4kxPI@pendragon.ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Tue, 19 Oct 2021 12:46:56 +0900","Message-ID":"<CAO5uPHOxijW9bQU5nXa7YzU+ahECMGyzaaxs94B1qVsbZfVqNA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] Revert \"android: camera_device:\n\tConfigure one stream for identical stream requests\"","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>"}}]