[openfirmware] [commit] r2374 - cpu/arm/olpc/1.75 cpu/x86/pc/olpc dev/via/unichrome

repository service svn at openfirmware.info
Sat Jul 16 13:40:25 CEST 2011


Author: wmb
Date: Sat Jul 16 13:40:24 2011
New Revision: 2374
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2374

Log:
OLPC XO-1.75 (and 1.5) - Fixed the vector test instructions display to use the right colors when the display is in RGB565 mode, and modified the XO-1.5 and XO-1.75 drivers to support the necessary color conversion function.

Modified:
   cpu/arm/olpc/1.75/devices.fth
   cpu/x86/pc/olpc/strokes.fth
   dev/via/unichrome/loadpkg.fth
   dev/via/unichrome/unichrome.fth

Modified: cpu/arm/olpc/1.75/devices.fth
==============================================================================
--- cpu/arm/olpc/1.75/devices.fth	Sat Jul 16 13:37:09 2011	(r2373)
+++ cpu/arm/olpc/1.75/devices.fth	Sat Jul 16 13:40:24 2011	(r2374)
@@ -194,9 +194,16 @@
 
    fload ${BP}/cpu/arm/olpc/1.75/lcd.fth
    fload ${BP}/dev/olpc/dcon/mmp2dcon.fth        \ DCON control
+   defer convert-color ' noop to convert-color
    defer pixel*
    defer pixel+
    defer pixel!
+
+   : color!  ( r g b index -- )  4drop  ;
+   : color@  ( index -- r g b )  drop 0 0 0  ;
+
+   fload ${BP}/dev/video/common/rectangle16.fth     \ Rectangular graphics
+
    depth d# 24 =  [if]
       code 3a+  ( adr n -- n' )
          pop  r0,sp
@@ -215,17 +222,14 @@
       ' 3* to pixel*
       ' 3a+ to pixel+
       ' rgb888! to pixel!
+      ' noop to convert-color
    [else]
       ' /w* to pixel*
       ' wa+ to pixel+
       ' w!  to pixel!
+      ' argb>565-pixel to convert-color
    [then]
 
-   : color!  ( r g b index -- )  4drop  ;
-   : color@  ( index -- r g b )  drop 0 0 0  ;
-
-   fload ${BP}/dev/video/common/rectangle16.fth     \ Rectangular graphics
-
    : display-on
 \      init-xo-display  \ Turns on DCON
       smb-init

Modified: cpu/x86/pc/olpc/strokes.fth
==============================================================================
--- cpu/x86/pc/olpc/strokes.fth	Sat Jul 16 13:37:09 2011	(r2373)
+++ cpu/x86/pc/olpc/strokes.fth	Sat Jul 16 13:40:24 2011	(r2374)
@@ -209,8 +209,8 @@
 ;
 : circleat  ( x y radius -- )  >r  moveto  r> rcircle  ;
 
-: set-fg  ( fg -- )  to fg  ;
-: set-bg  ( bg -- )  to bg  ;
+: set-fg  ( fg -- )  convert-color  to fg  ;
+: set-bg  ( bg -- )  convert-color  to bg  ;
 
 dend
 

Modified: dev/via/unichrome/loadpkg.fth
==============================================================================
--- dev/via/unichrome/loadpkg.fth	Sat Jul 16 13:37:09 2011	(r2373)
+++ dev/via/unichrome/loadpkg.fth	Sat Jul 16 13:40:24 2011	(r2374)
@@ -19,12 +19,18 @@
 defer pixel* ' noop is pixel*
 defer pixel+ ' + is pixel+
 defer pixel! ' c! is pixel!
+defer convert-color  ' noop is convert-color
 
+d# 1280 value width	\ Frame buffer line width
+d# 1024 value height	\ Screen height
+d#   16 value depth	\ Bits per pixel
+d# 1024 value /scanline	\ Frame buffer line width
+
+fload ${BP}/dev/video/common/rectangle16.fth     \ Rectangular graphics
 fload ${BP}/dev/video/controlr/vga.fth           \ Standard VGA interfaces
 fload ${BP}/dev/via/unichrome/unichrome.fth      \ Controller code
 fload ${BP}/dev/via/unichrome/accel2d.fth        \ Accelerator
 fload ${BP}/dev/via/unichrome/vgamodes.fth       \ Text mode support
-fload ${BP}/dev/video/common/rectangle16.fth     \ Rectangular graphics
 fload ${BP}/cpu/x86/pc/olpc/expand16.fth         \ Expand image by 2x
 
 \ LICENSE_BEGIN

Modified: dev/via/unichrome/unichrome.fth
==============================================================================
--- dev/via/unichrome/unichrome.fth	Sat Jul 16 13:37:09 2011	(r2373)
+++ dev/via/unichrome/unichrome.fth	Sat Jul 16 13:40:24 2011	(r2374)
@@ -11,11 +11,6 @@
 0 value fb-va
 0 value mmio-base
 
-d# 1280 value width	\ Frame buffer line width
-d# 1024 value height	\ Screen height
-d#   16 value depth	\ Bits per pixel
-d# 1024 value /scanline	\ Frame buffer line width
-
 \ This writes a memory variable that the early startup code can find,
 \ so the resume-from-S3 path can do the right thing
 : note-mode  ( mode# -- )  video-mode-adr !  ;
@@ -273,12 +268,13 @@
    \ at the end of each scanline.  Adjust /scanline for others.
    set-pitch
    depth case
-      d# 16 of  ['] w!  ['] /w*  ['] wa+  endof
-      d# 24 of  ['] l!  ['] /l*  ['] la+  endof
-      d# 32 of  ['] l!  ['] /l*  ['] la+  endof
-      ( default )  >r  ['] c!  ['] noop  ['] +  r>
+      d# 16 of  ['] w!  ['] /w*   ['] wa+  ['] argb>565-pixel  endof
+      d# 24 of  ['] l!  ['] /l*   ['] la+  ['] noop            endof
+      d# 32 of  ['] l!  ['] /l*   ['] la+  ['] noop            endof
+      ( default )
+           >r   ['] c!  ['] noop  ['] ca+  ['] noop  r>
    endcase
-   to pixel+  to pixel*  to pixel!
+   to convert-color  to pixel+  to pixel*  to pixel!
 ;
 
 : set-resolution  ( width height depth -- )  set-depth  to height  to width  ;



More information about the openfirmware mailing list