From patchwork Fri Nov 22 10:06:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883013 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 540821DE2AB for ; Fri, 22 Nov 2024 10:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270015; cv=none; b=YHVZYhtwr/SpwEyLO7oDiaGNLrYOgK/66IKheax2D6iOtRbWBlO7jx/02A0sZTOkKG2zdOv1imY9V3ucEnAidfphySg254gImIiZ55y6XXbhsG+l/Mt1Zegvz6ps6jiPAiKhpo1m14kHLdstBQKEisyuyUD81+OHDgrGK459Ht4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270015; c=relaxed/simple; bh=WBfBUTc7foxaXJtaX15rqZrWhtCGrvhQTyIm9yDq+Io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qZ8B3V7rNL4+t3HUqsAYPDwXBrxnARcNakMipCCB5VAuG6v2C3Wc7a1aXpoWMt1H97QpDFJWWIf/rVY4ZruAQDXS3qbHPfEphA3GqRzBbsFOR/43BYP1dWV5HBUlTjmycVVq+8iBlaSgUautl9zY7YWBE2AvCa5FeQV4ZiRoM60= 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=aBBTK53f; arc=none smtp.client-ip=198.175.65.9 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="aBBTK53f" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270015; x=1763806015; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WBfBUTc7foxaXJtaX15rqZrWhtCGrvhQTyIm9yDq+Io=; b=aBBTK53frEr94wNsVycsY1nVm8kA0UuEsEIYTBXEjKArz2HdQexNZDzB YoWPy86zEuGOG/s8p+yx3bxtsrBel/rSBi8l6WcDAVnms+n/MPmRUpGlZ uGMOi6Agqo/eyugBSDKaU/xkxsLI08sscFWBCduB6RtrLv/EbDJoj/PLG jIOZKvHF/g35cRGv3mMZoiLd44pDl61quVaGzhoNdZox0nSuXwQ9rayPr zQt+qccwCnIyz1YL7SXHbDPe9zQyZZoACpeM77Bn8awwHj62fGeEsj3ty fpeRvGr72jj5OhFgGdXyZu+I9qc+VUl+RQS8jVGT+4vdgyGXCGATUPNJn A==; X-CSE-ConnectionGUID: 6cplwV6SR3iwm3y1NhEpBA== X-CSE-MsgGUID: gU+UJ59fTyGgG0aKkh1JKQ== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927587" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927587" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:53 -0800 X-CSE-ConnectionGUID: YUSP/h3/Rpq+FiukMwdAKA== X-CSE-MsgGUID: bFrO0mUISKum/zp6Xl8zqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403062" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:47 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 848D811F8D9; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002LC-1a; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 1/8] media: Documentation: Rework embedded data documentation Date: Fri, 22 Nov 2024 12:06:26 +0200 Message-Id: <20241122100633.8971-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 Rework embedded data documentation by removing the reference to the pixel data stream. The specific documentation of the embedded data interface will be elsewhere, in the near future either CCS or common raw camera sensor model documentation. Signed-off-by: Sakari Ailus Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- .../userspace-api/media/drivers/camera-sensor.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index dc415b8f6c8e..8e1083417ae1 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -111,13 +111,12 @@ the sensor configuration for the captured frame back to the host. While CSI-2 is the most common data interface used by such sensors, embedded data can be available on other interfaces as well. -Such sensors expose two internal sink pads (pads that have both the -``MEDIA_PAD_FL_SINK `` and ``MEDIA_PAD_FL_INTERNAL -`` flags set) to model the source of the image and -embedded data streams. Both of these pads produces a single stream, and the -sub-device routes those streams to the external (source) pad. If the sub-device -driver supports disabling embedded data, this can be done by disabling the -embedded data route via the ``VIDIOC_SUBDEV_S_ROUTING`` IOCTL. +Embedded data support is indicated by the precence of an internal sink pad (pad +that has both the ``MEDIA_PAD_FL_SINK `` and +``MEDIA_PAD_FL_INTERNAL `` flags set) with a metadata +format to model the embedded data stream. If the sub-device driver supports +disabling embedded data, this can be done by disabling the embedded data route +via the ``VIDIOC_SUBDEV_S_ROUTING`` IOCTL. In general, changing the embedded data format from the driver-configured values is not supported. The height of the metadata is device-specific and the width From patchwork Fri Nov 22 10:06:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883011 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 3A31F1CB511 for ; Fri, 22 Nov 2024 10:06:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270013; cv=none; b=Oz1YVLCyzuGGzv7Gn/BuVEM/uyqOY0x5UzUlIQ8rAHNLyZtz0tcoQl6/3ZH6DcsO43w5ReibE7cfdE5fejJDC70OnE5K3RGeVjPlWWMMqaIf3GK0I8bvFbTKCuvv6zj1P5Y6wnOdDdIiJWicqaOFZiWMhsuydUQ2ZrGMIzwj2tI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270013; c=relaxed/simple; bh=YHHRXc1Nk7+uk0tqKGKzJ7qLUYSa7KX1dRjkg+mL3Dc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RyyCFAJ4PD3nJbtBUmu5XtN55ypsotysuRLV5ydsXTOT3ESwievSss33hM4KR4fttL1dHuissHeKRbZax6KQXZ+M/ZGjhBfZ7PK522NwJCw6ZEpa6Qou4OQC9qLuw1y9el76E5bO2Wj2jjPogKzhBsmDDQFCbtuZRgTlAX6At6g= 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=UUKCCGvn; arc=none smtp.client-ip=198.175.65.9 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="UUKCCGvn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270013; x=1763806013; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YHHRXc1Nk7+uk0tqKGKzJ7qLUYSa7KX1dRjkg+mL3Dc=; b=UUKCCGvnErThJknRUdYqmt/J2yxiS58NQmbRbAgqaxNgNKfrnkvqUf79 F02ojfVlINCeUqvvJU75VEN/pXj2awDNCxX8252vAftg+k5E5so4gZR2b JQN0yGpajKVamVmTWi0Vq4hg4gUzyslc412T6BuoWmKuqYzDxj2DpTqur ovMaj5Oii3dr7hnHA46h2lBcBz3b05zgwK4qP4VNTPRx5489BkfqxVFu3 DbIcununzdjoFcD2Idh59l7WfGXutoxbhU/csxLUG/l8TZoEMEKkRWLch MHCHMopp+SYJoa9ThpWeiDn2terJKGr4TBXhpIGsAC2c08u1XeGtUjaDB Q==; X-CSE-ConnectionGUID: CJhaJsPIRHq/LUibYjUmbQ== X-CSE-MsgGUID: ANBsle+3TNSw+2slLBM/UA== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927551" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927551" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:52 -0800 X-CSE-ConnectionGUID: CbbhwVh5SpaIEZuU6JTgAw== X-CSE-MsgGUID: 9QR5/WfQTSywBAXqqZTsdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403056" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:47 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 864AA11F996; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002LG-1h; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 2/8] media: Documentation: Add a hyphen to list-based Date: Fri, 22 Nov 2024 12:06:27 +0200 Message-Id: <20241122100633.8971-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 a hyphen to list-based for uniform spelling in camera-sensor.rst. Signed-off-by: Sakari Ailus --- Documentation/userspace-api/media/drivers/camera-sensor.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index 8e1083417ae1..9a1e8aa9fc77 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -26,10 +26,10 @@ of cropping and scaling operations from the device's pixel array's size. An example of such a driver is the CCS driver. -Register list based drivers +Register list-based drivers ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Register list based drivers generally, instead of able to configure the device +Register list-based drivers generally, instead of able to configure the device they control based on user requests, are limited to a number of preset configurations that combine a number of different parameters that on hardware level are independent. How a driver picks such configuration is based on the @@ -67,7 +67,7 @@ is pixels and the unit of the ``V4L2_CID_VBLANK`` is lines. The pixel rate in the sensor's **pixel array** is specified by ``V4L2_CID_PIXEL_RATE`` in the same sub-device. The unit of that control is pixels per second. -Register list based drivers need to implement read-only sub-device nodes for the +Register list-based drivers need to implement read-only sub-device nodes for the purpose. Devices that are not register list based need these to configure the device's internal processing pipeline. From patchwork Fri Nov 22 10:06:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883012 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 5CDA61DE8AE for ; Fri, 22 Nov 2024 10:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270015; cv=none; b=K8851jJOk8ra/v2QImVPr+VUzIprFfNp3Rsw1Vy6WUSVPnNAkQwOSfKGQGBdPDKYmLZQNJPvxavK67VTOUNp/sX/pKtOHw5w9+EWJ06Ivt2x99aZhqbSDPnHD+2cGs59Iv6lMi67eRwUUJxr1rzob3rvnMey2Fz0h9//IYfH2ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270015; c=relaxed/simple; bh=GOUmuNjlGwOIXgFKU8v6cjYwNnkXfejm0Glqg0u2qmw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GOBUsaTM6hocaG8q7mQulZWoMyXzgpx9sl+pLiSVVeT312A5+6Y0OZbd/Mg/VGEcatmBHLMdX1JE5xFpEXQ147Wr+OLKndZhM27GciwAwLMnZqvZQOYUIvCwYX3na9cWtIbMmd+VFtCiA3P9l5jTWhas1yETBoEWPMmXUl5WbGs= 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=jTlHTv4Q; arc=none smtp.client-ip=198.175.65.9 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="jTlHTv4Q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270014; x=1763806014; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GOUmuNjlGwOIXgFKU8v6cjYwNnkXfejm0Glqg0u2qmw=; b=jTlHTv4QfDuiq59MpZDD7DjXvE9HVX2fbutT6gfxNGdqIg2oplEKV5AK L+0m8cGgmrYqsqnG2CrUNVjEhgr+uY3GeeFKclDVlIepz7zYDGahWMRzI IX4zhKvpzpYvX6UohgIHbDDZ5hi3GcnbQQhf8yHuoosA0f70q6pjgpA5w UXZLjfGpSXZyvXHBjR6Ku/eIqLXQ5RHypXlm226uZg4K0l3PqRGaoTnPq kzQc0r1SyHqhlYEA0kNuyrGs6ZKUnTPXgKGjcm0z76fZp7d7/gGnxplJE Sn7we/9jLGHwCz0UGXFwobmQuljeUliEqBWWBTx+RTcxYf2/BUVah/JKm w==; X-CSE-ConnectionGUID: JFH5du02QPeHAW/WCvWS4g== X-CSE-MsgGUID: yNfqxS3IRlW+7rm+z+15vg== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927564" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927564" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:52 -0800 X-CSE-ConnectionGUID: 2E17zx9RQQGDP4682t/jHg== X-CSE-MsgGUID: cqjxoUJJQ6C45WuojbYJmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403058" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:47 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 8B66511FBC5; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002LK-1m; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 3/8] media: Documentation: Reword split of sensor driver to two classes Date: Fri, 22 Nov 2024 12:06:28 +0200 Message-Id: <20241122100633.8971-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 9a1e8aa9fc77..bc55c861fb69 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. +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 Nov 22 10:06:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883015 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 1619A1DED53 for ; Fri, 22 Nov 2024 10:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270018; cv=none; b=boRoysFEpfDepx53j2yJZ+N6heJecQfVXfx3ngD4lGa5yR6+NDcJA0Yg1u2N2FpC2bjORULNoNJ6Z+7tqF96Uq7TaKS6d29bee5xOqNc0yEqDrXNLltjfkhTCNHKCTcqkzLJgpDY2+0fiCxsKFQTDq8kZmi2jvbDDlFIYByC9JM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270018; c=relaxed/simple; bh=tJsom9Lw1f0xcgHsaOpi52x91chLoU1mAB23TRtdTlM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pv9xbAu1vxaRGTwZCN8ijrCb437e3G7oYpU9ssMRpDdydHmmEIJBhT6IRIvjxE7ULJ/iJMFFrvgMfW2HFODMvjDj6KGmY0Ef56VmepnnkE0uFhm1KvWPGz5kr2k2aYM6u1lxv+LcXZMgwjHzfFwO8YyOwjVOpmLxG8X77419ItU= 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=himuXO2Z; arc=none smtp.client-ip=198.175.65.9 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="himuXO2Z" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270015; x=1763806015; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tJsom9Lw1f0xcgHsaOpi52x91chLoU1mAB23TRtdTlM=; b=himuXO2ZxBqzCq33lEkKwPLc84XkoqS6euFN6/2R8UYI/hRwH78k2IKb 6XByq2y781pjaT4H0QV3gR0kbyI6n/+3omkLf4TG2SU3EQH+RI7s2eUQj /oye/3lllVFH2Jq1l2UmRvVP8/3Iw2UpAeTpzVsU0fulh/HaY2l+IgkDj xsvpQVmn/ox+NEbfVH1oQqCi40j8UVWdBFsHkEdhcMm8/UdV0Uw8OonEP rmNi7XCuhVA1kcbVVtS/47lShRNbBHOyj795clOOB+9YF6afsBor0Odcx nzvd7bhvTvEKYKoxKUkYE7TWEBbAIMQZODUQENQ3oyET80x6g95ZD+EaH Q==; X-CSE-ConnectionGUID: wBlF9Rt8RFazzH/y4zZoPg== X-CSE-MsgGUID: wffmJhMmRsmb/5m7Cb9BZQ== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927599" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927599" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:53 -0800 X-CSE-ConnectionGUID: e8VSYI2XTEGdo2Nod1rJ2A== X-CSE-MsgGUID: 1QPbZuR9SN+vWl+vMjlY7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403064" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:47 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 9039F11FBCC; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002LR-1r; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 4/8] media: Documentation: Add subdev configuration models, raw sensor model Date: Fri, 22 Nov 2024 12:06:29 +0200 Message-Id: <20241122100633.8971-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 Sub-device configuration models define what V4L2 API elements are available on a compliant sub-device and how do they behave. The patch also adds a model for common raw sensors. Signed-off-by: Sakari Ailus --- .../media/drivers/camera-sensor.rst | 4 + .../media/v4l/common-raw-sensor.dia | 441 ++++++++++++++++++ .../media/v4l/common-raw-sensor.svg | 134 ++++++ .../userspace-api/media/v4l/dev-subdev.rst | 2 + .../media/v4l/subdev-config-model.rst | 203 ++++++++ 5 files changed, 784 insertions(+) create mode 100644 Documentation/userspace-api/media/v4l/common-raw-sensor.dia create mode 100644 Documentation/userspace-api/media/v4l/common-raw-sensor.svg create mode 100644 Documentation/userspace-api/media/v4l/subdev-config-model.rst diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index bc55c861fb69..5bc4c79d230c 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -18,6 +18,8 @@ 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. +Also see :ref:`media_subdev_config_model_common_raw_sensor`. + Freely configurable camera sensor drivers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -105,6 +107,8 @@ values programmed by the register sequences. The default values of these controls shall be 0 (disabled). Especially these controls shall not be inverted, independently of the sensor's mounting rotation. +.. _media_using_camera_sensor_drivers_embedded_data: + Embedded data ------------- diff --git a/Documentation/userspace-api/media/v4l/common-raw-sensor.dia b/Documentation/userspace-api/media/v4l/common-raw-sensor.dia new file mode 100644 index 000000000000..aa927527eae3 --- /dev/null +++ b/Documentation/userspace-api/media/v4l/common-raw-sensor.dia @@ -0,0 +1,441 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #image data (1)# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #embedded data (2)# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #source pad (0)# + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Documentation/userspace-api/media/v4l/common-raw-sensor.svg b/Documentation/userspace-api/media/v4l/common-raw-sensor.svg new file mode 100644 index 000000000000..1d6055da2519 --- /dev/null +++ b/Documentation/userspace-api/media/v4l/common-raw-sensor.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst index dcfcbd52490d..4d145bd3bd09 100644 --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst @@ -838,3 +838,5 @@ stream while it may be possible to enable and disable the embedded data stream. The embedded data format does not need to be configured on the sensor's pads as the format is dictated by the pixel data format in this case. + +.. include:: subdev-config-model.rst diff --git a/Documentation/userspace-api/media/v4l/subdev-config-model.rst b/Documentation/userspace-api/media/v4l/subdev-config-model.rst new file mode 100644 index 000000000000..25030b80734f --- /dev/null +++ b/Documentation/userspace-api/media/v4l/subdev-config-model.rst @@ -0,0 +1,203 @@ +.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later + +.. _media_subdev_config_model: + +Sub-device configuration models +=============================== + +A sub-device configuration model specifies in detail what the user space can +expect from a sub-device in terms of V4L2 sub-device interface support, +including IOCTL (including selection targets and controls) semantics. + +A sub-device may implement more than one configuration model at the same +time. The implemented configuration models can be obtained from the sub-device's +``V4L2_CID_CONFIG_MODEL`` control. + +.. _media_subdev_config_model_common_raw_sensor: + +Common raw camera sensor model +------------------------------ + +The common raw camera sensor model defines a set of enumeration and +configuration interfaces (formats, selections etc.) that cover the vast majority +of funcitionality of raw camera sensors. Not all of the interfaces are +necessarily offered by all drivers. + +A sub-device complies with the common raw sensor model if the +``V4L2_CONFIG_MODEL_COMMON_RAW`` bit is set in the ``V4L2_CID_CONFIG_MODEL`` +control of the sub-device. + +The common raw camera sensor model is aligned with +:ref:`media_using_camera_sensor_drivers`. Please refer to that regarding aspects +not specified here. + +Each camera sensor implementing the common raw sensor model exposes a single +V4L2 sub-device. The sub-device contains a single source pad (0) and two or more +internal pads: an image data internal pad (1) and optionally an embedded data +pad (2). Additionally, further internal pads may be supported for other +features, in which case they are documented separately for the given device. + +This is shown in :ref:`media_subdev_config_model_common_raw_sensor_subdev`. + +.. _media_subdev_config_model_common_raw_sensor_subdev: + +.. kernel-figure:: common-raw-sensor.svg + :alt: common-raw-sensor.svg + :align: center + + **Common raw sensor sub-device** + +Routes +^^^^^^ + +A sub-device conforming to common raw camera sensor model implements the +following routes. + +.. flat-table:: Routes + :header-rows: 1 + + * - Sink pad/stream + - Source pad/stream + - Static (X/M(aybe)/-) + - Mandatory (X/-) + - Synopsis + * - 1/0 + - 0/0 + - X + - X + - Image data + * - 2/0 + - 0/1 + - M + - \- + - Embedded data + +Some devices do not support the embedded data stream, others do support it and +in some of the latter, it can be turned on and off before streaming is started. + +Sensor pixel array size, cropping and binning +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The sensor's pixel array is divided into one or more areas. The areas around the +edge of the pixel array, usually one or more sides, may contain optical black +pixels, dummy pixels and other non-image pixels. + +A rectangle within the pixel array contains the visible pixels. Capturing the +non-visible pixels may be supported by the sensor. + +The sensor can perform three operations that affect the output image size. First +comes analogue crop. This configuration limits parts of the pixel array which +the sensor will read, affecting sensor timing as well. The granularity of the +analogue crop configuration varies greatly across sensors: some sensors support +a few different analogue crop configurations whereas others may support anything +divisible by a given number of pixels. + +The default analogue crop rectangle corresponds to the visible pixel area. + +In the next step, binning is performed on the image data read from camera +sensor's pixel array. This will effectively result in an image smaller than the +original by given binning factors horizontally and vertically. Typical values +are 1/2 and 1/3 but others may well be supported by the hardware as well. + +Sub-sampling follows binning. Sub-sampling, like binning, reduces the size of +the image by including only a subset of samples read from the sensor's pixel +matrix, typically every n'th pixel horizontally and vertically, taking the +sensor's colour pattern into account. Sub-sampling is generally configurable +separately horizontally and vertically. + +Scaling is further done after sub-sampling. Scaling generally is fine grainer +than binning or sub-sampling. + +The binning, sub-sampling and scaling operations are configured using the +compose rectangle. It depends on the driver which of these operations are being +used to achieve the resulting size. + +The combination of the analogue crop and binning, sub-sampling and scaling +operations may result in an image size that may be larger than desirable. For +this purpose, a digital crop operation may be performed on the image after these +operations. The resulting image size is further output by the sensor. + +Drivers may only support some of even none of these configurations, in which +case they do not expose the corresponding selection rectangles. + +Also refer to :ref:`Selection targets `. + +.. flat-table:: Selection targets on pads + :header-rows: 1 + + * - Pad/Stream + - Selection target/format + - Mandatory (X/-) + - Modifiable (X/-) + - Synopsis + * - 1/0 + - Format + - X + - \- + - Image data format. The width and height fields of this format are the + same than those for the V4L2_SEL_TGT_CROP_BOUNDS rectangle. The media + bus code of this format reflects the native pixel depth of the sensor. + * - 1/0 + - V4L2_SEL_TGT_CROP_BOUNDS + - X + - \- + - The full pixel area, including non-visible pixels. No pixels outside + this area can be captured. This rectangle is relative to the format on + the same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_CROP_DEFAULT + - X + - \ + - The visible pixel area. This rectangle is relative to the format on the + same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_CROP + - \- + - X + - Analogue crop. Analogue crop typically has a coarse granularity. This + rectangle is relative to the format on the same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_COMPOSE + - \- + - X + - Binning, sub-sampling and scaling. This rectangle is relative to the + V4L2_SEL_TGT_CROP rectangle on the same (pad, stream). The combination + of binning, sub-sampling and scaling is configured using this selection + target. + * - 2/0 + - Format + - X + - \- + - Embedded data format. + * - 0/0 + - V4L2_SEL_TGT_CROP + - \- + - X + - Digital crop. This rectangle is relative to the V4L2_SEL_TGT_COMPOSE + rectangle on (pad, stream) pair 1/0. + * - 0/0 + - Format + - X + - X + - Image data source format. The width and height fields of the format are + the same than for the V4L2_SEL_TGT_CROP rectangle on (pad, stream) pair + 0/0 and the media bus code reflects the pixel data output of the sensor. + * - 0/1 + - Format + - X + - \- + - Embedded data source format. + +Embedded data +^^^^^^^^^^^^^ + +The embedded data stream is produced by the sensor when the corresponding route +is enabled. The embedded data route may also be immutable or not exist at all, +in case the sensor (or the driver) does not support it. + +Generally the sensor embedded data width is determined by the width of the image +data whereas the number of lines are constant for the embedded data. The user +space may obtain the size of the embedded data once the image data size on the +source pad has been configured. + +Also see :ref:`media_using_camera_sensor_drivers_embedded_data`. From patchwork Fri Nov 22 10:06:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883016 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 0C6EC1D90BC for ; Fri, 22 Nov 2024 10:07:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270021; cv=none; b=F8g0QKEh+4TzHk+26/fErKKPpsVBPlV8q+JNy5N13O9gMfMKyjZNE68fOEJLmOboyhPmP8Px2cNJH8oMSuZM/VMx6pSKSM7/vFNYan5o0ACx5W/K1QLPACAs9X2kVPZHdOc4l5Gzs1N5ukvG6Rt/aJbFgEnCJGpNB26FhTUKVvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270021; c=relaxed/simple; bh=XjzA4XGwvHVywRyLTBD+N3yhShUwTqaQr4zXrHO3Xs0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=my0aGUDqofZbD6pldHmjD0zz/9ZvtfR7rnVxAecgFJ5eFgj2fxJgwkjsMvDTy/RtBfCjbiRnMspGKvnbGxDbeqUVVEeNpop9ZUPrQpfu5KJ/P6fpv1l5thTuqwXLNdSHdlhTCfx0a0uRW1aAPu5c9Mey6wfv4UQ/uykZ3AP6rNc= 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=nwMDBuev; arc=none smtp.client-ip=198.175.65.9 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="nwMDBuev" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270020; x=1763806020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XjzA4XGwvHVywRyLTBD+N3yhShUwTqaQr4zXrHO3Xs0=; b=nwMDBuevmwkbEeFaAY/K7MoOlxWBlGQ48q3yv7XVgzDeg0EdukU5e31l D1FVBSrQTm3kAsKzIcUuViW2WTgnIUhMPYblQNxWmU+cXBk6vmoH930s+ pxSN0ru6kI8wG+ckAk2fh5cbLW3gI1MHCRWQ7te7bEH6N4ixCNVUVQ9+6 PmvqZFyakEzbo0Al/xL1+NQecPsVEoPA5vEsX5vrnGY2SJTCs1LBwmQWv HSjklBsKoOpLl3F5pEWjF16KQnYn63aLQ3EK2FB5QJCjztXxrdewJ/JSB VjnzukidiNVRMMkErXxSnXmRFkAMnJ+LpXCcFDGPWEc4EcNcUhLv4ORkc g==; X-CSE-ConnectionGUID: sWsMq2EHRd6rZ/+R27pLcQ== X-CSE-MsgGUID: WwiNXYBPQy2fm1UjZswOug== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927630" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927630" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:07:00 -0800 X-CSE-ConnectionGUID: +bx3UJXIT4Sc5p1vMRdEcw== X-CSE-MsgGUID: bmOV2JlWQuWxklPWZ3wYVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403089" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:54 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 9565012072C; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002LW-1u; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 5/8] media: uapi: Add V4L2_CID_CONFIG_MODEL control Date: Fri, 22 Nov 2024 12:06:30 +0200 Message-Id: <20241122100633.8971-6-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 Reviewed-by: Laurent Pinchart --- .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 ++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 5 +++++ include/uapi/linux/v4l2-controls.h | 3 +++ 3 files changed, 12 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/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 1ea52011247a..24c9c25e20d1 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1164,6 +1164,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! */ @@ -1481,6 +1482,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) From patchwork Fri Nov 22 10:06:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883018 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 DF5431DEFE3 for ; Fri, 22 Nov 2024 10:07:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270023; cv=none; b=OJbJx/xgHSk7xxDZf5TGKkDWVLNO6alJxn5+f5dE03pfnAx2FKZGdlyZ7IGWWk8Vs+ZysAx7TtTeR2HULIoizLkVkBCKb5pL5HD54gN92tyXvHLmiP9VoH+PrrAuiyy0NZ5JpsTOlQ8XKkxLab6aohI/ntrptnDOVYtMMVpYJ60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270023; c=relaxed/simple; bh=KdOyJnEFP41SwVnq1Bd9ebJvMIo6Ja44dGwb30mHvn0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sOQ422Qpd4dCZCGHg7eKZkc8wrfyYuqjStoyICOx1tOhJ6RsMSvGSUmpARKhqloWrkIk4WZ2pUvoiJ/JyWLZrThhr1o8ilsMvnB3wtDFvmorKx+1l+pzr5uwhWvGYRXxxxiIiWcFP55V1vHtsah86+DsxWm/hn0dCh3F8Vd6HOY= 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=nhLeaT3L; arc=none smtp.client-ip=198.175.65.9 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="nhLeaT3L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270022; x=1763806022; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KdOyJnEFP41SwVnq1Bd9ebJvMIo6Ja44dGwb30mHvn0=; b=nhLeaT3LpDb1IUq0nh+V9ebvLaZYYVpLRHUHBs7zpZLl1nG7Y8A5CBNv JMoM9DjcPK7vLB6gG1SZLTCqKpOA+C59fzitzP49QUABXPaO34o2fbaML SUpojylqCUH9MPDtJBoqKd/E7Bk/u+iLLhgXQHlA6pNSbU4FY35IvA6Rq A90f849/BB/4AO6I/Mrjg/nhHclP8KfDwXmft+Qo32cqTXxqBvE8Yts/y max7xpybPtKQZDKkQDSiwwji2hRdndkxX2zroLAqOkoXiYPYhvoUk/tzo rXvx0M1tpm5+0emBVwrUPmYdU5PwSh8eYo2xz4nweujr2/risTc03pf6j A==; X-CSE-ConnectionGUID: UDsRF5HXSEeroHw9WmKTxg== X-CSE-MsgGUID: yCczUd+SRaGFleYlWhkfDw== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927647" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927647" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:07:00 -0800 X-CSE-ConnectionGUID: rfN03+GySaC3zbDA4rhOeQ== X-CSE-MsgGUID: rLqzz+4DT7SqfaLrwtlEAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403093" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:54 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 99FB6120A78; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002Lb-1y; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 6/8] media: uapi: Add V4L2_CID_BINNING control for binning configuration Date: Fri, 22 Nov 2024 12:06:31 +0200 Message-Id: <20241122100633.8971-7-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 V4L2_CID_BINNING control for configuting binning and enumerating a camera sensor's binning capabilities. The control combines horizontal and vertical binning into a single control as the two are generally related. New drivers should use this control to configure binning. Signed-off-by: Sakari Ailus --- .../media/drivers/camera-sensor.rst | 10 +++++++ .../media/v4l/ext-ctrls-camera.rst | 29 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 2 ++ include/uapi/linux/v4l2-controls.h | 1 + 4 files changed, 42 insertions(+) diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index 5bc4c79d230c..c6167c91f46c 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -107,6 +107,16 @@ values programmed by the register sequences. The default values of these controls shall be 0 (disabled). Especially these controls shall not be inverted, independently of the sensor's mounting rotation. +Binning +------- + +Binning has traditionally been configured using :ref:`the compose selection +rectangle `. The :ref:`V4L2_CID_BINNING +` is also available for binning configuration and +users should use it when it's available. Drivers supporting the control shall +also support the compose rectangle, albeit the rectangle may be read-only when +the control is present. + .. _media_using_camera_sensor_drivers_embedded_data: Embedded data diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst index cdc515c60468..3fbab0e78719 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst @@ -672,3 +672,32 @@ enum v4l2_scene_mode - As modes differ for each sensor, menu items are not standardized by this control and are left to the programmer. + +.. _v4l2-cid-camera-sensor-binning: + +``V4L2_CID_BINNING (integer menu)`` + + Horizontal and vertical binning factors. Binning combines several + horizontal, vertical or both pixel values into a single pixel. It is a way + to scale an image. Binning typically produces fairly good quality output. + + Determines both horizontal and vertical binning factors for a camera + sensor. The values are encoded in the following way: + +.. flat-table:: + :header-rows: 1 + :stub-columns: 0 + + * - Bits + - Synopsis + * - 48--63 + - Horizontal binning numerator. + * - 32--47 + - Horizontal binning denominator. + * - 16--31 + - Vertical binning numerator. + * - 0--15 + - Vertical binning denominator. + +For instance, a value of ``0x0001000300020003`` indicates binning by 3 +(horizontally) * 3/2 (vertically). diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 24c9c25e20d1..3a84051ec11c 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1087,6 +1087,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_CAMERA_ORIENTATION: return "Camera Orientation"; case V4L2_CID_CAMERA_SENSOR_ROTATION: return "Camera Sensor Rotation"; case V4L2_CID_HDR_SENSOR_MODE: return "HDR Sensor Mode"; + case V4L2_CID_BINNING: return "Binning Factors"; /* FM Radio Modulator controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ @@ -1424,6 +1425,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_HDR_SENSOR_MODE: *type = V4L2_CTRL_TYPE_MENU; break; + case V4L2_CID_BINNING: case V4L2_CID_LINK_FREQ: *type = V4L2_CTRL_TYPE_INTEGER_MENU; break; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 0152240229ab..8d5815a058d7 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1088,6 +1088,7 @@ enum v4l2_auto_focus_range { #define V4L2_CID_CAMERA_SENSOR_ROTATION (V4L2_CID_CAMERA_CLASS_BASE+35) #define V4L2_CID_HDR_SENSOR_MODE (V4L2_CID_CAMERA_CLASS_BASE+36) +#define V4L2_CID_BINNING_FACTORS (V4L2_CID_CAMERA_CLASS_BASE+37) /* FM Modulator class control IDs */ From patchwork Fri Nov 22 10:06:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13883017 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 6A6B21DEFC8 for ; Fri, 22 Nov 2024 10:07:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270021; cv=none; b=bzzckiyLSwtsIiHVByDu7K362zuqo4RYiPd9VHT3qVSzrk4Ta9UKoneWIR3KNPEc45NfPDNQoMyM5OwlX0o3c7fNc6whcchAli26xF/bem/4I4zPO4qGHxBsdwMv+FC90geVNewnYR98YHfnO50ZuDLvBLZwJe7QtnepyHOD1Os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270021; c=relaxed/simple; bh=IBTh2/UEgKNe0qezwT15xLhzZdfHtCfTU4PgLROp9Cc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nfpNA9Id3HCZ3d9pzL0WHNR7UxFp9Hr6BEvVqt/sqt0ZLdUXGNYNg8+gs6mcGARA+M6vojTWM2ARdV1xiMHcYyw2fv/FvaYbo6bhlL4rEfSjKh5u7an4vUjYmig/05I/Yyu5GpYPUItahEEY9ts8nMZ+Qiq0NPO8xog0St6feB0= 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=QoR9RvPn; arc=none smtp.client-ip=198.175.65.9 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="QoR9RvPn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270021; x=1763806021; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IBTh2/UEgKNe0qezwT15xLhzZdfHtCfTU4PgLROp9Cc=; b=QoR9RvPnE9h8ow8FtrL7tKKmOOhTUjHdjQhIDqZ9C2eXYsJDaO68xxxv xHa6Ez3Gltb0gMYvkpkeQulyrZ13KRy9vnsNiEDkMPlYlcYKgx5QHBpAd nHmqthhkXdzdmRO5ahTjYvRvVCOcxT4TJ+fbI3cer7PERb9Siarrw9D1a quN3cmJSQlYEqUQq5+3WRGhgPCQv3Fq43Tm/ctrDh8g4ZR8cuDWHSvWqW e8vPlBp9wUYQA9rEklZSOSv+QOpURG4WAzGQczNv5vuJOOeDpSkMV/6qH 4yaYt3CpgcatCVz4T0Jj065nhDHsSMBh3I8XIZwQYFyHg0ptMamDh7N/r Q==; X-CSE-ConnectionGUID: aBh9ySxHQLGRAfCMYOHJRw== X-CSE-MsgGUID: bIZNXSLNSEKmnUWcKZAw9g== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927640" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927640" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:07:00 -0800 X-CSE-ConnectionGUID: rRStLNDlRvCRrd4UikTPYg== X-CSE-MsgGUID: 6JlMIGMhQbCzMZ/FL5PSAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403091" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:54 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 9DE05120B22; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002Lg-22; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 7/8] media: uapi: Add controls for sub-sampling configuration Date: Fri, 22 Nov 2024 12:06:32 +0200 Message-Id: <20241122100633.8971-8-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 Sub-sampling is a way to decrease the data rates after the pixel array by systematically discarding some samples, either vertically or horizontally or both. Add two controls for the purpose and document them. The sub-sampling configuration is taken into account in the compose rectangle. Signed-off-by: Sakari Ailus --- .../userspace-api/media/drivers/camera-sensor.rst | 14 ++++++++++++-- .../userspace-api/media/v4l/ext-ctrls-camera.rst | 11 +++++++++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 2 ++ include/uapi/linux/v4l2-controls.h | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index c6167c91f46c..e65e82c5940a 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -107,8 +107,8 @@ values programmed by the register sequences. The default values of these controls shall be 0 (disabled). Especially these controls shall not be inverted, independently of the sensor's mounting rotation. -Binning -------- +Binning and sub-sampling +------------------------ Binning has traditionally been configured using :ref:`the compose selection rectangle `. The :ref:`V4L2_CID_BINNING @@ -117,6 +117,16 @@ users should use it when it's available. Drivers supporting the control shall also support the compose rectangle, albeit the rectangle may be read-only when the control is present. +Sub-sampling is often supported as part of a camera sensor's binning +functionality and performed after the binning operation. Sub-sampling typically +produces quality-wise worse results than binning. Sub-sampling factors are +independent horizontally and vertically and they are controlled using two +controls, :ref:`V4L2_CID_SUBSAMPLING_HORIZONTAL and +V4L2_CID_SUBSAMPLING_VERTICAL `. In +sub-sampling, the image size before sub-sampling is horizontally and vertically +divided by the respective sub-sampling factors. Drivers supporting the control shall +also reflect the sub-sampling configuration in the compose rectangle. + .. _media_using_camera_sensor_drivers_embedded_data: Embedded data diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst index 3fbab0e78719..38fa97397793 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst @@ -701,3 +701,14 @@ enum v4l2_scene_mode - For instance, a value of ``0x0001000300020003`` indicates binning by 3 (horizontally) * 3/2 (vertically). + +.. _v4l2-cid-camera-sensor-subsampling: + +``V4L2_CID_SUBSAMPLING_HORIZONTAL`` and ``V4L2_CID_SUBSAMPLING_VERTICAL`` +(integer) + + Horizontal and vertical subsampling factors. + + Sub-sampling is used to downscale an image, horizontally and vertically, by + discarding a part of the image data. Typically sub-sampling produces lower + quality images than binning. diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 3a84051ec11c..62d19b09fd6d 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1088,6 +1088,8 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_CAMERA_SENSOR_ROTATION: return "Camera Sensor Rotation"; case V4L2_CID_HDR_SENSOR_MODE: return "HDR Sensor Mode"; case V4L2_CID_BINNING: return "Binning Factors"; + case V4L2_CID_SUBSAMPLING_HORIZONTAL: return "Sub-Sampling Factor, Horizontal"; + case V4L2_CID_SUBSAMPLING_VERTICAL: return "Sub-Sampling Factor, Vertical"; /* FM Radio Modulator controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 8d5815a058d7..e85747e2181b 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1089,6 +1089,8 @@ enum v4l2_auto_focus_range { #define V4L2_CID_HDR_SENSOR_MODE (V4L2_CID_CAMERA_CLASS_BASE+36) #define V4L2_CID_BINNING_FACTORS (V4L2_CID_CAMERA_CLASS_BASE+37) +#define V4L2_CID_SUBSAMPLING_HORIZONTAL (V4L2_CID_CAMERA_CLASS_BASE+38) +#define V4L2_CID_SUBSAMPLING_VERTICAL (V4L2_CID_CAMERA_CLASS_BASE+39) /* FM Modulator class control IDs */ From patchwork Fri Nov 22 10:06: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: 13883019 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 11E341DEFE9 for ; Fri, 22 Nov 2024 10:07:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270023; cv=none; b=brnacnp0dy+GbblHMNLcHrSvPcb7Zxvh3bHgZkay9PSSXIpDSc3ZuzIUQcNTN9qQ57rtUe4zva8Sq2mu2fPimJWs9YF9qB9SpuslxJO4DAmrvgNT+KcQMTVrA99a41FA/ffY1W907i/t7UTZ7dV0Tejg6D/uNf20rLLZOu87+RY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732270023; c=relaxed/simple; bh=WG1qQIgFnvy4XQTRrFc8isXGbG8ujiIiT4N+wUKpJ/8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lekdyCD580muTAB0JVjx+4QGN4mpgX3pSyax2nEWnC3S90vMPH7DiZA1kA2eTYvqSg+t6JW9aHQLptl/tysfr2I4jcRHkqkJIkOpvTLEr++jvtAA6ZaUfNaxxeDRrxBjz0BtPFeNMBe19jNJdt/HdkUdnLtp6UPtYwir0AYPGH0= 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=m1wUDwLf; arc=none smtp.client-ip=198.175.65.9 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="m1wUDwLf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732270022; x=1763806022; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WG1qQIgFnvy4XQTRrFc8isXGbG8ujiIiT4N+wUKpJ/8=; b=m1wUDwLfHJFVx4eB0cg1KJbWodQWYecvvRBjLm1edFJrwioISm+N66iI HjqBZl3hErgkNZAKWw/NZtHJwR1Wy2Q/hLwbHpwGIWd72OPyrcxQIGfMm E0aaTEF6NgrVejYLr8IP0fuaDiAtnSsbx35o2I91B1uzWhGPt36tqq0xQ qKi3BejzyY0WH5m+P/jwme9a3pgAacJ1aQFEmtBEFPKi+Gw7jcsD9Pyrh jkNhdjxDDQRukAVy8dI3zF2c0z5RyTI4WkkmhL0O5nHMibZ6FEjQXd+Ir v77/HPheQ0q7vNbrmdGvznWHeSD37aTsB3xSOP/RA39FGhbGQL9RltSfj Q==; X-CSE-ConnectionGUID: DnRQekF8RuibaeWGI1t45A== X-CSE-MsgGUID: 6yB37lmtSuyHXg7yEJ1T+w== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="54927658" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="54927658" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:07:00 -0800 X-CSE-ConnectionGUID: eL2AiauEQf+xvysmoqXusg== X-CSE-MsgGUID: WzWdMH5KQqmN7UUJKXcodg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="121403095" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 02:06:55 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id A1BB3120D28; Fri, 22 Nov 2024 12:06:43 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.96) (envelope-from ) id 1tEQYl-0002Ll-25; Fri, 22 Nov 2024 12:06:43 +0200 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 , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , "Wang, Hongju" , Stefan Klug , Mirela Rabulea , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Stanislaw Gruszka , Mehdi Djait Subject: [PATCH 8/8] media: Documentation: Add binning and sub-sampling controls Date: Fri, 22 Nov 2024 12:06:33 +0200 Message-Id: <20241122100633.8971-9-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241122100633.8971-1-sakari.ailus@linux.intel.com> References: <20241122100633.8971-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 Document the binning and scaling controls (V4L2_CID_BINNING and V4L2_CID_SUBSAMPLING_{HORIZONTAL,VERTICAL}) in the common raw sensor model. Signed-off-by: Sakari Ailus --- .../userspace-api/media/v4l/subdev-config-model.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/subdev-config-model.rst b/Documentation/userspace-api/media/v4l/subdev-config-model.rst index 25030b80734f..ae39a1bfd2f7 100644 --- a/Documentation/userspace-api/media/v4l/subdev-config-model.rst +++ b/Documentation/userspace-api/media/v4l/subdev-config-model.rst @@ -161,9 +161,14 @@ Also refer to :ref:`Selection targets `. - \- - X - Binning, sub-sampling and scaling. This rectangle is relative to the - V4L2_SEL_TGT_CROP rectangle on the same (pad, stream). The combination - of binning, sub-sampling and scaling is configured using this selection - target. + V4L2_SEL_TGT_CROP rectangle on the same (pad, stream). Binning is + configured using the :ref:`V4L2_CID_BINNING + ` control and sub-sampling is configured + using the :ref:`V4L2_CID_SUBSAMPLING_HORIZONTAL and + V4L2_CID_SUBSAMPLING_VERTICAL ` + controls. Further on, scaling may be configured by setting the compose + rectangle, relative to analogue crop rectangle after binning and + sub-sampling. * - 2/0 - Format - X