All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings
@ 2018-04-28 21:57 Vasily Khoruzhick
  2018-04-28 21:57 ` [U-Boot] [PATCH 1/2] Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings" Vasily Khoruzhick
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vasily Khoruzhick @ 2018-04-28 21:57 UTC (permalink / raw)
  To: u-boot

Previous attempt to fix HSYNC and VSYNC polarity settings for dw_hdmi
was wrong - actual root cause wasn't in sunxi dw_hdmi glue code, but in
dw_hdmi driver itself. This series reverts previous attempt to fix the issue
and applies proper fix

Vasily Khoruzhick (2):
  Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings"
  video: dw_hdmi: fix HSYNC and VSYNC polarity settings

 drivers/video/dw_hdmi.c             |  4 ++--
 drivers/video/sunxi/sunxi_dw_hdmi.c | 14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)

-- 
2.17.0

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

* [U-Boot] [PATCH 1/2] Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings"
  2018-04-28 21:57 [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
@ 2018-04-28 21:57 ` Vasily Khoruzhick
  2018-04-28 21:57 ` [U-Boot] [PATCH 2/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
  2018-05-02 11:01 ` [U-Boot] [PATCH 0/2] " Anatolij Gustschin
  2 siblings, 0 replies; 6+ messages in thread
From: Vasily Khoruzhick @ 2018-04-28 21:57 UTC (permalink / raw)
  To: u-boot

