{"id":14188,"url":"https://patchwork.libcamera.org/api/1.1/covers/14188/?format=json","web_url":"https://patchwork.libcamera.org/cover/14188/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211020104212.121743-1-umang.jain@ideasonboard.com>","date":"2021-10-20T10:42:08","name":"[libcamera-devel,v5,0/4] Async Post Processor","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/1.1/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/14188/mbox/","series":[{"id":2640,"url":"https://patchwork.libcamera.org/api/1.1/series/2640/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2640","date":"2021-10-20T10:42:08","name":"Async Post Processor","version":5,"mbox":"https://patchwork.libcamera.org/series/2640/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/14188/comments/","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 6568BBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Oct 2021 10:42:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D574E68F59;\n\tWed, 20 Oct 2021 12:42:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F41D6023A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Oct 2021 12:42:19 +0200 (CEST)","from perceval.ideasonboard.com (unknown [103.251.226.185])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 68AAB2A5;\n\tWed, 20 Oct 2021 12:42:18 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DqESYLNc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634726539;\n\tbh=yorJn/CZyAOakNip+3SbrIMBmfQYrjpFTTG4jIQGyGU=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=DqESYLNc9OF4E4GuGFa1B3wDfQhIJn2TWmgIsdFr8fYsVR147sAerN5dNsrn/hekV\n\tN3+2eBFPTwqQBKhVAZsTRXZdQHdrQNvKWUgK38MSMszHLYVmiTZKm6OMBe8VSyBnH+\n\t7sDTRbuUDJy8WctUyEoBY5NfvEV+tE9Z3C4Dj1BY=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 20 Oct 2021 16:12:08 +0530","Message-Id":"<20211020104212.121743-1-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 0/4] Async Post Processor","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This is v5 for Async Post Processor based on top of recent HAL\nrefactoring \"android: Overhaul request completion handling\"\n\nThis series primarily introduces a Thread worker class along\nwith a queue, in which request for post-process of streams\nare queued and processed ansychronously. All the context information\nis carried inside Camera3RequestDescriptor.\n\nPatch 1/4 and 2/4 introduces a notification mechanism to know\nthat a post-processing request has been finished. These run\nsynchronously.\n\n3/4 introduces the asynchronous-nity along with post-processor's\nqueue. \n\n4/4 prevents a small window of race while setting the descriptor\nstatus_ (since status can be set from 2 threads now, main thread vs\npost_processor's thread)\n\nNo CTS regressions seen on nautilus with this series.\n\nSome open questions/discussions:\n- As flush/stop scenarios are kept out of scope of this series,\n  however, I have kept flush() implementation for PostProcessorWorker\n  class in this series. It isn't called but makes the patch complete to\n  me.\n\n- streamsProcessMutex_ currently guards only post-processing bits\n  while it comes to descriptor->buffers_. Should we access-control\n  all calls to descriptor->buffers_ with streamProcessMutex_ (I don't\n  think so) but there might be a race I haven't considered.\n\n- As seen by 2/4, CameraStream::process returns a value to fail-check.\n  PostProcessor::process() doesn't (rather it notifies via signal\n  mechanism). There might be a case where multiple streams require\n  post-processor, 1 one them gets queued sucessfully, other one fails,\n  returning error value from CameraStream::process(). How would we\n  handle this situation. There is \\todo: mark in 3/4 regarding this.\n\nLaurent Pinchart (1):\n  android: camera_device: Protect descriptor status_ with lock\n\nUmang Jain (3):\n  android: Notify post processing completion via a signal\n  android: post_processor: Drop return value for process()\n  android: post_processor: Make post processing async\n\n src/android/camera_device.cpp            | 143 +++++++++++++++++------\n src/android/camera_device.h              |  12 +-\n src/android/camera_request.h             |   8 ++\n src/android/camera_stream.cpp            | 122 +++++++++++++++++--\n src/android/camera_stream.h              |  38 +++++-\n src/android/jpeg/post_processor_jpeg.cpp |  14 +--\n src/android/jpeg/post_processor_jpeg.h   |   6 +-\n src/android/post_processor.h             |  15 ++-\n src/android/yuv/post_processor_yuv.cpp   |  20 ++--\n src/android/yuv/post_processor_yuv.h     |   6 +-\n 10 files changed, 312 insertions(+), 72 deletions(-)"}