Add HAL definition for graphics buffer allocator

It differs from gralloc1.h in that

 - buffer descriptors are created from a struct, BufferDescriptorInfo, to
   reduce round trips
 - testAllocate is a function of its own
 - buffer allocation and export are two different steps
 - reference counting and buffer mapping are moved to gralloc-mapper
 - BAD_HANDLE is renamed to BAD_BUFFER
 - GRALLOC1_CONSUMER_USAGE_FOREIGN_BUFFERS is removed
 - CPU_{READ,WRITE}_OFTEN no longer implies CPU_{READ,WRITE}

Test: make android.hardware.graphics.allocator@2.0

Change-Id: Ibe9367d5b1701c0e1009da829f27fed0f7d98828
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
new file mode 100644
index 0000000..f29c50b
--- /dev/null
+++ b/graphics/allocator/2.0/Android.bp
@@ -0,0 +1,46 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+    name: "android.hardware.graphics.allocator@2.0_genc++",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.allocator@2.0",
+    srcs: [
+        "types.hal",
+        "IAllocator.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/types.cpp",
+        "android/hardware/graphics/allocator/2.0/AllocatorAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.graphics.allocator@2.0_genc++_headers",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.allocator@2.0",
+    srcs: [
+        "types.hal",
+        "IAllocator.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/types.h",
+        "android/hardware/graphics/allocator/2.0/IAllocator.h",
+        "android/hardware/graphics/allocator/2.0/IHwAllocator.h",
+        "android/hardware/graphics/allocator/2.0/BnAllocator.h",
+        "android/hardware/graphics/allocator/2.0/BpAllocator.h",
+        "android/hardware/graphics/allocator/2.0/BsAllocator.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.graphics.allocator@2.0",
+    generated_sources: ["android.hardware.graphics.allocator@2.0_genc++"],
+    generated_headers: ["android.hardware.graphics.allocator@2.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.graphics.allocator@2.0_genc++_headers"],
+    shared_libs: [
+        "libhidl",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+    ],
+}