[PATCH] pm3fb: replace busy waiting with cpu_relax

From
Krzysztof Helt <hidden>
Date
2007-09-05 19:59:47
From: Krzysztof Helt <redacted>

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

Signed-off-by: Krzysztof Helt <redacted>

---
This patch is done against 2.6.23-rc4-mm1 tree.
--- linux-2.6.22/drivers/video/pm3fb.c	2007-09-05 21:57:21.972390495 +0200
+++ linux-2.6.23-mm/drivers/video/pm3fb.c	2007-09-05 21:57:34.101081669 +0200
@@ -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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help