patch-2.1.130 linux/drivers/video/fbcon-iplan2p8.c

Next file: linux/drivers/video/fbcon.c
Previous file: linux/drivers/video/fbcon-iplan2p4.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.129/linux/drivers/video/fbcon-iplan2p8.c linux/drivers/video/fbcon-iplan2p8.c
@@ -209,18 +209,25 @@
 	/*  Special (but often used) case: Moving whole lines can be
 	 *  done with memmove()
 	 */
-	fast_memmove(p->screen_base + ((dy * p->next_line) << fontheightlog(p)),
-		     p->screen_base + ((sy * p->next_line) << fontheightlog(p)),
-		     (p->next_line * height) << fontheightlog(p));
+	fast_memmove(p->screen_base + dy * p->next_line * fontheight(p),
+		     p->screen_base + sy * p->next_line * fontheight(p),
+		     p->next_line * height * fontheight(p));
      } else {
 	int rows, cols;
 	u8 *src;
 	u8 *dst;
 	int bytes = p->next_line;
-	int linesize = bytes << fontheightlog(p);
-	u_int colsize = height << fontheightlog(p);
+	int linesize;
+	u_int colsize;
 	u_int upwards = (dy < sy) || (dy == sy && dx < sx);
 
+	if (fontheightlog(p)) {
+	    linesize = bytes << fontheightlog(p);
+	    colsize = height << fontheightlog(p);
+	} else {
+	    linesize = bytes * fontheight(p);
+	    colsize = height * fontheight(p);
+	}
 	if ((sx & 1) == (dx & 1)) {
 	    /* odd->odd or even->even */
 
@@ -301,18 +308,29 @@
     u8 *start;
     int rows;
     int bytes = p->next_line;
-    int lines = height << fontheightlog(p);
+    int lines;
     u32 size;
     u32 cval1, cval2, cval3, cval4, pcval1, pcval2;
 
     expand8ql(attr_bgcol_ec(p,conp), &cval1, &cval2, &cval3, &cval4);
 
+    if (fontheightlog(p))
+	lines = height << fontheightlog(p);
+    else
+	lines = height * fontheight(p);
+
     if (sx == 0 && width * 8 == bytes) {
-	offset = (sy * bytes) << fontheightlog(p);
+	if (fontheightlog(p))
+	    offset = (sy * bytes) << fontheightlog(p);
+	else
+	    offset = sy * bytes * fontheight(p);
 	size    = lines * bytes;
 	memset_even_8p(p->screen_base+offset, size, cval1, cval2, cval3, cval4);
     } else {
-	offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*16 + (sx & 1);
+	if (fontheightlog(p))
+	    offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*16 + (sx & 1);
+	else
+	    offset = sy * bytes * fontheight(p) + (sx>>1)*16 + (sx & 1);
 	start = p->screen_base + offset;
 	expand8dl(attr_bgcol_ec(p,conp), &pcval1, &pcval2);
 
@@ -348,8 +366,15 @@
     int bytes = p->next_line;
     u32 eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
-    dest = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*16 + (xx & 1);
-    cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    if (fontheightlog(p)) {
+	dest = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		(xx>>1)*16 + (xx & 1));
+	cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    } else {
+	dest = (p->screen_base + yy * bytes * fontheight(p) +
+		(xx>>1)*16 + (xx & 1));
+	cdat = p->fontdata + (c & p->charmask) * fontheight(p);
+    }
 
     expand8dl(attr_fgcol(p,c), &fgx1, &fgx2);
     expand8dl(attr_bgcol(p,c), &bgx1, &bgx2);
@@ -372,8 +397,12 @@
     u32 eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*16 +
-	    (xx & 1);
+    if (fontheightlog(p))
+	dest0 = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		 (xx>>1)*16 + (xx & 1));
+    else
+	dest0 = (p->screen_base + yy * bytes * fontheight(p) +
+		 (xx>>1)*16 + (xx & 1));
 
     expand8dl(attr_fgcol(p,*s), &fgx1, &fgx2);
     expand8dl(attr_bgcol(p,*s), &bgx1, &bgx2);
@@ -389,7 +418,10 @@
 	*/
 
 	c = *s++ & p->charmask;
-	cdat  = p->fontdata + (c << fontheightlog(p));
+	if (fontheightlog(p))
+	    cdat = p->fontdata + (c << fontheightlog(p));
+	else
+	    cdat = p->fontdata + c * fontheight(p);
 
 	for(rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup4l(*cdat++);
@@ -405,8 +437,12 @@
     int j;
     int bytes;
 
-    dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
-	    (xx>>1)*16 + (xx & 1));
+    if (fontheightlog(p))
+	dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
+		(xx>>1)*16 + (xx & 1));
+    else
+	dest = (p->screen_base + yy * p->next_line * fontheight(p) +
+		(xx>>1)*16 + (xx & 1));
     j = fontheight(p);
     bytes = p->next_line;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov