From 183a2c1be6394fae8f18b2e17e4f6c368f3ab798 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 9 Dec 2014 14:53:58 +0100 Subject: [PATCH] vbox: support more graphic modes Fixes #1319 --- repos/ports/ports/virtualbox.hash | 2 +- repos/ports/ports/virtualbox.port | 2 +- repos/ports/run/virtualbox_auto_disk.run | 7 ++----- repos/ports/src/virtualbox/frontend/fb.h | 20 +++++++++---------- .../virtualbox/patches/vbetables-gen.patch | 19 ------------------ 5 files changed, 14 insertions(+), 36 deletions(-) delete mode 100644 repos/ports/src/virtualbox/patches/vbetables-gen.patch diff --git a/repos/ports/ports/virtualbox.hash b/repos/ports/ports/virtualbox.hash index 866938f8be..2cc87e64e8 100644 --- a/repos/ports/ports/virtualbox.hash +++ b/repos/ports/ports/virtualbox.hash @@ -1 +1 @@ -612b4fbfc6cea5442ce7dd96997789e15f987cb1 +1c349fbf04ac30d2cf5d5bb8fedeb71e7e09c7c5 diff --git a/repos/ports/ports/virtualbox.port b/repos/ports/ports/virtualbox.port index 6944f1a212..24d4d75415 100644 --- a/repos/ports/ports/virtualbox.port +++ b/repos/ports/ports/virtualbox.port @@ -10,7 +10,7 @@ SHA(virtualbox) := e4c23b713e8715b8e0172fa066f2197756e901fe PATCHES_LIST := acpi_drv dev_e1000 eminternal fake_pci_vendor iconv mouse PATCHES_LIST += pdm_driver pdm_queue_irqs sharedfolder_pagelist timer -PATCHES_LIST += time-log-deadlock vbetables-gen vbox_inc vbox_main network +PATCHES_LIST += time-log-deadlock vbox_inc vbox_main network PATCHES_LIST += vga_fb vga_vbva vmdk vmmdev avoid_yield serial PATCHES := $(addsuffix .patch, $(PATCHES_LIST)) diff --git a/repos/ports/run/virtualbox_auto_disk.run b/repos/ports/run/virtualbox_auto_disk.run index 296a228f8b..20287a173c 100644 --- a/repos/ports/run/virtualbox_auto_disk.run +++ b/repos/ports/run/virtualbox_auto_disk.run @@ -53,11 +53,8 @@ exec cp ${genode_dir}/repos/ports/run/vm_auto_disk.vbox bin/. build_boot_image $boot_modules -run_genode_until "fb resize : 1024x768@16 -> 720x400@0" 40 -run_genode_until "fb resize : 720x400@16 -> 640x480@0" 25 $spawn_id -run_genode_until "fb resize : 640x480@16 -> 800x600@16" 45 $spawn_id - -run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} 180 $spawn_id +run_genode_until "fb resize : 1024x768@16 -> 640x480@32" 40 +run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} 240 $spawn_id # cleanup bin directory - remove vbox file exec rm bin/vm_auto_disk.vbox diff --git a/repos/ports/src/virtualbox/frontend/fb.h b/repos/ports/src/virtualbox/frontend/fb.h index 71f38ab211..4ca3ad0430 100644 --- a/repos/ports/src/virtualbox/frontend/fb.h +++ b/repos/ports/src/virtualbox/frontend/fb.h @@ -48,7 +48,7 @@ class Genodefb : public Framebuffer if (!width) return E_INVALIDARG; - *width = _width; + *width = _width > _fb_mode.width() ? _fb_mode.width() : _width; return S_OK; } @@ -57,7 +57,7 @@ class Genodefb : public Framebuffer if (!height) return E_INVALIDARG; - *height = _height; + *height = _height > _fb_mode.height() ? _fb_mode.height() : _height; return S_OK; } @@ -113,17 +113,17 @@ class Genodefb : public Framebuffer bool ok = ((bitsPerPixel == 16) || (bitsPerPixel == 0)) && (w <= (ULONG)_fb_mode.width()) && (h <= (ULONG)_fb_mode.height()); - - if (ok) { + if (ok) PINF("fb resize : %lux%lu@%zu -> %ux%u@%u", _width, _height, _fb_mode.bytes_per_pixel() * 8, w, h, bitsPerPixel); - _width = w; - _height = h; - } else - PERR("Could not resize to %ux%u - %u bpp, %u bpl, vram %p", - w, h, bitsPerPixel, bytesPerLine, vram); + else + PWRN("fb resize : %lux%lu@%zu -> %ux%u@%u ignored", _width, _height, + _fb_mode.bytes_per_pixel() * 8, w, h, bitsPerPixel); - *finished = ok; + _width = w; + _height = h; + + *finished = true; return S_OK; } diff --git a/repos/ports/src/virtualbox/patches/vbetables-gen.patch b/repos/ports/src/virtualbox/patches/vbetables-gen.patch deleted file mode 100644 index 8acd4dfb64..0000000000 --- a/repos/ports/src/virtualbox/patches/vbetables-gen.patch +++ /dev/null @@ -1,19 +0,0 @@ -+++ src/app/virtualbox/src/VBox/Devices/Graphics/BIOS/vbetables-gen.c -@@ -13,6 +13,7 @@ - - ModeInfo modes[] = { - /* standard VESA modes */ -+#if 0 - { 640, 400, 8 , 0x100}, - { 640, 480, 8 , 0x101}, - { 800, 600, 4 , 0x102}, -@@ -57,6 +58,9 @@ - { 1152, 864, 16 , 0x14a}, - { 1152, 864, 24 , 0x14b}, - { 1152, 864, 32 , 0x14c}, -+#else -+{ 800, 600, 16 , 0x111}, -+#endif - { 0, }, - }; -