From patchwork Sun May 10 22:30:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 209874 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F1A0C38A2A for ; Sun, 10 May 2020 22:31:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4CF52071C for ; Sun, 10 May 2020 22:31:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WzVrjaWo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728974AbgEJWbM (ORCPT ); Sun, 10 May 2020 18:31:12 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:49444 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728660AbgEJWbM (ORCPT ); Sun, 10 May 2020 18:31:12 -0400 Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6F57173E; Mon, 11 May 2020 00:31:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589149869; bh=8SWOGUg7re6P5qqPLUuxUEQTEcbRo6uxH3p4dAgRbkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzVrjaWoq09c4N+7JNQi5OOXx4QJdwOF23ItSYgqJvqM9gp6kkVnPp+hjvzeGjYvh oT9jHIK2fhk/vmL2JnqyUd38bci50lOrtH40DZydrz9uu4Vt4BCnjT5nS6Hpz0ViIg norNdrYceX/Xe0rtn4njtSPNuabJWFDI4gZfVknU= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-imx@nxp.com, kernel@pengutronix.de, Philipp Zabel Subject: [PATCH 1/2] media: imx-pxp: Fix routing configuration for i.MX7 Date: Mon, 11 May 2020 01:30:59 +0300 Message-Id: <20200510223100.11641-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200510223100.11641-1-laurent.pinchart@ideasonboard.com> References: <20200510223100.11641-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The PXP hangs without producing any frame on the i.MX7. This is caused by a mismatch between the routing configuration and the modules configuration. Fix the routing configuration by - Selecting Composite Alpha Blending/Color Key 0 (main path) as the input to CSC2 (MUX6). - Connecting the Rotation 0 block in the pipeline by feeding it with data (MUX12) and selecting its output (MUX14). - Disabling all other muxes () by selecting the "no output" option. The datasheet doesn't explicitly require this, but the PXP has been noticed to hang after several hundreds frames when testing routing with the LUT disabled and the LUT input mux (MUX9) set to MUX8. It's thus safer to explicitly disable all unused paths. Signed-off-by: Laurent Pinchart --- drivers/media/platform/imx-pxp.c | 34 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c index 74e16011fc09..53e3f8c8435f 100644 --- a/drivers/media/platform/imx-pxp.c +++ b/drivers/media/platform/imx-pxp.c @@ -911,26 +911,32 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb, /* bypass LUT */ pxp_write(dev, HW_PXP_LUT_CTRL, BM_PXP_LUT_CTRL_BYPASS); + /* + * Configure routing, disabling all paths that are not used by + * selecting the "no output" (3) option. The datasheet doesn't + * explicitly require this, but the PXP has been seen to hand after + * processing a few hundreds of frames otherwise. + */ pxp_write(dev, HW_PXP_DATA_PATH_CTRL0, - BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1)| - BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0)| + BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(0)| + BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(1)| BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0)| + BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3)| BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1)| BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0)| + BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(1)| + BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(3)| BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0)| - BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0)); + BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(3)); pxp_write(dev, HW_PXP_DATA_PATH_CTRL1, - BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1) | - BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1)); + BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3) | + BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(3)); pxp_write(dev, HW_PXP_IRQ_MASK, 0xffff); From patchwork Sun May 10 22:31:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 209873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78038C54E8E for ; Sun, 10 May 2020 22:31:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DB502071C for ; Sun, 10 May 2020 22:31:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tl0GcR/j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729241AbgEJWbO (ORCPT ); Sun, 10 May 2020 18:31:14 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:49456 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728660AbgEJWbN (ORCPT ); Sun, 10 May 2020 18:31:13 -0400 Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EB0C8E1E; Mon, 11 May 2020 00:31:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589149870; bh=x9sqqFATuF0EGiB9McPBfVlV3ECwwpepMytVPgloLOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tl0GcR/jEdkBgPxNMcGn1ngXiGCl3T9gdwAYrwCZdQMauxnjlCS89vwXskCrf+DsZ KViQA7/SE1/GAiUg/u3TQXpVWs7fg20Ga3iHyAt+5PPQaNhJmTyUKs5lFe543pBVnE y11vs7HzknGIw3J4kfOUbqFsg38edu5OsSBPNM0w= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-imx@nxp.com, kernel@pengutronix.de, Philipp Zabel Subject: [PATCH 2/2] media: imx-pxp: Disable LUT and Rotation 0 blocks Date: Mon, 11 May 2020 01:31:00 +0300 Message-Id: <20200510223100.11641-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200510223100.11641-1-laurent.pinchart@ideasonboard.com> References: <20200510223100.11641-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The LUT block is configured in bypass mode, and the Rotation 0 block has a harcoded 0 degrees rotation. Disable those two blocks, and update routing accordingly. Signed-off-by: Laurent Pinchart --- drivers/media/platform/imx-pxp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c index 53e3f8c8435f..f34317e4a6ed 100644 --- a/drivers/media/platform/imx-pxp.c +++ b/drivers/media/platform/imx-pxp.c @@ -919,12 +919,12 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb, */ pxp_write(dev, HW_PXP_DATA_PATH_CTRL0, BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(3)| - BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(0)| + BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1)| BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3)| - BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(1)| - BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0)| + BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(3)| + BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(1)| BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3)| - BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1)| + BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(3)| BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0)| BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3)| BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(1)| @@ -944,7 +944,6 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb, pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_IRQ_ENABLE); pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 | - BM_PXP_CTRL_ENABLE_LUT | BM_PXP_CTRL_ENABLE_ROTATE0 | BM_PXP_CTRL_ENABLE_PS_AS_OUT); return 0;