All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: linux-imx@nxp.com, kernel@pengutronix.de,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: [PATCH 1/2] media: imx-pxp: Fix routing configuration for i.MX7
Date: Mon, 11 May 2020 01:30:59 +0300	[thread overview]
Message-ID: <20200510223100.11641-2-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20200510223100.11641-1-laurent.pinchart@ideasonboard.com>

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 <laurent.pinchart@ideasonboard.com>
---
 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);
 
-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2020-05-10 22:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10 22:30 [PATCH 0/2] media: imx-pxp: Fix operation on i.MX7 Laurent Pinchart
2020-05-10 22:30 ` Laurent Pinchart [this message]
2020-05-18 13:33   ` [PATCH 1/2] media: imx-pxp: Fix routing configuration for i.MX7 Philipp Zabel
2020-05-18 13:54     ` Laurent Pinchart
2020-05-18 15:22       ` Philipp Zabel
2020-05-10 22:31 ` [PATCH 2/2] media: imx-pxp: Disable LUT and Rotation 0 blocks Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200510223100.11641-2-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.