[PATCH 04/13] drm: Add a -puts() function for the seq_file printer

2018-07-24 Thread Jordan Crouse
Add a puts() function to use seq_puts() to help speed up
up print time for constant strings.

Reviewed-by: Daniel Vetter 
Signed-off-by: Jordan Crouse 
---
 drivers/gpu/drm/drm_print.c | 6 ++
 include/drm/drm_print.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 4bcd960788ba..8ddeaba4bf9d 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -104,6 +104,12 @@ void __drm_printfn_coredump(struct drm_printer *p, struct 
va_format *vaf)
 }
 EXPORT_SYMBOL(__drm_printfn_coredump);
 
+void __drm_puts_seq_file(struct drm_printer *p, const char *str)
+{
+   seq_puts(p->arg, str);
+}
+EXPORT_SYMBOL(__drm_puts_seq_file);
+
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf)
 {
seq_printf(p->arg, "%pV", vaf);
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 06167a30f165..1834ec6244bf 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -76,6 +76,7 @@ struct drm_printer {
 
 void __drm_printfn_coredump(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
+void __drm_puts_seq_file(struct drm_printer *p, const char *str);
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
 
@@ -182,6 +183,7 @@ static inline struct drm_printer 
drm_seq_file_printer(struct seq_file *f)
 {
struct drm_printer p = {
.printfn = __drm_printfn_seq_file,
+   .puts = __drm_puts_seq_file,
.arg = f,
};
return p;
-- 
2.18.0

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


Re: [PATCH 04/13] drm: Add a -puts() function for the seq_file printer

2018-07-12 Thread Daniel Vetter
On Thu, Jul 12, 2018 at 12:59:21PM -0600, Jordan Crouse wrote:
> Add a puts() function to use seq_puts() to help speed up
> up print time for constant strings.
> 
> Signed-off-by: Jordan Crouse 

Reviewed-by: Daniel Vetter 

> ---
>  drivers/gpu/drm/drm_print.c | 6 ++
>  include/drm/drm_print.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index 8fd489248a50..bef8f0ec5d73 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -104,6 +104,12 @@ void __drm_printfn_coredump(struct drm_printer *p, 
> struct va_format *vaf)
>  }
>  EXPORT_SYMBOL(__drm_printfn_coredump);
>  
> +void __drm_puts_seq_file(struct drm_printer *p, const char *str)
> +{
> + seq_puts(p->arg, str);
> +}
> +EXPORT_SYMBOL(__drm_puts_seq_file);
> +
>  void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf)
>  {
>   seq_printf(p->arg, "%pV", vaf);
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index b16f4ecaa984..3bc6ba4b7b2c 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -76,6 +76,7 @@ struct drm_printer {
>  
>  void __drm_printfn_coredump(struct drm_printer *p, struct va_format *vaf);
>  void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
> +void __drm_puts_seq_file(struct drm_printer *p, const char *str);
>  void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
>  void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
>  
> @@ -144,6 +145,7 @@ static inline struct drm_printer 
> drm_seq_file_printer(struct seq_file *f)
>  {
>   struct drm_printer p = {
>   .printfn = __drm_printfn_seq_file,
> + .puts = __drm_puts_seq_file,
>   .arg = f,
>   };
>   return p;
> -- 
> 2.17.1
> 
> ___
> 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


[PATCH 04/13] drm: Add a -puts() function for the seq_file printer

2018-07-12 Thread Jordan Crouse
Add a puts() function to use seq_puts() to help speed up
up print time for constant strings.

Signed-off-by: Jordan Crouse 
---
 drivers/gpu/drm/drm_print.c | 6 ++
 include/drm/drm_print.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 8fd489248a50..bef8f0ec5d73 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -104,6 +104,12 @@ void __drm_printfn_coredump(struct drm_printer *p, struct 
va_format *vaf)
 }
 EXPORT_SYMBOL(__drm_printfn_coredump);
 
+void __drm_puts_seq_file(struct drm_printer *p, const char *str)
+{
+   seq_puts(p->arg, str);
+}
+EXPORT_SYMBOL(__drm_puts_seq_file);
+
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf)
 {
seq_printf(p->arg, "%pV", vaf);
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index b16f4ecaa984..3bc6ba4b7b2c 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -76,6 +76,7 @@ struct drm_printer {
 
 void __drm_printfn_coredump(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
+void __drm_puts_seq_file(struct drm_printer *p, const char *str);
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
 
@@ -144,6 +145,7 @@ static inline struct drm_printer 
drm_seq_file_printer(struct seq_file *f)
 {
struct drm_printer p = {
.printfn = __drm_printfn_seq_file,
+   .puts = __drm_puts_seq_file,
.arg = f,
};
return p;
-- 
2.17.1

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