public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Andy Yan" <andy.yan@rock-chips.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Mark Yao" <markyao0591@gmail.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	kernel@collabora.com, "Alexandre ARNOUD" <aarnoud@me.com>,
	"Luis de Arquer" <ldearquer@gmail.com>,
	"Algea Cao" <algea.cao@rock-chips.com>
Subject: Re: [PATCH v4 2/4] drm/bridge: synopsys: Add DW HDMI QP TX Controller support library
Date: Mon, 2 Sep 2024 09:36:50 +0200	[thread overview]
Message-ID: <20240902-turtle-of-major-glory-efb4e8@houat> (raw)
In-Reply-To: <34422b7a-ce70-445d-a574-60ac36322119@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

On Sat, Aug 31, 2024 at 01:21:48AM GMT, Cristian Ciocaltea wrote:
> 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.

It's not only about hotplug detection, it's also about what happens
after you've detected a disconnection / reconnection.

The framework expects to keep the current mode as is, despite the
monitor not being setup to use the scrambler anymore, and the display
remains black.

> During my testing so far it worked reliably when switching displays with
> different capabilities.  I don't have a 4K@60Hz 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.

How did you test exactly?

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  parent reply	other threads:[~2024-09-02  7:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240819-b4-rk3588-bridge-upstream-v4-0-6417c72a2749@collabora.com>
     [not found] ` <20240819-b4-rk3588-bridge-upstream-v4-3-6417c72a2749@collabora.com>
2024-08-19 16:53   ` [PATCH v4 3/4] dt-bindings: display: rockchip: Add schema for RK3588 HDMI TX Controller Conor Dooley
     [not found]     ` <ec84bc0b-c4c2-4735-9f34-52bc3a852aaf@collabora.com>
2024-08-20 16:14       ` Conor Dooley
     [not found]         ` <038073d0-d4b9-4938-9a51-ea2aeb4530f6@collabora.com>
2024-08-21 15:07           ` Conor Dooley
     [not found]             ` <5813cea2-4890-4fa9-8826-19be5bf3e161@collabora.com>
2024-08-21 21:28               ` Conor Dooley
2024-08-21 21:38                 ` Heiko Stuebner
     [not found]                   ` <2085e998-a453-4893-9e80-3be68b0fb13d@collabora.com>
2024-08-22  7:01                     ` Heiko Stübner
2024-08-22  8:41                       ` Conor Dooley
     [not found]                         ` <7fc8cbc3-43d0-43d2-9272-350ac556e2b2@collabora.com>
2024-08-23  1:01                           ` Andy Yan
2024-08-23 16:02                             ` Conor Dooley
2024-08-23 10:47                         ` Heiko Stübner
2024-08-23 15:59                           ` Conor Dooley
     [not found] ` <20240819-b4-rk3588-bridge-upstream-v4-2-6417c72a2749@collabora.com>
2024-08-27  8:58   ` [PATCH v4 2/4] drm/bridge: synopsys: Add DW HDMI QP TX Controller support library Maxime Ripard
     [not found]     ` <34422b7a-ce70-445d-a574-60ac36322119@collabora.com>
2024-09-02  7:36       ` Maxime Ripard [this message]
     [not found]         ` <6e20410a-a24d-4454-8577-2cff65319a2a@collabora.com>
2024-09-03  8:09           ` Maxime Ripard
2024-09-06  1:25             ` Cristian Ciocaltea

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=20240902-turtle-of-major-glory-efb4e8@houat \
    --to=mripard@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=aarnoud@me.com \
    --cc=airlied@gmail.com \
    --cc=algea.cao@rock-chips.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=conor+dt@kernel.org \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=ldearquer@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=markyao0591@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=tzimmermann@suse.de \
    /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