dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Oleg Vasilev" <oleg.vasilev@intel.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Emil Velikov" <emil.velikov@collabora.com>
Subject: Re: [PATCH v3 6/7] drm/amdgpu: utilize subconnector property for DP through atombios
Date: Fri, 30 Aug 2019 15:47:43 +0300	[thread overview]
Message-ID: <20190830124743.GQ7482@intel.com> (raw)
In-Reply-To: <CADnq5_Pk-Z4KvbVf+ctxKVghZE5ctY-wDtxPF4MmcSeWL2oHmA@mail.gmail.com>

On Thu, Aug 29, 2019 at 08:52:31AM -0400, Alex Deucher wrote:
> On Mon, Aug 26, 2019 at 9:22 AM Oleg Vasilev <oleg.vasilev@intel.com> wrote:
> >
> > Since DP-specific information is stored in driver's structures, every
> > driver needs to implement subconnector property by itself.
> >
> > Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> > Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Cc: David (ChunMing) Zhou <David1.Zhou@amd.com>
> > Cc: amd-gfx@lists.freedesktop.org
> 
> Similar to Ilia's sentiments, do these make sense for amd drivers?  We
> expose the physical connectors only.  So physical DP ports show up as
> DP drm connectors and if you connect a passive DP to HDMI/DVI dingle,
> the driver just does the right thing.  We don't expose multiple drm
> connectors for the same physical connector.

After a bit more though I guess you could just

if (detected DP)
	set_subconnector_prop(DFP type);
else if (detected HDMI)
	set_subconnector_prop(HDMI)


> 
> Alex
> 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 10 ++++++++++
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h       |  1 +
> >  drivers/gpu/drm/amd/amdgpu/atombios_dp.c       | 18 +++++++++++++++++-
> >  3 files changed, 28 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> > index ece55c8fa673..348ed9e46bae 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> > @@ -26,6 +26,7 @@
> >
> >  #include <drm/drm_edid.h>
> >  #include <drm/drm_fb_helper.h>
> > +#include <drm/drm_dp_helper.h>
> >  #include <drm/drm_probe_helper.h>
> >  #include <drm/amdgpu_drm.h>
> >  #include "amdgpu.h"
> > @@ -1407,6 +1408,10 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
> >                 pm_runtime_put_autosuspend(connector->dev->dev);
> >         }
> >
> > +       drm_dp_set_subconnector_property(&amdgpu_connector->base,
> > +                                        ret,
> > +                                        amdgpu_dig_connector->dpcd,
> > +                                        amdgpu_dig_connector->downstream_ports);
> >         return ret;
> >  }
> >
> > @@ -1934,6 +1939,11 @@ amdgpu_connector_add(struct amdgpu_device *adev,
> >         if (has_aux)
> >                 amdgpu_atombios_dp_aux_init(amdgpu_connector);
> >
> > +       if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> > +           connector_type == DRM_MODE_CONNECTOR_eDP) {
> > +               drm_mode_add_dp_subconnector_property(&amdgpu_connector->base);
> > +       }
> > +
> >         return;
> >
> >  failed:
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
> > index eb9975f4decb..cb360b44371c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
> > @@ -469,6 +469,7 @@ struct amdgpu_encoder {
> >  struct amdgpu_connector_atom_dig {
> >         /* displayport */
> >         u8 dpcd[DP_RECEIVER_CAP_SIZE];
> > +       u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
> >         u8 dp_sink_type;
> >         int dp_clock;
> >         int dp_lane_count;
> > diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c
> > index 6858cde9fc5d..b0d414553e71 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c
> > @@ -334,6 +334,22 @@ static void amdgpu_atombios_dp_probe_oui(struct amdgpu_connector *amdgpu_connect
> >                               buf[0], buf[1], buf[2]);
> >  }
> >
> > +static void amdgpu_atombios_dp_ds_ports(struct amdgpu_connector *amdgpu_connector)
> > +{
> > +       struct amdgpu_connector_atom_dig *dig_connector = amdgpu_connector->con_priv;
> > +       int ret;
> > +
> > +       if (dig_connector->dpcd[DP_DPCD_REV] > 0x10) {
> > +               ret = drm_dp_dpcd_read(&amdgpu_connector->ddc_bus->aux,
> > +                                      DP_DOWNSTREAM_PORT_0,
> > +                                      dig_connector->downstream_ports,
> > +                                      DP_MAX_DOWNSTREAM_PORTS);
> > +               if (ret)
> > +                       memset(dig_connector->downstream_ports, 0,
> > +                              DP_MAX_DOWNSTREAM_PORTS);
> > +       }
> > +}
> > +
> >  int amdgpu_atombios_dp_get_dpcd(struct amdgpu_connector *amdgpu_connector)
> >  {
> >         struct amdgpu_connector_atom_dig *dig_connector = amdgpu_connector->con_priv;
> > @@ -349,7 +365,7 @@ int amdgpu_atombios_dp_get_dpcd(struct amdgpu_connector *amdgpu_connector)
> >                               dig_connector->dpcd);
> >
> >                 amdgpu_atombios_dp_probe_oui(amdgpu_connector);
> > -
> > +               amdgpu_atombios_dp_ds_ports(amdgpu_connector);
> >                 return 0;
> >         }
> >
> > --
> > 2.23.0
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-08-30 12:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 13:22 Subconnector property for DP downstream type Oleg Vasilev
2019-08-26 13:22 ` [PATCH v3 1/7] drm: move DP_MAX_DOWNSTREAM_PORTS from i915 to drm core Oleg Vasilev
2019-08-26 13:22 ` [PATCH v3 2/7] drm: always determine branch device with drm_dp_is_branch() Oleg Vasilev
2019-08-26 13:22 ` [PATCH v3 3/7] drm: report dp downstream port type as a subconnector property Oleg Vasilev
2019-08-28 14:25   ` Ville Syrjälä
2019-08-26 13:22 ` [PATCH v3 4/7] drm/i915: utilize subconnector property for DP Oleg Vasilev
2019-08-28 14:27   ` Ville Syrjälä
2019-08-29 13:09     ` Alex Deucher
2019-08-30 12:13       ` Ville Syrjälä
     [not found] ` <20190826132216.2823-1-oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-08-26 13:22   ` [PATCH v3 5/7] drm/nouveau: " Oleg Vasilev
     [not found]     ` <20190826132216.2823-6-oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-08-26 13:36       ` Ilia Mirkin
     [not found]         ` <CAKb7UviahO6HWbxOoLyqN2X6WFw_GyucQuMs7Wj-MrKVNP1n_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-28 14:38           ` Ville Syrjälä
