dragonboards: Add support for upstream mesa/main vulkan

Patch completely suggested by Roman Stratiienko (many thanks!)

This patch enables config options needed to get vulkan
working using the upstream mesa/main branch.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I762436a5dc7403674eae5b20b6da1548805a7271
diff --git a/device-common.mk b/device-common.mk
index e781d2a..87f2bb4 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -85,6 +85,20 @@
     ro.opengles.version=196608 \
     persist.demo.rotationlock=1
 
+# Vulkan
+PRODUCT_PACKAGES += \
+	vulkan.freedreno
+
+PRODUCT_COPY_FILES += \
+	frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \
+	frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
+	frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \
+
+PRODUCT_VENDOR_PROPERTIES += \
+	ro.hardware.vulkan=freedreno
+
+# Will need to enable this after ANDROID_external_memory_android_hardware_buffer lands in mesa
+#TARGET_USES_VULKAN = true
 
 #
 # Hardware Composer HAL
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 1022689..e8738ac 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -65,6 +65,7 @@
 /vendor/lib(64)?/hw/android\.hardware\.health@2\.0-impl-2\.1-cuttlefish\.so		u:object_r:same_process_hal_file:s0
 /vendor/lib(64)?/hw/gralloc\.minigbm_msm\.so						u:object_r:same_process_hal_file:s0
 /vendor/lib(64)?/hw/android\.hardware\.graphics\.mapper@4\.0-impl\.minigbm_msm\.so	u:object_r:same_process_hal_file:s0
+/vendor/lib(64)?/hw/vulkan\.freedreno\.so						u:object_r:same_process_hal_file:s0
 /vendor/lib(64)?/libdrm\.so								u:object_r:same_process_hal_file:s0
 /vendor/lib(64)?/libdrm_freedreno\.so							u:object_r:same_process_hal_file:s0
 /vendor/lib(64)?/libgbm_mesa\.so							u:object_r:same_process_hal_file:s0