From: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: "Archit Taneja" <architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"Rob Clark" <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Sean Paul" <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
"Daniel Vetter" <daniel-/w4YWyX8dFk@public.gmane.org>,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
"Ville Syrjälä"
<ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Subject: [PATCH 5/6] drm/atomic: add debugfs file to dump out atomic state
Date: Fri, 14 Oct 2016 19:55:52 -0400 [thread overview]
Message-ID: <1476489353-16261-6-git-send-email-robdclark@gmail.com> (raw)
In-Reply-To: <1476489353-16261-1-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/gpu/drm/drm_atomic.c | 40 ++++++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/drm_debugfs.c | 9 +++++++++
include/drm/drm_atomic.h | 4 ++++
3 files changed, 53 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 3cc3cb5..117d429 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1565,6 +1565,46 @@ static void drm_atomic_print_state(const struct drm_atomic_state *state)
drm_atomic_connector_print_state(&p, connector_state);
}
+#ifdef CONFIG_DEBUG_FS
+static int drm_state_info(struct seq_file *m, void *data)
+{
+ struct drm_info_node *node = (struct drm_info_node *) m->private;
+ struct drm_device *dev = node->minor->dev;
+ struct drm_mode_config *config = &dev->mode_config;
+ struct drm_plane *plane;
+ struct drm_crtc *crtc;
+ struct drm_connector *connector;
+ struct drm_print p = drm_print_seq_file(m);
+
+ drm_modeset_lock_all(dev);
+
+ list_for_each_entry(plane, &config->plane_list, head)
+ drm_atomic_plane_print_state(&p, plane->state);
+
+ list_for_each_entry(crtc, &config->crtc_list, head)
+ drm_atomic_crtc_print_state(&p, crtc->state);
+
+ list_for_each_entry(connector, &config->connector_list, head)
+ drm_atomic_connector_print_state(&p, connector->state);
+
+ drm_modeset_unlock_all(dev);
+
+ return 0;
+}
+
+/* any use in debugfs files to dump individual planes/crtc/etc? */
+static const struct drm_info_list drm_atomic_debugfs_list[] = {
+ {"state", drm_state_info, 0},
+};
+
+int drm_atomic_debugfs_init(struct drm_minor *minor)
+{
+ return drm_debugfs_create_files(drm_atomic_debugfs_list,
+ ARRAY_SIZE(drm_atomic_debugfs_list),
+ minor->debugfs_root, minor);
+}
+#endif
+
/*
* The big monstor ioctl
*/
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index fa10cef..d8945a9 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -36,6 +36,7 @@
#include <linux/export.h>
#include <drm/drmP.h>
#include <drm/drm_edid.h>
+#include <drm/drm_atomic.h>
#include "drm_internal.h"
#if defined(CONFIG_DEBUG_FS)
@@ -163,6 +164,14 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
return ret;
}
+ if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
+ ret = drm_atomic_debugfs_init(minor);
+ if (ret) {
+ DRM_ERROR("Failed to create atomic debugfs files\n");
+ return ret;
+ }
+ }
+
if (dev->driver->debugfs_init) {
ret = dev->driver->debugfs_init(minor);
if (ret) {
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 856a9c8..68422f6 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -181,6 +181,10 @@ int __must_check drm_atomic_check_only(struct drm_atomic_state *state);
int __must_check drm_atomic_commit(struct drm_atomic_state *state);
int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);
+#ifdef CONFIG_DEBUG_FS
+int drm_atomic_debugfs_init(struct drm_minor *minor);
+#endif
+
#define for_each_connector_in_state(__state, connector, connector_state, __i) \
for ((__i) = 0; \
(__i) < (__state)->num_connector && \
--
2.7.4
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2016-10-14 23:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 23:55 [PATCH 0/6] drm: add atomic state logging and debugfs Rob Clark
2016-10-14 23:55 ` [PATCH 4/6] drm/atomic: add new drm_debug bit to dump atomic state before commit Rob Clark
2016-10-17 6:31 ` Daniel Vetter
2016-10-17 17:00 ` Sean Paul
[not found] ` <1476489353-16261-1-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-14 23:55 ` [PATCH 1/6] drm: helper macros to print composite types Rob Clark
2016-10-17 17:00 ` Sean Paul
2016-10-14 23:55 ` [PATCH 2/6] drm: add helper for printing to log or seq_file Rob Clark
2016-10-17 6:38 ` Daniel Vetter
2016-10-17 11:59 ` Rob Clark
2016-10-17 12:30 ` Daniel Vetter
2016-10-17 12:35 ` Rob Clark
[not found] ` <1476489353-16261-3-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-17 17:00 ` Sean Paul
2016-10-24 17:05 ` Rob Clark
2016-10-14 23:55 ` [PATCH 3/6] drm: add helpers to go from plane state to drm_rect Rob Clark
2016-10-17 17:00 ` Sean Paul
2016-10-14 23:55 ` Rob Clark [this message]
2016-10-17 17:00 ` [PATCH 5/6] drm/atomic: add debugfs file to dump out atomic state Sean Paul
2016-10-14 23:55 ` [PATCH 6/6] drm/msm/mdp5: add atomic_print_state support Rob Clark
[not found] ` <1476489353-16261-7-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-17 17:00 ` Sean Paul
2016-10-15 0:19 ` [PATCH 0/6] drm: add atomic state logging and debugfs Rob Clark
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=1476489353-16261-6-git-send-email-robdclark@gmail.com \
--to=robdclark-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=ville.syrjala-VuQAYsv1563Yd54FQh9/CA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.