Skip to contentSkip to conversation

pm2fb: pixclock setting restriction

PATCH New Krzysztof Helt 1 participant 2 messages Apr 23, 2007 – Apr 24, 2007 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pm2fb: pixclock setting restriction

From: Krzysztof Helt <[email protected]>

This patch add restrictions to calculations of m, n and p factors which sets the pixclock for the Permedia 2V. I found during tests that synchronization is unstable if m (divisor) is bigger than half of the n (numerator). The patch dissallows such settings combination.

---

----------------------------------------------------
Już niedługo pierwsza komunia! Zrób naprawdę niezapomniany prezent:
Pięknie wydany i zilustrowany album do uzupełnienia przez dziecko będzie na całe życie kroniką Pierwszej Komunii Świętej - Zobacz:
http://klik.wp.pl/?adr=http%3A%2F%2Fksiazka.eu%2F%3Fpg%3Dseria%26idseria%3D19%26ref%3Dwppl&sid=1113

drivers/video/pm2fb.c +3 -3
@@ -302,10 +303,10 @@ static void pm2v_mnp(u32 clk, unsigned c
 	s32 delta = 1000;
 
 	*mm = *nn = *pp = 0;
-	for (n = 1; n; n++) {
-		for ( m = 1; m; m++) {
+	for ( m = 1; m; m++) {
+		for (n = 2 * m + 1; n; n++) {
 			for ( p = 0; p < 2; p++) {
-				f = PM2_REFERENCE_CLOCK * n / (m * (1 << (p + 1)));
+				f = ( PM2_REFERENCE_CLOCK >> ( p + 1 )) * n / m;
 				if ( clk > f - delta && clk < f + delta ) {
 					delta = ( clk > f ) ? clk - f : f - clk;
 					*mm=m;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Linux-fbdev-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

#1 lore raw

PATCH 1/1 pm2fb: pixclock setting restriction

From: Krzysztof Helt <[email protected]>

This patch adds restrictions to calculations of m, n and p factors which sets the pixclock for the Permedia 2V. I found during tests that synchronization is unstable if m (divisor) is bigger than half of the n (numerator). The patch disallows such settings combination.

---
This patch has fixed range overflow with m > 127 comparing to previous one.

Regards,
Krzysztof

----------------------------------------------------
Skorzystaj ze starożytnej chińskiej mądrości. Twój horoskop wiosenny
- http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fchinski.html&sid=1112

drivers/video/pm2fb.c +3 -3
@@ -302,10 +303,10 @@ static void pm2v_mnp(u32 clk, unsigned c
 	s32 delta = 1000;
 
 	*mm = *nn = *pp = 0;
-	for (n = 1; n; n++) {
-		for ( m = 1; m; m++) {
+	for ( m = 1; m < 128; m++) {
+		for (n = 2 * m + 1; n; n++) {
 			for ( p = 0; p < 2; p++) {
-				f = PM2_REFERENCE_CLOCK * n / (m * (1 << (p + 1)));
+				f = ( PM2_REFERENCE_CLOCK >> ( p + 1 )) * n / m;
 				if ( clk > f - delta && clk < f + delta ) {
 					delta = ( clk > f ) ? clk - f : f - clk;
 					*mm=m;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Linux-fbdev-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel