From d3dfc784523ed2d590262518586416de59efa26d Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 19 Feb 2019 21:35:14 +0100 Subject: geode/display: add /chosen/framebuffer simple-framebuffer node Hand the framebuffer set up by OFW over to the operating system. This enables Linux to draw on the screen if the native driver is not (yet) available. Follows the display/simple-framebuffer.txt bindings. --- dev/geode/display/gp.fth | 29 +++++++++++++++++++++++++++++ dev/geode/display/gxfb.fth | 2 -- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dev/geode/display/gp.fth b/dev/geode/display/gp.fth index 65d66ac5..673e1c30 100644 --- a/dev/geode/display/gp.fth +++ b/dev/geode/display/gp.fth @@ -94,15 +94,44 @@ alias depth+ wa+ ['] fbgeode-delete-lines is delete-lines ; +: add-simple-framebuffer ( -- ) + height width frame-buffer-adr ( height width fba ) + " /chosen" find-device + new-device + " framebuffer" device-name + " simple-framebuffer" +compatible + + >physical encode-int ( height width adr len ) + 2over * 2 * encode-int encode+ ( height width adr len adr len) + " reg" property + + dup 2 * " stride" integer-property ( height width ) + " width" integer-property ( height ) + " height" integer-property ( ) + " r5g6b5" " format" string-property + " /display" encode-phandle " display" property + finish-device + device-end +; + +: remove-simple-framebuffer ( -- ) + " /chosen/framebuffer" find-package if delete-package then +; + : display-install ( -- ) init-all default-font set-font width height ( width height ) over char-width / over char-height / ( width height rows cols ) /scanline depth fb-install gp-install ( ) + add-simple-framebuffer init-hook ; +: display-remove ( -- ) + remove-simple-framebuffer +; + : display-selftest ( -- failed? ) false ; ' display-install is-install diff --git a/dev/geode/display/gxfb.fth b/dev/geode/display/gxfb.fth index 63dfe4ea..bf19050c 100644 --- a/dev/geode/display/gxfb.fth +++ b/dev/geode/display/gxfb.fth @@ -521,8 +521,6 @@ headers frame-buffer-adr /fb + to graphmem ; -: display-remove ( -- ) ; - " display" device-type " ISO8859-1" encode-string " character-set" property 0 0 encode-bytes " iso6429-1983-colors" property -- cgit 1.2.3-korg