[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=Wij7MjyuS0b+4jn65Oq7Ee+2-__+5GjhfURBBk9G3kpQ@mail.gmail.com>
Date: Mon, 15 Sep 2025 10:33:00 -0700
From: Doug Anderson <dianders@...omium.org>
To: John Ripple <john.ripple@...sight.com>
Cc: Laurent.pinchart@...asonboard.com, airlied@...il.com,
andrzej.hajda@...el.com, blake.vermeer@...sight.com,
dri-devel@...ts.freedesktop.org, jernej.skrabec@...il.com, jonas@...boo.se,
linux-kernel@...r.kernel.org, maarten.lankhorst@...ux.intel.com,
matt_laubhan@...sight.com, mripard@...nel.org, neil.armstrong@...aro.org,
rfoss@...nel.org, simona@...ll.ch, tzimmermann@...e.de
Subject: Re: [PATCH V6] drm/bridge: ti-sn65dsi86: Add support for DisplayPort
mode with HPD
Hi,
On Mon, Sep 15, 2025 at 9:51 AM John Ripple <john.ripple@...sight.com> wrote:
>
> @@ -1309,6 +1375,41 @@ static int ti_sn_bridge_parse_dsi_host(struct ti_sn65dsi86 *pdata)
> return 0;
> }
>
> +static irqreturn_t ti_sn_bridge_interrupt(int irq, void *private)
> +{
> + struct ti_sn65dsi86 *pdata = private;
> + struct drm_device *dev = pdata->bridge.dev;
> + u8 status;
> + int ret;
> + bool hpd_event;
> +
> + ret = ti_sn65dsi86_read_u8(pdata, SN_IRQ_STATUS_REG, &status);
> + if (ret) {
> + dev_err(pdata->dev, "Failed to read IRQ status: %d\n", ret);
> + return IRQ_NONE;
> + }
> +
> + hpd_event = status & (HPD_REMOVAL_STATUS | HPD_INSERTION_STATUS);
> +
> + dev_dbg(pdata->dev, "(SN_IRQ_STATUS_REG = %#x)\n", status);
> + ret = regmap_write(pdata->regmap, SN_IRQ_STATUS_REG, status);
> + if (ret) {
> + dev_err(pdata->dev, "Failed to clear IRQ status: %d\n", ret);
> + return IRQ_NONE;
> + }
> +
> + if (!status)
> + return IRQ_NONE;
> +
> + /* Only send the HPD event if we are bound with a device. */
> + mutex_lock(&pdata->hpd_mutex);
> + if (pdata->hpd_enabled && hpd_event)
> + drm_kms_helper_hotplug_event(dev);
> + mutex_unlock(&pdata->hpd_mutex);
The order above wasn't quite what I was suggesting. I was suggesting:
ret = ti_sn65dsi86_read_u8(...);
if (ret) {
...
}
dev_dbg(..., status);
if (!status)
return IRQ_NONE;
ret = regmap_write(..., status);
if (ret) {
...
}
/* Only send ... */
hpd_event = status & ...;
mutex_lock(...);
...
mutex_unlock(...);
...but it doesn't really matter. I guess it's a little weird that your
current code still writes status even if it's 0, but it shouldn't
really hurt. There's no need to spin with that change unless you feel
like it.
At this point I'm happy with things. Thanks for putting up with the
review process!
Reviewed-by: Douglas Anderson <dianders@...omium.org>
I'll plan to give this a week or so in case anyone else wants to jump
in, then apply it. I'll also try to find some time this week to test
this on a device using ti-sn65dsi86 to make sure nothing breaks,
though I don't expect it to.
-Doug
Powered by blists - more mailing lists