drm_hwcomposer: Cursor plane buffer validation

This change adds a check to DrmPlane::IsValidForLayer which
checks cursor-plane-specific requirements that the layer's
buffer has an acceptable size according to either the plane's
SIZE_HINTS or the device's DRM_CAP_CURSOR_{WIDTH|HEIGHT}
properties.

Change-Id: Ic88699996c6616e8da7a4527b03a12c12422fb8f
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
diff --git a/drm/DrmPlane.h b/drm/DrmPlane.h
index b744b2d..2fa6388 100644
--- a/drm/DrmPlane.h
+++ b/drm/DrmPlane.h
@@ -65,6 +65,8 @@
     return plane_->plane_id;
   }
 
+  bool HasCursorSizeConstraints() const;
+
  private:
   DrmPlane(DrmDevice &dev, DrmModePlaneUnique plane)
       : drm_(&dev), plane_(std::move(plane)){};
@@ -76,6 +78,7 @@
   auto Init() -> int;
   auto GetPlaneProperty(const char *prop_name, DrmProperty &property,
                         Presence presence = Presence::kMandatory) -> bool;
+  bool IsBufferValidForCursorPlane(const BufferInfo &bi) const;
 
   uint32_t type_{};