[ZenFone 2 General] DrGit:
Windows, TF2, 3D acceleration/drivers

I've been wanting a phone I can play TF2 on for a very long time, and I nearly had it running on my last phone, Sony Z Ultra GPE, using an extremely convoluted method of patching usermode QEMU for KGSL DRM ioctl passthrough, compiling Freedreno graphics drivers (both ARM kernel drivers and x86 userspace, which was possible because Freedreno's libDRM and Mesa components are open source, although both required some modifications), and running Steam inside the x86 chroot with x11vnc. Initially I tried with Wine, but using Nine was going to be more work than I could handle. Nine being the Direct3D 9 Gallium3D state tracker for native DirectX with Wine, which requires support for GL_ARB_clip_control, not implemented in Freedreno yet.

One problem with that was I couldn't get Steam in Wine to connect to the Internet to download/update itself, and I only got as far as glxgears running at 40FPS in the x86 chroot - with no XA/2D acceleration, mind you, so it could run much faster if that didn't crash - and it crashed a lot! I kind of gave up on it when I got my ZF2, because I've been following QEMU multithreaded TCG development for months, but even that likely won't make emulating x86 on ARM fast enough to run TF2.

Now that I have a ZenFone, I've been trying to get the PowerVR OpenGL ES v2/3 drivers to work with libhybris. I already have an Ubuntu chroot with Steam going, but I see little hope for 3D acceleration in any virtualized environment unless PowerVR goes open source. The binary drivers supposedly support "desktop" OpenGL, but I don't think libhybris can take advantage of that, and I don't think libhybris works with X11 anyway.

If a miracle occurs and ImgTec's marketing guy Alexandru Voica can convince management to open up documentation for the PowerVR Rogue, someone can develop a Gallium3D driver, and eventually one for Vulkan as well. If that happens, you might be able to use QEMU's virtio-3d passthrough along with KVM for running WIndows. PCI/VGA passthrough will not work, because the Atom SoC in the ZF2 doesn't support VT-d (IOMMU). Either way, emulating/paravirtualizing full Windows uses a lot of processing power, so I think Linux with Wine and/or native games will be much more battery friendly and faster with the solution I'm working on, which looks something like this:

Linux -> 32 bit x86 Android -> 32/64-bit Linux distro chroot with X11/X11vnc -> open PowerVR Gallium3D driver -> OpenGL 3.x/4.x [or Direct3D 9 with Gallium Nine] -> Wine/Steam/TF2/other games.

The only missing piece of the above stack is graphics drivers. If Intel ever produces a smartphone SoC with their in-house HD graphics (I've more or less lost hope and given up waiting - Atom X5/X7 would have been awesome, but it seems they're impractical for anything smaller than a tablet-sized device), I will buy that and I may be one of the first people playing TF2 on their phone. Until then, I love my ZenFone, and I'll be doing everything I can to get desktop games working on it! I don't have the skills to write complicated 3D drivers yet, so if you all want this to happen - and believe me, TF2 won't happen without quality drivers - politely pester ImgTec to open up the PowerVR Rogue documentation, and then pester Intel to develop a Gallium3D driver for us. Without #1, #2 won't happen, and Intel seems to be abandoning PowerVR anyway, so the longer we wait on #1, the less likely #2 will happen. Get on it, everyone!