Index: ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc |
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc |
index fcb888a753192bdda15f3f4cfacba526c982935d..62afcb2565c2699e0e2de1f3332791b536a54531 100644 |
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc |
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc |
@@ -15,6 +15,7 @@ |
namespace ui { |
namespace { |
+const char* kTypePropName = "type"; |
const char* kCrtcPropName = "CRTC_ID"; |
const char* kFbPropName = "FB_ID"; |
const char* kCrtcXPropName = "CRTC_X"; |
@@ -91,7 +92,14 @@ bool HardwareDisplayPlaneAtomic::SetPlaneData(drmModePropertySet* property_set, |
bool HardwareDisplayPlaneAtomic::Initialize( |
DrmDevice* drm, |
- const std::vector<uint32_t>& formats) { |
+ const std::vector<uint32_t>& formats, |
+ bool is_dummy) { |
+ if (is_dummy) { |
+ type_ = Dummy; |
+ supported_formats_.push_back(DRM_FORMAT_XRGB8888); |
+ return true; |
+ } |
+ |
ScopedDrmObjectPropertyPtr plane_props(drmModeObjectGetProperties( |
drm->get_fd(), plane_id_, DRM_MODE_OBJECT_PLANE)); |
@@ -117,8 +125,28 @@ bool HardwareDisplayPlaneAtomic::Initialize( |
} |
supported_formats_ = formats; |
- if (is_dummy()) |
- supported_formats_.push_back(DRM_FORMAT_XRGB8888); |
+ |
+ for (uint32_t i = 0; i < plane_props->count_props; i++) { |
+ ScopedDrmPropertyPtr property( |
+ drmModeGetProperty(drm->get_fd(), plane_props->props[i])); |
+ if (property && !strcmp(property->name, kTypePropName)) { |
+ int value = plane_props->prop_values[i]; |
+ switch (value) { |
dnicoara
2015/08/20 14:22:46
Could you please split this in a helper function?
kalyank
2015/08/20 16:36:18
Done.
|
+ case DRM_PLANE_TYPE_CURSOR: |
+ type_ = Cursor; |
+ break; |
+ case DRM_PLANE_TYPE_PRIMARY: |
+ type_ = Primary; |
+ break; |
+ case DRM_PLANE_TYPE_OVERLAY: |
+ type_ = Overlay; |
+ break; |
+ default: |
+ break; |
+ } |
+ break; |
+ } |
+ } |
return true; |
} |