]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
Detect HIDL gralloc4
authorAlessandro Astone <ales.astone@gmail.com>
Mon, 29 Aug 2022 09:10:14 +0000 (11:10 +0200)
committerAlessandro Astone <ales.astone@gmail.com>
Fri, 2 Sep 2022 12:02:09 +0000 (14:02 +0200)
tools/helpers/lxc.py

index 8cacfe25ccee0b9497814c9d8b790516a7e6ab70..a099801de4667a47e167d6f8f1809511a9b45ddf 100644 (file)
@@ -7,6 +7,7 @@ import logging
 import glob
 import shutil
 import platform
 import glob
 import shutil
 import platform
+import gbinder
 import tools.config
 import tools.helpers.run
 
 import tools.config
 import tools.helpers.run
 
@@ -171,6 +172,16 @@ def make_base_props(args):
                         return prop
         return ""
 
                         return prop
         return ""
 
+    def find_hidl(intf):
+        if args.vendor_type == "MAINLINE":
+            return False
+
+        try:
+            sm = gbinder.ServiceManager("/dev/hwbinder")
+            return intf in sm.list_sync()
+        except:
+            return False
+
     props = []
 
     if not os.path.exists("/dev/ashmem"):
     props = []
 
     if not os.path.exists("/dev/ashmem"):
@@ -180,7 +191,10 @@ def make_base_props(args):
     dri = tools.helpers.gpu.getDriNode(args)
 
     gralloc = find_hal("gralloc")
     dri = tools.helpers.gpu.getDriNode(args)
 
     gralloc = find_hal("gralloc")
-    if gralloc == "":
+    if not gralloc:
+        if find_hidl("android.hardware.graphics.allocator@4.0::IAllocator/default"):
+            gralloc = "android"
+    if not gralloc:
         if dri:
             gralloc = "gbm"
             egl = "mesa"
         if dri:
             gralloc = "gbm"
             egl = "mesa"