Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2010 15:40:18 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r205605 - head/sys/dev/syscons
Message-ID:  <201003241540.o2OFeIjO040124@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Mar 24 15:40:18 2010
New Revision: 205605
URL: http://svn.freebsd.org/changeset/base/205605

Log:
  Align memory access of 24-bit pixel renderer to word boundary.

Modified:
  head/sys/dev/syscons/scvgarndr.c

Modified: head/sys/dev/syscons/scvgarndr.c
==============================================================================
--- head/sys/dev/syscons/scvgarndr.c	Wed Mar 24 15:37:47 2010	(r205604)
+++ head/sys/dev/syscons/scvgarndr.c	Wed Mar 24 15:40:18 2010	(r205605)
@@ -184,8 +184,13 @@ static u_short mouse_or_mask[16] = {
 			writel(pos, vga_palette32[color]);		\
 			break;						\
 		case 24:						\
-			writew(pos, vga_palette32[color]);		\
-			writeb(pos + 2, vga_palette32[color] >> 16);	\
+			if (((pos) & 1) == 0) {				\
+				writew(pos, vga_palette32[color]);	\
+				writeb(pos + 2, vga_palette32[color] >> 16);\
+			} else {					\
+				writeb(pos, vga_palette32[color]);	\
+				writew(pos + 1, vga_palette32[color] >> 8);\
+			}						\
 			break;						\
 		case 16:						\
 			if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003241540.o2OFeIjO040124>