public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: Karol Herbst <kherbst@redhat.com>,
	Jani Nikula <jani.nikula@intel.com>,
	open list <linux-kernel@vger.kernel.org>,
	David Airlie <airlied@linux.ie>, Ben Skeggs <bskeggs@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>
Subject: [Intel-gfx] [RFC v4 11/17] drm/nouveau/kms: Cache DP encoders in nouveau_connector
Date: Wed, 17 Aug 2022 15:38:40 -0400	[thread overview]
Message-ID: <20220817193847.557945-12-lyude@redhat.com> (raw)
In-Reply-To: <20220817193847.557945-1-lyude@redhat.com>

Post-NV50, the only kind of encoder you'll find for DP connectors on Nvidia
GPUs are SORs (serial output resources). Because SORs have fixed
associations with their connectors, we can correctly assume that any DP
connector on a nvidia GPU will have exactly one SOR encoder routed to it
for DisplayPort.

Since we're going to need to be able to retrieve this fixed SOR DP encoder
much more often as a result of hooking up MST helpers for tracking
SST<->MST transitions in atomic states, let's simply cache this encoder in
nouveau_connector for any DP connectors on the system to avoid looking it
up each time. This isn't safe for NV50 since PIORs then come into play,
however there's no code pre-NV50 that would need to look this up anyhow -
so it's not really an issue.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +++-
 drivers/gpu/drm/nouveau/nouveau_connector.h | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 8100c75ee731..b8ee2173ca8f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -1368,7 +1368,7 @@ nouveau_connector_create(struct drm_device *dev,
 			return ERR_PTR(-ENOMEM);
 		}
 		drm_dp_aux_init(&nv_connector->aux);
-		fallthrough;
+		break;
 	default:
 		funcs = &nouveau_connector_funcs;
 		break;
@@ -1431,6 +1431,8 @@ nouveau_connector_create(struct drm_device *dev,
 
 	switch (type) {
 	case DRM_MODE_CONNECTOR_DisplayPort:
+		nv_connector->dp_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP);
+		fallthrough;
 	case DRM_MODE_CONNECTOR_eDP:
 		drm_dp_cec_register_connector(&nv_connector->aux, connector);
 		break;
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h
index 4bf0c703eee7..f4e17ff68bf9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.h
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.h
@@ -128,6 +128,9 @@ struct nouveau_connector {
 
 	struct drm_dp_aux aux;
 
+	/* The fixed DP encoder for this connector, if there is one */
+	struct nouveau_encoder *dp_encoder;
+
 	int dithering_mode;
 	int scaling_mode;
 
-- 
2.37.1


  parent reply	other threads:[~2022-08-17 19:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 19:38 [Intel-gfx] [RFC v4 00/17] drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 01/17] drm/amdgpu/dc/mst: Rename dp_mst_stream_allocation(_table) Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 02/17] drm/amdgpu/dm/mst: Rename get_payload_table() Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 03/17] drm/display/dp_mst: Rename drm_dp_mst_vcpi_allocation Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 04/17] drm/display/dp_mst: Call them time slots, not VCPI slots Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 05/17] drm/display/dp_mst: Fix confusing docs for drm_dp_atomic_release_time_slots() Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 06/17] drm/display/dp_mst: Add some missing kdocs for atomic MST structs Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 07/17] drm/display/dp_mst: Add helper for finding payloads in atomic MST state Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 08/17] drm/display/dp_mst: Add nonblocking helpers for DP MST Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 09/17] drm/display/dp_mst: Don't open code modeset checks for releasing time slots Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 10/17] drm/display/dp_mst: Fix modeset tracking in drm_dp_atomic_release_vcpi_slots() Lyude Paul
2022-08-17 19:38 ` Lyude Paul [this message]
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 12/17] drm/nouveau/kms: Pull mst state in for all modesets Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 13/17] drm/display/dp_mst: Add helpers for serializing SST <-> MST transitions Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 14/17] drm/display/dp_mst: Drop all ports from topology on CSNs before queueing link address work Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 15/17] drm/display/dp_mst: Maintain time slot allocations when deleting payloads Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 16/17] drm/radeon: Drop legacy MST support Lyude Paul
2022-08-17 19:38 ` [Intel-gfx] [RFC v4 17/17] drm/display/dp_mst: Move all payload info into the atomic state Lyude Paul
2022-08-17 19:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only (rev4) Patchwork
2022-08-17 20:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-08-18  3:34 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-08-23 17:26 ` [Intel-gfx] [RFC v4 00/17] drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only Lyude Paul
2022-08-23 21:09   ` Lyude Paul

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=20220817193847.557945-12-lyude@redhat.com \
    --to=lyude@redhat.com \
    --cc=airlied@linux.ie \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=kherbst@redhat.com \
    --cc=linux-kernel@vger.kernel.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