dragonboards: refactor graphics configs to independent fragments

Breakdown graphics configs to project specific fragments and
include them in target device config files individually.

It is the first step in cherry-picking the board specific
features/projects in the future target configuration(s).

Change-Id: If4aec9b7c789a243b98fcce8b4a4b6fcfd828c0a
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/shared/graphics/mesa/BoardConfig.mk b/shared/graphics/mesa/BoardConfig.mk
new file mode 100644
index 0000000..8836060
--- /dev/null
+++ b/shared/graphics/mesa/BoardConfig.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+BOARD_GPU_DRIVERS := freedreno
+ifeq ($(TARGET_BUILD_MESA),true)
+BOARD_MESA3D_USES_MESON_BUILD := true
+BOARD_MESA3D_GALLIUM_DRIVERS := freedreno
+BOARD_MESA3D_VULKAN_DRIVERS := freedreno
+else
+BOARD_USE_CUSTOMIZED_MESA := true
+endif
diff --git a/shared/graphics/mesa/device.mk b/shared/graphics/mesa/device.mk
new file mode 100644
index 0000000..f38c568
--- /dev/null
+++ b/shared/graphics/mesa/device.mk
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2014 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# GLES
+PRODUCT_PACKAGES := \
+    libGLES_mesa \
+    libEGL_mesa \
+    libGLESv1_CM_mesa \
+    libGLESv2_mesa \
+    libgallium_dri \
+    libglapi
+
+TARGET_BUILD_MESA ?= false
+ifeq ($(TARGET_BUILD_MESA), true)
+   PRODUCT_SOONG_NAMESPACES += \
+       external/mesa3d
+endif
+
+PRODUCT_PROPERTY_OVERRIDES := \
+    ro.sf.lcd_density=160 \
+    ro.opengles.version=196608 \
+    persist.demo.rotationlock=1
+
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
+    frameworks/native/data/etc/android.software.opengles.deqp.level-2022-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml
+
+# Vulkan
+PRODUCT_PACKAGES += \
+    vulkan.freedreno
+
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \
+    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 Freedreno
+#TARGET_USES_VULKAN = true