From 8bed4d0ce6fddfdfa0a03f6d563c4b4eac3dfe84 Mon Sep 17 00:00:00 2001 From: Lingfeng Yang Date: Fri, 11 Aug 2017 01:17:39 -0700 Subject: [PATCH] emulator: api 26 fix guest rendering (build) As swiftshader is open sourced, put it into emulator targets to enable -gpu guest option. Test: build aosp_x86-eng, launch emulator -gpu guest and it should boot to home screen. Change-Id: I2140d7cec28d5f00b7463b1d37d9cf62120398fb Merged-In: I2140d7cec28d5f00b7463b1d37d9cf62120398fb --- target/board/generic/sepolicy/bootanim.te | 4 ++++ target/board/generic/sepolicy/file_contexts | 1 + .../board/generic/sepolicy/hal_graphics_allocator_default.te | 2 ++ target/product/emulator.mk | 4 ++++ 4 files changed, 11 insertions(+) create mode 100644 target/board/generic/sepolicy/hal_graphics_allocator_default.te diff --git a/target/board/generic/sepolicy/bootanim.te b/target/board/generic/sepolicy/bootanim.te index 4be1c8a204..b23e1ca751 100644 --- a/target/board/generic/sepolicy/bootanim.te +++ b/target/board/generic/sepolicy/bootanim.te @@ -2,4 +2,8 @@ allow bootanim self:process execmem; allow bootanim ashmem_device:chr_file execute; #TODO: This can safely be ignored until b/62954877 is fixed dontaudit bootanim system_data_file:dir read; + +allow bootanim vendor_file:file { execute getattr open read }; +allow bootanim graphics_device:chr_file { read ioctl open }; + set_prop(bootanim, qemu_prop) diff --git a/target/board/generic/sepolicy/file_contexts b/target/board/generic/sepolicy/file_contexts index f550f4db2e..c046434008 100644 --- a/target/board/generic/sepolicy/file_contexts +++ b/target/board/generic/sepolicy/file_contexts @@ -23,6 +23,7 @@ /vendor/bin/hw/android\.hardware\.drm@1\.0-service\.widevine u:object_r:hal_drm_widevine_exec:s0 /vendor/lib(64)?/hw/gralloc\.ranchu\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/hw/gralloc\.goldfish\.default\.so u:object_r:same_process_hal_file:s0 /vendor/lib(64)?/libEGL_emulation\.so u:object_r:same_process_hal_file:s0 /vendor/lib(64)?/libGLESv1_CM_emulation\.so u:object_r:same_process_hal_file:s0 /vendor/lib(64)?/libGLESv2_emulation\.so u:object_r:same_process_hal_file:s0 diff --git a/target/board/generic/sepolicy/hal_graphics_allocator_default.te b/target/board/generic/sepolicy/hal_graphics_allocator_default.te new file mode 100644 index 0000000000..0c8e27de96 --- /dev/null +++ b/target/board/generic/sepolicy/hal_graphics_allocator_default.te @@ -0,0 +1,2 @@ +allow hal_graphics_allocator_default graphics_device:dir search; +allow hal_graphics_allocator_default graphics_device:chr_file { ioctl open read write }; diff --git a/target/product/emulator.mk b/target/product/emulator.mk index 58245cb457..cc946ca722 100644 --- a/target/product/emulator.mk +++ b/target/product/emulator.mk @@ -26,6 +26,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ egl.cfg \ gralloc.goldfish \ + gralloc.goldfish.default \ gralloc.ranchu \ libGLESv1_CM_emulation \ lib_renderControl_enc \ @@ -35,6 +36,9 @@ PRODUCT_PACKAGES += \ libOpenglSystemCommon \ libGLESv2_emulation \ libGLESv1_enc \ + libEGL_swiftshader \ + libGLESv1_CM_swiftshader \ + libGLESv2_swiftshader \ qemu-props \ camera.goldfish \ camera.goldfish.jpeg \