* [PATCH v3 1/8] drm/vma-manager: drm_vma_node_start() constify argument
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 2/8] drm/framebuffer: drm_framebuffer_read_refcount() " Noralf Trønnes
` (6 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Constify argument so functions calling into this take a const argument.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
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] 15+ messages in thread* [PATCH v3 2/8] drm/framebuffer: drm_framebuffer_read_refcount() constify argument
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 1/8] drm/vma-manager: drm_vma_node_start() constify argument Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 3/8] drm/gem: Remove trailing whitespace Noralf Trønnes
` (5 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Constify argument so functions calling into this take a const argument.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
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] 15+ messages in thread* [PATCH v3 3/8] drm/gem: Remove trailing whitespace
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 1/8] drm/vma-manager: drm_vma_node_start() constify argument Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 2/8] drm/framebuffer: drm_framebuffer_read_refcount() " Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 17:51 ` Ville Syrjälä
2017-10-26 16:57 ` [PATCH v3 4/8] drm/print: Add drm_printf_indent() Noralf Trønnes
` (4 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Remove two trailing spaces.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
drivers/gpu/drm/drm_gem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 55d6182555c7..4c84b23d37cc 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -348,7 +348,7 @@ EXPORT_SYMBOL_GPL(drm_gem_dumb_map_offset);
* @file: drm file-private structure to remove the dumb handle from
* @dev: corresponding drm_device
* @handle: the dumb handle to remove
- *
+ *
* This implements the &drm_driver.dumb_destroy kms driver callback for drivers
* which use gem to manage their backing storage.
*/
@@ -365,7 +365,7 @@ EXPORT_SYMBOL(drm_gem_dumb_destroy);
* @file_priv: drm file-private structure to register the handle for
* @obj: object to register
* @handlep: pointer to return the created handle to the caller
- *
+ *
* This expects the &drm_device.object_name_lock to be held already and will
* drop it before returning. Used to avoid races in establishing new handles
* when importing an object from either an flink name or a dma-buf.
--
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] 15+ messages in thread* Re: [PATCH v3 3/8] drm/gem: Remove trailing whitespace
2017-10-26 16:57 ` [PATCH v3 3/8] drm/gem: Remove trailing whitespace Noralf Trønnes
@ 2017-10-26 17:51 ` Ville Syrjälä
0 siblings, 0 replies; 15+ messages in thread
From: Ville Syrjälä @ 2017-10-26 17:51 UTC (permalink / raw)
To: Noralf Trønnes; +Cc: hoegsberg, dri-devel
On Thu, Oct 26, 2017 at 06:57:26PM +0200, Noralf Trønnes wrote:
> Remove two trailing spaces.
>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Patches 1-3 are
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_gem.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 55d6182555c7..4c84b23d37cc 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -348,7 +348,7 @@ EXPORT_SYMBOL_GPL(drm_gem_dumb_map_offset);
> * @file: drm file-private structure to remove the dumb handle from
> * @dev: corresponding drm_device
> * @handle: the dumb handle to remove
> - *
> + *
> * This implements the &drm_driver.dumb_destroy kms driver callback for drivers
> * which use gem to manage their backing storage.
> */
> @@ -365,7 +365,7 @@ EXPORT_SYMBOL(drm_gem_dumb_destroy);
> * @file_priv: drm file-private structure to register the handle for
> * @obj: object to register
> * @handlep: pointer to return the created handle to the caller
> - *
> + *
> * This expects the &drm_device.object_name_lock to be held already and will
> * drop it before returning. Used to avoid races in establishing new handles
> * when importing an object from either an flink name or a dma-buf.
> --
> 2.14.2
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 4/8] drm/print: Add drm_printf_indent()
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (2 preceding siblings ...)
2017-10-26 16:57 ` [PATCH v3 3/8] drm/gem: Remove trailing whitespace Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 17:49 ` Ville Syrjälä
2017-10-26 16:57 ` [PATCH v3 5/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (3 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Add drm_printf_indent() that adds tab indentation according to argument.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
drivers/gpu/drm/drm_print.c | 21 +++++++++++++++++++++
include/drm/drm_print.h | 2 ++
2 files changed, 23 insertions(+)
diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 0b3bf476dc4b..dac3ee98b30f 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -64,6 +64,27 @@ void drm_printf(struct drm_printer *p, const char *f, ...)
}
EXPORT_SYMBOL(drm_printf);
+/**
+ * drm_printf_indent - print to a &drm_printer stream with indentation
+ * @p: the &drm_printer
+ * @i: indentation
+ * @f: format string
+ */
+void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ drm_printf(p, "%.*s", i, "\t\t\t\t\t\t\t\t\t\t");
+
+ va_start(args, f);
+ vaf.fmt = f;
+ vaf.va = &args;
+ p->printfn(p, &vaf);
+ va_end(args);
+}
+EXPORT_SYMBOL(drm_printf_indent);
+
#define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
void drm_dev_printk(const struct device *dev, const char *level,
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 7b9c86a6ca3e..73dcd16eca49 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -79,6 +79,8 @@ 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, ...);
+__printf(3, 4)
+void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...);
/**
--
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] 15+ messages in thread* Re: [PATCH v3 4/8] drm/print: Add drm_printf_indent()
2017-10-26 16:57 ` [PATCH v3 4/8] drm/print: Add drm_printf_indent() Noralf Trønnes
@ 2017-10-26 17:49 ` Ville Syrjälä
2017-10-26 18:51 ` Noralf Trønnes
0 siblings, 1 reply; 15+ messages in thread
From: Ville Syrjälä @ 2017-10-26 17:49 UTC (permalink / raw)
To: Noralf Trønnes; +Cc: hoegsberg, dri-devel
On Thu, Oct 26, 2017 at 06:57:27PM +0200, Noralf Trønnes wrote:
> Add drm_printf_indent() that adds tab indentation according to argument.
>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
> drivers/gpu/drm/drm_print.c | 21 +++++++++++++++++++++
> include/drm/drm_print.h | 2 ++
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index 0b3bf476dc4b..dac3ee98b30f 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -64,6 +64,27 @@ void drm_printf(struct drm_printer *p, const char *f, ...)
> }
> EXPORT_SYMBOL(drm_printf);
>
> +/**
> + * drm_printf_indent - print to a &drm_printer stream with indentation
> + * @p: the &drm_printer
> + * @i: indentation
> + * @f: format string
> + */
> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...)
> +{
> + struct va_format vaf;
> + va_list args;
> +
> + drm_printf(p, "%.*s", i, "\t\t\t\t\t\t\t\t\t\t");
> +
> + va_start(args, f);
> + vaf.fmt = f;
> + vaf.va = &args;
> + p->printfn(p, &vaf);
> + va_end(args);
> +}
> +EXPORT_SYMBOL(drm_printf_indent);
The double printf() is rather unfortunate. Sadly I don't think there's
any proper way to manipulate a va_list to avoid that.
Hmm. Would it work if we simply make it a macro? Eg.
#define drm_printf_indent(printer, indent, fmt, ...) \
drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t", ##__VA_ARGS__)
The "\t\t\t..." thing is also rather off putting, but I guess it's
the best we can do if we want to keep it to one printf(). And maybe we
should have a check in there to make sure we have enought tabs in the
string to satisfy the indent level, or we just clamp the indent level
silently to something reasonable?
Oh, seeing the \t now reminds me that tabs won't necesarily get printed
out properly. At least I've seen fbcon just printing some weird blobs
instead of tabs. Not sure if it's just a matter of having a crappy font
or what. That said, the state dump code is using tabs already, so I guess
this wouldn't make it worse at least.
> +
> #define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
>
> void drm_dev_printk(const struct device *dev, const char *level,
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 7b9c86a6ca3e..73dcd16eca49 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -79,6 +79,8 @@ 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, ...);
> +__printf(3, 4)
> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...);
>
>
> /**
> --
> 2.14.2
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3 4/8] drm/print: Add drm_printf_indent()
2017-10-26 17:49 ` Ville Syrjälä
@ 2017-10-26 18:51 ` Noralf Trønnes
2017-10-26 19:13 ` Ville Syrjälä
0 siblings, 1 reply; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 18:51 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: hoegsberg, dri-devel
Den 26.10.2017 19.49, skrev Ville Syrjälä:
> On Thu, Oct 26, 2017 at 06:57:27PM +0200, Noralf Trønnes wrote:
>> Add drm_printf_indent() that adds tab indentation according to argument.
>>
>> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
>> ---
>> drivers/gpu/drm/drm_print.c | 21 +++++++++++++++++++++
>> include/drm/drm_print.h | 2 ++
>> 2 files changed, 23 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
>> index 0b3bf476dc4b..dac3ee98b30f 100644
>> --- a/drivers/gpu/drm/drm_print.c
>> +++ b/drivers/gpu/drm/drm_print.c
>> @@ -64,6 +64,27 @@ void drm_printf(struct drm_printer *p, const char *f, ...)
>> }
>> EXPORT_SYMBOL(drm_printf);
>>
>> +/**
>> + * drm_printf_indent - print to a &drm_printer stream with indentation
>> + * @p: the &drm_printer
>> + * @i: indentation
>> + * @f: format string
>> + */
>> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...)
>> +{
>> + struct va_format vaf;
>> + va_list args;
>> +
>> + drm_printf(p, "%.*s", i, "\t\t\t\t\t\t\t\t\t\t");
>> +
>> + va_start(args, f);
>> + vaf.fmt = f;
>> + vaf.va = &args;
>> + p->printfn(p, &vaf);
>> + va_end(args);
>> +}
>> +EXPORT_SYMBOL(drm_printf_indent);
> The double printf() is rather unfortunate. Sadly I don't think there's
> any proper way to manipulate a va_list to avoid that.
>
> Hmm. Would it work if we simply make it a macro? Eg.
>
> #define drm_printf_indent(printer, indent, fmt, ...) \
> drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t", ##__VA_ARGS__)
The macro worked fine and it looks like a better solution to me.
> The "\t\t\t..." thing is also rather off putting, but I guess it's
> the best we can do if we want to keep it to one printf(). And maybe we
> should have a check in there to make sure we have enought tabs in the
> string to satisfy the indent level, or we just clamp the indent level
> silently to something reasonable?
I put 10 tabs in my suggestion, which should be enough and I think it's
OK to just silently fail to do more. If 10 isn't enough it's easy to add
more for the developer that hits the limit.
Noralf.
> Oh, seeing the \t now reminds me that tabs won't necesarily get printed
> out properly. At least I've seen fbcon just printing some weird blobs
> instead of tabs. Not sure if it's just a matter of having a crappy font
> or what. That said, the state dump code is using tabs already, so I guess
> this wouldn't make it worse at least.
>
>> +
>> #define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
>>
>> void drm_dev_printk(const struct device *dev, const char *level,
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index 7b9c86a6ca3e..73dcd16eca49 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -79,6 +79,8 @@ 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, ...);
>> +__printf(3, 4)
>> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...);
>>
>>
>> /**
>> --
>> 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] 15+ messages in thread* Re: [PATCH v3 4/8] drm/print: Add drm_printf_indent()
2017-10-26 18:51 ` Noralf Trønnes
@ 2017-10-26 19:13 ` Ville Syrjälä
2017-10-27 9:44 ` Jani Nikula
0 siblings, 1 reply; 15+ messages in thread
From: Ville Syrjälä @ 2017-10-26 19:13 UTC (permalink / raw)
To: Noralf Trønnes; +Cc: hoegsberg, dri-devel
On Thu, Oct 26, 2017 at 08:51:57PM +0200, Noralf Trønnes wrote:
>
> Den 26.10.2017 19.49, skrev Ville Syrjälä:
> > On Thu, Oct 26, 2017 at 06:57:27PM +0200, Noralf Trønnes wrote:
> >> Add drm_printf_indent() that adds tab indentation according to argument.
> >>
> >> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> >> ---
> >> drivers/gpu/drm/drm_print.c | 21 +++++++++++++++++++++
> >> include/drm/drm_print.h | 2 ++
> >> 2 files changed, 23 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> >> index 0b3bf476dc4b..dac3ee98b30f 100644
> >> --- a/drivers/gpu/drm/drm_print.c
> >> +++ b/drivers/gpu/drm/drm_print.c
> >> @@ -64,6 +64,27 @@ void drm_printf(struct drm_printer *p, const char *f, ...)
> >> }
> >> EXPORT_SYMBOL(drm_printf);
> >>
> >> +/**
> >> + * drm_printf_indent - print to a &drm_printer stream with indentation
> >> + * @p: the &drm_printer
> >> + * @i: indentation
> >> + * @f: format string
> >> + */
> >> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...)
> >> +{
> >> + struct va_format vaf;
> >> + va_list args;
> >> +
> >> + drm_printf(p, "%.*s", i, "\t\t\t\t\t\t\t\t\t\t");
> >> +
> >> + va_start(args, f);
> >> + vaf.fmt = f;
> >> + vaf.va = &args;
> >> + p->printfn(p, &vaf);
> >> + va_end(args);
> >> +}
> >> +EXPORT_SYMBOL(drm_printf_indent);
> > The double printf() is rather unfortunate. Sadly I don't think there's
> > any proper way to manipulate a va_list to avoid that.
> >
> > Hmm. Would it work if we simply make it a macro? Eg.
> >
> > #define drm_printf_indent(printer, indent, fmt, ...) \
> > drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t", ##__VA_ARGS__)
>
> The macro worked fine and it looks like a better solution to me.
Only downside is that it bloats every format string. But as long
as there aren't a huge number of useless callers we should be fine.
>
> > The "\t\t\t..." thing is also rather off putting, but I guess it's
> > the best we can do if we want to keep it to one printf(). And maybe we
> > should have a check in there to make sure we have enought tabs in the
> > string to satisfy the indent level, or we just clamp the indent level
> > silently to something reasonable?
>
> I put 10 tabs in my suggestion, which should be enough and I think it's
> OK to just silently fail to do more. If 10 isn't enough it's easy to add
> more for the developer that hits the limit.
10 is probably even overkill. I'd say if you have to go past four or so
then there's alredy a bigger problem in the code ;)
>
> Noralf.
>
> > Oh, seeing the \t now reminds me that tabs won't necesarily get printed
> > out properly. At least I've seen fbcon just printing some weird blobs
> > instead of tabs. Not sure if it's just a matter of having a crappy font
> > or what. That said, the state dump code is using tabs already, so I guess
> > this wouldn't make it worse at least.
> >
> >> +
> >> #define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
> >>
> >> void drm_dev_printk(const struct device *dev, const char *level,
> >> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> >> index 7b9c86a6ca3e..73dcd16eca49 100644
> >> --- a/include/drm/drm_print.h
> >> +++ b/include/drm/drm_print.h
> >> @@ -79,6 +79,8 @@ 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, ...);
> >> +__printf(3, 4)
> >> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...);
> >>
> >>
> >> /**
> >> --
> >> 2.14.2
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3 4/8] drm/print: Add drm_printf_indent()
2017-10-26 19:13 ` Ville Syrjälä
@ 2017-10-27 9:44 ` Jani Nikula
0 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-10-27 9:44 UTC (permalink / raw)
To: Ville Syrjälä, Noralf Trønnes; +Cc: hoegsberg, dri-devel
On Thu, 26 Oct 2017, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Oct 26, 2017 at 08:51:57PM +0200, Noralf Trønnes wrote:
>>
>> Den 26.10.2017 19.49, skrev Ville Syrjälä:
>> > On Thu, Oct 26, 2017 at 06:57:27PM +0200, Noralf Trønnes wrote:
>> >> Add drm_printf_indent() that adds tab indentation according to argument.
>> >>
>> >> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
>> >> ---
>> >> drivers/gpu/drm/drm_print.c | 21 +++++++++++++++++++++
>> >> include/drm/drm_print.h | 2 ++
>> >> 2 files changed, 23 insertions(+)
>> >>
>> >> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
>> >> index 0b3bf476dc4b..dac3ee98b30f 100644
>> >> --- a/drivers/gpu/drm/drm_print.c
>> >> +++ b/drivers/gpu/drm/drm_print.c
>> >> @@ -64,6 +64,27 @@ void drm_printf(struct drm_printer *p, const char *f, ...)
>> >> }
>> >> EXPORT_SYMBOL(drm_printf);
>> >>
>> >> +/**
>> >> + * drm_printf_indent - print to a &drm_printer stream with indentation
>> >> + * @p: the &drm_printer
>> >> + * @i: indentation
>> >> + * @f: format string
>> >> + */
>> >> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...)
>> >> +{
>> >> + struct va_format vaf;
>> >> + va_list args;
>> >> +
>> >> + drm_printf(p, "%.*s", i, "\t\t\t\t\t\t\t\t\t\t");
>> >> +
>> >> + va_start(args, f);
>> >> + vaf.fmt = f;
>> >> + vaf.va = &args;
>> >> + p->printfn(p, &vaf);
>> >> + va_end(args);
>> >> +}
>> >> +EXPORT_SYMBOL(drm_printf_indent);
>> > The double printf() is rather unfortunate. Sadly I don't think there's
>> > any proper way to manipulate a va_list to avoid that.
>> >
>> > Hmm. Would it work if we simply make it a macro? Eg.
>> >
>> > #define drm_printf_indent(printer, indent, fmt, ...) \
>> > drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t", ##__VA_ARGS__)
>>
>> The macro worked fine and it looks like a better solution to me.
>
> Only downside is that it bloats every format string. But as long
> as there aren't a huge number of useless callers we should be fine.
>
>>
>> > The "\t\t\t..." thing is also rather off putting, but I guess it's
>> > the best we can do if we want to keep it to one printf(). And maybe we
>> > should have a check in there to make sure we have enought tabs in the
>> > string to satisfy the indent level, or we just clamp the indent level
>> > silently to something reasonable?
>>
>> I put 10 tabs in my suggestion, which should be enough and I think it's
>> OK to just silently fail to do more. If 10 isn't enough it's easy to add
>> more for the developer that hits the limit.
>
> 10 is probably even overkill. I'd say if you have to go past four or so
> then there's alredy a bigger problem in the code ;)
Just put some non-tab character at the end of the tab string? Dunno, +
or * or something, just to draw attention to it instead of just silently
failing to indent.
Overall I think this is a neat way to do indents.
BR,
Jani.
>
>>
>> Noralf.
>>
>> > Oh, seeing the \t now reminds me that tabs won't necesarily get printed
>> > out properly. At least I've seen fbcon just printing some weird blobs
>> > instead of tabs. Not sure if it's just a matter of having a crappy font
>> > or what. That said, the state dump code is using tabs already, so I guess
>> > this wouldn't make it worse at least.
>> >
>> >> +
>> >> #define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
>> >>
>> >> void drm_dev_printk(const struct device *dev, const char *level,
>> >> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> >> index 7b9c86a6ca3e..73dcd16eca49 100644
>> >> --- a/include/drm/drm_print.h
>> >> +++ b/include/drm/drm_print.h
>> >> @@ -79,6 +79,8 @@ 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, ...);
>> >> +__printf(3, 4)
>> >> +void drm_printf_indent(struct drm_printer *p, unsigned int i, const char *f, ...);
>> >>
>> >>
>> >> /**
>> >> --
>> >> 2.14.2
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 5/8] drm/framebuffer: Add framebuffer debugfs file
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (3 preceding siblings ...)
2017-10-26 16:57 ` [PATCH v3 4/8] drm/print: Add drm_printf_indent() Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 6/8] drm/atomic: Use drm_framebuffer_print_info() Noralf Trønnes
` (2 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Add debugfs file that dumps info about the framebuffers and its planes.
Also dump info about any connected gem object(s).
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
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 | 11 ++++++++
5 files changed, 100 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 af279844d7ce..4f7873a1b922 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"
/**
@@ -955,3 +957,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;
+ int i;
+
+ drm_printf_indent(p, indent, "refcount=%d\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=%dx%d\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[%d]=%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[%d]=%u\n", i, fb->pitches[i]);
+ drm_printf_indent(p, indent + 1, "offset[%d]=%u\n", i, fb->offsets[i]);
+ drm_printf_indent(p, indent + 1, "obj[%d]:%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[%d]:\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..152bd6210dde 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=%d\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..434de999c3ba 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,16 @@ 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.
+ * See 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] 15+ messages in thread* [PATCH v3 6/8] drm/atomic: Use drm_framebuffer_print_info()
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (4 preceding siblings ...)
2017-10-26 16:57 ` [PATCH v3 5/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 7/8] drm/cma-helper: Add drm_gem_cma_print_info() Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 8/8] drm/tinydrm: Use drm_gem_cma_print_info() Noralf Trønnes
7 siblings, 0 replies; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Use drm_framebuffer_print_info() to print framebuffer info in
drm_atomic_plane_print_state(). This will give optional GEM info as well.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
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 6c9c4a8e09af..6d626355ba4e 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)
{
@@ -934,21 +935,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] 15+ messages in thread* [PATCH v3 7/8] drm/cma-helper: Add drm_gem_cma_print_info()
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (5 preceding siblings ...)
2017-10-26 16:57 ` [PATCH v3 6/8] drm/atomic: Use drm_framebuffer_print_info() Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-26 16:57 ` [PATCH v3 8/8] drm/tinydrm: Use drm_gem_cma_print_info() Noralf Trønnes
7 siblings, 0 replies; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Add drm_gem_cma_print_info() for debugfs printing
struct drm_gem_cma_object specific info.
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 | 5 ++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c
index 020e7668dfab..89dc7f04fae6 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)
+{
+ 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 58a739bf15f1..bc47e6eba271 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -21,7 +21,7 @@ struct drm_gem_cma_object {
};
static inline struct drm_gem_cma_object *
-to_drm_gem_cma_obj(struct drm_gem_object *gem_obj)
+to_drm_gem_cma_obj(const struct drm_gem_object *gem_obj)
{
return container_of(gem_obj, struct drm_gem_cma_object, base);
}
@@ -94,6 +94,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] 15+ messages in thread* [PATCH v3 8/8] drm/tinydrm: Use drm_gem_cma_print_info()
2017-10-26 16:57 [PATCH v3 0/8] drm/framebuffer: Add framebuffer debugfs file Noralf Trønnes
` (6 preceding siblings ...)
2017-10-26 16:57 ` [PATCH v3 7/8] drm/cma-helper: Add drm_gem_cma_print_info() Noralf Trønnes
@ 2017-10-26 16:57 ` Noralf Trønnes
2017-10-30 10:31 ` Daniel Vetter
7 siblings, 1 reply; 15+ messages in thread
From: Noralf Trønnes @ 2017-10-26 16:57 UTC (permalink / raw)
To: dri-devel; +Cc: hoegsberg
Use drm_gem_cma_print_info() instead of drm_fb_cma_debugfs_show()
to print framebuffer/gem info to debugfs. The debugfs file is now:
<debugfs>/dri/<n>/framebuffer
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
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] 15+ messages in thread* Re: [PATCH v3 8/8] drm/tinydrm: Use drm_gem_cma_print_info()
2017-10-26 16:57 ` [PATCH v3 8/8] drm/tinydrm: Use drm_gem_cma_print_info() Noralf Trønnes
@ 2017-10-30 10:31 ` Daniel Vetter
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2017-10-30 10:31 UTC (permalink / raw)
To: Noralf Trønnes; +Cc: hoegsberg, dri-devel
On Thu, Oct 26, 2017 at 06:57:31PM +0200, Noralf Trønnes wrote:
> Use drm_gem_cma_print_info() instead of drm_fb_cma_debugfs_show()
> to print framebuffer/gem info to debugfs. The debugfs file is now:
> <debugfs>/dri/<n>/framebuffer
>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
> 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, \
I think a DRM_GEM_CMA_DRIVER_OPS like we have for FOPS might be nice
eventually. But probably better to go through with all the other
refactoring. For patches 4-8 (since Ville reviewed the first 3 already):
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> --
> 2.14.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
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] 15+ messages in thread