Even though we boot in 24-bit enabled mode, OpenBIOS only uses the 8-bit framebuffer. Hence we need to override the depth/linebytes obtained from QEMU to force the graphics subsystem into 8-bit mode, which was what seems to have been happening before this patch series.
Note: it seems strange that we have to update the package linebytes property too, however Debian etch freezes if we don't set it to match the 8-bit framebuffer even though it correctly switches to 24-bit mode.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/drivers/sbus.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/openbios-devel/drivers/sbus.c b/openbios-devel/drivers/sbus.c index fbac2d7..8cc0bf9 100644 --- a/openbios-devel/drivers/sbus.c +++ b/openbios-devel/drivers/sbus.c @@ -17,6 +17,7 @@ #include "libc/vsprintf.h" #include "drivers/drivers.h" #include "libopenbios/ofmem.h" +#include "libopenbios/video.h"
#define SBUS_REGS 0x28 #define SBUS_SLOTS 16 @@ -329,6 +330,17 @@ ob_tcx_init(unsigned int slot, const char *path) fword("property"); }
+ /* Even with a 24-bit enabled TCX card, the control plane is + used in 8-bit mode. So force the video subsystem into 8-bit + mode before initialisation. */ + if (graphic_depth == 24) { + VIDEO_DICT_VALUE(video.depth) = 8; + VIDEO_DICT_VALUE(video.rb) = VIDEO_DICT_VALUE(video.w); + + chosen = get_cur_dev(); + set_int_property(chosen, "linebytes", VIDEO_DICT_VALUE(video.rb)); + } + bind_func("hw-set-color", tcx_hw_set_color); feval("['] qemu-tcx-driver-init is-install");