Skip to contentSkip to conversation

pm3fb: replace busy waiting with cpu_relax

PATCH New Antonino A. Daplas 1 participant 1 message Sep 15, 2007 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 11/12 pm3fb: replace busy waiting with cpu_relax

From: Krzysztof Helt <[email protected]>

This patch replaces busy waiting with the cpu_relax() call. This makes scrolling faster.

---

 drivers/video/pm3fb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/video/pm3fb.c +4 -3
index 6a64b93..0706599 100644
@@ -110,7 +110,8 @@ static inline void PM3_WRITE_REG(struct 
 
 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 *in
 	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;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/