aboutsummaryrefslogtreecommitdiff
path: root/platform/platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/platform.cpp')
-rw-r--r--platform/platform.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/platform/platform.cpp b/platform/platform.cpp
index b7a47c7..a500398 100644
--- a/platform/platform.cpp
+++ b/platform/platform.cpp
@@ -17,10 +17,11 @@
#define LOG_TAG "hwc-platform"
#include "platform.h"
-#include "drmdevice.h"
#include <log/log.h>
+#include "drm/DrmDevice.h"
+
namespace android {
std::vector<DrmPlane *> Planner::GetUsablePlanes(
@@ -77,6 +78,13 @@ int Planner::PlanStage::ValidatePlane(DrmPlane *plane, DrmHwcLayer *layer) {
ALOGE("Expected a valid blend mode on plane %d", plane->id());
}
+ uint32_t format = layer->buffer->format;
+ if (!plane->IsFormatSupported(format)) {
+ ALOGE("Plane %d does not supports %c%c%c%c format", plane->id(), format,
+ format >> 8, format >> 16, format >> 24);
+ return -EINVAL;
+ }
+
return ret;
}