This reverts commit 64089178219371a512ddca8016d78bfdbe84565d.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 drivers/video/sunxi/sunxi_dw_hdmi.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 4f01d1bded..33920a2b67 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -304,11 +304,15 @@ static int sunxi_dw_hdmi_enable(struct udevice *dev, int panel_bpp,
 
 	sunxi_dw_hdmi_lcdc_init(priv->mux, edid, panel_bpp);
 
-	if (edid->flags & DISPLAY_FLAGS_HSYNC_LOW)
-		setbits_le32(&phy->pol, 0x200);
-
-	if (edid->flags & DISPLAY_FLAGS_VSYNC_LOW)
-		setbits_le32(&phy->pol, 0x100);
+	/*
+	 * Condition in original code is a bit weird. This is attempt
+	 * to make it more reasonable and it works. It could be that
+	 * bits and conditions are related and should be separated.
+	 */
+	if (!((edid->flags & DISPLAY_FLAGS_HSYNC_HIGH) &&
+	      (edid->flags & DISPLAY_FLAGS_VSYNC_HIGH))) {
+		setbits_le32(&phy->pol, 0x300);
+	}
 
 	setbits_le32(&phy->ctrl, 0xf << 12);
 
-- 
2.17.0

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

* [U-Boot] [PATCH 2/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings
  2018-04-28 21:57 [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
  2018-04-28 21:57 ` [U-Boot] [PATCH 1/2] Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings" Vasily Khoruzhick
@ 2018-04-28 21:57 ` Vasily Khoruzhick
  2018-05-02 11:01 ` [U-Boot] [PATCH 0/2] " Anatolij Gustschin
  2 siblings, 0 replies; 6+ messages in thread
From: Vasily Khoruzhick @ 2018-04-28 21:57 UTC (permalink / raw)
  To: u-boot

Currently dw_hdmi configures HSYNC polarity using VSYNC setting from
EDID and vice versa. Fix it, since it breaks displays where HSYNC
and VSYNC polarity differs

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 drivers/video/dw_hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index 6039d676c5..809e29b45f 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -402,11 +402,11 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
 	/* set up hdmi_fc_invidconf */
 	inv_val = HDMI_FC_INVIDCONF_HDCP_KEEPOUT_INACTIVE;
 
-	inv_val |= (edid->flags & DISPLAY_FLAGS_HSYNC_HIGH ?
+	inv_val |= (edid->flags & DISPLAY_FLAGS_VSYNC_HIGH ?
 		   HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_HIGH :
 		   HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_LOW);
 
-	inv_val |= (edid->flags & DISPLAY_FLAGS_VSYNC_HIGH ?
+	inv_val |= (edid->flags & DISPLAY_FLAGS_HSYNC_HIGH ?
 		   HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_HIGH :
 		   HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_LOW);
 
-- 
2.17.0

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

* [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings
  2018-04-28 21:57 [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
  2018-04-28 21:57 ` [U-Boot] [PATCH 1/2] Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings" Vasily Khoruzhick
  2018-04-28 21:57 ` [U-Boot] [PATCH 2/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
@ 2018-05-02 11:01 ` Anatolij Gustschin
  2018-05-02 14:47   ` Vasily Khoruzhick
  2 siblings, 1 reply; 6+ messages in thread
From: Anatolij Gustschin @ 2018-05-02 11:01 UTC (permalink / raw)
  To: u-boot

Hi,

On Sat, 28 Apr 2018 14:57:27 -0700
Vasily Khoruzhick anarsoul at gmail.com wrote:

> Previous attempt to fix HSYNC and VSYNC polarity settings for dw_hdmi
> was wrong - actual root cause wasn't in sunxi dw_hdmi glue code, but in
> dw_hdmi driver itself. This series reverts previous attempt to fix the issue
> and applies proper fix
> 
> Vasily Khoruzhick (2):
>   Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings"

is this revert needed? Shouldn't the flags be set separately like this
commit does?

--
Anatolij

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

* [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings
  2018-05-02 11:01 ` [U-Boot] [PATCH 0/2] " Anatolij Gustschin
@ 2018-05-02 14:47   ` Vasily Khoruzhick
  2018-05-02 14:54     ` Jernej Škrabec
  0 siblings, 1 reply; 6+ messages in thread
From: Vasily Khoruzhick @ 2018-05-02 14:47 UTC (permalink / raw)
  To: u-boot

On Wed, May 2, 2018 at 4:01 AM, Anatolij Gustschin <agust@denx.de> wrote:
> Hi,
>
> On Sat, 28 Apr 2018 14:57:27 -0700
> Vasily Khoruzhick anarsoul at gmail.com wrote:
>
>> Previous attempt to fix HSYNC and VSYNC polarity settings for dw_hdmi
>> was wrong - actual root cause wasn't in sunxi dw_hdmi glue code, but in
>> dw_hdmi driver itself. This series reverts previous attempt to fix the issue
>> and applies proper fix
>>
>> Vasily Khoruzhick (2):
>>   Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings"
>
> is this revert needed? Shouldn't the flags be set separately like this
> commit does?

Yes, revert is needed. Driver works fine without setting flags separately.

>
> --
> Anatolij

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

* [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings
  2018-05-02 14:47   ` Vasily Khoruzhick
@ 2018-05-02 14:54     ` Jernej Škrabec
  0 siblings, 0 replies; 6+ messages in thread
From: Jernej Škrabec @ 2018-05-02 14:54 UTC (permalink / raw)
  To: u-boot

Hi,

Dne sreda, 02. maj 2018 ob 16:47:07 CEST je Vasily Khoruzhick napisal(a):
> On Wed, May 2, 2018 at 4:01 AM, Anatolij Gustschin <agust@denx.de> wrote:
> > Hi,
> > 
> > On Sat, 28 Apr 2018 14:57:27 -0700
> > 
> > Vasily Khoruzhick anarsoul at gmail.com wrote:
> >> Previous attempt to fix HSYNC and VSYNC polarity settings for dw_hdmi
> >> was wrong - actual root cause wasn't in sunxi dw_hdmi glue code, but in
> >> dw_hdmi driver itself. This series reverts previous attempt to fix the
> >> issue and applies proper fix
> >> 
> >> Vasily Khoruzhick (2):
> >>   Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings"
> > 
> > is this revert needed? Shouldn't the flags be set separately like this
> > commit does?
> 
> Yes, revert is needed. Driver works fine without setting flags separately.

I think patch is still needed. Code should be done in this way:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?
id=e420ccd66d36e4ac2035620286495ce13a40b7f7

Without this, different polarities didn't work for me in Linux DRM driver.

Best regards,
Jernej

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

end of thread, other threads:[~2018-05-02 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28 21:57 [U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
2018-04-28 21:57 ` [U-Boot] [PATCH 1/2] Revert "sunxi: video: HDMI: split VSYNC and HSYNC polarity settings" Vasily Khoruzhick
2018-04-28 21:57 ` [U-Boot] [PATCH 2/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings Vasily Khoruzhick
2018-05-02 11:01 ` [U-Boot] [PATCH 0/2] " Anatolij Gustschin
2018-05-02 14:47   ` Vasily Khoruzhick
2018-05-02 14:54     ` Jernej Škrabec

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.