Author: wmb Date: Tue Dec 6 08:11:23 2011 New Revision: 2740 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2740
Log: OLPC - fixed hardcoded display resolution in various graphics packages.
Modified: cpu/arm/olpc/3.0/lcdcfg.fth cpu/arm/olpc/3.0/usb.fth cpu/arm/olpc/build-fw.fth cpu/arm/olpc/roller.fth cpu/arm/olpc/testitems.fth cpu/x86/pc/olpc/gridmap.fth cpu/x86/pc/olpc/gui.fth cpu/x86/pc/olpc/plot.fth cpu/x86/pc/olpc/via/copynand.fth dev/hdaudio/noiseburst.fth dev/olpc/touchpad/touchpad.fth ofw/gui/graphics.fth ofw/gui/iconmenu.fth ofw/gui/rgb565bmp24.fth
Modified: cpu/arm/olpc/3.0/lcdcfg.fth ============================================================================== --- cpu/arm/olpc/3.0/lcdcfg.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/arm/olpc/3.0/lcdcfg.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -4,8 +4,6 @@ d# 8 value hsync \ Sync width d# 1024 value hdisp \ Display width d# 1344 value htotal \ Display + FP + Sync + BP -\ d# 1200 value hdisp \ Display width -\ d# 1256 value htotal \ Display + FP + Sync + BP d# 24 value hbp \ Back porch
d# 3 value vsync \ Sync width
Modified: cpu/arm/olpc/3.0/usb.fth ============================================================================== --- cpu/arm/olpc/3.0/usb.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/arm/olpc/3.0/usb.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -62,7 +62,10 @@
d# 350 config-int usb-delay \ Milliseconds to wait before probing hub ports
-devalias u /usb/disk +devalias otg /usb@d4208000 \ USB OTG (micro) connector +devalias usba /usb@f0003000 \ USB-A connector +devalias o /usb@d4208000/disk \ Disk on USB OTG (micro) connector +devalias u /usb@f0003000/disk \ Disk on USB-A connector
\ Like $show-devs, but ignores pagination keystrokes : $nopage-show-devs ( nodename$ -- )
Modified: cpu/arm/olpc/build-fw.fth ============================================================================== --- cpu/arm/olpc/build-fw.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/arm/olpc/build-fw.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -300,8 +300,10 @@
devalias keyboard /keyboard
-create 15x30pc " ${BP}/ofw/termemu/15x30pc.psf" $file, -' 15x30pc to romfont ++ olpc-cl2 create 15x30pc " ${BP}/ofw/termemu/15x30pc.psf" $file, ++ olpc-cl2 ' 15x30pc to romfont ++ olpc-cl3 create cp881-16 " ${BP}/ofw/termemu/cp881-16.obf" $file, ++ olpc-cl3 ' cp881-16 to romfont
fload ${BP}/cpu/arm/olpc/sdhci.fth - cl2-a1 fload ${BP}/cpu/arm/olpc/emmc.fth @@ -442,12 +444,13 @@ : mmp-fb-tag, ( -- ) 8 tag-l, h# 54410008 tag-l, \ ATAG_VIDEOLFB - d# 1200 tag-w, \ Width - d# 900 tag-w, \ Height - d# 24 tag-w, \ Depth - d# 1200 3 * tag-w, \ Pitch - fb-mem-va tag-l, \ Base address - d# 1200 3 * d# 900 * tag-l, \ Total size - perhaps could be larger + screen-wh over tag-w, \ Width ( width height ) + dup tag-w, \ Height ( width height ) + " depth" $call-screen dup tag-w, \ Depth ( width height depth ) + rot * 8 / dup tag-w, \ Pitch ( height pitch ) + fb-mem-va tag-l, \ Base address ( height pitch ) + * tag-l, \ Total size - perhaps could be larger + \ The following assumes depth is 16 bpp 5 tag-b, \ Red size d# 11 tag-b, \ Red position 6 tag-b, \ Green size @@ -694,7 +697,8 @@ d# 18 gpio-pin@ 0= if h# 100 or then \ X d# 19 gpio-pin@ 0= if h# 01 or then \ Square d# 20 gpio-pin@ 0= if h# 40 or then \ Rotate -[else] +[then] +[ifdef] olpc-cl2 [ifdef] use_mmp2_keypad_control d# 15 gpio-pin@ 0= if button-rotate or then ( n ) scan-keypad ( n keypad ) @@ -908,7 +912,7 @@ disable-user-aborts console-start
-- olpc-cl3 read-game-keys + read-game-keys
factory-test? 0= if text-off then
Modified: cpu/arm/olpc/roller.fth ============================================================================== --- cpu/arm/olpc/roller.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/arm/olpc/roller.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -80,8 +80,8 @@ d# 20 constant ball-radius d# 40 constant ball-diameter
-d# 1200 ball-diameter - >fraction constant maxx -d# 900 ball-diameter - >fraction constant maxy +: maxx ( -- n ) screen-wh drop ball-diameter - >fraction ; +: maxy ( -- n ) screen-wh nip ball-diameter - >fraction ; d# 400 >fraction constant maxz
: 3swap ( x1 y1 z1 x2 y2 z2 -- x2 y2 z2 x1 y1 z1 ) 5 roll 5 roll 5 roll ;
Modified: cpu/arm/olpc/testitems.fth ============================================================================== --- cpu/arm/olpc/testitems.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/arm/olpc/testitems.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -23,7 +23,9 @@ : battery-item ( -- ) " /battery" mfg-test-dev ; : spiflash-item ( -- ) " /flash" mfg-test-dev ; : memory-item ( -- ) " /memory" mfg-test-dev ; -: usb-item ( -- ) " /usb/hub" mfg-test-dev ; ++ olpc-cl2 : usb-item ( -- ) " /usb/hub" mfg-test-dev ; ++ olpc-cl3 : otg-item ( -- ) " otg" mfg-test-dev ; ++ olpc-cl3 : usb-item ( -- ) " usba" mfg-test-dev ; : int-sd-item ( -- ) " int:0" mfg-test-dev ; - olpc-cl3 : ext-sd-item ( -- ) " ext:0" mfg-test-dev ; : rtc-item ( -- ) " /rtc" mfg-test-dev ; @@ -73,9 +75,13 @@ " RTC (Real-Time Clock)" ['] rtc-item clock.icon 2 4 install-icon
- " USB ports" ++ olpc-cl2 " USB ports" ++ olpc-cl3 " USB-A port" ['] usb-item usb.icon 3 0 install-icon
++ olpc-cl3 " USB OTG port" ++ olpc-cl3 ['] otg-item usb.icon 3 1 install-icon + \ These are last because they require user participation. \ The earlier tests are all included in automatic batch-mode.
Modified: cpu/x86/pc/olpc/gridmap.fth ============================================================================== --- cpu/x86/pc/olpc/gridmap.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/x86/pc/olpc/gridmap.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -7,9 +7,19 @@ 9 constant grid-w 9 constant grid-h
-d# 128 value #cols +d# 128 value #cols \ Good for 1200x900, may be changed d# 90 value #rows +d# 26 constant status-line + : max-grid ( -- n ) #rows #cols * ; +: set-array-size ( -- ) + screen-wh char-wh nip 2* - grid-h - ( width height ) + grid-h / to #rows ( width ) + dup grid-w / to #cols ( width ) + grid-w #cols * - 2/ ( x-offset ) + grid-h to ulhc ( ) + #rows 1+ grid-h * char-wh nip / 1+ to status-line +;
\needs xy+ : xy+ ( x1 y1 x2 y2 -- x3 y3 ) rot + -rot + swap ; \needs xy* : xy* ( x y w h -- x*w y*h ) rot * >r * r> ; @@ -19,6 +29,7 @@ 1 value scale-factor : scale-block# ( eblock# -- ) scale-factor / ; : set-grid-scale ( #eblocks -- ) + set-array-size d# 1000 1 do ( #eblocks ) dup i / max-grid <= if ( #eblocks ) drop ( )
Modified: cpu/x86/pc/olpc/gui.fth ============================================================================== --- cpu/x86/pc/olpc/gui.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/x86/pc/olpc/gui.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -368,16 +368,21 @@ 0 0 2value next-dot-xy d# 463 d# 540 2constant progress-xy
+: ?adjust ( x y -- x' y' ) +\ 88 is 1200 1024 - 2/ , 66 is 900 768 - 2/ ++ olpc-cl3 swap d# 88 - swap d# 66 - ( x' y' ) \ Recenter for XO-3 +; +: set-icon-xy ( x y -- ) ?adjust to icon-xy ; : show-going ( -- ) - background-rgb rgb>565 progress-xy d# 500 d# 100 " fill-rectangle" $call-screen - d# 588 d# 638 to icon-xy " bigdot" show-icon + background-rgb rgb>565 progress-xy ?adjust d# 500 d# 100 " fill-rectangle" $call-screen + d# 588 d# 638 set-icon-xy " bigdot" show-icon " vga?" $call-screen 0= if dcon-unfreeze dcon-freeze then ;
: show-no-power ( -- ) \ chip, battery, overlaid sad face - d# 25 d# 772 to icon-xy " spi" show-icon - d# 175 d# 772 to icon-xy " battery" show-icon - d# 175 d# 790 to icon-xy " sad" show-icon + d# 25 d# 772 set-icon-xy " spi" show-icon + d# 175 d# 772 set-icon-xy " battery" show-icon + d# 175 d# 790 set-icon-xy " sad" show-icon ;
d# 834 value bar-y @@ -391,8 +396,8 @@ ;
: show-reflash ( -- ) \ bottom left corner, chip and progress dots - d# 25 d# 772 to icon-xy " spi" show-icon - d# 992 bar-x + bar-y to icon-xy " yellowdot" show-icon + d# 25 d# 772 set-icon-xy " spi" show-icon + d# 992 bar-x + bar-y set-icon-xy " yellowdot" show-icon read-dot ;
@@ -416,7 +421,7 @@ : show-x ( -- ) " x" show-icon ; : show-sad ( -- ) icon-xy - d# 552 d# 283 to icon-xy " sad" show-icon + d# 552 d# 283 set-icon-xy " sad" show-icon to icon-xy ; : show-lock ( -- ) " lock" show-icon ; @@ -425,8 +430,8 @@ : show-minus ( -- ) " minus" show-icon ; : show-child ( -- ) " erase-screen" $call-screen - d# 552 d# 384 to icon-xy " xogray" $show-opaque - progress-xy to next-icon-xy \ For boot progress reports + d# 552 d# 384 set-icon-xy " xogray" $show-opaque + progress-xy ?adjust to next-icon-xy \ For boot progress reports ;
0 [if]
Modified: cpu/x86/pc/olpc/plot.fth ============================================================================== --- cpu/x86/pc/olpc/plot.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/x86/pc/olpc/plot.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -76,7 +76,7 @@
: setup-plot ( -- ) h# ffff set-fg 0 set-bg - d# 1200 d# 900 clear-plot - d# 1200 d# 900 d# 100 hgrid - d# 1200 d# 900 d# 100 vgrid + screen-wh clear-plot + screen-wh d# 100 hgrid + screen-wh d# 100 vgrid ;
Modified: cpu/x86/pc/olpc/via/copynand.fth ============================================================================== --- cpu/x86/pc/olpc/via/copynand.fth Tue Dec 6 08:11:13 2011 (r2739) +++ cpu/x86/pc/olpc/via/copynand.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -72,8 +72,6 @@ 0 h# ff h# ff rgb>565 constant strange-color \ cyan h# e8 h# e8 h# e8 rgb>565 constant starting-color \ very light gray
-d# 26 constant status-line - : gshow-init ( #eblocks -- ) suspend-logging dup set-grid-scale
Modified: dev/hdaudio/noiseburst.fth ============================================================================== --- dev/hdaudio/noiseburst.fth Tue Dec 6 08:11:13 2011 (r2739) +++ dev/hdaudio/noiseburst.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -527,10 +527,16 @@ loopback-threshold < ;
-d# 1200 constant #impulse-response -#impulse-response /w* buffer: impulse-response +0 value impulse-response +: #impulse-response ( -- samples ) screen-wh drop ;
+: ?alloc-impulse-buf ( -- ) + impulse-response 0= if + #impulse-response /w* alloc-mem to impulse-response + then +; : calc-sm-impulse ( offset -- adr ) \ offset is 0 for left or 2 for right + ?alloc-impulse-buf pb + rb #samples ( adr1 adr2 #samples ) #impulse-response 0 do 3dup swap i wa+ swap stereo-mono-covar ( adr1 adr2 #samples d.covar ) @@ -541,6 +547,7 @@ impulse-response ( adr ) ; : calc-stereo-impulse ( offset -- adr ) \ offset is 0 for left or 2 for right + ?alloc-impulse-buf dup pb + swap rb + #samples ( adr1 adr2 #samples ) #impulse-response 0 do 3dup swap i la+ swap stereo-covar ( adr1 adr2 #samples d.covar )
Modified: dev/olpc/touchpad/touchpad.fth ============================================================================== --- dev/olpc/touchpad/touchpad.fth Tue Dec 6 08:11:13 2011 (r2739) +++ dev/olpc/touchpad/touchpad.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -472,8 +472,8 @@ then ( x y ) \ Expand the PT (0..999) to the screen width (1200) packet-type 2 = if ( x y ) - swap d# 1200 d# 1000 */ - swap d# 1200 d# 1000 */ + swap screen-wh drop d# 1000 */ + swap screen-wh drop d# 1000 */ then ( x y ) then ( x y )
Modified: ofw/gui/graphics.fth ============================================================================== --- ofw/gui/graphics.fth Tue Dec 6 08:11:13 2011 (r2739) +++ ofw/gui/graphics.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -24,7 +24,15 @@ \needs screen-ih 0 value screen-ih 0 value mouse-ih
-d# 1200 d# 900 2value max-xy +: $call-screen ( ??? adr len -- ??? ) screen-ih $call-method ; +: screen-execute ( ?? xt -- ?? ) screen-ih package( execute )package ; + +\ : screen-wh ( -- x y ) +\ screen-ih package( screen-width screen-height )package +\ ; +: screen-wh ( -- x y ) " dimensions" $call-screen ; + +defer max-xy ' screen-wh to max-xy : max-x ( -- n ) max-xy drop ; : max-y ( -- n ) max-xy nip ;
@@ -39,14 +47,6 @@ >r swap r> - >r - r> ;
-: $call-screen ( ??? adr len -- ??? ) screen-ih $call-method ; -: screen-execute ( ?? xt -- ?? ) screen-ih package( execute )package ; - -\ : screen-wh ( -- x y ) -\ screen-ih package( screen-width screen-height )package -\ ; -: screen-wh ( -- x y ) " dimensions" $call-screen ; - : (inset-xy) ( x y -- x' y' ) screen-wh max-xy xy- swap 2/ swap 2/ ; defer inset-xy ' (inset-xy) to inset-xy : inset ( x y w h -- x' y' w h ) 2swap inset-xy xy+ 2swap ;
Modified: ofw/gui/iconmenu.fth ============================================================================== --- ofw/gui/iconmenu.fth Tue Dec 6 08:11:13 2011 (r2739) +++ ofw/gui/iconmenu.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -506,7 +506,7 @@ ; : setup-menu ( -- ) setup-graphics - ?open-mouse +\ ?open-mouse cursor-off gui-alerts ;
Modified: ofw/gui/rgb565bmp24.fth ============================================================================== --- ofw/gui/rgb565bmp24.fth Tue Dec 6 08:11:13 2011 (r2739) +++ ofw/gui/rgb565bmp24.fth Tue Dec 6 08:11:23 2011 (r2740) @@ -78,15 +78,14 @@ ; : raw565bmp24 ( -- ) reading writing - d# 1200 to image-width - d# 900 to image-height + screen-wh to image-height to image-width
565>rects ifd @ fclose ofd @ fclose ; : xraw565bmp24 ( -- ) reading writing - d# 1200 to image-width + screen-wh drop to image-width d# 256 to image-height
565>rects