drm_hwcomposer: Extract ConvertBoInfo() from ImportBuffer() method

To check either BO could be imported on validation stage, we need to
get more information regarding buffer (format, size, etc.)

This extraction also allows us to make ImportBuffer() and CanImport()
methods generic for all platforms.

In case BO can't be imported due to already existant checks in ImportBuffer(),
validator only marks single layer to be elaborated by GPU instead of whole
composition.

Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
diff --git a/include/drmhwcgralloc.h b/include/drmhwcgralloc.h
index 65a4007..b959714 100644
--- a/include/drmhwcgralloc.h
+++ b/include/drmhwcgralloc.h
@@ -29,8 +29,11 @@
   uint32_t pixel_stride;
   uint32_t pitches[HWC_DRM_BO_MAX_PLANES];
   uint32_t offsets[HWC_DRM_BO_MAX_PLANES];
+  uint32_t prime_fds[HWC_DRM_BO_MAX_PLANES];
   uint32_t gem_handles[HWC_DRM_BO_MAX_PLANES];
+  uint64_t modifiers[HWC_DRM_BO_MAX_PLANES];
   uint32_t fb_id;
+  bool with_modifiers;
   int acquire_fence_fd;
   void *priv;
 } hwc_drm_bo_t;
diff --git a/include/platform.h b/include/platform.h
index 6fdece2..6775e29 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -52,6 +52,9 @@
 
   // Checks if importer can import the buffer.
   virtual bool CanImportBuffer(buffer_handle_t handle) = 0;
+
+  // Convert platform-dependent buffer format to drm_hwc internal format.
+  virtual int ConvertBoInfo(buffer_handle_t handle, hwc_drm_bo_t *bo) = 0;
 };
 
 class Planner {