From patchwork Fri Dec 20 13:24:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 852679 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 B6202215706 for ; Fri, 20 Dec 2024 13:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701077; cv=none; b=s1uu8V0FcegeBkatJMrYroZ6IOJbk4NEOl1aStum52KGPoorSzQf5Hxq5krdjinJkJ3jI9Br3EbgeXU0WJh017ieN/6aXCd+r9tnFimIjUNllbl6VG/Gtg4/KI8xKlykOAFSo/XNGiOhCKLE7FEoGBkuhLB504hBeII73v3Eo8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701077; c=relaxed/simple; bh=WBfBUTc7foxaXJtaX15rqZrWhtCGrvhQTyIm9yDq+Io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=S1+/5p6tWHG8bwlbgXbGdYBfUaGFlgjj9NCKhnq4HwiBa5TMVOLka/hwmAWOs6WjpkakStLM1rZDp/zXikwM0zHtknpHVdSWAQyR7zZNsUaJj9E9X/vyRZG4Hhp/kVLEKjWsl+DiHjbX59g6ZVbY9/vTvYC0M/LnJwb1mfq384I= 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=kh3VrRby; arc=none smtp.client-ip=192.198.163.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="kh3VrRby" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734701076; x=1766237076; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WBfBUTc7foxaXJtaX15rqZrWhtCGrvhQTyIm9yDq+Io=; b=kh3VrRbySn2r83jHmNtPjj+KH9lmTpIbuaic0JeVqrodIQz9UA6ZP9hg pkoZz0mFZPS1cm0BJbwQPWBQKTWAVfdnIBheuqN84D41w7S4kDn6NxCua KP8/1AuRkBPQLdW4bu5hkn4OExjE3g3XvLPILHcDGS3xpF2OpRtnWjAgN Vj9qXLyD3W8/INVStARRsmtPuNCehFCXuvphfTicG8xwOI51EYCZaiY1P /VBd2+alkE7lqwIz3dp0izpLihrN4j/GVwMrAWAXIDPV+9J0l7cZbCXH1 Wtw+ocUQ16dJJBhrd5cm75zVsNS384z4ebGN71+JFgAF4IRt5fivy2sAH g==; X-CSE-ConnectionGUID: 1fLvJ2ClSe+wkiNlwRlzaw== X-CSE-MsgGUID: mm8ryBxHSAq7vuy638E0wA== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="45937554" X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="45937554" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:35 -0800 X-CSE-ConnectionGUID: I1s+zRlsRKGw/xo/CbRChA== X-CSE-MsgGUID: YX6/IrYcQz6r871szX7hnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="98333222" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:30 -0800 Received: from svinhufvud.intel.com (maa-artisokka.localdomain [192.168.240.50]) by kekkonen.fi.intel.com (Postfix) with ESMTP id A6E9E11FADB; Fri, 20 Dec 2024 15:24:24 +0200 (EET) 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 , Ricardo Ribalda Delgado Subject: [RFC v4 1/9] media: Documentation: Rework embedded data documentation Date: Fri, 20 Dec 2024 15:24:11 +0200 Message-Id: <20241220132419.1027206-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241220132419.1027206-1-sakari.ailus@linux.intel.com> References: <20241220132419.1027206-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 Dec 20 13:24:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 852678 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 2B24F215707 for ; Fri, 20 Dec 2024 13:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701084; cv=none; b=Mpwa5T8+xqrELtfZduk3504SM44aqNiCMmhNup6OUqyuNYiOEV/hcCIDCq5pDDLu316ouOv3VK2dFY+wYvrocsZjQ91nIZfgAT3qXyDEHHminW0UsA+QpleHM2PMRr2EbWeZoovv6D+3m0ZxN1GFdJ/CeWgXUyZiWrS77dTlijQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701084; c=relaxed/simple; bh=iBppAmcg/4oeQmFNol3/v5Tdg5CR//+q6p+zX2mWQUI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EZjhv+gWD5W52S7p/ohf+WHKHRU1x2g+Fq3Jij98o71U7aOKLnycxdKMQiX8tRsMnU/CxzYRM4e5O0B56JtgzVWTP8Qapow3+xONQOCe6o0feuNy2bkEG/wMwVH2nvZ9sDHQEzvXG8Z0DHyMT3NB5wZ6gallhwUN+9K5GGd1UyI= 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=YNG5+icO; arc=none smtp.client-ip=192.198.163.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="YNG5+icO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734701083; x=1766237083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iBppAmcg/4oeQmFNol3/v5Tdg5CR//+q6p+zX2mWQUI=; b=YNG5+icO9IzUDa2R/Ba5oSE4/zrOzGd4wc0ke8XO2D0SiIJeGb2saoIC rrOjQ45F0wypKcL853muIzQbHy/22wAkm9wzs4GJUrOEEN/tni0KXybaP FMCkorv7UIoXLkAiA33ntRw8MMHLwQq8PQX4hWkp/O87yO1sFmzF54rYi 0x+uBai5pHDYCARjeD8HlxucMXGFViUyne/lzGnnwawF0Ee2mdAqZscfO snJBRESy4KxX7wfnw9l9bXD2oVjklojKqlWBI1Y6T7ljrKly6w1h4kJe/ EgpKMKFitScAHjG0hH0LU+sdEfCeXfLSqBfSXF5NWSfcHDXWZ4xzNPt4i Q==; X-CSE-ConnectionGUID: O10yUD4ESeWyeY1txE9CcA== X-CSE-MsgGUID: vJqxlqOcTm62NFIcIMoMMQ== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="45937583" X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="45937583" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:43 -0800 X-CSE-ConnectionGUID: sRA5njW9Q8mot5Gut8EaSA== X-CSE-MsgGUID: nvhYWyR9TgK6UwwF9N6mYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="98333251" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:37 -0800 Received: from svinhufvud.intel.com (maa-artisokka.localdomain [192.168.240.50]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 28513120B3E; Fri, 20 Dec 2024 15:24:32 +0200 (EET) 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 , Ricardo Ribalda Delgado Subject: [RFC v4 3/9] media: Documentation: Reword split of sensor driver to two classes Date: Fri, 20 Dec 2024 15:24:13 +0200 Message-Id: <20241220132419.1027206-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241220132419.1027206-1-sakari.ailus@linux.intel.com> References: <20241220132419.1027206-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 Reviewed-by: Jacopo Mondi --- .../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 Dec 20 13:24:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 852677 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 4E0A6215F5D for ; Fri, 20 Dec 2024 13:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701092; cv=none; b=I0vUO0v0bJCUKX4NBJPvxoczsbb2sm1ButgjH83NYJMHF78toMJO8z/pzJoBcaaHW5JIhFn4i6N+5E4OUIqG5ivvaehhTKRWVf9ICF7n1vuvLjbTEnDSxXlLHjBdeWMjNpWxUhABcgw9I5qqqT6PW8FiDT4GC8ETY2TdD5mTWKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701092; c=relaxed/simple; bh=EqS8HsotZO5ElRikzcpalqye+HQyEZNIAk/pAvJ7Qb8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mCgKNadhQTEpOPJIGGWc30kL0UsfobGOBbzrcVSZpBrMcmmUdUaLuJkW4cOX2DKwwIX/7hxc6HWef49K69/LL9GudARg5ekTbjhbe+sSG9CuA/AAxEqBixTXf6sIHt/UhuOjQdlznEngzhIRx3Qcl+pdKT3gNicl9TCfB+JJ//Q= 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=mstwKA6P; arc=none smtp.client-ip=192.198.163.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="mstwKA6P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734701091; x=1766237091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EqS8HsotZO5ElRikzcpalqye+HQyEZNIAk/pAvJ7Qb8=; b=mstwKA6Pmox4z31LNu/UVbIZd+WdkVlAO7UukZ2Zre085MsglZCxpJSh QZbGAU7d9uQNrBdPUbaJR+kfz+A3NK//7FbAZFNxq3z9382DjBjzfcS9k F1itC0TDnRL4un14e1K0XsOop23N9yFtj9kwrjB7KEwqbG826G6ld/Gm2 Ib3MoOyS46j6iYBaGwEFBBsYznrt4wxNV8gioM2cb79X4n2z5zDTrpdUC D8dyu9uCPGLsscWcBm8kl8Z7C+U51JyG1sWGylhlWFKzrEInxg9oLqrh/ 6E7S5NYEfYFNPVp1LfXr0R0rcykDqTlyQ0F8XveAId0r849Yp//9WB2jX w==; X-CSE-ConnectionGUID: GNwkHudCQPuBiGj43COLmg== X-CSE-MsgGUID: 1sk2vSKyTnq6LoeOdqYf/g== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="45937612" X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="45937612" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:51 -0800 X-CSE-ConnectionGUID: jj7oxGHJSi26vORCbE1Qrg== X-CSE-MsgGUID: iq2NlmfPRK+ugVmfPb8GVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="98333276" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:44 -0800 Received: from svinhufvud.intel.com (maa-artisokka.localdomain [192.168.240.50]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 2FEEC11FADB; Fri, 20 Dec 2024 15:24:39 +0200 (EET) 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 , Ricardo Ribalda Delgado Subject: [RFC v4 5/9] media: Documentation: Add scaling and post-scaler crop for common raw Date: Fri, 20 Dec 2024 15:24:15 +0200 Message-Id: <20241220132419.1027206-6-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241220132419.1027206-1-sakari.ailus@linux.intel.com> References: <20241220132419.1027206-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 scaling and post-scaler digital crop operations for the common raw sensor model. Signedg-off-by: Sakari Ailus --- .../media/v4l/subdev-config-model.rst | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/subdev-config-model.rst b/Documentation/userspace-api/media/v4l/subdev-config-model.rst index b0bd09772ceb..f15e5495cc34 100644 --- a/Documentation/userspace-api/media/v4l/subdev-config-model.rst +++ b/Documentation/userspace-api/media/v4l/subdev-config-model.rst @@ -118,11 +118,18 @@ sub-sampling to achieve the desired size. The digital crop operation takes place after binning and sub-sampling. It is configured by setting the ``V4L2_SEL_TGT_CROP`` rectangle on (pad, stream) pair -0/0. The resulting image size is further output by the sensor. +0/0. + +The scaling operation is performed after the digital crop. It is configured by +setting the ``V4L2_SEL_TGT_COMPOSE`` rectangle on (pad, stream) pair 0/0, +relative to the digital crop. The sensor's output mbus code is configured by setting the format on the (pad, -stream) pair 0/0. When setting the format, always use the same width and height -as for the digital crop setting. +stream) pair 0/0. The width and height fields are used to configure post-scaler +digital crop if supported by the driver, affecting the right and bottom edges of +the frame. If post-scaler digital crop is not supported, the width and height +fields of the format will match the compose rectangle sizes applied on the same +0/0 (pad, stream) pair. Drivers may only support some of even none of these configurations, in which case they do not expose the corresponding selection rectangles. If any selection @@ -180,12 +187,19 @@ Also refer to :ref:`Selection targets `. - X - Digital crop. This rectangle is relative to the ``V4L2_SEL_TGT_COMPOSE`` rectangle on (pad, stream) pair 1/0. + * - 0/0 + - ``V4L2_SEL_TGT_COMPOSE`` + - \- + - X + - Scaling. This rectangle is relative to the ``V4L2_SEL_TGT_CROP`` + rectangle on (pad, stream) pair 0/0. * - 0/0 - Format - X - X - - Image data source format. Always assign the width and height fields of - the format to the same values than for the ``V4L2_SEL_TGT_CROP`` + - Image data source format and post-scaler crop. The width and height + fields of the format, used to configure post-scaler crop on the right + and bottom edges of the image, are related to the ``V4L2_SEL_TGT_COMPOSE`` rectangle on (pad, stream) pair 0/0. The media bus code reflects the pixel data output of the sensor. * - 0/1 From patchwork Fri Dec 20 13:24:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 852676 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 676EB215F76 for ; Fri, 20 Dec 2024 13:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701099; cv=none; b=SsCLenO7eJl6HpCsrS6pzuqUY1JFqRRVIjh3QK7JLqRAgichNboZteyvVKMKnB96CpUCItRSrbbWN8+6mkAHnz0W/BIkLGvD6QRPvMFyQ6KcxDHaX7GnyXQ7a9taNG0tmrRqV6fUS9x5/H0qhThOko3IoANRfcjxON3UXJSIgTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701099; c=relaxed/simple; bh=0iC0lQyNBuxKm1TUD7DF+PD53HARIMHVyuMWdRyh7Is=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SgFKqMRNE/Ue5DWLQadieqHDQPXHitvzBMLHtb4jaJrHzPnGphmS2YwcLFglyzKfcnq1LBJosRBb4wuRChMV1LX3oR56cyGYKMhui/Kv0nif2QYrKuGSHzpGXNp0cBpPWyUWxqgB4R7Mu2hEHEjIucSo7MdqK87l6tbCr+fB1TU= 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=HzRVRXQ7; arc=none smtp.client-ip=192.198.163.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="HzRVRXQ7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734701097; x=1766237097; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0iC0lQyNBuxKm1TUD7DF+PD53HARIMHVyuMWdRyh7Is=; b=HzRVRXQ7w/rHLLuXtZNkazCLH6s7gqKkwGhYJc0SFumOm+ZAfbLoqVrj LyhVPgl7baThZf21t50i+gvhTAiB+GusLjw82LZkkBLvcG4MFTM3kPB2d YZInGxBdfYGlfCFcgUQ+Li9jLxMF9naqmO511w8gTsXFVkXa66hrJBklu ZmQyAWUa9FFElf1BDTck0auBc4Cj5qWHfBo3tUc0uXsWtEBO/lvidRVNF B7LsNPmkMtAoeG2p8Y3JYqS9z6Wulq/xg3Bq/HgrZkUe3FcDDVRU+4K7B hagqH6NX7dwSYpNMslppSLhWPCx75JU2GyXKXR80flx1Bzi0nPSGgumfu Q==; X-CSE-ConnectionGUID: hMjtoktdTNyNcTyrLMving== X-CSE-MsgGUID: I/W/HXWcTDqN19tVBgu2GQ== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="45937645" X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="45937645" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:57 -0800 X-CSE-ConnectionGUID: FoWtpdc4S2qM8Qj2Q71SfQ== X-CSE-MsgGUID: wUYBYwE/QZiESJt4HXFJJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="98333295" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:24:51 -0800 Received: from svinhufvud.intel.com (maa-artisokka.localdomain [192.168.240.50]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 5F17C120B3E; Fri, 20 Dec 2024 15:24:46 +0200 (EET) 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 , Ricardo Ribalda Delgado Subject: [RFC v4 7/9] media: uapi: Add V4L2_CID_BINNING control for binning configuration Date: Fri, 20 Dec 2024 15:24:17 +0200 Message-Id: <20241220132419.1027206-8-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241220132419.1027206-1-sakari.ailus@linux.intel.com> References: <20241220132419.1027206-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..18b484ff5d75 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_FACTORS (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..5945976b841f 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_FACTORS: 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_FACTORS: 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 Dec 20 13:24:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 852675 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 F24D0215F7E for ; Fri, 20 Dec 2024 13:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701107; cv=none; b=Co/GWbTzM38G8Ud7WVFBuuz3n3lil0UgFS2j1OII7oBV1SF8eSpM5C8OFwNfotHJLpVCovbybpVVux4Ue35xePAzEcEkGNYHqUT5T5NPe1OHjYgl2hVE8dzbkwLW7Rqm2D5Tv4d/1BKjl9iZUh+04D67ixsGGS2iVl/4C1pplok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734701107; c=relaxed/simple; bh=APCMTulVGvl/4oU3GCTZx2R+6M3HjalCZobgdjNcH2g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eQNar1P/xX9Yxb6otFf4zamSAqBZNluEfoXEPXhu4vV4Yb7yT75mYkfWE+jqGbd3xGC5Qk0zZ6w63s7h1vl2G0hG/To2AXA/kedPKoUbCXSGfjOGmAhqTOJKjwo+akWVAPu0vcUWNls+uIHxBDZaHjtp4S1AgphejquREnFhaoE= 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=itNlfKMs; arc=none smtp.client-ip=192.198.163.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="itNlfKMs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734701106; x=1766237106; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=APCMTulVGvl/4oU3GCTZx2R+6M3HjalCZobgdjNcH2g=; b=itNlfKMsuEDhOq7oXqtNtibV7BpgpegCc0/QTPhh8G10G9aySpva4MOX mPr4zwRZ+O58y8h0/qIKqyFNfB53S0Ax58oVEYfrM1gxYuU2bwZZcn02n B1WRZbARe9mUV4t9DbBh/mt/Q2MlI193GYOpTAPiX79+SE6ugQIt/4xtW TNe4z+5NdcgM9SF07Fm0L0XQyOhpMrjiPZmIudznq4XdRfqg412a+ox9Q pQmKHSK8375QZXzIeFegxtwdi+IQ2nAaju3R29ydhz/JULSj8B43U7hY5 AndXiz9olvDeADRL0uJXQWWx7JFcy+3kAHh68HbGeTsrbbz5yUbT5hKzM g==; X-CSE-ConnectionGUID: rou9pJEyT+WUypIdJe1z8w== X-CSE-MsgGUID: wMDnfltgSMe99C5BdaUEFA== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="45937679" X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="45937679" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:25:06 -0800 X-CSE-ConnectionGUID: A+iEhH4YTaCw1TI9T4YXfA== X-CSE-MsgGUID: Vuq7adqdTdylIbYkOAsTmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="103132536" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:25:00 -0800 Received: from svinhufvud.intel.com (maa-artisokka.localdomain [192.168.240.50]) by kekkonen.fi.intel.com (Postfix) with ESMTP id D164711FADB; Fri, 20 Dec 2024 15:24:54 +0200 (EET) 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 , Ricardo Ribalda Delgado Subject: [RFC v4 9/9] media: Documentation: Add binning and sub-sampling controls Date: Fri, 20 Dec 2024 15:24:19 +0200 Message-Id: <20241220132419.1027206-10-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241220132419.1027206-1-sakari.ailus@linux.intel.com> References: <20241220132419.1027206-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 --- .../media/v4l/subdev-config-model.rst | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/subdev-config-model.rst b/Documentation/userspace-api/media/v4l/subdev-config-model.rst index f15e5495cc34..84957dc62800 100644 --- a/Documentation/userspace-api/media/v4l/subdev-config-model.rst +++ b/Documentation/userspace-api/media/v4l/subdev-config-model.rst @@ -113,8 +113,12 @@ separately horizontally and vertically. Binning and sub-sampling are configured using the ``V4L2_SEL_TGT_COMPOSE`` rectangle, relative to the analogue crop rectangle, on (pad, stream) pair -1/0. The driver implementation determines how to configure binning and -sub-sampling to achieve the desired size. +1/0. It depends on the driver which of these operations are being used to +achieve the resulting size. Binning and sub-sampling are also directly +configured using :ref:`V4L2_CID_BINNING_FACTORS +` and :ref:`V4L2_CID_SUBSAMPLING_HORIZONTAL and +V4L2_CID_SUBSAMPLING_VERTICAL ` controls on +drivers that support them. The digital crop operation takes place after binning and sub-sampling. It is configured by setting the ``V4L2_SEL_TGT_CROP`` rectangle on (pad, stream) pair @@ -173,9 +177,15 @@ Also refer to :ref:`Selection targets `. - \- - X - Binning and sub-sampling. This rectangle is relative to the - ``V4L2_SEL_TGT_CROP`` rectangle on the same (pad, stream). The - combination of binning and sub-sampling 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_FACTORS + ` control and sub-sampling is configured + using the :ref:`V4L2_CID_SUBSAMPLING_HORIZONTAL and + V4L2_CID_SUBSAMPLING_VERTICAL ` + controls on drivers that support these controls. To configure binning + and sub-sampling on drivers that do not support these controls, the + selection rectangle may be changed directly to configure the combined + effect on the image size. * - 2/0 - Format - X