From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Chen-Yu Tsai <wens@csie.org>,
Andre Heider <a.heider@gmail.com>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Maxime Ripard <maxime@cerno.tech>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10 077/104] drm/sun4i: tcon: set sync polarity for tcon1 channel
Date: Mon, 15 Feb 2021 16:27:30 +0100 [thread overview]
Message-ID: <20210215152721.938702617@linuxfoundation.org> (raw)
In-Reply-To: <20210215152719.459796636@linuxfoundation.org>
From: Jernej Skrabec <jernej.skrabec@siol.net>
[ Upstream commit 50791f5d7b6a14b388f46c8885f71d1b98216d1d ]
Channel 1 has polarity bits for vsync and hsync signals but driver never
sets them. It turns out that with pre-HDMI2 controllers seemingly there
is no issue if polarity is not set. However, with HDMI2 controllers
(H6) there often comes to de-synchronization due to phase shift. This
causes flickering screen. It's safe to assume that similar issues might
happen also with pre-HDMI2 controllers.
Solve issue with setting vsync and hsync polarity. Note that display
stacks with tcon top have polarity bits actually in tcon0 polarity
register.
Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210209175900.7092-3-jernej.skrabec@siol.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/sun4i/sun4i_tcon.c | 25 +++++++++++++++++++++++++
drivers/gpu/drm/sun4i/sun4i_tcon.h | 6 ++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index eaaf5d70e3529..1e643bc7e786a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -689,6 +689,30 @@ static void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon,
SUN4I_TCON1_BASIC5_V_SYNC(vsync) |
SUN4I_TCON1_BASIC5_H_SYNC(hsync));
+ /* Setup the polarity of multiple signals */
+ if (tcon->quirks->polarity_in_ch0) {
+ val = 0;
+
+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
+ val |= SUN4I_TCON0_IO_POL_HSYNC_POSITIVE;
+
+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
+ val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
+
+ regmap_write(tcon->regs, SUN4I_TCON0_IO_POL_REG, val);
+ } else {
+ /* according to vendor driver, this bit must be always set */
+ val = SUN4I_TCON1_IO_POL_UNKNOWN;
+
+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
+ val |= SUN4I_TCON1_IO_POL_HSYNC_POSITIVE;
+
+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
+ val |= SUN4I_TCON1_IO_POL_VSYNC_POSITIVE;
+
+ regmap_write(tcon->regs, SUN4I_TCON1_IO_POL_REG, val);
+ }
+
/* Map output pins to channel 1 */
regmap_update_bits(tcon->regs, SUN4I_TCON_GCTL_REG,
SUN4I_TCON_GCTL_IOMAP_MASK,
@@ -1517,6 +1541,7 @@ static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = {
.has_channel_1 = true,
+ .polarity_in_ch0 = true,
.set_mux = sun8i_r40_tcon_tv_set_mux,
};
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h
index cfbf4e6c16799..ee555318e3c2f 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.h
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h
@@ -153,6 +153,11 @@
#define SUN4I_TCON1_BASIC5_V_SYNC(height) (((height) - 1) & 0x3ff)
#define SUN4I_TCON1_IO_POL_REG 0xf0
+/* there is no documentation about this bit */
+#define SUN4I_TCON1_IO_POL_UNKNOWN BIT(26)
+#define SUN4I_TCON1_IO_POL_HSYNC_POSITIVE BIT(25)
+#define SUN4I_TCON1_IO_POL_VSYNC_POSITIVE BIT(24)
+
#define SUN4I_TCON1_IO_TRI_REG 0xf4
#define SUN4I_TCON_ECC_FIFO_REG 0xf8
@@ -235,6 +240,7 @@ struct sun4i_tcon_quirks {
bool needs_de_be_mux; /* sun6i needs mux to select backend */
bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */
bool supports_lvds; /* Does the TCON support an LVDS output? */
+ bool polarity_in_ch0; /* some tcon1 channels have polarity bits in tcon0 pol register */
u8 dclk_min_div; /* minimum divider for TCON0 DCLK */
/* callback to handle tcon muxing options */
--
2.27.0
next prev parent reply other threads:[~2021-02-15 16:50 UTC|newest]
Thread overview: 121+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-15 15:26 [PATCH 5.10 000/104] 5.10.17-rc1 review Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 001/104] objtool: Fix seg fault with Clang non-section symbols Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 002/104] Revert "dts: phy: add GPIO number and active state used for phy reset" Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 003/104] gpio: mxs: GPIO_MXS should not default to y unconditionally Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 004/104] gpio: ep93xx: fix BUG_ON port F usage Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 005/104] gpio: ep93xx: Fix single irqchip with multi gpiochips Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 006/104] tracing: Do not count ftrace events in top level enable output Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 007/104] tracing: Check length before giving out the filter buffer Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 008/104] drm/i915: Fix overlay frontbuffer tracking Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 009/104] arm/xen: Dont probe xenbus as part of an early initcall Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 010/104] cgroup: fix psi monitor for root cgroup Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 011/104] Revert "drm/amd/display: Update NV1x SR latency values" Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 012/104] drm/i915/tgl+: Make sure TypeC FIA is powered up when initializing it Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 013/104] drm/dp_mst: Dont report ports connected if nothing is attached to them Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 014/104] dmaengine: move channel device_node deletion to driver Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 015/104] tmpfs: disallow CONFIG_TMPFS_INODE64 on s390 Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 016/104] tmpfs: disallow CONFIG_TMPFS_INODE64 on alpha Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 017/104] soc: ti: omap-prm: Fix boot time errors for rst_map_012 bits 0 and 1 Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 018/104] arm64: dts: rockchip: Fix PCIe DT properties on rk3399 Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 019/104] arm64: dts: qcom: sdm845: Reserve LPASS clocks in gcc Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 020/104] ARM: OMAP2+: Fix suspcious RCU usage splats for omap_enter_idle_coupled Greg Kroah-Hartman
2021-02-19 21:14 ` Pavel Machek
2021-02-19 21:26 ` Paul E. McKenney
2021-02-15 15:26 ` [PATCH 5.10 021/104] arm64: dts: rockchip: remove interrupt-names property from rk3399 vdec node Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 022/104] kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc Greg Kroah-Hartman
2021-02-17 9:08 ` Pavel Machek
2021-02-17 9:28 ` Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 023/104] platform/x86: hp-wmi: Disable tablet-mode reporting by default Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 024/104] arm64: dts: rockchip: Disable display for NanoPi R2S Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 025/104] ovl: perform vfs_getxattr() with mounter creds Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 026/104] cap: fix conversions on getxattr Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 027/104] ovl: skip getxattr of security labels Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 028/104] scsi: lpfc: Fix EEH encountering oops with NVMe traffic Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 029/104] x86/split_lock: Enable the split lock feature on another Alder Lake CPU Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 030/104] nvme-pci: ignore the subsysem NQN on Phison E16 Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 031/104] drm/amd/display: Fix DPCD translation for LTTPR AUX_RD_INTERVAL Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 032/104] drm/amd/display: Add more Clock Sources to DCN2.1 Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 033/104] drm/amd/display: Release DSC before acquiring Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 034/104] drm/amd/display: Fix dc_sink kref count in emulated_link_detect Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 035/104] drm/amd/display: Free atomic state after drm_atomic_commit Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 036/104] drm/amd/display: Decrement refcount of dc_sink before reassignment Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 037/104] riscv: virt_addr_valid must check the address belongs to linear mapping Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 038/104] bfq-iosched: Revert "bfq: Fix computation of shallow depth" Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 039/104] ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 040/104] kallsyms: fix nonconverging kallsyms table with lld Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 041/104] ARM: ensure the signal page contains defined contents Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 042/104] ARM: kexec: fix oops after TLB are invalidated Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 043/104] kasan: add explicit preconditions to kasan_report() Greg Kroah-Hartman
2021-02-16 11:50 ` Pavel Machek
2021-02-17 9:26 ` Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 044/104] ubsan: implement __ubsan_handle_alignment_assumption Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 045/104] Revert "lib: Restrict cpumask_local_spread to houskeeping CPUs" Greg Kroah-Hartman
2021-02-15 15:26 ` [PATCH 5.10 046/104] x86/efi: Remove EFI PGD build time checks Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 047/104] lkdtm: dont move ctors to .rodata Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 048/104] KVM: x86: cleanup CR3 reserved bits checks Greg Kroah-Hartman
2021-02-15 18:46 ` Pavel Machek
2021-02-15 19:04 ` Paolo Bonzini
2021-02-15 15:27 ` [PATCH 5.10 049/104] cgroup-v1: add disabled controller check in cgroup1_parse_param() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 050/104] dmaengine: idxd: fix misc interrupt completion Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 051/104] ath9k: fix build error with LEDS_CLASS=m Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 052/104] mt76: dma: fix a possible memory leak in mt76_add_fragment() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 053/104] drm/vc4: hvs: Fix buffer overflow with the dlist handling Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 054/104] dmaengine: idxd: check device state before issue command Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 055/104] bpf: Unbreak BPF_PROG_TYPE_KPROBE when kprobe is called via do_int3 Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 056/104] bpf: Check for integer overflow when using roundup_pow_of_two() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 057/104] netfilter: xt_recent: Fix attempt to update deleted entry Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 058/104] selftests: netfilter: fix current year Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 059/104] netfilter: nftables: fix possible UAF over chains from packet path in netns Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 060/104] netfilter: flowtable: fix tcp and udp header checksum update Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 061/104] xen/netback: avoid race in xenvif_rx_ring_slots_available() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 062/104] net: hdlc_x25: Return meaningful error code in x25_open Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 063/104] net: ipa: set error code in gsi_channel_setup() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 064/104] hv_netvsc: Reset the RSC count if NVSP_STAT_FAIL in netvsc_receive() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 065/104] net: enetc: initialize the RFS and RSS memories Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 066/104] selftests: txtimestamp: fix compilation issue Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 067/104] net: stmmac: set TxQ mode back to DCB after disabling CBS Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 068/104] ibmvnic: Clear failover_pending if unable to schedule Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 069/104] netfilter: conntrack: skip identical origin tuple in same zone only Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 070/104] scsi: scsi_debug: Fix a memory leak Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 071/104] x86/build: Disable CET instrumentation in the kernel for 32-bit too Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 072/104] net: dsa: felix: implement port flushing on .phylink_mac_link_down Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 073/104] net: hns3: add a check for queue_id in hclge_reset_vf_queue() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 074/104] net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 075/104] net: hns3: add a check for index in hclge_get_rss_key() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 076/104] firmware_loader: align .builtin_fw to 8 Greg Kroah-Hartman
2021-02-15 15:27 ` Greg Kroah-Hartman [this message]
2021-02-15 15:27 ` [PATCH 5.10 078/104] drm/sun4i: dw-hdmi: always set clock rate Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 079/104] drm/sun4i: Fix H6 HDMI PHY configuration Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 080/104] drm/sun4i: dw-hdmi: Fix max. frequency for H6 Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 081/104] clk: sunxi-ng: mp: fix parent rate change flag check Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 082/104] i2c: stm32f7: fix configuration of the digital filter Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 083/104] h8300: fix PREEMPTION build, TI_PRE_COUNT undefined Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 084/104] scripts: set proper OpenSSL include dir also for sign-file Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 085/104] x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 086/104] arm64: mte: Allow PTRACE_PEEKMTETAGS access to the zero page Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 087/104] rxrpc: Fix clearance of Tx/Rx ring when releasing a call Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 088/104] udp: fix skb_copy_and_csum_datagram with odd segment sizes Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 089/104] net: dsa: call teardown method on probe failure Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 090/104] cpufreq: ACPI: Extend frequency tables to cover boost frequencies Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 091/104] cpufreq: ACPI: Update arch scale-invariance max perf ratio if CPPC is not there Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 092/104] net: gro: do not keep too many GRO packets in napi->rx_list Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 093/104] net: fix iteration for sctp transport seq_files Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 094/104] net/vmw_vsock: fix NULL pointer dereference Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 095/104] net/vmw_vsock: improve locking in vsock_connect_timeout() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 096/104] net: watchdog: hold device global xmit lock during tx disable Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 097/104] bridge: mrp: Fix the usage of br_mrp_port_switchdev_set_state Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 098/104] switchdev: mrp: Remove SWITCHDEV_ATTR_ID_MRP_PORT_STAT Greg Kroah-Hartman
2021-02-16 21:35 ` Pavel Machek
2021-02-16 22:08 ` Horatiu Vultur
2021-02-17 19:27 ` Pavel Machek
2021-02-15 15:27 ` [PATCH 5.10 099/104] vsock/virtio: update credit only if socket is not closed Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 100/104] vsock: fix locking in vsock_shutdown() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 101/104] net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 102/104] net/qrtr: restrict user-controlled length in qrtr_tun_write_iter() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 103/104] ovl: expand warning in ovl_d_real() Greg Kroah-Hartman
2021-02-15 15:27 ` [PATCH 5.10 104/104] kcov, usb: only collect coverage from __usb_hcd_giveback_urb in softirq Greg Kroah-Hartman
2021-02-15 20:29 ` [PATCH 5.10 000/104] 5.10.17-rc1 review Pavel Machek
2021-02-16 4:08 ` Naresh Kamboju
2021-02-16 18:50 ` Guenter Roeck
2021-02-16 22:28 ` Shuah Khan
2021-02-17 1:19 ` Ross Schmidt
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=20210215152721.938702617@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=a.heider@gmail.com \
--cc=jernej.skrabec@siol.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wens@csie.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).