[U-Boot] [PATCH 0/2] video: dw_hdmi: fix HSYNC and VSYNC polarity settings

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(-)

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);

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);

Hi,
On Sat, 28 Apr 2018 14:57:27 -0700 Vasily Khoruzhick anarsoul@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

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@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

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@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
participants (3)
-
Anatolij Gustschin
-
Jernej Škrabec
-
Vasily Khoruzhick