drm_hwcomposer: Add checking if we can import a buffer
Add CanImportBuffer() function to the Importer interface.
Platform specific importer should check in this function if it can
import given buffer_handle_t. For example platformhisi will return
false for buffers without GRALLOC_USAGE_HW_FB.
This function should be used on ValidateDisplay step to avoid the
need of 'fake-importing' of buffers.
Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
diff --git a/platformdrmgeneric.cpp b/platformdrmgeneric.cpp
index 24d0650..503c04a 100644
--- a/platformdrmgeneric.cpp
+++ b/platformdrmgeneric.cpp
@@ -161,6 +161,12 @@
return 0;
}
+bool DrmGenericImporter::CanImportBuffer(buffer_handle_t handle) {
+ if (handle == NULL)
+ return false;
+ return true;
+}
+
#ifdef USE_DRM_GENERIC_IMPORTER
std::unique_ptr<Planner> Planner::CreateInstance(DrmDevice *) {
std::unique_ptr<Planner> planner(new Planner);