From patchwork Fri Oct 11 07:55:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 834823 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07F82209664 for ; Fri, 11 Oct 2024 07:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728633352; cv=none; b=JCFwlvFcJxxVKoKCLM2x75DaksIMKzqJlhfcqBlkeKtViM9SUQfinjhpftAaFHAmEo9E8IFqy/TpEva1wt2px+yhNW2ap8eH4JqZZLANRZ+b247ft1AmwycKf3HXcM1FPW1j0hoO+7h/mzWWIZxIHGDtnXJ86BGhnWbcgijqmT8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728633352; c=relaxed/simple; bh=NlHZQcTX8fTFO2mNwZSVn6pmxqgKEnNDuoUszz5Ja3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V2fHj+/4egUP0NzADazJ90mFL5rqJ6Na2tCSIkaLnS1vlWa5Y2wuCrn3gRCVeaIJnGnXEQrw6eiHXZzAkjKwYjZLPVd4a/gvlxhf3M16dYQv+4faVgcx+oSGq3ylsqR7r8mB7SvIUlaO0MdyikfW1J8S9YAinwsYDX76ctukSVA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=br5/Kcz9; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="br5/Kcz9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728633351; x=1760169351; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NlHZQcTX8fTFO2mNwZSVn6pmxqgKEnNDuoUszz5Ja3Q=; b=br5/Kcz958tShtbqsyzlpJ2PhZXSTIQ53FPzzq9iLGiotZtddvreKt8m YJeQfi1s+nAvH2ZNumKnG2PmZFvlu5WSP9Ulx4l0sMBrF8qmOho6G3wyA 3JH/t7IHme08OGkeg/Vn9LNDBz7+8PBIjN3ehW3f8w1WG0A9m68gK9Lcm o+5LGM0zLDu0fTWjhzhHuSK7A2zHqHMAfQwg9ISn0oHpzjj2Tpk4QqAon qrfCWXIxiAjV0wLFvRjNrkIyokcmqSyPeDHd1o6XSEDmdllLULHtVE47h hNfYDHI8gArDPLLQcIzjEwlsitZ2g79jju0LsVJAp5fXaBLJyBvhn6a6B Q==; X-CSE-ConnectionGUID: ZpOimQBDToKMgislwo2b2Q== X-CSE-MsgGUID: uKKtPX5mTuGf+SgR+20Wrg== X-IronPort-AV: E=McAfee;i="6700,10204,11221"; a="30898394" X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="30898394" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2024 00:55:51 -0700 X-CSE-ConnectionGUID: sk0u2EEHQPuckDfwkcjmJA== X-CSE-MsgGUID: pnI30kvKSZO8TMoPa6O4cA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="81826881" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2024 00:55:47 -0700 Received: from svinhufvud.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id C89D811F9C2; Fri, 11 Oct 2024 10:55:41 +0300 (EEST) Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Alexander Shiyan , Mikhail Rudenko , Dave Stevenson , Tommaso Merciai , Umang Jain , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck Subject: [RFC 2/4] media: Documentation: Reword split of sensor driver to two classes Date: Fri, 11 Oct 2024 10:55:33 +0300 Message-Id: <20241011075535.588140-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241011075535.588140-1-sakari.ailus@linux.intel.com> References: <20241011075535.588140-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The sensor drivers do not configure the output size of the sensors but the entire internal pipeline. Reflect this in the documentation. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart --- .../userspace-api/media/drivers/camera-sensor.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index d82cd803e337..ad4049ff7eec 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -10,11 +10,13 @@ used to control the camera sensor drivers. You may also find :ref:`media_writing_camera_sensor_drivers` useful. -Frame size ----------- +Sensor internal pipeline configuration +-------------------------------------- -There are two distinct ways to configure the frame size produced by camera -sensors. +The camera sensors have an internal processing pipeline including cropping and +binning functionality. The sensor drivers belong to two distinct classes, freely +configurable and register list based drivers, depending on how the driver +configures this functionality. Freely configurable camera sensor drivers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From patchwork Fri Oct 11 07:55:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 834822 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E003209F46 for ; Fri, 11 Oct 2024 07:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728633358; cv=none; b=ZOY/5FV4CNDf1FRaHFCqAPIC1nB6yARguUv4tM9Vl9bWfKwNO2jBvONK37JhvIvtputN39ToFMtl0sQGf9azgpUjVJ5rrO4viWDgn4avPQQ4HeDPN5RJVwDqeXll0PWaBoh39QwRWl8sM/7q8vX350JG+xVYI6g1Wsd+cJdaQTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728633358; c=relaxed/simple; bh=rMlaKMiEcIbBa4rkrlctLGvnmE7VbLQy0DLu7cD7cF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DYvEV7u9XsglMma+4yQli+KE44IGKH/qD9IHB2ULzO7eiB6Ic3OdrMmDOXnilsmEyT4sAGSJxtghxOvnudayl8z6T6QiOKmVwAKwyuhGqrY8pbhaAQ2QTi+ueMhNZlZ7JI6dVLtq3oMWx+2YDzhKGT5gYr3NNrbYjsibxH67ewg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eSCYbR8g; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eSCYbR8g" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728633357; x=1760169357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rMlaKMiEcIbBa4rkrlctLGvnmE7VbLQy0DLu7cD7cF0=; b=eSCYbR8gXceTNMzOIZZsaFPB1cCo7s8PA17whXlb/vCMS5IkREvm+lKt p3/3Bi1E8LwGFqVffXzXpndfUJj33ogZXjvC56D21UEGsP19SyTTBvj23 pLvA2KlDbqrXnJAM1dz5XJJGCT3kv/B1UoZmyboEyxJUEM6YsJ1dLvOqN dzvajyn5SSsw7dP7lKhmryn4Psd483zY64TiJC+rwYp/YH7F4nYZfjOjN TnFMSbzSKE0IcgagiH8Mg1Z0os3U9kkuhmZ1lLLKD8uO39EDB4sP+ZFzp c4qtSS1W1MgDvkXJMyJGF9S4x3D8qF26yifptnQ2f1cKbFAZaICob6Wbg A==; X-CSE-ConnectionGUID: nZmf+gLtRX+VgP6wFsLFyA== X-CSE-MsgGUID: FIzSHGHHSPypR99IvyiHAA== X-IronPort-AV: E=McAfee;i="6700,10204,11221"; a="30898414" X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="30898414" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2024 00:55:57 -0700 X-CSE-ConnectionGUID: HczDxgDPSBiRBO/51at+lA== X-CSE-MsgGUID: oXKOAn/6QwmcxIQT7bWEpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="81826907" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2024 00:55:53 -0700 Received: from svinhufvud.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 19BB911F984; Fri, 11 Oct 2024 10:55:48 +0300 (EEST) Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Alexander Shiyan , Mikhail Rudenko , Dave Stevenson , Tommaso Merciai , Umang Jain , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck Subject: [RFC 4/4] media: v4l: ctrl: Add V4L2_CID_CONFIG_MODEL control Date: Fri, 11 Oct 2024 10:55:35 +0300 Message-Id: <20241011075535.588140-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241011075535.588140-1-sakari.ailus@linux.intel.com> References: <20241011075535.588140-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the V4L2_CID_CONFIG_MODEL control for the configuration model. Signed-off-by: Sakari Ailus --- .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 ++++ .../userspace-api/media/v4l/subdev-config-model.rst | 2 ++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 5 +++++ include/uapi/linux/v4l2-controls.h | 3 +++ 4 files changed, 14 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst index 27803dca8d3e..928e8e3eed7f 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst @@ -55,3 +55,7 @@ Image Process Control IDs control value divided by e.g. 0x100, meaning that to get no digital gain the control value needs to be 0x100. The no-gain configuration is also typically the default. + +``V4L2_CID_CONFIG_MODEL (bitmask)`` + Which configuration models the sub-device supports. Please see + :ref:`media_subdev_config_model`. diff --git a/Documentation/userspace-api/media/v4l/subdev-config-model.rst b/Documentation/userspace-api/media/v4l/subdev-config-model.rst index 8ec801998f5f..d4ae921b69c8 100644 --- a/Documentation/userspace-api/media/v4l/subdev-config-model.rst +++ b/Documentation/userspace-api/media/v4l/subdev-config-model.rst @@ -1,5 +1,7 @@ .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later +.. _media_subdev_config_model: + Sub-device configuration models =============================== diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 6b9188a4a220..378657a52cd5 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1167,6 +1167,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_TEST_PATTERN: return "Test Pattern"; case V4L2_CID_DEINTERLACING_MODE: return "Deinterlacing Mode"; case V4L2_CID_DIGITAL_GAIN: return "Digital Gain"; + case V4L2_CID_CONFIG_MODEL: return "Sub-device configuration model"; /* DV controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ @@ -1489,6 +1490,10 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_DV_RX_POWER_PRESENT: *type = V4L2_CTRL_TYPE_BITMASK; break; + case V4L2_CID_CONFIG_MODEL: + *flags |= V4L2_CTRL_FLAG_READ_ONLY; + *type = V4L2_CTRL_TYPE_BITMASK; + break; case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: *type = V4L2_CTRL_TYPE_INTEGER; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 974fd254e573..0152240229ab 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1225,6 +1225,9 @@ enum v4l2_jpeg_chroma_subsampling { #define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) #define V4L2_CID_DEINTERLACING_MODE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4) #define V4L2_CID_DIGITAL_GAIN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 5) +#define V4L2_CID_CONFIG_MODEL (V4L2_CID_IMAGE_PROC_CLASS_BASE + 6) + +#define V4L2_CID_CONFIG_MODEL_COMMON_RAW (1ULL << 0) /* DV-class control IDs defined by V4L2 */ #define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)