public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Sam McNally <sammc@chromium.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	LKML <linux-kernel@vger.kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 2/4] drm_dp_mst_topology: use correct AUX channel
Date: Fri, 5 Feb 2021 15:24:20 +0200	[thread overview]
Message-ID: <YB1HBDEB5/fefQzi@intel.com> (raw)
In-Reply-To: <CAJqEsoCOJmS5aVb5du09tXUi7UUKVBQDPe5KTdcBiDr8A7kSYA@mail.gmail.com>

On Fri, Feb 05, 2021 at 04:17:51PM +1100, Sam McNally wrote:
> On Thu, 4 Feb 2021 at 21:19, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >
> > On 01/02/2021 23:13, Ville Syrjälä wrote:
> > > On Wed, Sep 23, 2020 at 12:13:53PM +1000, Sam McNally wrote:
> > >> From: Hans Verkuil <hans.verkuil@cisco.com>
> > >>
> > >> For adapters behind an MST hub use the correct AUX channel.
> > >>
> > >> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> > >> [sammc@chromium.org: rebased, removing redundant changes]
> > >> Signed-off-by: Sam McNally <sammc@chromium.org>
> > >> ---
> > >>
> > >> (no changes since v1)
> > >>
> > >>  drivers/gpu/drm/drm_dp_mst_topology.c | 36 +++++++++++++++++++++++++++
> > >>  1 file changed, 36 insertions(+)
> > >>
> > >> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> > >> index 15b6cc39a754..0d753201adbd 100644
> > >> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > >> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > >> @@ -2255,6 +2255,9 @@ drm_dp_mst_topology_unlink_port(struct drm_dp_mst_topology_mgr *mgr,
> > >>      drm_dp_mst_topology_put_port(port);
> > >>  }
> > >>
> > >> +static ssize_t
> > >> +drm_dp_mst_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg);
> > >> +
> > >>  static struct drm_dp_mst_port *
> > >>  drm_dp_mst_add_port(struct drm_device *dev,
> > >>                  struct drm_dp_mst_topology_mgr *mgr,
> > >> @@ -2271,9 +2274,13 @@ drm_dp_mst_add_port(struct drm_device *dev,
> > >>      port->port_num = port_number;
> > >>      port->mgr = mgr;
> > >>      port->aux.name = "DPMST";
> > >> +    mutex_init(&port->aux.hw_mutex);
> > >> +    mutex_init(&port->aux.cec.lock);
> > >>      port->aux.dev = dev->dev;
> > >>      port->aux.is_remote = true;
> > >>
> > >> +    port->aux.transfer = drm_dp_mst_aux_transfer;
> > >> +
> > >
> > > This was supposed to be handled via higher levels checking for
> > > is_remote==true.
> >
> > Ah, I suspect this patch can be dropped entirely: it predates commit 2f221a5efed4
> > ("drm/dp_mst: Add MST support to DP DPCD R/W functions").
> >
> > It looks like that commit basically solved what this older patch attempts to do
> > as well.
> >
> > Sam, can you test if it works without this patch?
> 
> It almost just works; drm_dp_cec uses whether aux.transfer is non-null
> to filter out non-DP connectors. Using aux.is_remote as another signal
> indicating a DP connector seems plausible. We can drop this patch.

Why would anyone even call this stuff on a non-DP connector?
And where did they even get the struct drm_dp_aux to do so?

> Thanks all!
> >
> > Regards,
> >
> >         Hans
> >
> > >
> > >>      /* initialize the MST downstream port's AUX crc work queue */
> > >>      drm_dp_remote_aux_init(&port->aux);
> > >>
> > >> @@ -3503,6 +3510,35 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr,
> > >>      return 0;
> > >>  }
> > >>
> > >> +static ssize_t
> > >> +drm_dp_mst_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
> > >> +{
> > >> +    struct drm_dp_mst_port *port =
> > >> +            container_of(aux, struct drm_dp_mst_port, aux);
> > >> +    int ret;
> > >> +
> > >> +    switch (msg->request & ~DP_AUX_I2C_MOT) {
> > >> +    case DP_AUX_NATIVE_WRITE:
> > >> +    case DP_AUX_I2C_WRITE:
> > >> +    case DP_AUX_I2C_WRITE_STATUS_UPDATE:
> > >> +            ret = drm_dp_send_dpcd_write(port->mgr, port, msg->address,
> > >> +                                         msg->size, msg->buffer);
> > >
> > > That doesn't make sense to me. I2c writes and DPCD writes
> > > are definitely not the same thing.
> > >
> > > aux->transfer is a very low level thing. I don't think it's the
> > > correct level of abstraction for sideband.
> > >
> > >> +            break;
> > >> +
> > >> +    case DP_AUX_NATIVE_READ:
> > >> +    case DP_AUX_I2C_READ:
> > >> +            ret = drm_dp_send_dpcd_read(port->mgr, port, msg->address,
> > >> +                                        msg->size, msg->buffer);
> > >> +            break;
> > >> +
> > >> +    default:
> > >> +            ret = -EINVAL;
> > >> +            break;
> > >> +    }
> > >> +
> > >> +    return ret;
> > >> +}
> > >> +
> > >>  static int drm_dp_get_vc_payload_bw(u8 dp_link_bw, u8  dp_link_count)
> > >>  {
> > >>      if (dp_link_bw == 0 || dp_link_count == 0)
> > >> --
> > >> 2.28.0.681.g6f77f65b4e-goog
> > >>
> > >> _______________________________________________
> > >> dri-devel mailing list
> > >> dri-devel@lists.freedesktop.org
> > >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> > >
> >

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2021-02-06  0:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  2:13 [PATCH v3 1/4] dp/dp_mst: Add support for sink event notify messages Sam McNally
2020-09-23  2:13 ` [PATCH v3 2/4] drm_dp_mst_topology: use correct AUX channel Sam McNally
2021-02-01 21:58   ` Lyude Paul
2021-02-01 22:13   ` Ville Syrjälä
2021-02-04 10:19     ` Hans Verkuil
2021-02-05  5:17       ` Sam McNally
2021-02-05 13:24         ` Ville Syrjälä [this message]
2021-02-05 13:46           ` Hans Verkuil
2021-02-05 14:00             ` Ville Syrjälä
2020-09-23  2:13 ` [PATCH v3 3/4] drm_dp_mst_topology: export two functions Sam McNally
2021-02-01 22:02   ` Lyude Paul
2021-02-05  7:41     ` Sam McNally
2020-09-23  2:13 ` [PATCH v3 4/4] drm_dp_cec: add MST support Sam McNally
2021-02-04 10:42   ` Hans Verkuil
2021-02-05  7:35     ` Sam McNally
2021-01-12  9:24 ` [PATCH v3 1/4] dp/dp_mst: Add support for sink event notify messages Hans Verkuil
2021-02-01  9:57   ` Hans Verkuil
2021-02-01 21:56 ` Lyude Paul
2021-02-03  9:56   ` Hans Verkuil
     [not found]     ` <CAJqEsoAAgqnirFirxfiAvTObG-j9DRE_qvMd1uu5DRTHAyFq=Q@mail.gmail.com>
2021-02-04 10:44       ` Hans Verkuil

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=YB1HBDEB5/fefQzi@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sammc@chromium.org \
    --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