2019-08-28 14:47             ` [Nouveau] " Ilia Mirkin
     [not found]               ` <CAKb7Uvg=5BrQmLsq_=Cv1D_-baQ_crWRDePbnXXKy-jCVXtvsA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-28 14:54                 ` Ville Syrjälä
2019-08-28 15:11                   ` [Nouveau] " Ilia Mirkin
     [not found]                     ` <CAKb7UviDZZkOAQWu+_Lqw3TbhnKq138XM5HXNRUzoc5GCCZGNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-28 15:41                       ` Ville Syrjälä
2019-08-26 13:22   ` [PATCH v3 6/7] drm/amdgpu: utilize subconnector property for DP through atombios Oleg Vasilev
     [not found]     ` <20190826132216.2823-7-oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-08-29 12:52       ` Alex Deucher
2019-08-30 12:47         ` Ville Syrjälä [this message]
2019-08-26 13:22   ` [PATCH v3 7/7] drm/amdgpu: utilize subconnector property for DP through DisplayManager Oleg Vasilev
2019-08-29 11:48 ` [PATCH v4 1/7] drm: move DP_MAX_DOWNSTREAM_PORTS from i915 to drm core Oleg Vasilev
2019-08-29 11:48   ` [PATCH v4 2/7] drm: always determine branch device with drm_dp_is_branch() Oleg Vasilev
2020-01-10 13:42     ` Jani Nikula
2019-08-29 11:48   ` [PATCH v4 3/7] drm: report dp downstream port type as a subconnector property Oleg Vasilev
2019-08-29 11:48   ` [PATCH v4 4/7] drm/i915: utilize subconnector property for DP Oleg Vasilev
     [not found]   ` <20190829114854.1539-1-oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-08-29 11:48     ` [PATCH v4 5/7] drm/nouveau: " Oleg Vasilev
2019-08-29 11:48   ` [PATCH v4 6/7] drm/amdgpu: utilize subconnector property for DP through atombios Oleg Vasilev
2019-08-29 11:48   ` [PATCH v4 7/7] drm/amdgpu: utilize subconnector property for DP through DisplayManager Oleg Vasilev

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=20190830124743.GQ7482@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=oleg.vasilev@intel.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).