From patchwork Fri Oct 11 07:55: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: 13832208 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 7C1CE20A5F4 for ; Fri, 11 Oct 2024 07:55:47 +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=1728633349; cv=none; b=eUSFEv4oPZlbE+53pGBRh191O+zUm8sHmglODUW9e8I/5AAwCPCV2i0PBm5hpeY199riVtXyy1Z8NNm81yOMKar6jWGvysWdc45Lo8DZeNTJr7xy4IzEa3XKOSl9sGDGOw0KWlcJzPUNt02lSGUT+yqdBpHtCPHQtpZni2m+CLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728633349; c=relaxed/simple; bh=dk6Nsb90lQagWOQfcKpxDbQ2aUfSv6xoZJNuHo3BDtY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uuMx/3eIptEHubpAhEo3UAo8zsV518Ya6vSnGPRqJnbFDYanjrynQjHiAM78typjDsyD5s/3D3ZxmlrS7OSG51ycA96JDIvbnyfMiV4yCWfE3DpKuVqBQ+l93VsPqmfzSLR2g1xL3IPvGHEo5Y36roSN9yqYd15xNBvt5rpOHQk= 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=HO814w6e; 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="HO814w6e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728633348; x=1760169348; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dk6Nsb90lQagWOQfcKpxDbQ2aUfSv6xoZJNuHo3BDtY=; b=HO814w6egcSOCgrLet+OLkLT5MKr9hgYhgjyv6Ch0ecUIyVUgEZrsD3J vb0xcQM/0L2g843u6SaMeaaEFt/8RiQYHPjVLLDQL5EhYifBW91ifcXyr 0k0853rSxc6Q89ZAyUjjGvBCGAbSOUhL2fUP7qP/S7TqjvUmCp0HySuF7 kHm/hBohSa6qJSXP7UnfdCgPTY5p36mq+LT3uymVuM/z0U3vgKTPOO3pT 61dsjF+yXzNGY5sS2m0RLAXSriyc/z3qqbBAdZe/LOAt25dv0aDNqszIa xwjeKU5KWMtSHBzmi0b+Eg/93YFtklYYkP28tKyN54YNbcmTFYyQnh/6s Q==; X-CSE-ConnectionGUID: TquawCNiSyOY/nw37RPbHg== X-CSE-MsgGUID: wleGMBNbQNu/VUhSPmdnXA== X-IronPort-AV: E=McAfee;i="6700,10204,11221"; a="30898382" X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="30898382" 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:47 -0700 X-CSE-ConnectionGUID: N126rubASpmF1BCYzp+YyQ== X-CSE-MsgGUID: pR9zdzXeSUWhBtJvUh29Dg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="81826879" 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:44 -0700 Received: from svinhufvud.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 7AF2711F984; Fri, 11 Oct 2024 10:55:38 +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 1/4] media: Documentation: Rework embedded data documentation Date: Fri, 11 Oct 2024 10:55:32 +0300 Message-Id: <20241011075535.588140-2-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 Rework embedded data documentation by removing the reference to the pixel data stream. The specific documentation of the embedded data interface will be elsewhere. Signed-off-by: Sakari Ailus --- .../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..d82cd803e337 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 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 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: 13832209 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 --- .../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:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13832210 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 2B4E7209664 for ; Fri, 11 Oct 2024 07:55:55 +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=iC2F7EbF6eYX0+5Ksc+q6S/C7L1H0V3q8mF9TOlQVCNRVeMR4jDOS34y1g6wY0pGJNWKLkDHahN41M5KR/h4z++0TLdb5HaX7Qep+xQfqQyCHI3ZpMSCKbggtnH9wZ7S4cwERINgY+kUHxtEPl942S9ih5XmDHdw57XHTyUVUl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728633358; c=relaxed/simple; bh=u/lX4dvlfnanhH0Y2fO4e982CLXkYX1hkAWS212QbIE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oiz19ybKScRTWjruBHkB+qv8bqSwlaRt6yhXW4hIQHMuKaXsC9AnIc9EBIShzBGWncHStyt1bSbHkfK27EJ2LFt0AuiZmJSSvXgcuQBBcwTLU+xuvp4t6JFoM4eEHOniBM8jtI3koTWOevqsnQV0h8NQe4aq+EVZD8VqaE4vXbg= 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=kFfTB4R3; 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="kFfTB4R3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728633355; x=1760169355; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u/lX4dvlfnanhH0Y2fO4e982CLXkYX1hkAWS212QbIE=; b=kFfTB4R3t9y3y8jZLmP88JPiWKFY7nXBzQy5bcWQPJtvkpZSuYZrmiW7 CxvW2ki97C7TKmuL/6W4pZEkpaZaIzSHhgmx7UoeEFw2Gwr4KLSCzckF+ EBvmpoQNCLMFvArHEmod+1y+xHqkUEa7WUfE/wkydWc9l/wstYPFQkcuk WPcC6qHhpM/9oPNkrhGMvn7leqc+EjwoKqNJf6I2uIlvBYJAQTLIDQHhX PqqySzsnex0Lp5W6ihOYefAQHtUxst8dMKa8rJb0B22wIbCdrMT96/C67 MynO1K3DrukEoR1tIRDVIo0rYPwUdwi/nTrL79thtAyLaXtp1xsL3uZa5 Q==; X-CSE-ConnectionGUID: nv7ZSR/VTfmoa3ySYyAJhw== X-CSE-MsgGUID: kcotW0GcQki1ujLwMSDbBA== X-IronPort-AV: E=McAfee;i="6700,10204,11221"; a="30898404" X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="30898404" 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:55 -0700 X-CSE-ConnectionGUID: VNemzg3hQ8aQHuKsqD0Tjw== X-CSE-MsgGUID: bltkENXKT5aiZiHCXJRUrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,195,1725346800"; d="scan'208";a="81826896" 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:51 -0700 Received: from svinhufvud.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 611BF11F855; Fri, 11 Oct 2024 10:55:45 +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 3/4] media: Documentation: Add subdev configuration models, raw sensor model Date: Fri, 11 Oct 2024 10:55:34 +0300 Message-Id: <20241011075535.588140-4-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 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 | 5 + .../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 | 180 +++++++ 5 files changed, 762 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 ad4049ff7eec..727cc12bc624 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -18,6 +18,9 @@ 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 +108,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..8ec801998f5f --- /dev/null +++ b/Documentation/userspace-api/media/v4l/subdev-config-model.rst @@ -0,0 +1,180 @@ +.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later + +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 semantics specific to a given configuration model. + +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 the configurability of a superset +that covers the vast majority of raw camera sensors. Not all of the +configuration and enumeration interfaces are 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 show 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 may support enabling and disabling the embedded data stream. Others +may not support it at all, in which case the embedded data route does not exist. + +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 one or more sides, may contain optical +black pixels, dummy pixels and other non-image pixels. + +A rectangle within the pixel area 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 if +supported by the hardware. + +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 proportions horizontally and vertically. Typical values are +1/2 and 1/3 but others may well be supported by the hardware as well. + +The combination of the analogue crop and binning 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 binned image. The resulting image size is +further outputted by the sensor. + +.. flat-table:: Selection targets on pads + :header-rows: 1 + + * - Pad/Stream + - Selection target/format + - Mandatory (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_NATIVE_SIZE + - X + - The full size of the pixel array, including all pixels in the pixel + array, even if they cannot be captured. This rectangle is relative to + the format on the same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_CROP_BOUNDS + - X + - The crop rectangle bounds. No pixels outside this area can be + captured. This rectangle is relative to the V4L2_SEL_TGT_NATIVE_SIZE + rectangle on the same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_CROP_DEFAULT + - X + - The visible pixel area. This rectangle is relative to the + V4L2_SEL_TGT_NATIVE_SIZE rectangle on the same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_CROP + - \- + - Analogue crop. Analogue crop typically has a coarse granularity. This + rectangle is relative to the V4L2_SEL_TGT_NATIVE_SIZE rectangle on the + same (pad, stream). + * - 1/0 + - V4L2_SEL_TGT_COMPOSE + - \- + - Binning. This rectangle is relative to the V4L2_SEL_TGT_CROP + rectangle on the same (pad, stream). + * - 2/0 + - Format + - X + - Embedded data format. + * - 0/0 + - V4L2_SEL_TGT_CROP + - \- + - Digital crop. This rectangle is relative to the V4L2_SEL_TGT_COMPOSE + rectangle on (pad, stream) pair 1/0. + * - 0/0 + - Format + - 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 where as 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 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: 13832211 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)