public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings
@ 2017-11-29  6:33 Vasily Khoruzhick
  2017-11-29  7:39 ` Anatolij Gustschin
  2017-11-29  9:01 ` Maxime Ripard
  0 siblings, 2 replies; 4+ messages in thread
From: Vasily Khoruzhick @ 2017-11-29  6:33 UTC (permalink / raw)
  To: u-boot

These are actually different bits, and since some monitors (Benq BL2420PT)
have modes with different HSYNC and VSYNC polarity, we should set them
independently

Tested on Pine64-LTS with Benq BL2420PT monitor.

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

diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 33920a2b67..4f01d1bded 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -304,15 +304,11 @@ static int sunxi_dw_hdmi_enable(struct udevice *dev, int panel_bpp,
 
 	sunxi_dw_hdmi_lcdc_init(priv->mux, edid, panel_bpp);
 
-	/*
-	 * 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);
-	}
+	if (edid->flags & DISPLAY_FLAGS_HSYNC_LOW)
+		setbits_le32(&phy->pol, 0x200);
+
+	if (edid->flags & DISPLAY_FLAGS_VSYNC_LOW)
+		setbits_le32(&phy->pol, 0x100);
 
 	setbits_le32(&phy->ctrl, 0xf << 12);
 
-- 
2.15.0

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

* [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings
  2017-11-29  6:33 [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings Vasily Khoruzhick
@ 2017-11-29  7:39 ` Anatolij Gustschin
  2017-11-29  9:01 ` Maxime Ripard
  1 sibling, 0 replies; 4+ messages in thread
From: Anatolij Gustschin @ 2017-11-29  7:39 UTC (permalink / raw)
  To: u-boot

Hi Vasily,

On Tue, 28 Nov 2017 22:33:27 -0800
Vasily Khoruzhick anarsoul at gmail.com wrote:

> These are actually different bits, and since some monitors (Benq BL2420PT)
> have modes with different HSYNC and VSYNC polarity, we should set them
> independently
> 
> Tested on Pine64-LTS with Benq BL2420PT monitor.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  drivers/video/sunxi/sunxi_dw_hdmi.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)

Reviewed-by: Anatolij Gustschin <agust@denx.de>

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

* [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings
  2017-11-29  6:33 [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings Vasily Khoruzhick
  2017-11-29  7:39 ` Anatolij Gustschin
@ 2017-11-29  9:01 ` Maxime Ripard
  2017-12-02 16:35   ` Jagan Teki
  1 sibling, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2017-11-29  9:01 UTC (permalink / raw)
  To: u-boot

On Tue, Nov 28, 2017 at 10:33:27PM -0800, Vasily Khoruzhick wrote:
> These are actually different bits, and since some monitors (Benq BL2420PT)
> have modes with different HSYNC and VSYNC polarity, we should set them
> independently
> 
> Tested on Pine64-LTS with Benq BL2420PT monitor.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171129/81f8145f/attachment.sig>

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

* [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings
  2017-11-29  9:01 ` Maxime Ripard
@ 2017-12-02 16:35   ` Jagan Teki
  0 siblings, 0 replies; 4+ messages in thread
From: Jagan Teki @ 2017-12-02 16:35 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 29, 2017 at 2:31 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Tue, Nov 28, 2017 at 10:33:27PM -0800, Vasily Khoruzhick wrote:
>> These are actually different bits, and since some monitors (Benq BL2420PT)
>> have modes with different HSYNC and VSYNC polarity, we should set them
>> independently
>>
>> Tested on Pine64-LTS with Benq BL2420PT monitor.
>>
>> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>
> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied to u-boot-sunxi/master

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

end of thread, other threads:[~2017-12-02 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-29  6:33 [U-Boot] [PATCH] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings Vasily Khoruzhick
2017-11-29  7:39 ` Anatolij Gustschin
2017-11-29  9:01 ` Maxime Ripard
2017-12-02 16:35   ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox