From: "Ville Syrjälä" <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
Cc: nouveau
<nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
Oleg Vasilev
<oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
dri-devel
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
Emil Velikov
<emil.velikov-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Subject: Re: [PATCH v3 5/7] drm/nouveau: utilize subconnector property for DP
Date: Wed, 28 Aug 2019 17:38:21 +0300 [thread overview]
Message-ID: <20190828143821.GD7482@intel.com> (raw)
In-Reply-To: <CAKb7UviahO6HWbxOoLyqN2X6WFw_GyucQuMs7Wj-MrKVNP1n_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, Aug 26, 2019 at 09:36:50AM -0400, Ilia Mirkin wrote:
> This should probably be fixed to account for the scenario where an
> HDMI connector is plugged directly into the DP++ port. I don't think
> the dp.subconnector property will be valid in that case.
> (Unfortunately I don't remember how one detects that particular
> situation.)
One may or may not be able to detect it very well. I've seen dongles
that automagically change the DFP type from DP++ to DP/HDMI depending
on what's plugged in, and I've also seen dongles that leave the DFP
type to DP++.
I'm actually broiling a series of patches which try to improve how
i915 handles various DFP types, and for that I'm thinking of using
a combination of the DFP type and the EDID digital input type to
differentiate between the two cases like so:
static bool is_edid_digital_input_dp(const struct edid *edid)
{
return edid && edid->revision >= 4 &&
edid->input & DRM_EDID_INPUT_DIGITAL &&
(edid->input & DRM_EDID_DIGITAL_TYPE_MASK) == DRM_EDID_DIGITAL_TYPE_DP;
}
{
switch (port_cap[0] & DP_DS_PORT_TYPE_MASK) {
case DP_DS_PORT_TYPE_DP:
DP_STUFF;
case DP_DS_PORT_TYPE_DP_DUALMODE:
if (is_edid_digital_input_dp(edid))
DP_STUFF;
/* fall through */
case DP_DS_PORT_TYPE_HDMI:
case DP_DS_PORT_TYPE_DVI:
TMDS_STUFF;
}
>
> 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: Ben Skeggs <bskeggs@redhat.com>
> > Cc: nouveau@lists.freedesktop.org
> > ---
> > drivers/gpu/drm/nouveau/nouveau_connector.c | 13 +++++++++++++
> > drivers/gpu/drm/nouveau/nouveau_dp.c | 9 +++++++++
> > drivers/gpu/drm/nouveau/nouveau_encoder.h | 1 +
> > 3 files changed, 23 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
> > index 94dfa2e5a9ab..d9c116cc11b9 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> > @@ -635,6 +635,17 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
> > pm_runtime_mark_last_busy(dev->dev);
> > pm_runtime_put_autosuspend(dev->dev);
> >
> > + if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> > + connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
> > + enum drm_mode_subconnector subconnector = DRM_MODE_SUBCONNECTOR_Unknown;
> > +
> > + if (conn_status == connector_status_connected && nv_encoder)
> > + subconnector = nv_encoder->dp.subconnector;
> > + drm_object_property_set_value(&connector->base,
> > + connector->dev->mode_config.dp_subconnector_property,
> > + subconnector);
> > + }
> > +
> > return conn_status;
> > }
> >
> > @@ -1359,6 +1370,8 @@ nouveau_connector_create(struct drm_device *dev,
> > kfree(nv_connector);
> > return ERR_PTR(ret);
> > }
> > +
> > + drm_mode_add_dp_subconnector_property(connector);
> > funcs = &nouveau_connector_funcs;
> > break;
> > default:
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c
> > index 2674f1587457..85eac853e3f8 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_dp.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c
> > @@ -62,6 +62,7 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)
> > struct nouveau_drm *drm = nouveau_drm(dev);
> > struct nvkm_i2c_aux *aux;
> > u8 dpcd[8];
> > + u8 port_cap[DP_MAX_DOWNSTREAM_PORTS] = {};
> > int ret;
> >
> > aux = nv_encoder->aux;
> > @@ -72,6 +73,14 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)
> > if (ret)
> > return ret;
> >
> > + if (dpcd[DP_DPCD_REV] > 0x10) {
> > + ret = nvkm_rdaux(aux, DP_DOWNSTREAM_PORT_0,
> > + port_cap, DP_MAX_DOWNSTREAM_PORTS);
> > + if (ret)
> > + memset(port_cap, 0, DP_MAX_DOWNSTREAM_PORTS);
> > + }
> > + nv_encoder->dp.subconnector = drm_dp_subconnector_type(dpcd, port_cap);
> > +
> > nv_encoder->dp.link_bw = 27000 * dpcd[1];
> > nv_encoder->dp.link_nr = dpcd[2] & DP_MAX_LANE_COUNT_MASK;
> >
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h
> > index 3517f920bf89..e17971a30221 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_encoder.h
> > +++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h
> > @@ -63,6 +63,7 @@ struct nouveau_encoder {
> > struct nv50_mstm *mstm;
> > int link_nr;
> > int link_bw;
> > + enum drm_mode_subconnector subconnector;
> > } dp;
> > };
> >
> > --
> > 2.23.0
> >
> > _______________________________________________
> > Nouveau mailing list
> > Nouveau@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/nouveau
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2019-08-28 14:38 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ä [this message]
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ä
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=20190828143821.GD7482@intel.com \
--to=ville.syrjala-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=emil.velikov-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/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).