Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 556703C3BE2 for ; Thu, 2 Jul 2026 11:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782990381; cv=none; b=Ti57BvsYLD1q48jDn3+Q4CMUzP/kwPfSvzcqNKsfIrVrjD3+GWy8YEMryA6aWnpTitb/r+h6xKBMc4cldhgsxZQvm/eibI8Itp8jBpvdKhQjCLtHCnsrymnQO0i2dRSngz0+bZSlQo7YbvzA2kKgmQa4CbcWwTuhRT6DR2kfTzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782990381; c=relaxed/simple; bh=M7rVo8gVWIcPlgSET/5BobYVSHN+EotPYHFYCGhT8H0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ktz3057kn6+Ny7AJqjaHt2wIQmB/dVlERf9/UCRs1+JxuHv3d1g6oqlD7AkvREoVNeczw4pgY8zp+5Za//11pjUESyg8frIfMaocAGhsKWrVFmrX9H3ykZw2mt049CQWGL2FVLpvYGryS4NPEhFMGo1xSM4oIwCy3Y6Ew0GEHaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LXXK//Wa; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass 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="LXXK//Wa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782990380; x=1814526380; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=M7rVo8gVWIcPlgSET/5BobYVSHN+EotPYHFYCGhT8H0=; b=LXXK//WaXMSABXyCfcLf/AD5RozEOn8inSexiyT87tWoTKAlNBUwFsXh ElghCA3JxqMXERDx2Iz9gn+7LkU99zlgYVfxuUoNCkCVK/kzLizgE5r/+ pJ5ErRnyfRcWO6xLW7kZROBfVEa0FBOTR5lVA13tLY+FdjDYwy2EJRpKz 6FxIcVn8IHGmvI6Gw09muydeXfh7MJZcErmYO6RmQzj34DKTLoZLu/xzT IxgG9ml8FYyMoU0p9ai3j77Xoic7Tjcd4sCPLwo4Vz2+S8L81B7JkVwNR D8gHyyvJfywAuMbgvCd4wkXnadVtM4orFpSe1O6xp6Ev0PQSRp7kuaL5/ g==; X-CSE-ConnectionGUID: Vf7bYuavQD+SWhTSnWQO1Q== X-CSE-MsgGUID: qxPYv/YGS+e17QJoJGHJqg== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="83831122" X-IronPort-AV: E=Sophos;i="6.25,143,1779174000"; d="scan'208";a="83831122" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2026 04:06:19 -0700 X-CSE-ConnectionGUID: fgCTQpOBQHSiY6hrSBklMw== X-CSE-MsgGUID: fYciMMYJQJCs7PkydT9xvg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,143,1779174000"; d="scan'208";a="277158521" Received: from conormcd-mobl2.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.244.229]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2026 04:06:13 -0700 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with SMTP id C4578121C29; Thu, 02 Jul 2026 14:06:09 +0300 (EEST) Date: Thu, 2 Jul 2026 14:06:09 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: Jai Luthra Cc: linux-media@vger.kernel.org, hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , Stefan Klug , Mirela Rabulea , =?iso-8859-1?Q?Andr=E9?= Apitzsch , Heimir Thor Sverrisson , Kieran Bingham , Mehdi Djait , Ricardo Ribalda Delgado , Hans de Goede , Jacopo Mondi , Tomi Valkeinen , David Plowman , "Yu, Ong Hock" , " Ng, Khai Wen" , Rishikesh Donadkar Subject: Re: [PATCH v12 05/86] media: uapi: Add V4L2_CID_CFA_PATTERN for describing color patterns Message-ID: References: <20260409201501.975242-1-sakari.ailus@linux.intel.com> <20260409201501.975242-6-sakari.ailus@linux.intel.com> <178240963924.1799417.13645477490024464265@freya> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <178240963924.1799417.13645477490024464265@freya> Hi Jai, On Thu, Jun 25, 2026 at 11:17:19PM +0530, Jai Luthra wrote: > Hi Sakari, > > Thank you for the patch. Thanks for the review! > > Quoting Sakari Ailus (2026-04-10 01:43:40) > > Add V4L2_CID_CFA_PATTERN to tell the camera sensor's native Color Filter > > Array (CFA) pattern. > > > > Signed-off-by: Sakari Ailus > > Reviewed-by: Jacopo Mondi > > Reviewed-by: Mirela Rabulea > > --- > > .../media/v4l/ext-ctrls-image-source.rst | 43 +++++++++++++++++++ > > .../media/v4l/subdev-formats.rst | 2 + > > drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + > > include/uapi/linux/v4l2-controls.h | 6 +++ > > 4 files changed, 52 insertions(+) > > > > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst > > index f9c0b7ad3b4e..b09ad4b4576e 100644 > > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst > > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst > > @@ -93,3 +93,46 @@ Image Source Control IDs > > representing a gain of exactly 1.0. For example, if this default value > > is reported as being (say) 128, then a value of 192 would represent > > a gain of exactly 1.5. > > + > > +``V4L2_CID_CFA_PATTERN (integer)`` > > + This control determines the color components and native pixel order in the > > + sensor's CFA (Color Filter Array) when used in conjunction with > > + :ref:`generic raw mbus codes MEDIA_BUS_FMT_RAW_x (where 'x' is the bit > > + depth) ` pixelcodes. The native pixel > > + order is constant for a given device, it is not affected by cropping or > > + flipping. > > + > > + This control may only be used on V4L2 sub-devices. > > + > > + This is a read-only control. > > + > > + Available patterns: > > + > > +.. flat-table:: V4L2 Color Filter Array Patterns > > + :header-rows: 1 > > + :stub-columns: 0 > > + :widths: 1 2 1 > > + > > + * - Macro name > > + - Synopsis > > + - Value > > + * - V4L2_CFA_PATTERN_GRBG > > + - Bayer pattern (2x2 macroblocks). Each macroblock has a green filter in > > + the top-left and bottom-right pixels, a red filter in the top-right > > + pixel, and a blue filter in the bottom-left pixel. > > + - 0 > > + * - V4L2_CFA_PATTERN_RGGB > > + - Bayer pattern (2x2 macroblocks). Each macroblock has a green filter in > > + the top-right and bottom-left pixels, a red filter in the top-left > > + pixel, and a blue filter in the bottom-right pixel. > > + - 1 > > + * - V4L2_CFA_PATTERN_BGGR > > + - Bayer pattern (2x2 macroblocks). Each macroblock has a green filter in > > + the top-right and bottom-left pixels, a blue filter in the top-left > > + pixel, and a red filter in the bottom-right pixel. > > + - 2 > > + * - V4L2_CFA_PATTERN_GBRG > > + - Bayer pattern (2x2 macroblocks). Each macroblock has a green filter in > > + the top-left and bottom-right pixels, a blue filter in the top-right > > + pixel, and a red filter in the bottom-left pixel. > > + - 3 > > WDYT about adding a V4L2_CFA_PATTERN_MONO or similar here? > > This would help us re-use MEDIA_BUS_FMT_RAW_xx across mono/color variants > of the same sensor (like IMX678), and applications supporting the new raw > sensor model can also have a simple code-flow of always reading the > CFA_PATTERN control instead of handling MEDIA_BUS_FMT_Yxx separately. I'll add this to v13. We also have a chance now to differentiate visible light vs. infrared etc. here. The sensitivity of different sensors for visible light differs, too, but some information might be useful here. Some of the other patterns have various kinds of pixels, too, and we may need additional interfaces to convey this information to the userspace in the future -- or just keep it in the userspace. -- Regards, Sakari Ailus