From patchwork Fri Dec 2 12:40:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17935 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 317C2BE08B for ; Fri, 2 Dec 2022 12:40:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B4DEA63342; Fri, 2 Dec 2022 13:40:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669984808; bh=WgfTMgiT2h2koTink5AMK2cgVpdEvH8xZGc0F4d9smU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=v8D5AmfO8CqZ538bLq9TdbB1tyif1uQbzqg7PdN+sq81MHxcZ+zcKPQu2pr0r9zUF cnWUT21Y4Ghjr5ceFyeVqUMrSuT9xcS3pJf0W1+bsyeHpo/Bs3jw765MeWViuqvKvB uIK3GVnf+srFRCDyCEmZ76GqjR0Ah40VQJjemx+/Ld5zmDVAHIITH+P/Xo5gFJDi7z c4fNArKi+w1LB3RD4GOiLoMYYDVhY2lWLgokdPKx/g4B8CEI1nfSlRvIRZUXv3BxeW ZdiCQWOVooaETsN8dGuxqWfpNNmo4hudTozuizF7oytFuJGJr83s3zpwxE2tYMRbGo IjpI8/iwP/2kw== Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F39BB60483 for ; Fri, 2 Dec 2022 13:40:06 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="lk5ngN9f"; dkim-atps=neutral Received: by mail-wr1-x434.google.com with SMTP id q7so7611502wrr.8 for ; Fri, 02 Dec 2022 04:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=n7JfvoyjZ9CisCwQzlYuffIN31sk4BLuhg6sZHP9pqk=; b=lk5ngN9fghf8eN4Tji/PhsLsGAwZV/G6wuoY0GqDuQXmWl7LplR0oZXE1+7G37oJ+9 jofpoji7y68Bs8tZBCk2uVBqJDNBbWoSxFWbbnjj+ILSYI2Ht+Go6UkFaTqcR7Dzi52A KU8c/9ci+lDLFoC3/X7olfvSCAGL6Pg2LRKXb5A6ubDCqnblln8CWy7aM6Qoklz/byKw Nj6om7iRiPhpiBMqPphCVmfxVdgkw9hwLnbjSyttl2gW6e1vqR6ogro67zWeK5QULgnD JKGQgSc8Y/2F5ttJPMQ+ruIQBbULQZGU1Ut5FlFDGp+vtJX/90yqA3Bew2YX2pTq383o asYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n7JfvoyjZ9CisCwQzlYuffIN31sk4BLuhg6sZHP9pqk=; b=wPFoX1Re1n1a+j0HUp6v1zKuXIxcj+VasqoyM0zxyoweGhnd3jnjAtseiRyRFK8Ou8 okUstre1mT2xj7a8o4uU5busCmY72PlR0ljxKMwbj36/mWnLqhPjtwoFx6Qd3AZ6FQZt du55PRIZNUnit2vCqeVXx5h+QeUbGLva55bJqYEMYcT0dMBAdzzJhs1FyHkSCstBpctt WQlmlF5spCkx0h1BcVWOHqns4HakJNaTqaP4se7rpUJ7quJq06efeTaGKsOytjDjhgOm EUZulpOeC8l1v05/FHJre+PfezTCpOfqYqR4qMd4ubR88pMHL8iL054BtX8u7QKBIoAq knkw== X-Gm-Message-State: ANoB5pk11Mf8dSiWK7/MnzBX94UcNZotqsRjGDfFQ/RPyRc3+IHuEAzY D1G/AJOb0fLpF0tDqGCq5INS4ITt1tywPLKU X-Google-Smtp-Source: AA0mqf4rKA+5XOpEtymijSRrBM3AvC0DKkuYk45lUbW41bpQsdvnDmKCa0tdFKUHnq65qiI/w1MN0g== X-Received: by 2002:adf:fc48:0:b0:236:e0d:9ad with SMTP id e8-20020adffc48000000b002360e0d09admr33849951wrs.692.1669984806398; Fri, 02 Dec 2022 04:40:06 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id y15-20020a5d4acf000000b00241e5b917d0sm8276484wrs.36.2022.12.02.04.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 04:40:06 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 2 Dec 2022 12:40:03 +0000 Message-Id: <20221202124005.3643-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/2] Add read-only flag to ControlInfo X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This small patch series adds a read-only flag to ControlInfo. This is used to test if a control, in particular V4L2_CID_HBLANK, can be written to by userland. It replaces the slightly fragile workaround we have right now where we test if the min and max values of a control are the same to determine if a control is read-only. I've only modified the one ControlInfo constructor signature used by the V4L2Device class to allow this flag to be set, as setting it for a non-v4l2 control probably does not make sense at this point. If folks think this is incorrect, please let me know. Regards, Naush Naushir Patuck (2): libcamera: controls: Add read-only flag to ControlInfo libcamera:camera_sensor, ipa: raspberrypi: Test readOnly() for HBLANK control include/libcamera/controls.h | 5 ++++- src/ipa/raspberrypi/raspberrypi.cpp | 12 +----------- src/libcamera/camera_sensor.cpp | 14 ++------------ src/libcamera/controls.cpp | 17 +++++++++++++---- src/libcamera/v4l2_device.cpp | 12 ++++++++---- 5 files changed, 28 insertions(+), 32 deletions(-)