{"id":15671,"url":"https://patchwork.libcamera.org/api/1.1/covers/15671/?format=json","web_url":"https://patchwork.libcamera.org/cover/15671/","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":"<20220414074342.7455-1-hpa@redhat.com>","date":"2022-04-14T07:43:37","name":"[libcamera-devel,RFC,v1,0/5] Enabling AF algorithm to get the VCM attributes from the device driver","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/1.1/people/105/?format=json","name":"Kate Hsuan","email":"hpa@redhat.com"},"mbox":"https://patchwork.libcamera.org/cover/15671/mbox/","series":[{"id":3052,"url":"https://patchwork.libcamera.org/api/1.1/series/3052/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3052","date":"2022-04-14T07:43:37","name":"Enabling AF algorithm to get the VCM attributes from the device driver","version":1,"mbox":"https://patchwork.libcamera.org/series/3052/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/15671/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 57602C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Apr 2022 07:44:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9150165647;\n\tThu, 14 Apr 2022 09:44:00 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B3B8604B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 09:43:58 +0200 (CEST)","from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n\t[66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-265-pEhN2x4oMGWgC2C-bqZ7lw-1; Thu, 14 Apr 2022 03:43:56 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B57480346F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 07:43:56 +0000 (UTC)","from fedora.rhtw.internal (unknown [10.39.193.169])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 833DA111E3EA;\n\tThu, 14 Apr 2022 07:43:51 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649922240;\n\tbh=CT66shc5wCnSQ501VvSe2HFNAdsjm7fZ+GCYAdrRmZE=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=L6joT/yNox9zDDqipE8WH+nwRH2Ec3rkFyOa4J6Kx151A9Aism5qgYjJ7kKN+EhIV\n\tF2OS0UlNXqajttKFczrWwp8lnRC7grKRn4TrDMscicvU7iejO1ZO3Gjs6F1cxVxnby\n\tdo97Bm3XtjRBokUcj5TBUMPj2rmI47H1lB9L2dJOoSWnGd/S5ivFItVx+iV4GIDxdW\n\tR4vy055otc4rYwZSrkXGKDYbj4S5/e5rYARF++6/rQFKJIBTfBkvwo+wCZQoIJ8kFb\n\t8aj0BNmgUqoq+GE2EyJ9MIB2RBkigfzimUqEBJAc0tv5ok2OVW2Lz5lzQLrqVP1ic9\n\tl0RABE8qT+eWA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1649922237;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=uM43MuhFm6GQ1H3tcKjQj9BYsT+elk+vvlfHuESqdZg=;\n\tb=cP+1mh14NX/jUXsGveFm0OO74tOg1UHnU4o514wIYIqqcpIhf7M1BS7qWOCK/yzsNhW7s6\n\tzXWrC6hDzyvtaW5MbBf+FwRqvBKdWj8yrIlw6a/KOyYzrKRgMZex/E02ej+e//p1xP+XvB\n\tcdhPtLGANob5SQajHLeBKCf+w9ZRK8A="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"cP+1mh14\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"X-MC-Unique":"pEhN2x4oMGWgC2C-bqZ7lw-1","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Thu, 14 Apr 2022 15:43:37 +0800","Message-Id":"<20220414074342.7455-1-hpa@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 2.78 on 10.11.54.3","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC v1 0/5] Enabling AF algorithm to get the VCM\n\tattributes from the device driver","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":"Kate Hsuan via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kate Hsuan <hpa@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Some of the algorithm, such as autofocus needs the information from the\ndevice to configure the range of the search or the maximum values of the\nconfigurations. Currently, this information, such as VCM attributes was\nhardcoded in the code so it can only be used for specific hardware. If the\ndevice attributes can be got through the codes, the algorithm can be\ndynamically configured based on the device attributes got from the kernel.\n\nThis work proposed an implementation that can be used to get the device\nattribute from the kernel and allows the algorithm has a method to get the\ndevice attribute without a specific call. Therefore, for example, the AF\nalgorithm can get the necessary maximum VCM steps value to configure itself.\n\nFirst, VIDIOC_QUERYCTRL is used to get the device attributes for a given\ncontrol list. in other words, we can generate a control list and set a\ncontrol ID, such as V4L2_CID_FOCUS_ABSOLUTE to the list and then\nthis function will get the attribute and put maximum results to the control\nlist. Based on this, the interface can be implemented in each layer and\npass the values to the algorithms. Camara_lens is an entry to get the\nmaximum VCM steps value. Next, this action can be triggered in the pipeline\nand the results will be stored in the \"configInfo\" before the IPA object is\ncreated. Finally, after the IPA is created and initiated, the algorithm\ncan get the value from IPAContext.\n\nKate Hsuan (5):\n  libcamera: v4l2_device: VIDIOC_QUERYCTRL call to fetch device\n    attributes\n  libcamera: camera_lens: Get maximum VCM steps\n  ipa: ipu3: Variables to hold the maximum VCM steps\n  libcamera: pipeline: ipu3: Get VCM information\n  ipa: ipu3: af: Remove hardcoded maximum VCM steps\n\n include/libcamera/internal/camera_lens.h |  1 +\n include/libcamera/internal/v4l2_device.h |  2 ++\n include/libcamera/ipa/core.mojom         |  2 ++\n src/ipa/ipu3/algorithms/af.cpp           |  6 ++--\n src/ipa/ipu3/ipa_context.h               |  1 +\n src/ipa/ipu3/ipu3.cpp                    |  1 +\n src/libcamera/camera_lens.cpp            | 18 ++++++++++++\n src/libcamera/pipeline/ipu3/ipu3.cpp     | 15 ++++++++++\n src/libcamera/v4l2_device.cpp            | 37 ++++++++++++++++++++++++\n 9 files changed, 80 insertions(+), 3 deletions(-)"}