Accelerated graphics in vbox 6
Jung-uk Kim
jkim at FreeBSD.org
Tue Jun 25 18:43:54 UTC 2019
On 19. 6. 25., Johannes Lundberg wrote:
> On 6/25/19 10:47 AM, Jung-uk Kim wrote:
>> On 19. 5. 21., Jung-uk Kim wrote:
>>> On 19. 5. 21., Johannes Lundberg wrote:
>>>> Hi
>>>>
>>>> On 5/21/19 11:46 AM, Jung-uk Kim wrote:
>>>>> On 19. 5. 21., Johannes Lundberg wrote:
>>>>>> Hi vbox folks! (cc: x11 list)
>>>>>>
>>>>>> According to this
>>>>>> https://www.phoronix.com/scan.php?page=article&item=virtualbox-60-vmsvga&num=1
>>>>>> vbox can now use the vmwgfx kernel driver for accelerated graphics. With
>>>>>> that I assume that virtualbox's own drm driver project is scrapped.
>>>>> Actually, they moved vboxvideo KMS/DRM driver to Linux kernel.
>>>>>
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/vboxvideo
>>>> It's been there for quite some time and no progress have been made for
>>>> the time I've been tracking it. Seems abandoned to me and my impression
>>>> is that that one is scrapped in favor of vmwgfx... Do anyone know if
>>>> vboxvideo is suppose to be in working state (the one in linux kernel)?
>>> It was added to staging for almost two years ago. Please see the
>>> original patch submission.
>>>
>>> https://lwn.net/Articles/726355/
>>>
>>> Recently they moved it out of staging (via merging drm-next-2019-05-09).
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=131abc56e1bacef23cb7b340519d36e2f5adb2a9
>>>
>>> It means Linux 5.2 release will have it by default.
>>>
>>> It doesn't look dead to me. ;-)
>>>
>>>>> And DDX driver was moved to Xorg repository.
>>>>>
>>>>> https://cgit.freedesktop.org/xorg/driver/xf86-video-vbox
>>>>>
>>>>>> I've been working on porting vmwgfx from Linux to our linuxkpi. It works
>>>>>> pretty well with freebsd 13 as vmware guest on macos as long you're
>>>>>> using only one vcpu (some race condition issue to be solved..). It
>>>>>> would be cool if we could get accelerated graphics in vbox, with freebsd
>>>>>> as both host and guest since vmware can't run as host on freebsd.
>>>>> Can you please port the vboxvideo driver to linuxkpi?
>>>> vmwgfx seems like the better choice if it's used by both vmware and vbox
>>>> (v6+). But if it's suppose to be in a working state I can take a look..
>>> ...
>>>
>>> AFAIK VirtualBox graphics stack is in a working state.
>> I found it is ported now.
>>
>> https://github.com/FreeBSDDesktop/kms-drm/commits/drm-v5.0
>>
>> I tried it and it's somewhat working, thanks!
>
> Hi! So you found it :) The reason I ported it now was that I realized
> that vboxideo does not build anymore with Xorg 1.20. Maybe it's
> deprecated in favor of KMS+modesetting?
Yes, correct.
https://www.virtualbox.org/wiki/Guest_resizing
o vboxvideo_drv.so: ... It is supported up to X.Org Server 1.18. So
X.Org 1.19 and later cannot be used with Linux 3.10 and earlier except
with fall-back graphics.
>> However, I found two problems.
>>
>> 1. Console does not refresh automatically.
>>
>> When vboxvideo.ko is loaded, console stays black. Console preview looks
>> fine, though. I found it's redrawn when the window is resized. Note I
>> only tried it on a Windows host. I will try it with FreeBSD host soon
>> but I think it'll be the same.
>
> Yeah I've been trying to debug this but it's somewhat tricky... Same
> issue on VMWare. On VMWare I ended up copying the whole fb driver from
> the kernel to the vmwgfx driver so I can refresh the screen without
> adding extra KPI in the kernel (as a temporary solution). Need to figure
> out why it works on real hardware but not in VMs.. It might just be
> something simple...
>
>> 2. Console does not resize dynamically.
>>
>> Actually, it is not vboxvideo.ko's fault. It happens because vt(4) does
>> not support monitor hotplug.
>>
>> https://www.virtualbox.org/wiki/Guest_resizing
>>
>> After I tried it out, I realized vboxvideo.ko is just a KMS driver and
>> modesetting driver is used for X.org. IOW, we cannot resize X.org
>> window dynamically when vboxvideo.ko is used. With vboxvideo.ko or
>> vboxvideo_drv.so, 3D acceleration is still handled by the Chromium
>> OpenGL pass-through stub. As always, it may be enabled with setting
>> OPENGL option for emulators/virtualbox-ose-additions.
>
> Yeah it would be nice to have the guest resize when resizing the window
> on the host. Do you mean that this functionality is missing in the
> modesetting ddx?
Modesetting DDX runs on fb driver, e.g., efifb, which must have a way to
resize. IOW, if the fb driver cannot resize, modesetting driver cannot
do anything about it.
Jung-uk Kim
>> BTW, Phoronix once reported 3D acceleration with VMware driver does not
>> look good on VirtualBox anyway. :-p
>>
>> http://www.phoronix.com/vr.php?view=27348
More information about the freebsd-emulation
mailing list