summaryrefslogtreecommitdiffstats
path: root/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
diff options
context:
space:
mode:
authorachaulk <achaulk@chromium.org>2015-04-24 13:09:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-24 20:09:15 +0000
commite5983b7fde9d576bd514490106564e2238eb0713 (patch)
tree13013c5671f2ffa1c7492ca50d610a7a7ee782d1 /ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
parent2ed5f820be60cfe8ef53f2e25605ae94bda8de0a (diff)
downloadchromium_src-e5983b7fde9d576bd514490106564e2238eb0713.zip
chromium_src-e5983b7fde9d576bd514490106564e2238eb0713.tar.gz
chromium_src-e5983b7fde9d576bd514490106564e2238eb0713.tar.bz2
ozone: Add ability to set client capabilities which we will need for atomic
Review URL: https://codereview.chromium.org/1100803004 Cr-Commit-Position: refs/heads/master@{#326860}
Diffstat (limited to 'ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc')
-rw-r--r--ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
index 7c7b0bf..ea21a9a 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
@@ -67,6 +67,14 @@ HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() {
bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) {
drm_ = drm;
+
+ // Try to get all of the planes if possible, so we don't have to try to
+ // discover hidden primary planes.
+ bool has_universal_planes = false;
+#if defined(DRM_CLIENT_CAP_UNIVERSAL_PLANES)
+ has_universal_planes = drm->SetCapability(DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+#endif // defined(DRM_CLIENT_CAP_UNIVERSAL_PLANES)
+
ScopedDrmResourcesPtr resources(drmModeGetResources(drm->get_fd()));
if (!resources) {
PLOG(ERROR) << "Failed to get resources";
@@ -104,13 +112,15 @@ bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) {
// dummy plane for which we can assign exactly one overlay.
// TODO(dnicoara): refactor this to simplify AssignOverlayPlanes and move
// this workaround into HardwareDisplayPlaneLegacy.
- for (int i = 0; i < resources->count_crtcs; ++i) {
- if (plane_ids.find(resources->crtcs[i] - 1) == plane_ids.end()) {
- scoped_ptr<HardwareDisplayPlane> dummy_plane(
- CreatePlane(resources->crtcs[i] - 1, (1 << i)));
- dummy_plane->set_is_dummy(true);
- if (dummy_plane->Initialize(drm))
- planes_.push_back(dummy_plane.release());
+ if (!has_universal_planes) {
+ for (int i = 0; i < resources->count_crtcs; ++i) {
+ if (plane_ids.find(resources->crtcs[i] - 1) == plane_ids.end()) {
+ scoped_ptr<HardwareDisplayPlane> dummy_plane(
+ CreatePlane(resources->crtcs[i] - 1, (1 << i)));
+ dummy_plane->set_is_dummy(true);
+ if (dummy_plane->Initialize(drm))
+ planes_.push_back(dummy_plane.release());
+ }
}
}