From patchwork Mon Jul 10 13:22:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13307129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09AB9EB64D9 for ; Mon, 10 Jul 2023 13:23:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbjGJNXF (ORCPT ); Mon, 10 Jul 2023 09:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbjGJNXE (ORCPT ); Mon, 10 Jul 2023 09:23:04 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFD0A100 for ; Mon, 10 Jul 2023 06:22:56 -0700 (PDT) Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 81B6EBEB; Mon, 10 Jul 2023 15:22:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1688995326; bh=a3X+mOsubBqW8aQtyXJqoPH788qdIvxtQegZ82/7KPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ok+tuAaGXVmU0lCoz8dlhNtAh0ScTfwCwPUi5sbqze6+wkdLQeGAZeRjVqMKoP/NQ 0FWZ5xA+pHuLBWVIiLEO1c8qfZUViObgxg7X8XXP4yOU2cIA+4BnYUwmK19IozbIvp BEd+YoCt9/M08VNh4tVpzTD14d19g1UXDKqr8fxE= From: Jacopo Mondi To: linux-media@vger.kernel.org Cc: Jacopo Mondi , Hans Verkuil , Sakari Ailus , Laurent Pinchart , Dave Stevenson Subject: [PATCH v3 1/2] Documentation: v4l: Flip handling for RAW sensors Date: Mon, 10 Jul 2023 15:22:39 +0200 Message-Id: <20230710132240.7864-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230710132240.7864-1-jacopo.mondi@ideasonboard.com> References: <20230710132240.7864-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Document the requirement of notifying to userspace the possible re-ordering of the color sample components when a vertical or horizontal flip is applied to a RAW camera sensor. Signed-off-by: Jacopo Mondi Reviewed-by: Dave Stevenson --- Documentation/driver-api/media/camera-sensor.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/driver-api/media/camera-sensor.rst b/Documentation/driver-api/media/camera-sensor.rst index 93f4f2536c25..cd915ca119ea 100644 --- a/Documentation/driver-api/media/camera-sensor.rst +++ b/Documentation/driver-api/media/camera-sensor.rst @@ -173,3 +173,19 @@ V4L2_CID_VFLIP controls with the 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. + +Flip handling for raw camera color sensors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Applying vertical and horizontal flips on raw camera sensors inverts the color +sample reading direction on the sensor's pixel array. This may cause the +re-ordering of the color samples on the sensor's output frame. As an example, a +raw camera sensor with a Bayer pattern color filter array with a native RGGB +Bayer order will produce frames with GRBG component ordering when an horizontal +flip is applied. Camera sensor drivers where inverting the reading order +direction causes a re-ordering of the color components are required to register +the ``V4L2_CID_VFLIP`` and ``V4L2_CID_HFLIP`` controls with the +``V4L2_CTRL_FLAG_MODIFY_LAYOUT`` flag enabled to notify userspace that enabling +a flip can potentially change the output buffer content layout. Flips should +also be taken into account when enumerating and handling media bus formats +on the camera sensor source pads.