summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonas Kylmälä <joonas.kylmala@iki.fi>2020-07-22 18:06:38 -0400
committerJoonas Kylmälä <joonas.kylmala@iki.fi>2020-07-22 18:06:38 -0400
commit62d61abe032f700cd73a6eefddd498d8e8bc29be (patch)
tree66ee655dba65ad5297a86c1c08ebb27b563fddc7
parentc5637b3535d6e7d8c1bc0d413e16ef6e9b6bb81b (diff)
downloaddevice_samsung_midas_common-62d61abe032f700cd73a6eefddd498d8e8bc29be.tar.gz
device_samsung_midas_common-62d61abe032f700cd73a6eefddd498d8e8bc29be.tar.bz2
device_samsung_midas_common-62d61abe032f700cd73a6eefddd498d8e8bc29be.zip
Override default gralloc service to prevent race condition with hwcomposer
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
-rw-r--r--allocator/android.hardware.graphics.allocator@2.0-service.rc18
-rw-r--r--midas.mk2
2 files changed, 20 insertions, 0 deletions
diff --git a/allocator/android.hardware.graphics.allocator@2.0-service.rc b/allocator/android.hardware.graphics.allocator@2.0-service.rc
new file mode 100644
index 0000000..c2a34fb
--- /dev/null
+++ b/allocator/android.hardware.graphics.allocator@2.0-service.rc
@@ -0,0 +1,18 @@
+# This is modified version of the file at
+# hardware/interfaces/graphics/allocator/2.0/default/android.hardware.graphics.allocator@2.0-service.rc
+
+# Here we override and disable the gralloc service. Custom init.rc
+# script needs to start the service in order to prevent a race condition
+# with gbm_gralloc and drm_hwcomposer both opening /dev/dri/card0
+# node, meaning gbm_gralloc might get DRM Master status if it gets
+# started first. This would lead to drm_hwcomposer not working.
+
+service vendor.gralloc-2-0 /vendor/bin/hw/android.hardware.graphics.allocator@2.0-service
+ override
+ disabled
+ class hal animation
+ interface android.hardware.graphics.allocator@2.0::IAllocator default
+ user system
+ group graphics drmrpc
+ capabilities SYS_NICE
+ onrestart restart surfaceflinger
diff --git a/midas.mk b/midas.mk
index fa909a1..0fb7f5a 100644
--- a/midas.mk
+++ b/midas.mk
@@ -158,6 +158,8 @@ PRODUCT_COPY_FILES += device/samsung/midas-common/resize2fs_partitions.sh:system
PRODUCT_COPY_FILES += device/samsung/midas-common/prevent_suspend.sh:system/bin/prevent_suspend.sh
PRODUCT_COPY_FILES += device/samsung/midas-common/prevent_suspend.rc:system/etc/init/prevent_suspend.rc
+PRODUCT_COPY_FILES += device/samsung/midas-common/allocator/android.hardware.graphics.allocator@2.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.graphics.allocator@2.0-override-service.rc
+
# Enable Hardware compoments on the framework level
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml