All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch, abrodkin@synopsys.com,
	tomi.valkeinen@ti.com, hoegsberg@gmail.com, jsarha@ti.com,
	liviu.dudau@arm.com, laurent.pinchart@ideasonboard.com
Subject: [PATCH v5 07/12] drm/cma-helper: Add drm_gem_cma_print_info()
Date: Tue,  7 Nov 2017 20:13:43 +0100	[thread overview]
Message-ID: <20171107191348.17555-8-noralf@tronnes.org> (raw)
In-Reply-To: <20171107191348.17555-1-noralf@tronnes.org>

Add drm_gem_cma_print_info() for debugfs printing
struct drm_gem_cma_object specific info.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/drm_gem_cma_helper.c | 19 +++++++++++++++++++
 include/drm/drm_gem_cma_helper.h     |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c
index 020e7668dfab..29f7b0fd3ad4 100644
--- a/drivers/gpu/drm/drm_gem_cma_helper.c
+++ b/drivers/gpu/drm/drm_gem_cma_helper.c
@@ -423,6 +423,25 @@ void drm_gem_cma_describe(struct drm_gem_cma_object *cma_obj,
 EXPORT_SYMBOL_GPL(drm_gem_cma_describe);
 #endif
 
+/**
+ * drm_gem_cma_print_info() - Print &drm_gem_cma_object info for debugfs
+ * @p: DRM printer
+ * @indent: Tab indentation level
+ * @gem: GEM object
+ *
+ * This function can be used as the &drm_driver->gem_print_info callback.
+ * It prints paddr and vaddr for use in e.g. debugfs output.
+ */
+void drm_gem_cma_print_info(struct drm_printer *p, unsigned int indent,
+			    const struct drm_gem_object *obj)
+{
+	const struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj);
+
+	drm_printf_indent(p, indent, "paddr=%pad\n", &cma_obj->paddr);
+	drm_printf_indent(p, indent, "vaddr=%p\n", cma_obj->vaddr);
+}
+EXPORT_SYMBOL(drm_gem_cma_print_info);
+
 /**
  * drm_gem_cma_prime_get_sg_table - provide a scatter/gather table of pinned
  *     pages for a CMA GEM object
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 7a3dcf0cf289..40435f3480e5 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -91,6 +91,9 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp,
 void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m);
 #endif
 
+void drm_gem_cma_print_info(struct drm_printer *p, unsigned int indent,
+			    const struct drm_gem_object *obj);
+
 struct sg_table *drm_gem_cma_prime_get_sg_table(struct drm_gem_object *obj);
 struct drm_gem_object *
 drm_gem_cma_prime_import_sg_table(struct drm_device *dev,
-- 
2.14.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-11-07 19:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 01/12] drm/vma-manager: drm_vma_node_start() constify argument Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 02/12] drm/framebuffer: drm_framebuffer_read_refcount() " Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 03/12] drm/print: Add drm_printf_indent() Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
2017-11-11 18:55   ` Chris Wilson
2017-11-13 19:54     ` Noralf Trønnes
2017-11-13 21:33       ` Chris Wilson
2017-11-13 22:12         ` Noralf Trønnes
2017-11-13 22:17           ` Chris Wilson
2017-11-13 22:31             ` Noralf Trønnes
2017-11-20  7:38               ` Daniel Vetter
2017-11-07 19:13 ` [PATCH v5 05/12] drm/atomic: Use drm_framebuffer_print_info() Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 06/12] drm/cma-helper: Turn to_drm_gem_cma_obj() into a macro Noralf Trønnes
2017-11-08  6:21   ` Laurent Pinchart
2017-11-07 19:13 ` Noralf Trønnes [this message]
2017-11-07 19:13 ` [PATCH v5 08/12] drm/arc: Use drm_gem_cma_print_info() Noralf Trønnes
2017-11-07 19:31   ` Alexey Brodkin
2017-11-09 15:52     ` Noralf Trønnes
2017-11-09 16:44       ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 09/12] drm/arm/hdlcd: " Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 10/12] drm/tilcdc: " Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 11/12] drm/tinydrm: " Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 12/12] drm/cma-helper: Remove drm_fb_cma_debugfs_show() Noralf Trønnes
2017-11-11 10:37 ` [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes

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=20171107191348.17555-8-noralf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=abrodkin@synopsys.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@gmail.com \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=liviu.dudau@arm.com \
    --cc=tomi.valkeinen@ti.com \
    /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.