Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: ui/ozone/platform/drm/common/drm_util.cc

Issue 2636203002: ozone: Select a crtc even when KMS doesn't report any plane for it. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/common/drm_util.h" 5 #include "ui/ozone/platform/drm/common/drm_util.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 drmModeConnector* connector, 65 drmModeConnector* connector,
66 drmModeRes* resources, 66 drmModeRes* resources,
67 const ScopedVector<HardwareDisplayControllerInfo>& displays) { 67 const ScopedVector<HardwareDisplayControllerInfo>& displays) {
68 ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(fd)); 68 ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(fd));
69 std::vector<ScopedDrmPlanePtr> planes; 69 std::vector<ScopedDrmPlanePtr> planes;
70 for (uint32_t i = 0; i < plane_resources->count_planes; i++) 70 for (uint32_t i = 0; i < plane_resources->count_planes; i++)
71 planes.emplace_back(drmModeGetPlane(fd, plane_resources->planes[i])); 71 planes.emplace_back(drmModeGetPlane(fd, plane_resources->planes[i]));
72 72
73 DCHECK_GE(32, resources->count_crtcs); 73 DCHECK_GE(32, resources->count_crtcs);
74 uint32_t best_crtc = 0; 74 uint32_t best_crtc = 0;
75 int best_crtc_planes = 0; 75 int best_crtc_planes = -1;
76 76
77 // Try to find an encoder for the connector. 77 // Try to find an encoder for the connector.
78 for (int i = 0; i < connector->count_encoders; ++i) { 78 for (int i = 0; i < connector->count_encoders; ++i) {
79 ScopedDrmEncoderPtr encoder(drmModeGetEncoder(fd, connector->encoders[i])); 79 ScopedDrmEncoderPtr encoder(drmModeGetEncoder(fd, connector->encoders[i]));
80 if (!encoder) 80 if (!encoder)
81 continue; 81 continue;
82 82
83 for (int j = 0; j < resources->count_crtcs; ++j) { 83 for (int j = 0; j < resources->count_crtcs; ++j) {
84 // Check if the encoder is compatible with this CRTC 84 // Check if the encoder is compatible with this CRTC
85 int crtc_bit = 1 << j; 85 int crtc_bit = 1 << j;
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 case gfx::BufferFormat::BGR_565: 449 case gfx::BufferFormat::BGR_565:
450 return DRM_FORMAT_RGB565; 450 return DRM_FORMAT_RGB565;
451 case gfx::BufferFormat::UYVY_422: 451 case gfx::BufferFormat::UYVY_422:
452 return DRM_FORMAT_UYVY; 452 return DRM_FORMAT_UYVY;
453 default: 453 default:
454 NOTREACHED(); 454 NOTREACHED();
455 return 0; 455 return 0;
456 } 456 }
457 } 457 }
458 } // namespace ui 458 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698