All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: ipu-v3: Fix CSI selection for VDIC
@ 2017-06-03 18:57 Steve Longerbeam
  2017-06-06  8:22 ` Philipp Zabel
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Longerbeam @ 2017-06-03 18:57 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: Marek Vasut, Steve Longerbeam, dri-devel

From: Marek Vasut <marex@denx.de>

The description of the CSI_SEL bit in the i.MX6 reference manual is
incorrect. It states "This bit defines which CSI is the input to the
IC. This bit is effective only if IC_INPUT is bit cleared".

From experiment it was found this is in fact not correct. The CSI_SEL
bit selects which CSI is input to _both_ the VDIC _and_ the IC. If the
IC_INPUT bit is set so that the IC is receiving from the VDIC, the IC
ignores the CSI_SEL bit, but CSI_SEL still selects which CSI the VDIC
receives from in that case.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
 drivers/gpu/ipu-v3/ipu-common.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 16d5568..2fb5f43 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -725,15 +725,16 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi)
 	spin_lock_irqsave(&ipu->lock, flags);
 
 	val = ipu_cm_read(ipu, IPU_CONF);
-	if (vdi) {
+	if (vdi)
 		val |= IPU_CONF_IC_INPUT;
-	} else {
+	else
 		val &= ~IPU_CONF_IC_INPUT;
-		if (csi_id == 1)
-			val |= IPU_CONF_CSI_SEL;
-		else
-			val &= ~IPU_CONF_CSI_SEL;
-	}
+
+	if (csi_id == 1)
+		val |= IPU_CONF_CSI_SEL;
+	else
+		val &= ~IPU_CONF_CSI_SEL;
+
 	ipu_cm_write(ipu, val, IPU_CONF);
 
 	spin_unlock_irqrestore(&ipu->lock, flags);
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpu: ipu-v3: Fix CSI selection for VDIC
  2017-06-03 18:57 [PATCH] gpu: ipu-v3: Fix CSI selection for VDIC Steve Longerbeam
@ 2017-06-06  8:22 ` Philipp Zabel
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Zabel @ 2017-06-06  8:22 UTC (permalink / raw)
  To: Steve Longerbeam; +Cc: Marek Vasut, Steve Longerbeam, dri-devel

On Sat, 2017-06-03 at 11:57 -0700, Steve Longerbeam wrote:
> From: Marek Vasut <marex@denx.de>
> 
> The description of the CSI_SEL bit in the i.MX6 reference manual is
> incorrect. It states "This bit defines which CSI is the input to the
> IC. This bit is effective only if IC_INPUT is bit cleared".
> 
> From experiment it was found this is in fact not correct. The CSI_SEL
> bit selects which CSI is input to _both_ the VDIC _and_ the IC. If the
> IC_INPUT bit is set so that the IC is receiving from the VDIC, the IC
> ignores the CSI_SEL bit, but CSI_SEL still selects which CSI the VDIC
> receives from in that case.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
> ---
>  drivers/gpu/ipu-v3/ipu-common.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
> index 16d5568..2fb5f43 100644
> --- a/drivers/gpu/ipu-v3/ipu-common.c
> +++ b/drivers/gpu/ipu-v3/ipu-common.c
> @@ -725,15 +725,16 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi)
>  	spin_lock_irqsave(&ipu->lock, flags);
>  
>  	val = ipu_cm_read(ipu, IPU_CONF);
> -	if (vdi) {
> +	if (vdi)
>  		val |= IPU_CONF_IC_INPUT;
> -	} else {
> +	else
>  		val &= ~IPU_CONF_IC_INPUT;
> -		if (csi_id == 1)
> -			val |= IPU_CONF_CSI_SEL;
> -		else
> -			val &= ~IPU_CONF_CSI_SEL;
> -	}
> +
> +	if (csi_id == 1)
> +		val |= IPU_CONF_CSI_SEL;
> +	else
> +		val &= ~IPU_CONF_CSI_SEL;
> +
>  	ipu_cm_write(ipu, val, IPU_CONF);
>  
>  	spin_unlock_irqrestore(&ipu->lock, flags);

Applied, thanks.

regards
Philipp

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-06  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-03 18:57 [PATCH] gpu: ipu-v3: Fix CSI selection for VDIC Steve Longerbeam
2017-06-06  8:22 ` Philipp Zabel

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.