drm/nouveau: Add support for dp_mst_info in debugfs
Subsystems (3)
Lyude Paul
maintainercover drm/nouveau: Add support for dp_mst_info in debugfs
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
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(-)
Signature · 6 lines
2.17.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Lyude Paul
maintainerPATCH 1/2 drm/nouveau: Expose nv50 MST structures in disp.h
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.
--- drivers/gpu/drm/nouveau/dispnv50/disp.c | 34 ------------------------ drivers/gpu/drm/nouveau/dispnv50/disp.h | 35 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 34 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +0 -34
@@ -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) {
drivers/gpu/drm/nouveau/dispnv50/disp.h +35 -0
@@ -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);
Signature · 1 line
2.17.1
Lyude Paul
maintainerPATCH 2/2 drm/nouveau: Hook up dp_mst_info in debugfs
In reply to Lyude PaulThis is very useful for checking what nouveau thinks the current state of each MST topology looks like.
--- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 47 ++++++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_debugfs.c +45 -2
@@ -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)
Signature · 6 lines
2.17.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Quoted 8 lines · Lyude Paul
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 indisp.hdrm/nouveau: Hook updp_mst_infoin 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
Quoted 9 lines
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(-)Signature · 1 line
2.17.1
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel