Commit c4239a2d authored by Richard Li's avatar Richard Li Committed by Chromium LUCI CQ

Promoting two videos to overlays on some latest Intel platforms

Some latest Intel platforms(Icelake, Tigerlake) support two yuv MPO
planes. This CL add a workaround to promote two video quads to overlays
on Intel platforms. Previous test has showed this will benefit power
consumption when playing two videos simultaneously.

Bug: 1105618
Change-Id: I5fc44a5064d371a2fdad97dc63068c328ed55a46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2592629Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Commit-Queue: Richard Li <richard.li@intel.com>
Cr-Commit-Position: refs/heads/master@{#837928}
parent 795af3c8
...@@ -660,23 +660,21 @@ void DCLayerOverlayProcessor::Process( ...@@ -660,23 +660,21 @@ void DCLayerOverlayProcessor::Process(
candidate_index_list.push_back(index); candidate_index_list.push_back(index);
} }
// A YUV quad might be rejected later due to not allowed as an underlay.
// Recount the YUV overlays when they are added to the overlay list
// successfully.
processed_yuv_overlay_count_ = 0;
// TODO(magchen@): Revisit this code if allowed_yuv_overlay_count_ > 1. // We might not save power if there are more than one videos and only part of
// We might not save power if there are more than one videos and only one is // them are promoted to overlay. Skip overlays for this frame unless there are
// promoted to overlay. Skip overlays for this frame unless there are
// protected video or texture overlays. // protected video or texture overlays.
if (candidate_index_list.size() > 0 && bool reject_overlays = false;
yuv_quads_in_quad_list > allowed_yuv_overlay_count_ && if (yuv_quads_in_quad_list != processed_yuv_overlay_count_ &&
!has_protected_video_or_texture_overlays) { !has_protected_video_or_texture_overlays) {
candidate_index_list.clear(); reject_overlays = true;
// In this case, there is only one candidate in the list.
RecordDCLayerResult(DC_LAYER_FAILED_TOO_MANY_OVERLAYS, prev_it);
} }
// A YUV quad might be rejected later due to not allowed as an underlay.
// Recount the YUV overlays when they are added to the overlay list
// successfully.
processed_yuv_overlay_count_ = 0;
// Copy the overlay quad info to dc_layer_overlays and replace/delete overlay // Copy the overlay quad info to dc_layer_overlays and replace/delete overlay
// quads in quad_list. // quads in quad_list.
for (auto index : candidate_index_list) { for (auto index : candidate_index_list) {
...@@ -684,6 +682,10 @@ void DCLayerOverlayProcessor::Process( ...@@ -684,6 +682,10 @@ void DCLayerOverlayProcessor::Process(
prev_it = it; prev_it = it;
prev_index = index; prev_index = index;
if (reject_overlays) {
RecordDCLayerResult(DC_LAYER_FAILED_TOO_MANY_OVERLAYS, it);
continue;
}
gfx::Rect quad_rectangle_in_target_space = gfx::Rect quad_rectangle_in_target_space =
gfx::ToEnclosingRect(ClippedQuadRectangle(*it)); gfx::ToEnclosingRect(ClippedQuadRectangle(*it));
......
...@@ -161,7 +161,6 @@ class VIZ_SERVICE_EXPORT DCLayerOverlayProcessor ...@@ -161,7 +161,6 @@ class VIZ_SERVICE_EXPORT DCLayerOverlayProcessor
bool has_overlay_support_; bool has_overlay_support_;
const bool use_overlay_damage_list_; const bool use_overlay_damage_list_;
// TODO(magchen@): We are going to support more than one YUV overlay.
const int allowed_yuv_overlay_count_; const int allowed_yuv_overlay_count_;
int processed_yuv_overlay_count_ = 0; int processed_yuv_overlay_count_ = 0;
......
...@@ -115,6 +115,9 @@ class VIZ_SERVICE_EXPORT OutputSurface { ...@@ -115,6 +115,9 @@ class VIZ_SERVICE_EXPORT OutputSurface {
int max_render_target_size = 0; int max_render_target_size = 0;
// The root surface is rendered using vulkan secondary command buffer. // The root surface is rendered using vulkan secondary command buffer.
bool root_is_vulkan_secondary_command_buffer = false; bool root_is_vulkan_secondary_command_buffer = false;
// Some new Intel GPUs support two YUV MPO planes. Promoting two videos
// to hardware overlays in these platforms will benefit power consumption.
bool supports_two_yuv_hardware_overlays = false;
// SkColorType for all supported buffer formats. // SkColorType for all supported buffer formats.
SkColorType sk_color_types[static_cast<int>(gfx::BufferFormat::LAST) + 1] = SkColorType sk_color_types[static_cast<int>(gfx::BufferFormat::LAST) + 1] =
......
...@@ -98,8 +98,12 @@ OverlayProcessorInterface::CreateOverlayProcessor( ...@@ -98,8 +98,12 @@ OverlayProcessorInterface::CreateOverlayProcessor(
return std::make_unique<OverlayProcessorStub>(); return std::make_unique<OverlayProcessorStub>();
return std::make_unique<OverlayProcessorWin>( return std::make_unique<OverlayProcessorWin>(
output_surface, std::make_unique<DCLayerOverlayProcessor>( output_surface,
debug_settings, /*allowed_yuv_overlay_count=*/1)); std::make_unique<DCLayerOverlayProcessor>(
debug_settings, /*allowed_yuv_overlay_count=*/capabilities
.supports_two_yuv_hardware_overlays
? 2
: 1));
#elif defined(USE_OZONE) #elif defined(USE_OZONE)
if (!features::IsUsingOzonePlatform()) if (!features::IsUsingOzonePlatform())
return std::make_unique<OverlayProcessorStub>(); return std::make_unique<OverlayProcessorStub>();
......
...@@ -132,6 +132,9 @@ SkiaOutputDeviceGL::SkiaOutputDeviceGL( ...@@ -132,6 +132,9 @@ SkiaOutputDeviceGL::SkiaOutputDeviceGL(
if (feature_info->workarounds().force_rgb10a2_overlay_support_flags) { if (feature_info->workarounds().force_rgb10a2_overlay_support_flags) {
capabilities_.forces_rgb10a2_overlay_support_flags = true; capabilities_.forces_rgb10a2_overlay_support_flags = true;
} }
if (feature_info->workarounds().supports_two_yuv_hardware_overlays) {
capabilities_.supports_two_yuv_hardware_overlays = true;
}
capabilities_.max_frames_pending = gl_surface_->GetBufferCount() - 1; capabilities_.max_frames_pending = gl_surface_->GetBufferCount() - 1;
capabilities_.supports_commit_overlay_planes = capabilities_.supports_commit_overlay_planes =
gl_surface_->SupportsCommitOverlayPlanes(); gl_surface_->SupportsCommitOverlayPlanes();
......
...@@ -3644,6 +3644,21 @@ ...@@ -3644,6 +3644,21 @@
"features": [ "features": [
"disable_accelerated_vp9_profile2_decode" "disable_accelerated_vp9_profile2_decode"
] ]
},
{
"id": 362,
"description": "Promote 2 videos to hardware overlays on Windows Intel platforms",
"cr_bugs": [1105618],
"os": {
"type": "win"
},
"intel_gpu_series": [
"icelake",
"tigerlake"
],
"features": [
"supports_two_yuv_hardware_overlays"
]
} }
] ]
} }
...@@ -110,6 +110,7 @@ round_down_uniform_bind_buffer_range_size ...@@ -110,6 +110,7 @@ round_down_uniform_bind_buffer_range_size
scalarize_vec_and_mat_constructor_args scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap set_zero_level_before_generating_mipmap
simulate_out_of_memory_on_large_textures simulate_out_of_memory_on_large_textures
supports_two_yuv_hardware_overlays
unbind_attachments_on_bound_render_fbo_delete unbind_attachments_on_bound_render_fbo_delete
unbind_egl_context_to_flush_driver_caches unbind_egl_context_to_flush_driver_caches
unbind_fbo_on_context_switch unbind_fbo_on_context_switch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment