Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-30 Thread Peilin Ye
On Mon, Nov 30, 2020 at 08:56:45AM +0100, Sam Ravnborg wrote:
> Please just keep up the good work cleaning up fbcon and related stuff.
> This is an area that needs some love and care and there is work for many
> long nights yet to do.

Thanks! I will see what I can do,

Peilin Ye

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


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Sam Ravnborg
Hi Peilin,
On Mon, Nov 30, 2020 at 01:38:05AM -0500, Peilin Ye wrote:
> Hi Sam,
> 
> On Sun, Nov 29, 2020 at 12:18:36PM +0100, Sam Ravnborg wrote:
> > On Sun, Nov 29, 2020 at 07:28:08PM +0900, Tetsuo Handa wrote:
> > > But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from 
> > > being printed
> > > when FBCONDEBUG is defined. Is such change what the author of this module 
> > > expects?
> > 
> > When someone goes and enable DEBUG for fbcon they are also able to
> > recognize the logging, so the printing of the function name is redundant
> > in this case.
> > 
> > There is likely limited to no use for these few logging entries, but if
> > they should be dropped then I expect Peilin Ye to do so as he is the
> > only one doing active maintenance of fbcon lately.
> 
> Sure, I will take another look at them. Also sorry for the delay in that
> printk() -> dev_*() patch you suggested, overwhelmed by some other
> things this week. Sometimes fbcon.c accesses dev structs in a pretty
> weird way (e.g. registered_fb[con2fb_map[vc->vc_num]]->dev), I will get
> back to it when I understand this better.
Please just keep up the good work cleaning up fbcon and related stuff.
This is an area that needs some love and care and there is work for many
long nights yet to do.

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


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Peilin Ye
Hi Sam,

On Sun, Nov 29, 2020 at 12:18:36PM +0100, Sam Ravnborg wrote:
> On Sun, Nov 29, 2020 at 07:28:08PM +0900, Tetsuo Handa wrote:
> > But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from 
> > being printed
> > when FBCONDEBUG is defined. Is such change what the author of this module 
> > expects?
> 
> When someone goes and enable DEBUG for fbcon they are also able to
> recognize the logging, so the printing of the function name is redundant
> in this case.
> 
> There is likely limited to no use for these few logging entries, but if
> they should be dropped then I expect Peilin Ye to do so as he is the
> only one doing active maintenance of fbcon lately.

Sure, I will take another look at them. Also sorry for the delay in that
printk() -> dev_*() patch you suggested, overwhelmed by some other
things this week. Sometimes fbcon.c accesses dev structs in a pretty
weird way (e.g. registered_fb[con2fb_map[vc->vc_num]]->dev), I will get
back to it when I understand this better.

Thanks,
Peilin Ye

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


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Tetsuo Handa
On 2020/11/29 19:03, Thomas Zimmermann wrote:
> Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
>> Replacing DPRINTK() statements with pr_debug fixes set but not used
>> warnings.  And moves to a more standard logging setup at the same time.
> 
> I guess this was added for quick debugging during development. Anyway, I 
> never liked these kinds of hacks.
> 
> Acked-by: Thomas Zimmermann 
> 

But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being 
printed
when FBCONDEBUG is defined. Is such change what the author of this module 
expects?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Sam Ravnborg
On Sun, Nov 29, 2020 at 11:03:25AM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> > Replacing DPRINTK() statements with pr_debug fixes set but not used
> > warnings.  And moves to a more standard logging setup at the same time.
> > 
> > v2:
> >- Fix indent (Joe)
> > 
> > Signed-off-by: Sam Ravnborg 
> > Cc: Joe Perches 
> > Cc: Greg Kroah-Hartman 
> > Cc: Daniel Vetter 
> > Cc: Bartlomiej Zolnierkiewicz 
> > Cc: Sam Ravnborg 
> > Cc: Jiri Slaby 
> > Cc: Peilin Ye 
> > Cc: Tetsuo Handa 
> > Cc: George Kennedy 
> > Cc: Nathan Chancellor 
> > Cc: Peter Rosin 
> > ---
> >   drivers/video/fbdev/core/fbcon.c | 25 -
> >   1 file changed, 8 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/core/fbcon.c 
> > b/drivers/video/fbdev/core/fbcon.c
> > index bf61598bf1c3..44a5cd2f54cc 100644
> > --- a/drivers/video/fbdev/core/fbcon.c
> > +++ b/drivers/video/fbdev/core/fbcon.c
> > @@ -56,8 +56,6 @@
> >*  more details.
> >*/
> > -#undef FBCONDEBUG
> > -
> 
> I guess this was added for quick debugging during development. Anyway, I
> never liked these kinds of hacks.
> 
> Acked-by: Thomas Zimmermann 

Thanks, applied to drm-misc-next.

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


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Sam Ravnborg
Hi Tetsuo,
On Sun, Nov 29, 2020 at 07:28:08PM +0900, Tetsuo Handa wrote:
> On 2020/11/29 19:03, Thomas Zimmermann wrote:
> > Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> >> Replacing DPRINTK() statements with pr_debug fixes set but not used
> >> warnings.  And moves to a more standard logging setup at the same time.
> > 
> > I guess this was added for quick debugging during development. Anyway, I 
> > never liked these kinds of hacks.
> > 
> > Acked-by: Thomas Zimmermann 
> > 
> 
> But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being 
> printed
> when FBCONDEBUG is defined. Is such change what the author of this module 
> expects?

When someone goes and enable DEBUG for fbcon they are also able to
recognize the logging, so the printing of the function name is redundant
in this case.

There is likely limited to no use for these few logging entries, but if
they should be dropped then I expect Peilin Ye to do so as he is the
only one doing active maintenance of fbcon lately.

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


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Thomas Zimmermann



Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Replacing DPRINTK() statements with pr_debug fixes set but not used
warnings.  And moves to a more standard logging setup at the same time.

v2:
   - Fix indent (Joe)

Signed-off-by: Sam Ravnborg 
Cc: Joe Perches 
Cc: Greg Kroah-Hartman 
Cc: Daniel Vetter 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Jiri Slaby 
Cc: Peilin Ye 
Cc: Tetsuo Handa 
Cc: George Kennedy 
Cc: Nathan Chancellor 
Cc: Peter Rosin 
---
  drivers/video/fbdev/core/fbcon.c | 25 -
  1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bf61598bf1c3..44a5cd2f54cc 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -56,8 +56,6 @@
   *  more details.
   */
  
-#undef FBCONDEBUG

-


I guess this was added for quick debugging during development. Anyway, I 
never liked these kinds of hacks.


Acked-by: Thomas Zimmermann 


  #include 
  #include 
  #include 
@@ -82,12 +80,6 @@
  
  #include "fbcon.h"
  
-#ifdef FBCONDEBUG

-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## 
args)
-#else
-#  define DPRINTK(fmt, args...)
-#endif
-
  /*
   * FIXME: Locking
   *
@@ -1015,11 +1007,11 @@ static const char *fbcon_startup(void)
rows /= vc->vc_font.height;
vc_resize(vc, cols, rows);
  
-	DPRINTK("mode:   %s\n", info->fix.id);

-   DPRINTK("visual: %d\n", info->fix.visual);
-   DPRINTK("res:%dx%d-%d\n", info->var.xres,
-   info->var.yres,
-   info->var.bits_per_pixel);
+   pr_debug("mode:   %s\n", info->fix.id);
+   pr_debug("visual: %d\n", info->fix.visual);
+   pr_debug("res:%dx%d-%d\n", info->var.xres,
+info->var.yres,
+info->var.bits_per_pixel);
  
  	fbcon_add_cursor_timer(info);

return display_desc;
@@ -2013,7 +2005,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
y_diff < 0 || y_diff > virt_fh) {
const struct fb_videomode *mode;
  
-		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);

+   pr_debug("attempting resize %ix%i\n", var.xres, var.yres);
mode = fb_find_best_mode(, >modelist);
if (mode == NULL)
return -EINVAL;
@@ -2023,7 +2015,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
if (virt_w > var.xres/virt_fw || virt_h > var.yres/virt_fh)
return -EINVAL;
  
-		DPRINTK("resize now %ix%i\n", var.xres, var.yres);

+   pr_debug("resize now %ix%i\n", var.xres, var.yres);
if (con_is_visible(vc)) {
var.activate = FB_ACTIVATE_NOW |
FB_ACTIVATE_FORCE;
@@ -3299,8 +3291,7 @@ static void fbcon_exit(void)
  
  		if (info->queue.func)

pending = cancel_work_sync(>queue);
-   DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
-   "no"));
+   pr_debug("fbcon: %s pending work\n", (pending ? "canceled" : 
"no"));
  
  		for (j = first_fb_vc; j <= last_fb_vc; j++) {

if (con2fb_map[j] == i) {



--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer



OpenPGP_signature
Description: OpenPGP digital signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-28 Thread Sam Ravnborg
Replacing DPRINTK() statements with pr_debug fixes set but not used
warnings.  And moves to a more standard logging setup at the same time.

v2:
  - Fix indent (Joe)

Signed-off-by: Sam Ravnborg 
Cc: Joe Perches 
Cc: Greg Kroah-Hartman 
Cc: Daniel Vetter 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Jiri Slaby 
Cc: Peilin Ye 
Cc: Tetsuo Handa 
Cc: George Kennedy 
Cc: Nathan Chancellor 
Cc: Peter Rosin 
---
 drivers/video/fbdev/core/fbcon.c | 25 -
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bf61598bf1c3..44a5cd2f54cc 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -56,8 +56,6 @@
  *  more details.
  */
 
-#undef FBCONDEBUG
-
 #include 
 #include 
 #include 
@@ -82,12 +80,6 @@
 
 #include "fbcon.h"
 
-#ifdef FBCONDEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## 
args)
-#else
-#  define DPRINTK(fmt, args...)
-#endif
-
 /*
  * FIXME: Locking
  *
@@ -1015,11 +1007,11 @@ static const char *fbcon_startup(void)
rows /= vc->vc_font.height;
vc_resize(vc, cols, rows);
 
-   DPRINTK("mode:   %s\n", info->fix.id);
-   DPRINTK("visual: %d\n", info->fix.visual);
-   DPRINTK("res:%dx%d-%d\n", info->var.xres,
-   info->var.yres,
-   info->var.bits_per_pixel);
+   pr_debug("mode:   %s\n", info->fix.id);
+   pr_debug("visual: %d\n", info->fix.visual);
+   pr_debug("res:%dx%d-%d\n", info->var.xres,
+info->var.yres,
+info->var.bits_per_pixel);
 
fbcon_add_cursor_timer(info);
return display_desc;
@@ -2013,7 +2005,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
y_diff < 0 || y_diff > virt_fh) {
const struct fb_videomode *mode;
 
-   DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
+   pr_debug("attempting resize %ix%i\n", var.xres, var.yres);
mode = fb_find_best_mode(, >modelist);
if (mode == NULL)
return -EINVAL;
@@ -2023,7 +2015,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
if (virt_w > var.xres/virt_fw || virt_h > var.yres/virt_fh)
return -EINVAL;
 
-   DPRINTK("resize now %ix%i\n", var.xres, var.yres);
+   pr_debug("resize now %ix%i\n", var.xres, var.yres);
if (con_is_visible(vc)) {
var.activate = FB_ACTIVATE_NOW |
FB_ACTIVATE_FORCE;
@@ -3299,8 +3291,7 @@ static void fbcon_exit(void)
 
if (info->queue.func)
pending = cancel_work_sync(>queue);
-   DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
-   "no"));
+   pr_debug("fbcon: %s pending work\n", (pending ? "canceled" : 
"no"));
 
for (j = first_fb_vc; j <= last_fb_vc; j++) {
if (con2fb_map[j] == i) {
-- 
2.27.0

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