* [PATCH 1/2] drm/nouveau: Expose nv50 MST structures in disp.h
2018-07-12 17:10 [PATCH 0/2] drm/nouveau: Add support for dp_mst_info in debugfs Lyude Paul
@ 2018-07-12 17:10 ` Lyude Paul
2018-07-12 17:10 ` [PATCH 2/2] drm/nouveau: Hook up dp_mst_info in debugfs Lyude Paul
2018-07-12 17:21 ` [PATCH 0/2] drm/nouveau: Add support for " Daniel Vetter
2 siblings, 0 replies; 4+ messages in thread
From: Lyude Paul @ 2018-07-12 17:10 UTC (permalink / raw)
To: nouveau
Cc: Ben Skeggs, David Airlie, Daniel Vetter, Maarten Lankhorst,
Ville Syrjälä,
Archit Taneja, dri-devel, linux-kernel
We're about to need this so that we can hook up dp_mst_info into debugfs
so we can walk the encoder list and find each mst mgr.
Signed-off-by: Lyude Paul <lyude@redhat.com>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 34 ------------------------
drivers/gpu/drm/nouveau/dispnv50/disp.h | 35 +++++++++++++++++++++++++
2 files changed, 35 insertions(+), 34 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index d9da69c83ae7..f76fe5f260a4 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -568,40 +568,6 @@ nv50_hdmi_enable(struct drm_encoder *encoder, struct drm_display_mode *mode)
/******************************************************************************
* MST
*****************************************************************************/
-#define nv50_mstm(p) container_of((p), struct nv50_mstm, mgr)
-#define nv50_mstc(p) container_of((p), struct nv50_mstc, connector)
-#define nv50_msto(p) container_of((p), struct nv50_msto, encoder)
-
-struct nv50_mstm {
- struct nouveau_encoder *outp;
-
- struct drm_dp_mst_topology_mgr mgr;
- struct nv50_msto *msto[4];
-
- bool modified;
- bool disabled;
- int links;
-};
-
-struct nv50_mstc {
- struct nv50_mstm *mstm;
- struct drm_dp_mst_port *port;
- struct drm_connector connector;
-
- struct drm_display_mode *native;
- struct edid *edid;
-
- int pbn;
-};
-
-struct nv50_msto {
- struct drm_encoder encoder;
-
- struct nv50_head *head;
- struct nv50_mstc *mstc;
- bool disabled;
-};
-
static struct drm_dp_payload *
nv50_msto_payload(struct nv50_msto *msto)
{
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h
index e48c5eb35b49..5ba7093f3c74 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.h
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h
@@ -3,6 +3,7 @@
#include <nvif/mem.h>
#include "nouveau_display.h"
+#include "nouveau_encoder.h"
struct nv50_disp {
struct nvif_disp *disp;
@@ -65,6 +66,40 @@ struct nv50_dmac {
struct mutex lock;
};
+#define nv50_mstm(p) container_of((p), struct nv50_mstm, mgr)
+#define nv50_mstc(p) container_of((p), struct nv50_mstc, connector)
+#define nv50_msto(p) container_of((p), struct nv50_msto, encoder)
+
+struct nv50_mstm {
+ struct nouveau_encoder *outp;
+
+ struct drm_dp_mst_topology_mgr mgr;
+ struct nv50_msto *msto[4];
+
+ bool modified;
+ bool disabled;
+ int links;
+};
+
+struct nv50_mstc {
+ struct nv50_mstm *mstm;
+ struct drm_dp_mst_port *port;
+ struct drm_connector connector;
+
+ struct drm_display_mode *native;
+ struct edid *edid;
+
+ int pbn;
+};
+
+struct nv50_msto {
+ struct drm_encoder encoder;
+
+ struct nv50_head *head;
+ struct nv50_mstc *mstc;
+ bool disabled;
+};
+
int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
const s32 *oclass, u8 head, void *data, u32 size,
u64 syncbuf, struct nv50_dmac *dmac);
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 2/2] drm/nouveau: Hook up dp_mst_info in debugfs
2018-07-12 17:10 [PATCH 0/2] drm/nouveau: Add support for dp_mst_info in debugfs Lyude Paul
2018-07-12 17:10 ` [PATCH 1/2] drm/nouveau: Expose nv50 MST structures in disp.h Lyude Paul
@ 2018-07-12 17:10 ` Lyude Paul
2018-07-12 17:21 ` [PATCH 0/2] drm/nouveau: Add support for " Daniel Vetter
2 siblings, 0 replies; 4+ messages in thread
From: Lyude Paul @ 2018-07-12 17:10 UTC (permalink / raw)
To: nouveau; +Cc: Ben Skeggs, David Airlie, dri-devel, linux-kernel
This is very useful for checking what nouveau thinks the current state
of each MST topology looks like.
Signed-off-by: Lyude Paul <lyude@redhat.com>
---
drivers/gpu/drm/nouveau/nouveau_debugfs.c | 47 ++++++++++++++++++++++-
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 963a4dba8213..82f10beed0df 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -32,13 +32,19 @@
#include <nvif/class.h>
#include <nvif/if0001.h>
#include "nouveau_debugfs.h"
+#include "nouveau_encoder.h"
#include "nouveau_drv.h"
+#include "dispnv50/disp.h"
+
+static inline struct nouveau_drm *node_to_nouveau(struct drm_info_node *node)
+{
+ return nouveau_drm(node->minor->dev);
+}
static int
nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
+ struct nouveau_drm *drm = node_to_nouveau(m->private);
int i;
for (i = 0; i < drm->vbios.length; i++)
@@ -46,6 +52,42 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
return 0;
}
+static int
+nouveau_debugfs_dp_mst_info(struct seq_file *m, void *unused)
+{
+ struct nouveau_drm *drm = node_to_nouveau(m->private);
+ struct drm_device *dev = drm->dev;
+ struct drm_encoder *encoder;
+ struct nv50_mstm *mstm;
+ int ret;
+
+ ret = pm_runtime_get_sync(dev->dev);
+ if (ret < 0 && ret != -EACCES)
+ return ret;
+
+ ret = drm_modeset_lock_single_interruptible(&dev->mode_config.connection_mutex);
+ if (ret)
+ goto out;
+
+ drm_for_each_encoder(encoder, dev) {
+ if (encoder->encoder_type != DRM_MODE_ENCODER_TMDS)
+ continue;
+
+ mstm = nouveau_encoder(encoder)->dp.mstm;
+ if (!mstm)
+ continue;
+
+ seq_printf(m, "MST encoder source %s\n", encoder->name);
+ drm_dp_mst_dump_topology(m, &mstm->mgr);
+ }
+
+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
+out:
+ pm_runtime_mark_last_busy(dev->dev);
+ pm_runtime_put_autosuspend(dev->dev);
+ return ret;
+}
+
static int
nouveau_debugfs_pstate_get(struct seq_file *m, void *data)
{
@@ -182,6 +224,7 @@ static const struct file_operations nouveau_pstate_fops = {
static struct drm_info_list nouveau_debugfs_list[] = {
{ "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL },
+ { "dp_mst_info", nouveau_debugfs_dp_mst_info, 0, NULL },
};
#define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 0/2] drm/nouveau: Add support for dp_mst_info in debugfs
2018-07-12 17:10 [PATCH 0/2] drm/nouveau: Add support for dp_mst_info in debugfs Lyude Paul
2018-07-12 17:10 ` [PATCH 1/2] drm/nouveau: Expose nv50 MST structures in disp.h Lyude Paul
2018-07-12 17:10 ` [PATCH 2/2] drm/nouveau: Hook up dp_mst_info in debugfs Lyude Paul
@ 2018-07-12 17:21 ` Daniel Vetter
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2018-07-12 17:21 UTC (permalink / raw)
To: Lyude Paul
Cc: nouveau, David Airlie, Maarten Lankhorst, Daniel Vetter,
linux-kernel, dri-devel, Ben Skeggs, Ville Syrjälä,
Archit Taneja
On Thu, Jul 12, 2018 at 01:10:45PM -0400, Lyude Paul wrote:
> This hooks up the DRM helpers for dumping information on the current
> status of each MST topology from nouveau's perspective to debugfs files,
> similar to what i915 does (albeit, i915 labels their debugfs node for
> this as i915_dp_mst_info).
>
> Lyude Paul (2):
> drm/nouveau: Expose nv50 MST structures in disp.h
> drm/nouveau: Hook up dp_mst_info in debugfs
We already register the i2c-over-aux and dp_aux devnodes in
drm_dp_aux_register(). Could we do the same with a per-devnode debugfs
file for mst? The topology manager sits on top of the dp aux abstraction,
so this could work, with s/encoder->name/dp_aux->name/.
Would give us mst info on every driver for free (plus we could nuke the
ad-hoc version in i915).
-Daniel
>
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 34 ----------------
> drivers/gpu/drm/nouveau/dispnv50/disp.h | 35 +++++++++++++++++
> drivers/gpu/drm/nouveau/nouveau_debugfs.c | 47 ++++++++++++++++++++++-
> 3 files changed, 80 insertions(+), 36 deletions(-)
>
> --
> 2.17.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread