dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Andrey Gusakov <andrey.gusakov@cogentembedded.com>,
	Jyri Sarha <jsarha@ti.com>,
	dri-devel@lists.freedesktop.org,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Chris Healy <cphealy@gmail.com>
Subject: Re: [21/21] drm/bridge: tc358767: implement naive HPD handling
Date: Tue, 19 Mar 2019 22:55:23 -0700	[thread overview]
Message-ID: <CAHQ1cqGps7n9ixaiUuvqcR+AN8muAoyN5J4XCQTskBiFFkK7fw@mail.gmail.com> (raw)
In-Reply-To: <20190319181825.15146-1-andrew.smirnov@gmail.com>

On Tue, Mar 19, 2019 at 11:18 AM Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
>
> > tc358767 driver doesn't have any HPD handling at the moment, as it was
> > originally developed to support only eDP.
>
> > This patch implements a naive, polling-based HPD handling, which is used
> > when the driver is in DP mode.
>
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > ---
> >  drivers/gpu/drm/bridge/tc358767.c | 56 +++++++++++++++++++++----------
> >  1 file changed, 38 insertions(+), 18 deletions(-)
>
> > diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> > index 8606de29c9b2..2b252f7ac070 100644
> > --- a/drivers/gpu/drm/bridge/tc358767.c
> > +++ b/drivers/gpu/drm/bridge/tc358767.c
> > @@ -1095,6 +1095,12 @@ static void tc_bridge_enable(struct drm_bridge *bridge)
> >       struct tc_data *tc = bridge_to_tc(bridge);
> >       int ret;
>
> > +     ret = tc_get_display_props(tc);
> > +     if (ret < 0) {
> > +             dev_err(tc->dev, "failed to read display props: %d\n", ret);
> > +             return;
> > +     }
> > +
> >       ret = tc_main_link_enable(tc);
> >       if (ret < 0) {
> >               dev_err(tc->dev, "main link enable error: %d\n", ret);
> > @@ -1200,19 +1206,35 @@ static int tc_connector_get_modes(struct drm_connector *connector)
> >       return count;
> >  }
>
> > -static void tc_connector_set_polling(struct tc_data *tc,
> > -                                  struct drm_connector *connector)
> > -{
> > -     /* TODO: add support for HPD */
> > -     connector->polled = DRM_CONNECTOR_POLL_CONNECT |
> > -                         DRM_CONNECTOR_POLL_DISCONNECT;
> > -}
> > -
> >  static const struct drm_connector_helper_funcs tc_connector_helper_funcs = {
> >       .get_modes = tc_connector_get_modes,
> >  };
>
> > +static enum drm_connector_status tc_connector_detect(struct drm_connector *connector, bool force)
> > +{
> > +     struct tc_data *tc = connector_to_tc(connector);
> > +     u32 val;
> > +     int ret;
> > +     bool conn;
> > +
> > +     tc_read(GPIOI, &val);
> > +
> > +     conn = val & BIT(0);

Another thing I noticed when trying this patch is that
tc_connector_detect() will get called via drm_helper_probe_detect()
even if tc->panel is not NULL and tc->connector.polled is zero, which
creates a problem for eDP use-case.

Thanks,
Andrey Smirnov
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-03-20  5:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 10:40 [PATCH 00/21] drm/bridge: tc358767: DP support Tomi Valkeinen
2019-03-19 10:40 ` [PATCH 01/21] drm/bridge: tc358767: fix tc_aux_get_status error handling Tomi Valkeinen
2019-03-19 10:40 ` [PATCH 02/21] drm/bridge: tc358767: reset voltage-swing & pre-emphasis Tomi Valkeinen
2019-03-19 10:40 ` [PATCH 03/21] drm/bridge: tc358767: fix ansi 8b10b use Tomi Valkeinen
2019-03-19 10:40 ` [PATCH 04/21] drm/bridge: tc358767: cleanup spread & scrambler_dis Tomi Valkeinen
2019-03-19 10:40 ` [PATCH 05/21] drm/bridge: tc358767: remove unused swing & preemp Tomi Valkeinen
2019-03-19 10:40 ` [PATCH 06/21] drm/bridge: tc358767: cleanup aux_link_setup Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 07/21] drm/bridge: tc358767: move video stream setup to tc_main_link_stream Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 08/21] drm/bridge: tc358767: split stream enable/disable Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 09/21] drm/bridge: tc358767: move PXL PLL enable/disable to " Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 10/21] drm/bridge: tc358767: add link disable function Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 11/21] drm/bridge: tc358767: ensure DP is disabled before LT Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 12/21] drm/bridge: tc358767: remove unnecessary msleep Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 13/21] drm/bridge: tc358767: use more reliable seq when finishing LT Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 14/21] drm/bridge: tc358767: cleanup LT result check Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 15/21] drm/bridge: tc358767: clean-up link training Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 16/21] drm/bridge: tc358767: remove check for video mode in link enable Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 17/21] drm/bridge: tc358767: use bridge mode_valid Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 18/21] drm/bridge: tc358767: remove tc_connector_best_encoder Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 19/21] drm/bridge: tc358767: copy the mode data, instead of storing the pointer Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 20/21] drm/bridge: tc358767: add GPIO & interrupt registers Tomi Valkeinen
2019-03-19 10:41 ` [PATCH 21/21] drm/bridge: tc358767: implement naive HPD handling Tomi Valkeinen
2019-03-19 18:18   ` [21/21] " Andrey Smirnov
2019-03-20  5:55     ` Andrey Smirnov [this message]
2019-03-20  7:06       ` Tomi Valkeinen
2019-03-20  6:57     ` Tomi Valkeinen
2019-03-20 13:03       ` Tomi Valkeinen
2019-03-20 22:58         ` Andrey Smirnov
2019-03-21 13:12           ` Tomi Valkeinen

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=CAHQ1cqGps7n9ixaiUuvqcR+AN8muAoyN5J4XCQTskBiFFkK7fw@mail.gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=andrey.gusakov@cogentembedded.com \
    --cc=cphealy@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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).