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/platform.h b/platform.h
index 547a297..a58d62e 100644
--- a/platform.h
+++ b/platform.h
@@ -49,6 +49,9 @@
// Note: This can be called from a different thread than ImportBuffer. The
// implementation is responsible for ensuring thread safety.
virtual int ReleaseBuffer(hwc_drm_bo_t *bo) = 0;
+
+ // Checks if importer can import the buffer.
+ virtual bool CanImportBuffer(buffer_handle_t handle) = 0;
};
class Planner {