From: Lyude Paul <lyude@redhat.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
nouveau@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v5 00/20] drm/dp, i915, nouveau: Cleanup nouveau HPD and add DP features from i915
Date: Wed, 26 Aug 2020 14:24:36 -0400 [thread overview]
Message-ID: <20200826182456.322681-1-lyude@redhat.com> (raw)
Most of the reason I'm asking for an RFC here is because this
code pulls a lot of code out of i915 and into shared DP helpers.
Anyway-nouveau's HPD related code has been collecting dust for a while.
Other then the occasional runtime PM related and MST related fixes,
we're missing a lot of nice things that have been added to DRM since
this was originally written. Additionally, the code is just really
unoptimized in general:
* We handle connector probing in the same context that we handle short
IRQs in for DP, which means connector probing could potentially block
ESI handling for MST
* When we receive a hotplug event from a connector, we reprobe every
single connector instead of just the connector that was hotplugged
* Additionally because of the above reason, combined with the fact I had
the bad idea of reusing some of the MST locks when I last rewrote
nouveau's DP MST detection, trying to handle any other events that
require short HPD IRQs is a bit awkward to actually implement.
* We don't actually properly check whether EDIDs change or not when
reprobing, which means we basically send out a hotplug event every
single time we receive one even if nothing has changed
Additionally, the code for handling DP that we have in nouveau is also
quite unoptimized in general, doesn't use a lot of helpers that have
been added since it was written, and is also missing quite a number of
features:
* Downstream port capability probing
* Extended DPRX cap parsing
* SINK_COUNT handling for hpd on dongles
Luckily for us - all of these are implemented in i915 already. Since
there's no reason for us to reinvent the wheel, and having more shared
code is always nice, I decided to take the opportunity to extract the
code for all of these features from i915 into a set of core DP helpers,
which both i915 and nouveau (and hopefully other drivers in the future)
can use.
As well, this patch series also addesses the other general
connector probing related issues I mentioned above, along with rewriting
how we handle MST probing so we don't hit any surprise locking design
issues in the future.
As a note - most of this work is motivated by the fact that I'm
planning on adding max_bpc/output_bpc prop support, DSC support (for
both MST and SST, along with proper helpers for handling bandwidth
limitations and DSC), and fallback link retraining. I figured I might as
clean this code up and implement missing DP features like the ones
mentioned here before moving on to those tasks.
Lyude Paul (20):
drm/nouveau/kms: Fix some indenting in nouveau_dp_detect()
drm/nouveau/kms/nv50-: Remove open-coded drm_dp_read_desc()
drm/nouveau/kms/nv50-: Just use drm_dp_dpcd_read() in nouveau_dp.c
drm/nouveau/kms/nv50-: Use macros for DP registers in nouveau_dp.c
drm/nouveau/kms: Don't clear DP_MST_CTRL DPCD in nv50_mstm_new()
drm/nouveau/kms: Search for encoders' connectors properly
drm/nouveau/kms/nv50-: Use drm_dp_dpcd_(readb|writeb)() in
nv50_sor_disable()
drm/nouveau/kms/nv50-: Refactor and cleanup DP HPD handling
drm/i915/dp: Extract drm_dp_read_mst_cap()
drm/nouveau/kms: Use new drm_dp_read_mst_cap() helper for checking MST
caps
drm/nouveau/kms: Move drm_dp_cec_unset_edid() into
nouveau_connector_detect()
drm/nouveau/kms: Only use hpd_work for reprobing in HPD paths
drm/i915/dp: Extract drm_dp_read_downstream_info()
drm/nouveau/kms/nv50-: Use downstream DP clock limits for mode
validation
drm/i915/dp: Extract drm_dp_read_sink_count_cap()
drm/i915/dp: Extract drm_dp_read_sink_count()
drm/nouveau/kms/nv50-: Add support for DP_SINK_COUNT
drm/nouveau/kms: Don't change EDID when it hasn't actually changed
drm/i915/dp: Extract drm_dp_read_dpcd_caps()
drm/nouveau/kms: Start using drm_dp_read_dpcd_caps()
drivers/gpu/drm/drm_dp_helper.c | 187 +++++++++++-
drivers/gpu/drm/drm_dp_mst_topology.c | 22 ++
drivers/gpu/drm/i915/display/intel_dp.c | 124 ++------
drivers/gpu/drm/i915/display/intel_dp.h | 1 -
drivers/gpu/drm/i915/display/intel_lspcon.c | 2 +-
drivers/gpu/drm/nouveau/dispnv04/dac.c | 2 +-
drivers/gpu/drm/nouveau/dispnv04/dfp.c | 7 +-
drivers/gpu/drm/nouveau/dispnv04/disp.c | 24 +-
drivers/gpu/drm/nouveau/dispnv04/disp.h | 4 +
drivers/gpu/drm/nouveau/dispnv04/tvnv04.c | 2 +-
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +-
drivers/gpu/drm/nouveau/dispnv50/disp.c | 305 +++++++++++---------
drivers/gpu/drm/nouveau/nouveau_connector.c | 132 ++++-----
drivers/gpu/drm/nouveau/nouveau_connector.h | 1 +
drivers/gpu/drm/nouveau/nouveau_display.c | 72 ++++-
drivers/gpu/drm/nouveau/nouveau_display.h | 3 +-
drivers/gpu/drm/nouveau/nouveau_dp.c | 210 +++++++++++---
drivers/gpu/drm/nouveau/nouveau_drm.c | 4 +-
drivers/gpu/drm/nouveau/nouveau_drv.h | 2 +
drivers/gpu/drm/nouveau/nouveau_encoder.h | 48 ++-
include/drm/drm_dp_helper.h | 15 +-
include/drm/drm_dp_mst_helper.h | 3 +-
22 files changed, 779 insertions(+), 393 deletions(-)
--
2.26.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2020-08-26 18:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 18:24 Lyude Paul [this message]
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 01/20] drm/nouveau/kms: Fix some indenting in nouveau_dp_detect() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 02/20] drm/nouveau/kms/nv50-: Remove open-coded drm_dp_read_desc() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 03/20] drm/nouveau/kms/nv50-: Just use drm_dp_dpcd_read() in nouveau_dp.c Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 04/20] drm/nouveau/kms/nv50-: Use macros for DP registers " Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 05/20] drm/nouveau/kms: Don't clear DP_MST_CTRL DPCD in nv50_mstm_new() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 06/20] drm/nouveau/kms: Search for encoders' connectors properly Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 07/20] drm/nouveau/kms/nv50-: Use drm_dp_dpcd_(readb|writeb)() in nv50_sor_disable() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 08/20] drm/nouveau/kms/nv50-: Refactor and cleanup DP HPD handling Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 09/20] drm/i915/dp: Extract drm_dp_read_mst_cap() Lyude Paul
2020-08-27 13:50 ` Jani Nikula
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 10/20] drm/nouveau/kms: Use new drm_dp_read_mst_cap() helper for checking MST caps Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 11/20] drm/nouveau/kms: Move drm_dp_cec_unset_edid() into nouveau_connector_detect() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 12/20] drm/nouveau/kms: Only use hpd_work for reprobing in HPD paths Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 13/20] drm/i915/dp: Extract drm_dp_read_downstream_info() Lyude Paul
2020-08-27 14:09 ` Jani Nikula
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 14/20] drm/nouveau/kms/nv50-: Use downstream DP clock limits for mode validation Lyude Paul
2020-09-17 16:45 ` Ville Syrjälä
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 15/20] drm/i915/dp: Extract drm_dp_read_sink_count_cap() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 16/20] drm/i915/dp: Extract drm_dp_read_sink_count() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 17/20] drm/nouveau/kms/nv50-: Add support for DP_SINK_COUNT Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 18/20] drm/nouveau/kms: Don't change EDID when it hasn't actually changed Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 19/20] drm/i915/dp: Extract drm_dp_read_dpcd_caps() Lyude Paul
2020-08-26 18:24 ` [Intel-gfx] [PATCH v5 20/20] drm/nouveau/kms: Start using drm_dp_read_dpcd_caps() Lyude Paul
2020-08-26 19:07 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/dp, i915, nouveau: Cleanup nouveau HPD and add DP features from i915 (rev7) Patchwork
2020-08-26 19:09 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-08-26 19:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-08-27 2:50 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=20200826182456.322681-1-lyude@redhat.com \
--to=lyude@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.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