NetBSD Problem Report #9449

Received: (qmail 26231 invoked from network); 19 Feb 2000 18:36:33 -0000
Message-Id: <200002191836.KAA16304@nbwww.isc.org>
Date: Sat, 19 Feb 2000 10:36:32 -0800 (PST)
From: bjh21@cam.ac.uk
Reply-To: bjh21@cam.ac.uk
To: gnats-bugs@gnats.netbsd.org
Subject: rasops code is rather endianness-dependant
X-Send-Pr-Version: www-1.0

>Number:         9449
>Category:       kern
>Synopsis:       rasops code is rather endianness-dependant
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 19 10:39:00 +0000 2000
>Closed-Date:    
>Last-Modified:  
>Originator:     Ben Harris
>Release:        1.4T (2000-02-18)
>Organization:
University of Cambridge
>Environment:
(Not yet ported, *grin*)
>Description:
When using the rasops code in sys/dev/rasops on a little-endian
framebuffer, things seem to end up mangled.  It looks as if the code has
almost no support for non-big-endian framebuffers -- RI_BSWAP is referenced
anywhere.

>How-To-Repeat:

>Fix:
This patch at least makes the code work using an 8-pixel wide font on
a 1-bit display, at least.  Gallant still doesn't work.

--- rasops.c    2000/01/06 05:27:19     1.26
+++ rasops.c    2000/02/19 18:33:11
@@ -121,6 +121,7 @@
        struct rasops_info *ri;
        int wantrows, wantcols;
 {
+       int font_order;

 #ifdef _KERNEL 
        /* Select a font if the caller doesn't care */
@@ -138,8 +139,19 @@
                        return (-1);
                }

-               if (wsfont_lock(cookie, &ri->ri_font, 
-                   WSDISPLAY_FONTORDER_L2R, WSDISPLAY_FONTORDER_L2R) <= 0) {
+#if BYTE_ORDER == BIG_ENDIAN
+               if (ri->ri_flg & RI_BSWAP)
+                       font_order = WSDISPLAY_FONTORDER_R2L;
+               else
+                       font_order = WSDISPLAY_FONTORDER_L2R;
+#else
+               if (ri->ri_flg & RI_BSWAP)
+                       font_order = WSDISPLAY_FONTORDER_L2R;
+               else
+                       font_order = WSDISPLAY_FONTORDER_R2L;
+#endif
+               if (wsfont_lock(cookie, &ri->ri_font,
+                               font_order, font_order) <= 0) {
                        printf("rasops_init: couldn't lock font\n");
                        return (-1);
                }

>Release-Note:
>Audit-Trail:

From: Ben Harris <bjh21@cam.ac.uk>
To: gnats-bugs@gnats.netbsd.org
Cc:  Subject: Re: kern/9449: rasops code is rather endianness-dependant
Date: Sat, 19 Feb 2000 21:59:32 +0000 (GMT)

 The patch I gave is utterly bogus.  The problem is real, though.  If I
 come up with a proper solution, I'll send it to you.

 -- 
 Ben Harris
 Unix Support, University of Cambridge Computing Service.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.