lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <34422b7a-ce70-445d-a574-60ac36322119@collabora.com>
Date: Sat, 31 Aug 2024 01:21:48 +0300
From: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
To: Maxime Ripard <mripard@...nel.org>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
 Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
 Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
 Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
 Daniel Vetter <daniel@...ll.ch>, Sandy Huang <hjc@...k-chips.com>,
 Heiko Stübner <heiko@...ech.de>,
 Andy Yan <andy.yan@...k-chips.com>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Mark Yao <markyao0591@...il.com>,
 Sascha Hauer <s.hauer@...gutronix.de>, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-rockchip@...ts.infradead.org, devicetree@...r.kernel.org,
 kernel@...labora.com, Alexandre ARNOUD <aarnoud@...com>,
 Luis de Arquer <ldearquer@...il.com>, Algea Cao <algea.cao@...k-chips.com>
Subject: Re: [PATCH v4 2/4] drm/bridge: synopsys: Add DW HDMI QP TX Controller
 support library

On 8/27/24 11:58 AM, Maxime Ripard wrote:
> On Mon, Aug 19, 2024 at 01:29:29AM GMT, Cristian Ciocaltea wrote:
>> +static irqreturn_t dw_hdmi_qp_main_hardirq(int irq, void *dev_id)
>> +{
>> +	struct dw_hdmi_qp *hdmi = dev_id;
>> +	struct dw_hdmi_qp_i2c *i2c = hdmi->i2c;
>> +	u32 stat;
>> +
>> +	stat = dw_hdmi_qp_read(hdmi, MAINUNIT_1_INT_STATUS);
>> +
>> +	i2c->stat = stat & (I2CM_OP_DONE_IRQ | I2CM_READ_REQUEST_IRQ |
>> +			    I2CM_NACK_RCVD_IRQ);
>> +
>> +	if (i2c->stat) {
>> +		dw_hdmi_qp_write(hdmi, i2c->stat, MAINUNIT_1_INT_CLEAR);
>> +		complete(&i2c->cmp);
>> +	}
>> +
>> +	if (stat)
>> +		return IRQ_HANDLED;
>> +
>> +	return IRQ_NONE;
>> +}
> 
> If the scrambler is enabled, you need to deal with hotplug. On hotplug,
> the monitor will drop its TMDS ratio and scrambling status, but the
> driver will keep assuming it's been programmed.
> 
> If you don't have a way to deal with hotplug yet, then I'd suggest to
> just drop the scrambler setup for now.

Thanks for the heads up!

HPD is partially handled by the RK platform driver, which makes use of
drm_helper_hpd_irq_event(). Since the bridge sets DRM_BRIDGE_OP_DETECT
flag, the dw_hdmi_qp_bridge_detect() callback gets executed, which in turn
verifies the PHY status via ->read_hpd() implemented as
dw_hdmi_qp_rk3588_read_hpd() in the platform driver.

During my testing so far it worked reliably when switching displays with
different capabilities.  I don't have a 4K@...z display at the moment, but
used the HDMI RX port on the Rock 5B board in a loopback connection to
verify this mode, which triggered the high TMDS clock ratio and scrambling
setup as well.

I just submitted v5 [1] where I reworked a bit the scrambling handling,
which allowed for some code simplification.

[1] https://lore.kernel.org/lkml/20240831-b4-rk3588-bridge-upstream-v5-0-9503bece0136@collabora.com/

Regards,
Cristian


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