{"id":9983,"url":"https://patchwork.libcamera.org/api/covers/9983/?format=json","web_url":"https://patchwork.libcamera.org/cover/9983/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20201006160637.29841-1-jacopo@jmondi.org>","date":"2020-10-06T16:06:35","name":"[libcamera-devel,RFC,0/2] android: Introduce CameraWorker","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/9983/mbox/","series":[{"id":1357,"url":"https://patchwork.libcamera.org/api/series/1357/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1357","date":"2020-10-06T16:06:35","name":"android: Introduce CameraWorker","version":1,"mbox":"https://patchwork.libcamera.org/series/1357/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/9983/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 DC128BEEE0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Oct 2020 16:02:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A51663C57;\n\tTue,  6 Oct 2020 18:02:45 +0200 (CEST)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B956260363\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Oct 2020 18:02:43 +0200 (CEST)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 133301BF215;\n\tTue,  6 Oct 2020 16:02:42 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  6 Oct 2020 18:06:35 +0200","Message-Id":"<20201006160637.29841-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.28.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [RFC 0/2] android: Introduce CameraWorker","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This two small patches, sent as RFC mostly for comments on the design,\nimplement a worker in the libcamera HAL that is used to handle synchronization\nfences before queueing a Request to the libcamera::Camera.\n\nThe camera framework provides, for each buffer part of a capture request\nan acquisition fence the camera HAL is supposed to wait on before using\nthe buffer. The wait procedure cannot be performed in the Camera HAL thread, as\nthe HAL runs in the global CameraManager thread.\n\nAs fences are handled through a simple poll, it would be possible to install\na Notifier for each fence and handle their completion through a Signal in the\nCameraDevice. Although this would make the class over-complicated.\n\nIntroducing a worker that synchronously waits on fences using its own thread\nis a cleaner design a provides a cleaner interface for the CameraDevice.\n\nThe waitFence() function implementes the same mechanism as the libdrm provided\nsync_wait() function without introducing an explicit dependency in libcamera.\n\n\nJacopo Mondi (2):\n  android: camera_worker: Introduce CameraWorker\n  android: camera_device: Queue request to Worker\n\n src/android/camera_device.cpp | 21 ++++------\n src/android/camera_device.h   |  3 ++\n src/android/camera_worker.cpp | 67 +++++++++++++++++++++++++++++++\n src/android/camera_worker.h   | 75 +++++++++++++++++++++++++++++++++++\n src/android/meson.build       |  1 +\n 5 files changed, 154 insertions(+), 13 deletions(-)\n create mode 100644 src/android/camera_worker.cpp\n create mode 100644 src/android/camera_worker.h\n\n--\n2.28.0"}