OSDN Git Service

Support virgl GPU
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 16 Feb 2016 20:12:48 +0000 (04:12 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 5 May 2016 18:17:13 +0000 (02:17 +0800)
The patch enables 3D acceleration on QEMU.

BoardConfig.mk
gpu/gpu_mesa.mk
init.sh

index c3a18eb..c234746 100644 (file)
@@ -58,6 +58,7 @@ USE_INTEL_OMX_COMPONENTS := true
 
 USE_OPENGL_RENDERER := true
 NUM_FRAMEBUFFER_SURFACE_BUFFERS ?= 3
+BOARD_USES_DRM_HWCOMPOSER ?= true
 
 USE_CAMERA_STUB ?= false
 
@@ -70,7 +71,7 @@ BOARD_WPA_SUPPLICANT_PRIVATE_LIB ?= private_lib_driver_cmd
 WPA_SUPPLICANT_VERSION ?= VER_2_1_DEVEL
 WIFI_DRIVER_MODULE_PATH ?= auto
 
-BOARD_GPU_DRIVERS ?= i915 i965 nouveau r300g r600g swrast
+BOARD_GPU_DRIVERS ?= i915 i965 nouveau r300g r600g swrast virgl
 ifneq ($(strip $(BOARD_GPU_DRIVERS)),)
 TARGET_HARDWARE_3D := true
 BOARD_EGL_CFG ?= device/generic/common/gpu/egl_mesa.cfg
index 6d27c71..ac2d800 100644 (file)
@@ -9,6 +9,7 @@
 #
 
 PRODUCT_PACKAGES := \
+    hwcomposer.drm  \
     gralloc.drm     \
     libGLES_mesa
 
diff --git a/init.sh b/init.sh
index 96b1963..7fa0f72 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -117,6 +117,9 @@ function init_uvesafb()
 function init_hal_gralloc()
 {
        case "$(cat /proc/fb | head -1)" in
+               *virtiodrmfb)
+                       set_property ro.hardware.hwcomposer drm
+                       ;&
                0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb)
                        set_property ro.hardware.gralloc drm
                        set_drm_mode