$OpenBSD: patch-xwindow_fb_x_display_c,v 1.2 2014/01/11 21:15:26 dcoppa Exp $

Only if _display.pixels_per_byte is 8, multiple planes of scrolled
lines are copied: fix the bug of scrolling on framebuffer
https://bitbucket.org/arakiken/mlterm/commits/4d974f758c5491704cd4a41481940bda6f303ac1

--- xwindow/fb/x_display.c.orig	Sat Dec 21 18:11:35 2013
+++ xwindow/fb/x_display.c	Sat Jan 11 20:48:20 2014
@@ -1870,6 +1870,7 @@ x_display_copy_lines(
 	u_char *  dst ;
 	u_int  copy_len ;
 	u_int  count ;
+	int  num_of_planes ;
 	int  plane ;
 
 	/* XXX cheap implementation. */
@@ -1878,7 +1879,16 @@ x_display_copy_lines(
 	/* XXX could be different from FB_WIDTH_BYTES(display, dst_x, width) */
 	copy_len = FB_WIDTH_BYTES(&_display, src_x, width) ;
 
-	for( plane = 0 ; plane < _disp.depth ; plane++)
+	if( _display.pixels_per_byte == 8)
+	{
+		num_of_planes = _disp.depth ;
+	}
+	else
+	{
+		num_of_planes = 1 ;
+	}
+
+	for( plane = 0 ; plane < num_of_planes ; plane++)
 	{
 		if( src_y <= dst_y)
 		{
