pm3fb: replace busy waiting with cpu_relax
authorKrzysztof Helt <krzysztof.h1@wp.pl>
Tue, 16 Oct 2007 08:29:27 +0000 (01:29 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:19 +0000 (09:43 -0700)
This patch replaces busy waiting with the cpu_relax() call.  This makes
scrolling faster.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/pm3fb.c

index 6a64b934133aec4f15874ac3b9190c4feaaf6460..070659992c1841bd6fccac6f9d2abd56ec174011 100644 (file)
@@ -110,7 +110,8 @@ static inline void PM3_WRITE_REG(struct pm3_par *par, s32 off, u32 v)
 
 static inline void PM3_WAIT(struct pm3_par *par, u32 n)
 {
-       while (PM3_READ_REG(par, PM3InFIFOSpace) < n);
+       while (PM3_READ_REG(par, PM3InFIFOSpace) < n)
+               cpu_relax();
 }
 
 static inline void PM3_WRITE_DAC_REG(struct pm3_par *par, unsigned r, u8 v)
@@ -209,8 +210,8 @@ static int pm3fb_sync(struct fb_info *info)
        PM3_WRITE_REG(par, PM3Sync, 0);
        mb();
        do {
-               while ((PM3_READ_REG(par, PM3OutFIFOWords)) == 0);
-               rmb();
+               while ((PM3_READ_REG(par, PM3OutFIFOWords)) == 0)
+                       cpu_relax();
        } while ((PM3_READ_REG(par, PM3OutputFifo)) != PM3Sync_Tag);
 
        return 0;