OSDN Git Service

drm_hwcomposer: On error, free active composition
[android-x86/external-drm_hwcomposer.git] / drmplane.cpp
index 3f17d7c..c4ea722 100644 (file)
@@ -19,6 +19,7 @@
 #include "drmplane.h"
 #include "drmresources.h"
 
+#include <cinttypes>
 #include <errno.h>
 #include <stdint.h>
 
@@ -31,9 +32,6 @@ DrmPlane::DrmPlane(DrmResources *drm, drmModePlanePtr p)
     : drm_(drm), id_(p->plane_id), possible_crtc_mask_(p->possible_crtcs) {
 }
 
-DrmPlane::~DrmPlane() {
-}
-
 int DrmPlane::Init() {
   DrmProperty p;
 
@@ -56,7 +54,7 @@ int DrmPlane::Init() {
       type_ = (uint32_t)type;
       break;
     default:
-      ALOGE("Invalid plane type %d", type);
+      ALOGE("Invalid plane type %" PRIu64, type);
       return -EINVAL;
   }
 
@@ -124,6 +122,10 @@ int DrmPlane::Init() {
   if (ret)
     ALOGE("Could not get rotation property");
 
+  ret = drm_->GetPlaneProperty(*this, "alpha", &alpha_property_);
+  if (ret)
+    ALOGI("Could not get alpha property");
+
   return 0;
 }
 
@@ -182,4 +184,8 @@ const DrmProperty &DrmPlane::src_h_property() const {
 const DrmProperty &DrmPlane::rotation_property() const {
   return rotation_property_;
 }
+
+const DrmProperty &DrmPlane::alpha_property() const {
+  return alpha_property_;
+}
 }