Skip to contentSkip to conversation

video/radeon_base: replace MS_TO_HZ() with msecs_to_jiffies()

PATCH In review [email protected] 3 participants 4 messages Sep 24, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 3/21 video/radeon_base: replace MS_TO_HZ() with msecs_to_jiffies()

I would appreciate any comments from the janitors list.

Description: Replace MS_TO_HZ() with msecs_to_jiffies().

---

 linux-2.6.9-rc2-bk7-max/drivers/video/aty/radeon_base.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/video/aty/radeon_base.c renamed from drivers/video/aty/radeon_base.c~use-msecs-to-jiffies-drivers_video_aty_radeon_base +2 -1
diff -puN drivers/video/aty/radeon_base.c~use-msecs-to-jiffies-drivers_video_aty_radeon_base drivers/video/aty/radeon_base.c
@@ -61,6 +61,7 @@
 #include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/time.h>
 #include <linux/fb.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -1286,7 +1287,7 @@ static void radeon_write_mode (struct ra
 					OUTREG(LVDS_GEN_CNTL, mode->lvds_gen_cntl | LVDS_BLON);
 				rinfo->pending_lvds_gen_cntl = mode->lvds_gen_cntl;
 				mod_timer(&rinfo->lvds_timer,
-					  jiffies + MS_TO_HZ(rinfo->panel_info.pwr_delay));
+					  jiffies + msecs_to_jiffies(rinfo->panel_info.pwr_delay));
 			}
 		}
 	}

_

#1 lore raw
Quoted 1 line · On Thursday 23 September 2004 16:31, [email protected] wrote:

I would appreciate any comments from the janitors list.

Well, I'm not a janitor, but this patch tickled my fancy enough to apply it just for grins, and there is now a wide one here at the Heskett digs. Running 2.6.9-rc2-mm2 without this patch, my glxgears speeds are fixed +- a half a frame a second from 10 fps. Thats real exciting, like watching grass grow or paint dry.

However, after applying this patch only, my glxgears performance is looking up a bit, as follows:
root@coyote root]# glxgears
1254 frames in 5.0 seconds = 250.800 FPS
1260 frames in 5.0 seconds = 252.000 FPS
1276 frames in 5.0 seconds = 255.200 FPS
1260 frames in 5.0 seconds = 252.000 FPS
1260 frames in 5.0 seconds = 252.000 FPS
1134 frames in 5.0 seconds = 226.800 FPS
1260 frames in 5.0 seconds = 252.000 FPS
1262 frames in 5.0 seconds = 252.400 FPS
1182 frames in 5.0 seconds = 236.400 FPS
1260 frames in 5.0 seconds = 252.000 FPS
1134 frames in 5.0 seconds = 226.800 FPS
1260 frames in 5.0 seconds = 252.000 FPS
X connection to :0.0 broken (explicit kill or server shutdown).

The 2 stumbles visible were probably kmail related.

And the exit message when clicking on it to close it is changed from the former "Broken pipe" to the above, so there is a side effect of this 2 line patch observed here.

Humm, another effect I just noticed, tvtime had a just barely noticeable stutter, frame skips I think, that was much worse when running the unpatched rc2-mm2. They seem to be gone, its as smooth as the hubble mirror at the moment.

I don't know what other side efects this particular patch might have but it sure seems like its all plus for this user.

Quoted 34 lines

Description: Replace MS_TO_HZ() with msecs_to_jiffies().

---

linux-2.6.9-rc2-bk7-max/drivers/video/aty/radeon_base.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/video/aty/radeon_base.c~use-msecs-to-jiffies-drivers_video_ aty_radeon_base drivers/video/aty/radeon_base.c --- linux-2.6.9-rc2-bk7/drivers/video/aty/radeon_base.c~use-msecs-to-ji ffies-drivers_video_aty_radeon_base 2004-09-21 20:51:45.000000000 +0200 +++ linux-2.6.9-rc2-bk7-max/drivers/video/aty/radeon_base.c 2004-09-21 20:51:45.000000000 +0200 @@ -61,6 +61,7 @@
#include <linux/tty.h>
#include <linux/slab.h>
#include <linux/delay.h>
+#include <linux/time.h>
#include <linux/fb.h>
#include <linux/ioport.h>
#include <linux/init.h>

drivers/video/aty/radeon_base.c renamed from drivers/video/aty/radeon_base.c~use-msecs-to-jiffies-drivers_video_aty_radeon_base +1 -1
@@ -1286,7 +1287,7 @@ static void radeon_write_mode (struct ra
     OUTREG(LVDS_GEN_CNTL, mode->lvds_gen_cntl | LVDS_BLON);
    rinfo->pending_lvds_gen_cntl = mode->lvds_gen_cntl;
    mod_timer(&rinfo->lvds_timer,
-       jiffies + MS_TO_HZ(rinfo->panel_info.pwr_delay));
+       jiffies + msecs_to_jiffies(rinfo->panel_info.pwr_delay));
   }
  }
 }
Quoted 1 line

_

Nice catch guys.

Signature · 8 lines
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.26% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2004 by Maurice Eugene Heskett, all rights reserved.
#2 lore raw

That patch didn't fix your performance. It modifies the timer for the panel backlight on laptops. Something else fixed your speed problem.

Signature · 2 lines
Jon Smirl
[email protected]
#3 lore raw
Quoted 3 lines · Jon Smirl

That patch didn't fix your performance. It modifies the timer for the panel backlight on laptops. Something else fixed your speed problem.

Oh dear, now we're back to the phase of the moon theory? I don't go to that church.

I didn't change anything else John. I had previously rebuilt rc2-mm2 2 times because I'd found that cachefs wasn't what I thought it was and took that back out, leaving me still stuck at 10 fps for either instance and I did check. Applied the subject line patch, rebuilt/reboot again without even calling a make xconfig, and I get 250 fps. Steady, rather than fading down to the 100 fps in about a minute like all previous kernels have in this 2.6.8 and up series.

Several things are locally built here: X, amanda, kde, cups, gutenprint, sane, xsane and all kernels. I don't think yum replaced anything but mozilla (up to 1.7.3 now) last night. Not according to the email I got from it anyway. That, and this patch are the only diffs. I've since did the patch that takes out the #define from the radeonfb.h file but I haven't rebooted to that kernel yet. From my read of that file, its just housekeeping, like sweeping the floor.

Signature · 8 lines
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.26% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2004 by Maurice Eugene Heskett, all rights reserved.