* [PATCH v5 01/12] drm/vma-manager: drm_vma_node_start() constify argument
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 02/12] drm/framebuffer: drm_framebuffer_read_refcount() " Noralf Trønnes
` (11 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
Constify argument so functions calling into this take a const argument.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/drm/drm_vma_manager.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h
index d84d52f6d2b1..8758df94e9a0 100644
--- a/include/drm/drm_vma_manager.h
+++ b/include/drm/drm_vma_manager.h
@@ -152,7 +152,7 @@ static inline void drm_vma_node_reset(struct drm_vma_offset_node *node)
* Start address of @node for page-based addressing. 0 if the node does not
* have an offset allocated.
*/
-static inline unsigned long drm_vma_node_start(struct drm_vma_offset_node *node)
+static inline unsigned long drm_vma_node_start(const struct drm_vma_offset_node *node)
{
return node->vm_node.start;
}
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 02/12] drm/framebuffer: drm_framebuffer_read_refcount() constify argument
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 ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 03/12] drm/print: Add drm_printf_indent() Noralf Trønnes
` (10 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
Constify argument so functions calling into this take a const argument.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/drm/drm_framebuffer.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h
index b6996ddb19d6..6cce22e1a0f2 100644
--- a/include/drm/drm_framebuffer.h
+++ b/include/drm/drm_framebuffer.h
@@ -263,7 +263,7 @@ static inline void drm_framebuffer_unreference(struct drm_framebuffer *fb)
*
* This functions returns the framebuffer's reference count.
*/
-static inline uint32_t drm_framebuffer_read_refcount(struct drm_framebuffer *fb)
+static inline uint32_t drm_framebuffer_read_refcount(const struct drm_framebuffer *fb)
{
return kref_read(&fb->base.refcount);
}
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 03/12] drm/print: Add drm_printf_indent()
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 ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (9 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
Add drm_printf_indent() that adds tab indentation according to argument.
Indentation overflow is marked with an X.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/drm/drm_print.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 7b9c86a6ca3e..7dbfdebec973 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -80,6 +80,14 @@ void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
__printf(2, 3)
void drm_printf(struct drm_printer *p, const char *f, ...);
+/**
+ * drm_printf_indent - Print to a &drm_printer stream with indentation
+ * @printer: DRM printer
+ * @indent: Tab indentation level (max 5)
+ * @fmt: Format string
+ */
+#define drm_printf_indent(printer, indent, fmt, ...) \
+ drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t\t\tX", ##__VA_ARGS__)
/**
* drm_seq_file_printer - construct a &drm_printer that outputs to &seq_file
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (2 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 03/12] drm/print: Add drm_printf_indent() Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-11 18:55 ` Chris Wilson
2017-11-07 19:13 ` [PATCH v5 05/12] drm/atomic: Use drm_framebuffer_print_info() Noralf Trønnes
` (8 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
Add debugfs file that dumps info about the framebuffers and its planes.
Also dump info about any connected gem object(s).
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/drm_debugfs.c | 6 ++++
drivers/gpu/drm/drm_framebuffer.c | 59 +++++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/drm_gem.c | 17 +++++++++++
drivers/gpu/drm/drm_internal.h | 7 +++++
include/drm/drm_drv.h | 15 ++++++++++
5 files changed, 104 insertions(+)
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index c1807d5754b2..550f29de6c1f 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -158,6 +158,12 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
}
}
+ ret = drm_framebuffer_debugfs_init(minor);
+ if (ret) {
+ DRM_ERROR("Failed to create framebuffer debugfs file\n");
+ return ret;
+ }
+
if (dev->driver->debugfs_init) {
ret = dev->driver->debugfs_init(minor);
if (ret) {
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 40e6565105ac..c421dc01b334 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -25,7 +25,9 @@
#include <drm/drm_auth.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_atomic.h>
+#include <drm/drm_print.h>
+#include "drm_internal.h"
#include "drm_crtc_internal.h"
/**
@@ -956,3 +958,60 @@ int drm_framebuffer_plane_height(int height,
return fb_plane_height(height, fb->format, plane);
}
EXPORT_SYMBOL(drm_framebuffer_plane_height);
+
+void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
+ const struct drm_framebuffer *fb)
+{
+ struct drm_format_name_buf format_name;
+ unsigned int i;
+
+ drm_printf_indent(p, indent, "refcount=%u\n",
+ drm_framebuffer_read_refcount(fb));
+ drm_printf_indent(p, indent, "format=%s\n",
+ drm_get_format_name(fb->format->format, &format_name));
+ drm_printf_indent(p, indent, "modifier=0x%llx\n", fb->modifier);
+ drm_printf_indent(p, indent, "size=%ux%u\n", fb->width, fb->height);
+ drm_printf_indent(p, indent, "layers:\n");
+
+ for (i = 0; i < fb->format->num_planes; i++) {
+ drm_printf_indent(p, indent + 1, "size[%u]=%dx%d\n", i,
+ drm_framebuffer_plane_width(fb->width, fb, i),
+ drm_framebuffer_plane_height(fb->height, fb, i));
+ drm_printf_indent(p, indent + 1, "pitch[%u]=%u\n", i, fb->pitches[i]);
+ drm_printf_indent(p, indent + 1, "offset[%u]=%u\n", i, fb->offsets[i]);
+ drm_printf_indent(p, indent + 1, "obj[%u]:%s\n", i,
+ fb->obj[i] ? "" : "(null)");
+ if (fb->obj[i])
+ drm_gem_print_info(p, indent + 2, fb->obj[i]);
+ }
+}
+
+#ifdef CONFIG_DEBUG_FS
+static int drm_framebuffer_info(struct seq_file *m, void *data)
+{
+ struct drm_info_node *node = m->private;
+ struct drm_device *dev = node->minor->dev;
+ struct drm_printer p = drm_seq_file_printer(m);
+ struct drm_framebuffer *fb;
+
+ mutex_lock(&dev->mode_config.fb_lock);
+ drm_for_each_fb(fb, dev) {
+ drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+ drm_framebuffer_print_info(&p, 1, fb);
+ }
+ mutex_unlock(&dev->mode_config.fb_lock);
+
+ return 0;
+}
+
+static const struct drm_info_list drm_framebuffer_debugfs_list[] = {
+ { "framebuffer", drm_framebuffer_info, 0 },
+};
+
+int drm_framebuffer_debugfs_init(struct drm_minor *minor)
+{
+ return drm_debugfs_create_files(drm_framebuffer_debugfs_list,
+ ARRAY_SIZE(drm_framebuffer_debugfs_list),
+ minor->debugfs_root, minor);
+}
+#endif
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 4c84b23d37cc..01f8d9481211 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -40,6 +40,7 @@
#include <drm/drmP.h>
#include <drm/drm_vma_manager.h>
#include <drm/drm_gem.h>
+#include <drm/drm_print.h>
#include "drm_internal.h"
/** @file drm_gem.c
@@ -1040,3 +1041,19 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
return ret;
}
EXPORT_SYMBOL(drm_gem_mmap);
+
+void drm_gem_print_info(struct drm_printer *p, unsigned int indent,
+ const struct drm_gem_object *obj)
+{
+ drm_printf_indent(p, indent, "name=%d\n", obj->name);
+ drm_printf_indent(p, indent, "refcount=%u\n",
+ kref_read(&obj->refcount));
+ drm_printf_indent(p, indent, "start=%08lx\n",
+ drm_vma_node_start(&obj->vma_node));
+ drm_printf_indent(p, indent, "size=%zu\n", obj->size);
+ drm_printf_indent(p, indent, "imported=%s\n",
+ obj->import_attach ? "yes" : "no");
+
+ if (obj->dev->driver->gem_print_info)
+ obj->dev->driver->gem_print_info(p, indent, obj);
+}
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index fbc3f308fa19..430ce3fe4f3b 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -106,6 +106,8 @@ int drm_gem_open_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
+void drm_gem_print_info(struct drm_printer *p, unsigned int indent,
+ const struct drm_gem_object *obj);
/* drm_debugfs.c drm_debugfs_crc.c */
#if defined(CONFIG_DEBUG_FS)
@@ -173,3 +175,8 @@ int drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_private);
int drm_syncobj_signal_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_private);
+
+/* drm_framebuffer.c */
+void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
+ const struct drm_framebuffer *fb);
+int drm_framebuffer_debugfs_init(struct drm_minor *minor);
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 0e90ef24214b..1536e5bddeaf 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -39,6 +39,7 @@ struct drm_minor;
struct dma_buf_attachment;
struct drm_display_mode;
struct drm_mode_create_dumb;
+struct drm_printer;
/* driver capabilities and requirements mask */
#define DRIVER_USE_AGP 0x1
@@ -428,6 +429,20 @@ struct drm_driver {
*/
void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
+ /**
+ * @gem_print_info:
+ *
+ * If driver subclasses struct &drm_gem_object, it can implement this
+ * optional hook for printing additional driver specific info.
+ *
+ * drm_printf_indent() should be used in the callback passing it the
+ * indent argument.
+ *
+ * This callback is called from drm_gem_print_info().
+ */
+ void (*gem_print_info)(struct drm_printer *p, unsigned int indent,
+ const struct drm_gem_object *obj);
+
/**
* @gem_create_object: constructor for gem objects
*
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
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
0 siblings, 1 reply; 25+ messages in thread
From: Chris Wilson @ 2017-11-11 18:55 UTC (permalink / raw)
To: Noralf Trønnes, dri-devel
Cc: daniel.vetter, abrodkin, hoegsberg, jsarha, tomi.valkeinen,
laurent.pinchart, liviu.dudau
Quoting Noralf Trønnes (2017-11-07 19:13:40)
> Add debugfs file that dumps info about the framebuffers and its planes.
> Also dump info about any connected gem object(s).
This isn't too hot for non-modesetting drm drivers.
And isn't this growing a midlayer? Calling to the drivers instead of the
drivers controlling and calling helpers for the common stuff.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-11 18:55 ` Chris Wilson
@ 2017-11-13 19:54 ` Noralf Trønnes
2017-11-13 21:33 ` Chris Wilson
0 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-13 19:54 UTC (permalink / raw)
To: Chris Wilson, dri-devel
Cc: daniel.vetter, abrodkin, hoegsberg, jsarha, tomi.valkeinen,
laurent.pinchart, liviu.dudau
Den 11.11.2017 19.55, skrev Chris Wilson:
> Quoting Noralf Trønnes (2017-11-07 19:13:40)
>> Add debugfs file that dumps info about the framebuffers and its planes.
>> Also dump info about any connected gem object(s).
> This isn't too hot for non-modesetting drm drivers.
>
> And isn't this growing a midlayer? Calling to the drivers instead of the
> drivers controlling and calling helpers for the common stuff.
I really can't say, but Daniel asked me to do it like this:
https://lists.freedesktop.org/archives/dri-devel/2017-October/155245.html
Noralf.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-13 19:54 ` Noralf Trønnes
@ 2017-11-13 21:33 ` Chris Wilson
2017-11-13 22:12 ` Noralf Trønnes
0 siblings, 1 reply; 25+ messages in thread
From: Chris Wilson @ 2017-11-13 21:33 UTC (permalink / raw)
To: Noralf Trønnes, dri-devel
Cc: daniel.vetter, abrodkin, hoegsberg, jsarha, tomi.valkeinen,
laurent.pinchart, liviu.dudau
Quoting Noralf Trønnes (2017-11-13 19:54:43)
>
> Den 11.11.2017 19.55, skrev Chris Wilson:
> > Quoting Noralf Trønnes (2017-11-07 19:13:40)
> >> Add debugfs file that dumps info about the framebuffers and its planes.
> >> Also dump info about any connected gem object(s).
> > This isn't too hot for non-modesetting drm drivers.
Just to be clear; this is currently on fire in i915's CI. As
framebuffer-info is installed for vgem and vgem hasn't initialised any
of the data structs being inspected...
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-13 21:33 ` Chris Wilson
@ 2017-11-13 22:12 ` Noralf Trønnes
2017-11-13 22:17 ` Chris Wilson
0 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-13 22:12 UTC (permalink / raw)
To: Chris Wilson, dri-devel
Cc: daniel.vetter, abrodkin, hoegsberg, jsarha, tomi.valkeinen,
laurent.pinchart, liviu.dudau
Den 13.11.2017 22.33, skrev Chris Wilson:
> Quoting Noralf Trønnes (2017-11-13 19:54:43)
>> Den 11.11.2017 19.55, skrev Chris Wilson:
>>> Quoting Noralf Trønnes (2017-11-07 19:13:40)
>>>> Add debugfs file that dumps info about the framebuffers and its planes.
>>>> Also dump info about any connected gem object(s).
>>> This isn't too hot for non-modesetting drm drivers.
> Just to be clear; this is currently on fire in i915's CI. As
> framebuffer-info is installed for vgem and vgem hasn't initialised any
> of the data structs being inspected...
Ok, so I have broken vgem :-(
drm_framebuffer_info() takes dev->mode_config.fb_lock which hasn't been
initialized because vgem doesn't call drm_mode_config_init().
drm_mode_config_init() in addition to initializing various thing also
calls drm_mode_create_standard_properties().
Can we call drm_mode_config_init() in vgem or is this a no-go because of
the properties? Do you see a solution to this?
Sorry about the fallout.
Noralf.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-13 22:12 ` Noralf Trønnes
@ 2017-11-13 22:17 ` Chris Wilson
2017-11-13 22:31 ` Noralf Trønnes
0 siblings, 1 reply; 25+ messages in thread
From: Chris Wilson @ 2017-11-13 22:17 UTC (permalink / raw)
To: Noralf Trønnes, dri-devel
Cc: daniel.vetter, abrodkin, hoegsberg, jsarha, tomi.valkeinen,
laurent.pinchart, liviu.dudau
Quoting Noralf Trønnes (2017-11-13 22:12:06)
>
> Den 13.11.2017 22.33, skrev Chris Wilson:
> > Quoting Noralf Trønnes (2017-11-13 19:54:43)
> >> Den 11.11.2017 19.55, skrev Chris Wilson:
> >>> Quoting Noralf Trønnes (2017-11-07 19:13:40)
> >>>> Add debugfs file that dumps info about the framebuffers and its planes.
> >>>> Also dump info about any connected gem object(s).
> >>> This isn't too hot for non-modesetting drm drivers.
> > Just to be clear; this is currently on fire in i915's CI. As
> > framebuffer-info is installed for vgem and vgem hasn't initialised any
> > of the data structs being inspected...
>
> Ok, so I have broken vgem :-(
>
> drm_framebuffer_info() takes dev->mode_config.fb_lock which hasn't been
> initialized because vgem doesn't call drm_mode_config_init().
> drm_mode_config_init() in addition to initializing various thing also
> calls drm_mode_create_standard_properties().
>
> Can we call drm_mode_config_init() in vgem or is this a no-go because of
> the properties? Do you see a solution to this?
My quick fix idea was a drm_core_check_feature(dev, DRIVER_MODESET)
around the drm_framebuffer_debugfs_init().
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-13 22:17 ` Chris Wilson
@ 2017-11-13 22:31 ` Noralf Trønnes
2017-11-20 7:38 ` Daniel Vetter
0 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-13 22:31 UTC (permalink / raw)
To: Chris Wilson, dri-devel
Cc: daniel.vetter, abrodkin, hoegsberg, jsarha, tomi.valkeinen,
laurent.pinchart, liviu.dudau
Den 13.11.2017 23.17, skrev Chris Wilson:
> Quoting Noralf Trønnes (2017-11-13 22:12:06)
>> Den 13.11.2017 22.33, skrev Chris Wilson:
>>> Quoting Noralf Trønnes (2017-11-13 19:54:43)
>>>> Den 11.11.2017 19.55, skrev Chris Wilson:
>>>>> Quoting Noralf Trønnes (2017-11-07 19:13:40)
>>>>>> Add debugfs file that dumps info about the framebuffers and its planes.
>>>>>> Also dump info about any connected gem object(s).
>>>>> This isn't too hot for non-modesetting drm drivers.
>>> Just to be clear; this is currently on fire in i915's CI. As
>>> framebuffer-info is installed for vgem and vgem hasn't initialised any
>>> of the data structs being inspected...
>> Ok, so I have broken vgem :-(
>>
>> drm_framebuffer_info() takes dev->mode_config.fb_lock which hasn't been
>> initialized because vgem doesn't call drm_mode_config_init().
>> drm_mode_config_init() in addition to initializing various thing also
>> calls drm_mode_create_standard_properties().
>>
>> Can we call drm_mode_config_init() in vgem or is this a no-go because of
>> the properties? Do you see a solution to this?
> My quick fix idea was a drm_core_check_feature(dev, DRIVER_MODESET)
> around the drm_framebuffer_debugfs_init().
Ah, yes, thank you!
That sounds like a good idea. I will create a patch.
Noralf.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-13 22:31 ` Noralf Trønnes
@ 2017-11-20 7:38 ` Daniel Vetter
0 siblings, 0 replies; 25+ messages in thread
From: Daniel Vetter @ 2017-11-20 7:38 UTC (permalink / raw)
To: Noralf Trønnes
Cc: daniel.vetter, abrodkin, hoegsberg, dri-devel, tomi.valkeinen,
jsarha, liviu.dudau, laurent.pinchart
On Mon, Nov 13, 2017 at 11:31:28PM +0100, Noralf Trønnes wrote:
>
> Den 13.11.2017 23.17, skrev Chris Wilson:
> > Quoting Noralf Trønnes (2017-11-13 22:12:06)
> > > Den 13.11.2017 22.33, skrev Chris Wilson:
> > > > Quoting Noralf Trønnes (2017-11-13 19:54:43)
> > > > > Den 11.11.2017 19.55, skrev Chris Wilson:
> > > > > > Quoting Noralf Trønnes (2017-11-07 19:13:40)
> > > > > > > Add debugfs file that dumps info about the framebuffers and its planes.
> > > > > > > Also dump info about any connected gem object(s).
> > > > > > This isn't too hot for non-modesetting drm drivers.
> > > > Just to be clear; this is currently on fire in i915's CI. As
> > > > framebuffer-info is installed for vgem and vgem hasn't initialised any
> > > > of the data structs being inspected...
> > > Ok, so I have broken vgem :-(
> > >
> > > drm_framebuffer_info() takes dev->mode_config.fb_lock which hasn't been
> > > initialized because vgem doesn't call drm_mode_config_init().
> > > drm_mode_config_init() in addition to initializing various thing also
> > > calls drm_mode_create_standard_properties().
> > >
> > > Can we call drm_mode_config_init() in vgem or is this a no-go because of
> > > the properties? Do you see a solution to this?
> > My quick fix idea was a drm_core_check_feature(dev, DRIVER_MODESET)
> > around the drm_framebuffer_debugfs_init().
>
> Ah, yes, thank you!
> That sounds like a good idea. I will create a patch.
Yeah we need that check, same way we have it in all the ioctls. Sorry for
not spotting this, and yes we need our CI checking dri-devel patches, but
just not there yet :-/
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v5 05/12] drm/atomic: Use drm_framebuffer_print_info()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (3 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 04/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
@ 2017-11-07 19:13 ` 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
` (7 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
Use drm_framebuffer_print_info() to print framebuffer info in
drm_atomic_plane_print_state(). This will give optional GEM info as well.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/drm_atomic.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index fd96c3dad2fb..bf8ca515c958 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -33,6 +33,7 @@
#include <linux/sync_file.h>
#include "drm_crtc_internal.h"
+#include "drm_internal.h"
void __drm_crtc_commit_free(struct kref *kref)
{
@@ -935,21 +936,8 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,
drm_printf(p, "plane[%u]: %s\n", plane->base.id, plane->name);
drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)");
drm_printf(p, "\tfb=%u\n", state->fb ? state->fb->base.id : 0);
- if (state->fb) {
- struct drm_framebuffer *fb = state->fb;
- int i, n = fb->format->num_planes;
- struct drm_format_name_buf format_name;
-
- drm_printf(p, "\t\tformat=%s\n",
- drm_get_format_name(fb->format->format, &format_name));
- drm_printf(p, "\t\t\tmodifier=0x%llx\n", fb->modifier);
- drm_printf(p, "\t\tsize=%dx%d\n", fb->width, fb->height);
- drm_printf(p, "\t\tlayers:\n");
- for (i = 0; i < n; i++) {
- drm_printf(p, "\t\t\tpitch[%d]=%u\n", i, fb->pitches[i]);
- drm_printf(p, "\t\t\toffset[%d]=%u\n", i, fb->offsets[i]);
- }
- }
+ if (state->fb)
+ drm_framebuffer_print_info(p, 2, state->fb);
drm_printf(p, "\tcrtc-pos=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&dest));
drm_printf(p, "\tsrc-pos=" DRM_RECT_FP_FMT "\n", DRM_RECT_FP_ARG(&src));
drm_printf(p, "\trotation=%x\n", state->rotation);
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 06/12] drm/cma-helper: Turn to_drm_gem_cma_obj() into a macro
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (4 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 05/12] drm/atomic: Use drm_framebuffer_print_info() Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-08 6:21 ` Laurent Pinchart
2017-11-07 19:13 ` [PATCH v5 07/12] drm/cma-helper: Add drm_gem_cma_print_info() Noralf Trønnes
` (6 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
This allows the argument to be a const.
The other option was to keep it an inline function and make the argument
a const:
static inline struct drm_gem_cma_object *
to_drm_gem_cma_obj(const struct drm_gem_object *gem_obj)
{
return container_of(gem_obj, struct drm_gem_cma_object, base);
}
This will happily return a non-const pointer to the drm_gem_cma_object
based on a const pointer to the contained drm_gem_object, thus creating
const-safety problems.
There was an attempt to fix the problem in the container_of() macro
itself (see https://lkml.org/lkml/2017/5/19/381) but the patch seems to
have fallen through the cracks. It would require turning this inline
function into a macro.
By making this a macro now, we will benefit from a possible future
enhancement of container_of(). We don't loose type checking by doing
this, container_of() takes care of that.
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
include/drm/drm_gem_cma_helper.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 58a739bf15f1..7a3dcf0cf289 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -20,11 +20,8 @@ struct drm_gem_cma_object {
void *vaddr;
};
-static inline struct drm_gem_cma_object *
-to_drm_gem_cma_obj(struct drm_gem_object *gem_obj)
-{
- return container_of(gem_obj, struct drm_gem_cma_object, base);
-}
+#define to_drm_gem_cma_obj(gem_obj) \
+ container_of(gem_obj, struct drm_gem_cma_object, base)
#ifndef CONFIG_MMU
#define DRM_GEM_CMA_UNMAPPED_AREA_FOPS \
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v5 06/12] drm/cma-helper: Turn to_drm_gem_cma_obj() into a macro
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
0 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2017-11-08 6:21 UTC (permalink / raw)
To: Noralf Trønnes
Cc: daniel.vetter, tomi.valkeinen, hoegsberg, abrodkin, dri-devel,
liviu.dudau, jsarha
Hi Noralf,
Thank you for the patch.
On Tuesday, 7 November 2017 21:13:42 EET Noralf Trønnes wrote:
> This allows the argument to be a const.
>
> The other option was to keep it an inline function and make the argument
> a const:
>
> static inline struct drm_gem_cma_object *
> to_drm_gem_cma_obj(const struct drm_gem_object *gem_obj)
> {
> return container_of(gem_obj, struct drm_gem_cma_object, base);
> }
>
> This will happily return a non-const pointer to the drm_gem_cma_object
> based on a const pointer to the contained drm_gem_object, thus creating
> const-safety problems.
>
> There was an attempt to fix the problem in the container_of() macro
> itself (see https://lkml.org/lkml/2017/5/19/381) but the patch seems to
> have fallen through the cracks. It would require turning this inline
> function into a macro.
>
> By making this a macro now, we will benefit from a possible future
> enhancement of container_of(). We don't loose type checking by doing
> this, container_of() takes care of that.
>
> Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> include/drm/drm_gem_cma_helper.h | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/include/drm/drm_gem_cma_helper.h
> b/include/drm/drm_gem_cma_helper.h index 58a739bf15f1..7a3dcf0cf289 100644
> --- a/include/drm/drm_gem_cma_helper.h
> +++ b/include/drm/drm_gem_cma_helper.h
> @@ -20,11 +20,8 @@ struct drm_gem_cma_object {
> void *vaddr;
> };
>
> -static inline struct drm_gem_cma_object *
> -to_drm_gem_cma_obj(struct drm_gem_object *gem_obj)
> -{
> - return container_of(gem_obj, struct drm_gem_cma_object, base);
> -}
> +#define to_drm_gem_cma_obj(gem_obj) \
> + container_of(gem_obj, struct drm_gem_cma_object, base)
>
> #ifndef CONFIG_MMU
> #define DRM_GEM_CMA_UNMAPPED_AREA_FOPS \
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v5 07/12] drm/cma-helper: Add drm_gem_cma_print_info()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (5 preceding siblings ...)
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-07 19:13 ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 08/12] drm/arc: Use drm_gem_cma_print_info() Noralf Trønnes
` (5 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
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
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 08/12] drm/arc: Use drm_gem_cma_print_info()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (6 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 07/12] drm/cma-helper: Add drm_gem_cma_print_info() Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-07 19:31 ` Alexey Brodkin
2017-11-07 19:13 ` [PATCH v5 09/12] drm/arm/hdlcd: " Noralf Trønnes
` (4 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
There is a new core debugfs file that prints fb/gem info:
<debugfs>/dri/<n>/framebuffer
Use drm_gem_cma_print_info() to provide info to that output instead
of using drm_fb_cma_debugfs_show().
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/arc/arcpgu_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 074fd4ea7ece..f067de4e1e82 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -155,7 +155,6 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
static struct drm_info_list arcpgu_debugfs_list[] = {
{ "clocks", arcpgu_show_pxlclock, 0 },
- { "fb", drm_fb_cma_debugfs_show, 0 },
};
static int arcpgu_debugfs_init(struct drm_minor *minor)
@@ -180,6 +179,7 @@ static struct drm_driver arcpgu_drm_driver = {
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_free_object_unlocked = drm_gem_cma_free_object,
+ .gem_print_info = drm_gem_cma_print_info,
.gem_vm_ops = &drm_gem_cma_vm_ops,
.gem_prime_export = drm_gem_prime_export,
.gem_prime_import = drm_gem_prime_import,
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v5 08/12] drm/arc: Use drm_gem_cma_print_info()
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
0 siblings, 1 reply; 25+ messages in thread
From: Alexey Brodkin @ 2017-11-07 19:31 UTC (permalink / raw)
To: noralf
Cc: daniel.vetter, liviu.dudau, jsarha, tomi.valkeinen, hoegsberg,
dri-devel, laurent.pinchart
Hi Noralf,
On Tue, 2017-11-07 at 20:13 +0100, Noralf Trønnes wrote:
> There is a new core debugfs file that prints fb/gem info:
> <debugfs>/dri/<n>/framebuffer
>
> Use drm_gem_cma_print_info() to provide info to that output instead
> of using drm_fb_cma_debugfs_show().
>
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I think I acked the previous version but anyways,
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 08/12] drm/arc: Use drm_gem_cma_print_info()
2017-11-07 19:31 ` Alexey Brodkin
@ 2017-11-09 15:52 ` Noralf Trønnes
2017-11-09 16:44 ` Noralf Trønnes
0 siblings, 1 reply; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-09 15:52 UTC (permalink / raw)
To: Alexey Brodkin
Cc: daniel.vetter, liviu.dudau, jsarha, tomi.valkeinen, hoegsberg,
dri-devel, laurent.pinchart
Den 07.11.2017 20.31, skrev Alexey Brodkin:
> Hi Noralf,
>
> On Tue, 2017-11-07 at 20:13 +0100, Noralf Trønnes wrote:
>> There is a new core debugfs file that prints fb/gem info:
>> <debugfs>/dri/<n>/framebuffer
>>
>> Use drm_gem_cma_print_info() to provide info to that output instead
>> of using drm_fb_cma_debugfs_show().
>>
>> Cc: Alexey Brodkin <abrodkin@synopsys.com>
>> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> I think I acked the previous version but anyways,
>
> Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
>
Indeed you did, but somehow patchwork didn't catch it:
https://patchwork.freedesktop.org/patch/185349/
But the ml did:
https://lists.freedesktop.org/archives/dri-devel/2017-October/156438.html
I use patchwork to respin series because I get all ack/rb applied
automatically.
Thanks for re-acking :-)
Noralf.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v5 09/12] drm/arm/hdlcd: Use drm_gem_cma_print_info()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (7 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 08/12] drm/arc: Use drm_gem_cma_print_info() Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 10/12] drm/tilcdc: " Noralf Trønnes
` (3 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
There is a new core debugfs file that prints fb/gem info:
<debugfs>/dri/<n>/framebuffer
Use drm_gem_cma_print_info() to provide info to that output instead
of using drm_fb_cma_debugfs_show().
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/arm/hdlcd_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 764d0c83710c..59b21bdc0c30 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -230,7 +230,6 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
static struct drm_info_list hdlcd_debugfs_list[] = {
{ "interrupt_count", hdlcd_show_underrun_count, 0 },
{ "clocks", hdlcd_show_pxlclock, 0 },
- { "fb", drm_fb_cma_debugfs_show, 0 },
};
static int hdlcd_debugfs_init(struct drm_minor *minor)
@@ -252,6 +251,7 @@ static struct drm_driver hdlcd_driver = {
.irq_postinstall = hdlcd_irq_postinstall,
.irq_uninstall = hdlcd_irq_uninstall,
.gem_free_object_unlocked = drm_gem_cma_free_object,
+ .gem_print_info = drm_gem_cma_print_info,
.gem_vm_ops = &drm_gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 10/12] drm/tilcdc: Use drm_gem_cma_print_info()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (8 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 09/12] drm/arm/hdlcd: " Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-07 19:13 ` [PATCH v5 11/12] drm/tinydrm: " Noralf Trønnes
` (2 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
There is a new core debugfs file that prints fb/gem info:
<debugfs>/dri/<n>/framebuffer
Use drm_gem_cma_print_info() to provide info to that output instead
of using drm_fb_cma_debugfs_show().
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 72ce063aa0d8..bc4feb3a84b9 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -507,7 +507,6 @@ static int tilcdc_mm_show(struct seq_file *m, void *arg)
static struct drm_info_list tilcdc_debugfs_list[] = {
{ "regs", tilcdc_regs_show, 0 },
{ "mm", tilcdc_mm_show, 0 },
- { "fb", drm_fb_cma_debugfs_show, 0 },
};
static int tilcdc_debugfs_init(struct drm_minor *minor)
@@ -541,6 +540,7 @@ static struct drm_driver tilcdc_driver = {
.lastclose = tilcdc_lastclose,
.irq_handler = tilcdc_irq,
.gem_free_object_unlocked = drm_gem_cma_free_object,
+ .gem_print_info = drm_gem_cma_print_info,
.gem_vm_ops = &drm_gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 11/12] drm/tinydrm: Use drm_gem_cma_print_info()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (9 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 10/12] drm/tilcdc: " Noralf Trønnes
@ 2017-11-07 19:13 ` 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
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
There is a new core debugfs file that prints fb/gem info:
<debugfs>/dri/<n>/framebuffer
Use drm_gem_cma_print_info() to provide info to that output instead
of using drm_fb_cma_debugfs_show().
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/tinydrm/mipi-dbi.c | 8 +-------
include/drm/tinydrm/tinydrm.h | 1 +
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index d43e992ab432..347f9b226f26 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -961,10 +961,6 @@ static const struct file_operations mipi_dbi_debugfs_command_fops = {
.write = mipi_dbi_debugfs_command_write,
};
-static const struct drm_info_list mipi_dbi_debugfs_list[] = {
- { "fb", drm_fb_cma_debugfs_show, 0 },
-};
-
/**
* mipi_dbi_debugfs_init - Create debugfs entries
* @minor: DRM minor
@@ -987,9 +983,7 @@ int mipi_dbi_debugfs_init(struct drm_minor *minor)
debugfs_create_file("command", mode, minor->debugfs_root, mipi,
&mipi_dbi_debugfs_command_fops);
- return drm_debugfs_create_files(mipi_dbi_debugfs_list,
- ARRAY_SIZE(mipi_dbi_debugfs_list),
- minor->debugfs_root, minor);
+ return 0;
}
EXPORT_SYMBOL(mipi_dbi_debugfs_init);
diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h
index 4774fe3d4273..423828922e5a 100644
--- a/include/drm/tinydrm/tinydrm.h
+++ b/include/drm/tinydrm/tinydrm.h
@@ -46,6 +46,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)
*/
#define TINYDRM_GEM_DRIVER_OPS \
.gem_free_object = tinydrm_gem_cma_free_object, \
+ .gem_print_info = drm_gem_cma_print_info, \
.gem_vm_ops = &drm_gem_cma_vm_ops, \
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, \
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 12/12] drm/cma-helper: Remove drm_fb_cma_debugfs_show()
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (10 preceding siblings ...)
2017-11-07 19:13 ` [PATCH v5 11/12] drm/tinydrm: " Noralf Trønnes
@ 2017-11-07 19:13 ` Noralf Trønnes
2017-11-11 10:37 ` [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-07 19:13 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
drm_fb_cma_debugfs_show() and drm_gem_cma_describe() are superseded
by drm_framebuffer_debugfs_init() and drm_gem_cma_print_info().
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/drm_fb_cma_helper.c | 37 ------------------------------------
drivers/gpu/drm/drm_gem_cma_helper.c | 26 -------------------------
include/drm/drm_fb_cma_helper.h | 6 ------
include/drm/drm_gem_cma_helper.h | 4 ----
4 files changed, 73 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index 0e3c14174d08..35b56dfba929 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -130,43 +130,6 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
}
EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_addr);
-#ifdef CONFIG_DEBUG_FS
-static void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m)
-{
- int i;
-
- seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height,
- (char *)&fb->format->format);
-
- for (i = 0; i < fb->format->num_planes; i++) {
- seq_printf(m, " %d: offset=%d pitch=%d, obj: ",
- i, fb->offsets[i], fb->pitches[i]);
- drm_gem_cma_describe(drm_fb_cma_get_gem_obj(fb, i), m);
- }
-}
-
-/**
- * drm_fb_cma_debugfs_show() - Helper to list CMA framebuffer objects
- * in debugfs.
- * @m: output file
- * @arg: private data for the callback
- */
-int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg)
-{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct drm_device *dev = node->minor->dev;
- struct drm_framebuffer *fb;
-
- mutex_lock(&dev->mode_config.fb_lock);
- drm_for_each_fb(fb, dev)
- drm_fb_cma_describe(fb, m);
- mutex_unlock(&dev->mode_config.fb_lock);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(drm_fb_cma_debugfs_show);
-#endif
-
static int drm_fb_cma_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
return dma_mmap_writecombine(info->device, vma, info->screen_base,
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c
index 29f7b0fd3ad4..88ad88719605 100644
--- a/drivers/gpu/drm/drm_gem_cma_helper.c
+++ b/drivers/gpu/drm/drm_gem_cma_helper.c
@@ -397,32 +397,6 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp,
EXPORT_SYMBOL_GPL(drm_gem_cma_get_unmapped_area);
#endif
-#ifdef CONFIG_DEBUG_FS
-/**
- * drm_gem_cma_describe - describe a CMA GEM object for debugfs
- * @cma_obj: CMA GEM object
- * @m: debugfs file handle
- *
- * This function can be used to dump a human-readable representation of the
- * CMA GEM object into a synthetic file.
- */
-void drm_gem_cma_describe(struct drm_gem_cma_object *cma_obj,
- struct seq_file *m)
-{
- struct drm_gem_object *obj = &cma_obj->base;
- uint64_t off;
-
- off = drm_vma_node_start(&obj->vma_node);
-
- seq_printf(m, "%2d (%2d) %08llx %pad %p %zu",
- obj->name, kref_read(&obj->refcount),
- off, &cma_obj->paddr, cma_obj->vaddr, obj->size);
-
- seq_printf(m, "\n");
-}
-EXPORT_SYMBOL_GPL(drm_gem_cma_describe);
-#endif
-
/**
* drm_gem_cma_print_info() - Print &drm_gem_cma_object info for debugfs
* @p: DRM printer
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
index 023f052a5873..a613ff022e6c 100644
--- a/include/drm/drm_fb_cma_helper.h
+++ b/include/drm/drm_fb_cma_helper.h
@@ -35,11 +35,5 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
struct drm_plane_state *state,
unsigned int plane);
-#ifdef CONFIG_DEBUG_FS
-struct seq_file;
-
-int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
-#endif
-
#endif
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 40435f3480e5..76ded75f02cc 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -87,10 +87,6 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp,
unsigned long flags);
#endif
-#ifdef CONFIG_DEBUG_FS
-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);
--
2.14.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file
2017-11-07 19:13 [PATCH v5 00/12] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (11 preceding siblings ...)
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 ` Noralf Trønnes
12 siblings, 0 replies; 25+ messages in thread
From: Noralf Trønnes @ 2017-11-11 10:37 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, abrodkin, tomi.valkeinen, hoegsberg, jsarha,
liviu.dudau, laurent.pinchart
Den 07.11.2017 20.13, skrev Noralf Trønnes:
> This patchset adds a debugfs file that prints info about the
> framebuffers.
>
> Changes since version 4:
> - Add framebuffer debugfs file: Fix printk formats and add info about
> indent argument in gem_print_info callback docs (Laurent)
> - Turn to_drm_gem_cma_obj() into a macro (Laurent)
> - drm_gem_cma_print_info(): Make the cma_obj variable a const since it
> is derived from the obj variable which is a const.
>
> Changes since version 3:
> - Applied patch: drm/gem: Remove trailing whitespace
> - Turn drm_printf_indent() into a macro (Ville)
> - drm_printf_indent() add overflow marker (Jani)
> - Converted arc, hdlcd, tilcdc and removed drm_fb_cma_debugfs_show()
>
> Noralf Trønnes (12):
> drm/vma-manager: drm_vma_node_start() constify argument
> drm/framebuffer: drm_framebuffer_read_refcount() constify argument
> drm/print: Add drm_printf_indent()
> drm/framebuffer: Add framebuffer debugfs file
> drm/atomic: Use drm_framebuffer_print_info()
> drm/cma-helper: Turn to_drm_gem_cma_obj() into a macro
> drm/cma-helper: Add drm_gem_cma_print_info()
> drm/arc: Use drm_gem_cma_print_info()
> drm/arm/hdlcd: Use drm_gem_cma_print_info()
> drm/tilcdc: Use drm_gem_cma_print_info()
> drm/tinydrm: Use drm_gem_cma_print_info()
> drm/cma-helper: Remove drm_fb_cma_debugfs_show()
Series applied to drm-misc-next.
Thanks for reviewing!
Noralf.
> drivers/gpu/drm/arc/arcpgu_drv.c | 2 +-
> drivers/gpu/drm/arm/hdlcd_drv.c | 2 +-
> drivers/gpu/drm/drm_atomic.c | 18 ++---------
> drivers/gpu/drm/drm_debugfs.c | 6 ++++
> drivers/gpu/drm/drm_fb_cma_helper.c | 37 ----------------------
> drivers/gpu/drm/drm_framebuffer.c | 59 ++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/drm_gem.c | 17 +++++++++++
> drivers/gpu/drm/drm_gem_cma_helper.c | 31 ++++++++-----------
> drivers/gpu/drm/drm_internal.h | 7 +++++
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
> drivers/gpu/drm/tinydrm/mipi-dbi.c | 8 +----
> include/drm/drm_drv.h | 15 +++++++++
> include/drm/drm_fb_cma_helper.h | 6 ----
> include/drm/drm_framebuffer.h | 2 +-
> include/drm/drm_gem_cma_helper.h | 12 +++-----
> include/drm/drm_print.h | 8 +++++
> include/drm/drm_vma_manager.h | 2 +-
> include/drm/tinydrm/tinydrm.h | 1 +
> 18 files changed, 138 insertions(+), 97 deletions(-)
>
> --
> 2.14.2
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread