| Index: ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
|
| diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
|
| index 100c7a405ecd97318359373e24ee1c4173cf6ba6..53fb4c180593e4bdd3d450b9af963ad0ddad1850 100644
|
| --- a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
|
| +++ b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
|
| @@ -108,6 +108,37 @@ void DrmGpuDisplayManager::GetScanoutFormats(
|
| scanout_formats->push_back(GetBufferFormatFromFourCCFormat(fourcc));
|
| }
|
|
|
| +void DrmGpuDisplayManager::GetScanoutFormatsWithModifiers(
|
| + gfx::AcceleratedWidget widget,
|
| + gfx::GpuMemoryBufferAttribVector* scanout_combinations) {
|
| + HardwareDisplayPlaneManager* plane_manager =
|
| + drm_device_manager_->GetDrmDevice(widget)
|
| + ->plane_manager();
|
| + const std::vector<uint32_t>& fourcc_formats =
|
| + plane_manager->GetSupportedFormats();
|
| +
|
| + for (auto& format : fourcc_formats) {
|
| + const std::vector<std::unique_ptr<HardwareDisplayPlane>>& planes =
|
| + plane_manager->planes();
|
| + for (auto& plane : planes) {
|
| + if (plane->type() != HardwareDisplayPlane::kPrimary)
|
| + continue;
|
| +
|
| + const std::vector<uint64_t>& drm_modifiers =
|
| + plane->ModifiersForFormat(format);
|
| + if (drm_modifiers.size() > 0) {
|
| + for (auto modifier : drm_modifiers) {
|
| + scanout_combinations->push_back(gfx::GpuMemoryBufferAttrib(
|
| + GetBufferFormatFromFourCCFormat(format), modifier));
|
| + }
|
| + } else
|
| + scanout_combinations->push_back(gfx::GpuMemoryBufferAttrib(
|
| + GetBufferFormatFromFourCCFormat(format), 0 /* MOD_NONE */));
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +
|
| bool DrmGpuDisplayManager::TakeDisplayControl() {
|
| const DrmDeviceVector& devices = drm_device_manager_->GetDrmDevices();
|
| bool status = true;
|
|
|