From patchwork Tue May 10 11:51:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15875 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 65235C3256 for ; Tue, 10 May 2022 11:52:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EBC4365656; Tue, 10 May 2022 13:52:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652183556; bh=d3QEcEuWK6z6oOc1biYGe9+5VTFDc2s4Kpf0jtO3sqk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=2WdwD/YX9bkY6KmHG6FFpv4EjTjClarLTGOjgCkQZQnNooVH2H5kb8B6cqPSc3DoG tCj1yUvwbJAFCaOm3vLvg7LT2zN2ADrgmHgOM968GTCal0QLp7FsMHqFiggCY7KaLQ TObt/K/i5PBSxdOG1ys1V9fGLVlZ8m0BFWOMX4jriAAwG4u/7Kjr6u4rH6mAYxyc+6 6CfvRhxoQwfNjDHlsrBjuAETqzevD54jnEP+od0oJigeVx1yymawKXIZmPvI25wuxs Rxg6m+lkCuHZ2WlpcXmakr3WjDNPPkIGlca7r+ddYcGkP7ChEiy1Q90l8FyT0+bmXA qrUtFik+LIPQA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F1D4065694 for ; Tue, 10 May 2022 13:52:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BFlvTIi1"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 16269824; Tue, 10 May 2022 13:52:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1652183546; bh=d3QEcEuWK6z6oOc1biYGe9+5VTFDc2s4Kpf0jtO3sqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BFlvTIi1siMuhiKaocaeuj7uU0fbSPJy0kI41rmfTtqu5xnT+eTbT/8F7YvtkEEbb uM1AmVxakjmJ7QA3437wut9F3REFWxzPX3jDDDLpFg2AIfSz983SS5X1bCBPJAABPp R9DimFqgGNbNm0OkG7GFwbto9N4/wgRRdLuX4D1U= To: libcamera-devel@lists.libcamera.org Date: Tue, 10 May 2022 14:51:32 +0300 Message-Id: <20220510115147.19360-36-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220510115147.19360-1-laurent.pinchart@ideasonboard.com> References: <20220510115147.19360-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 35/50] staging: media: imx: imx7-media-csi: Drop IC support from imx7_csi_try_colorimetry() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Cc: Martin Kepplinger , kernel@pengutronix.de, Dorota Czaplejewicz , Alexander Stein , Rui Miguel Silva , Philipp Zabel , Steve Longerbeam Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The imx7_csi_try_colorimetry() function supports the unrelated image converter hardware as it originates from shared helpers. Drop that. Signed-off-by: Laurent Pinchart --- drivers/staging/media/imx/imx7-media-csi.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index b8ce4fd7c55d..c8ff259452b1 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -2031,13 +2031,8 @@ static int imx7_csi_get_fmt(struct v4l2_subdev *sd, * parameters based on the colorspace if they are uninitialized. * * tryfmt->code must be set on entry. - * - * If this format is destined to be routed through the Image Converter, - * Y`CbCr encoding must be fixed. The IC supports only BT.601 Y`CbCr - * or Rec.709 Y`CbCr encoding. */ -static void imx7_csi_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt, - bool ic_route) +static void imx7_csi_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt) { const struct imx7_csi_pixfmt *cc; bool is_rgb = false; @@ -2069,16 +2064,9 @@ static void imx7_csi_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt, tryfmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(tryfmt->colorspace); - if (ic_route) { - if (tryfmt->ycbcr_enc != V4L2_YCBCR_ENC_601 && - tryfmt->ycbcr_enc != V4L2_YCBCR_ENC_709) - tryfmt->ycbcr_enc = V4L2_YCBCR_ENC_601; - } else { - if (tryfmt->ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT) { - tryfmt->ycbcr_enc = - V4L2_MAP_YCBCR_ENC_DEFAULT(tryfmt->colorspace); - } - } + if (tryfmt->ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT) + tryfmt->ycbcr_enc = + V4L2_MAP_YCBCR_ENC_DEFAULT(tryfmt->colorspace); if (tryfmt->quantization == V4L2_QUANTIZATION_DEFAULT) tryfmt->quantization = @@ -2135,7 +2123,7 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi, return -EINVAL; } - imx7_csi_try_colorimetry(&sdformat->format, false); + imx7_csi_try_colorimetry(&sdformat->format); return 0; }