drm_hwcomposer: Support Nvidia gralloc
When using an Nvidia gralloc implementation, ask Nvidia gralloc to import the
buffer_handle_t to the hwcomposer's drm device.
Arguably, the code to perform the import would more naturally belong to
drm_hwcomposer than Nvidia gralloc. But letting Nvidia gralloc do it has two
advantages. First, drm_hwcomposer doesn't need to include vendor headers or
link against vendor libraries. This means that it's easy to support both
drm_gralloc and Nvidia gralloc from the same default build of drm_hwcomposer.
Second, Nvidia gralloc will take care of properly setting up any vendor
specific metadata (such as tiling parameters) of the imported GEM handle.
Change-Id: I0f77fb301e7e0bff2a8cd7befeae4bc4892220ad
Reviewed-on: https://chrome-internal-review.googlesource.com/195115
Reviewed-by: Stéphane Marchesin <marcheu@google.com>
Commit-Queue: Stéphane Marchesin <marcheu@google.com>
Tested-by: Stéphane Marchesin <marcheu@google.com>
diff --git a/drm_hwcomposer.h b/drm_hwcomposer.h
index a83acab..35b3aa9 100644
--- a/drm_hwcomposer.h
+++ b/drm_hwcomposer.h
@@ -16,6 +16,10 @@
struct hwc_import_context;
+enum {
+ GRALLOC_MODULE_PERFORM_DRM_IMPORT = 0xffeeff00
+};
+
struct hwc_drm_bo {
uint32_t width;
uint32_t height;