Commit 96534fd9 authored by jchen10's avatar jchen10 Committed by Commit Bot

Force NV12 overlay on some Intel GPUs

The NV12 overlay support isn't reported by driver on some Intel
KBL devices. This adds a list of these device IDs to workaround.

Bug: 1079393
Change-Id: Id4dc477dbbe03b61e2f9105f14276c4795526547
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409214Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Cr-Commit-Position: refs/heads/master@{#806862}
parent 6bdff0cc
...@@ -3543,6 +3543,22 @@ ...@@ -3543,6 +3543,22 @@
"features": [ "features": [
"reset_vp_when_colorspace_changes" "reset_vp_when_colorspace_changes"
] ]
},
{
"id": 351,
"cr_bugs": [1079393],
"description": "Some Intel GPUs have NV12 overlay support, but aren't advertised.",
"os": {
"type": "win"
},
"vendor_id": "0x8086",
"device_id": ["0x5906", "0x5913", "0x5916", "0x5921", "0x5926", "0x590e",
"0x5915", "0x591e", "0x5902", "0x5917", "0x590b", "0x5908",
"0x591b", "0x593b", "0x590a", "0x591a", "0x591d", "0x5923",
"0x5927", "0x5932", "0x592b", "0x592a", "0x593a", "0x593d"],
"features": [
"force_nv12_overlay_support"
]
} }
] ]
} }
...@@ -72,6 +72,7 @@ force_gl_flush_on_swap_buffers ...@@ -72,6 +72,7 @@ force_gl_flush_on_swap_buffers
force_high_performance_gpu force_high_performance_gpu
force_int_or_srgb_cube_texture_complete force_int_or_srgb_cube_texture_complete
force_low_power_gpu force_low_power_gpu
force_nv12_overlay_support
force_rgb10a2_overlay_support_flags force_rgb10a2_overlay_support_flags
force_update_scissor_state_when_binding_fbo0 force_update_scissor_state_when_binding_fbo0
get_frag_data_info_bug get_frag_data_info_bug
......
...@@ -96,6 +96,9 @@ void InitializePlatformOverlaySettings(GPUInfo* gpu_info, ...@@ -96,6 +96,9 @@ void InitializePlatformOverlaySettings(GPUInfo* gpu_info,
gpu::ENABLE_BGRA8_OVERLAYS_WITH_YUV_OVERLAY_SUPPORT)) { gpu::ENABLE_BGRA8_OVERLAYS_WITH_YUV_OVERLAY_SUPPORT)) {
gl::DirectCompositionSurfaceWin::EnableBGRA8OverlaysWithYUVOverlaySupport(); gl::DirectCompositionSurfaceWin::EnableBGRA8OverlaysWithYUVOverlaySupport();
} }
if (gpu_feature_info.IsWorkaroundEnabled(gpu::FORCE_NV12_OVERLAY_SUPPORT)) {
gl::DirectCompositionSurfaceWin::ForceNV12OverlaySupport();
}
DCHECK(gpu_info); DCHECK(gpu_info);
CollectHardwareOverlayInfo(&gpu_info->overlay_info); CollectHardwareOverlayInfo(&gpu_info->overlay_info);
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
......
...@@ -38,6 +38,8 @@ bool g_overlay_caps_valid = false; ...@@ -38,6 +38,8 @@ bool g_overlay_caps_valid = false;
bool g_supports_overlays = false; bool g_supports_overlays = false;
// Whether the DecodeSwapChain is disabled or not. // Whether the DecodeSwapChain is disabled or not.
bool g_decode_swap_chain_disabled = false; bool g_decode_swap_chain_disabled = false;
// Whether to force the nv12 overlay support.
bool g_force_nv12_overlay_support = false;
// The lock to guard g_overlay_caps_valid and g_supports_overlays. // The lock to guard g_overlay_caps_valid and g_supports_overlays.
base::Lock& GetOverlayLock() { base::Lock& GetOverlayLock() {
...@@ -295,6 +297,12 @@ void UpdateOverlaySupport() { ...@@ -295,6 +297,12 @@ void UpdateOverlaySupport() {
&bgra8_overlay_support_flags, &rgb10a2_overlay_support_flags, &bgra8_overlay_support_flags, &rgb10a2_overlay_support_flags,
&overlay_monitor_size); &overlay_monitor_size);
if (g_force_nv12_overlay_support) {
supports_overlays = true;
nv12_overlay_support_flags = DXGI_OVERLAY_SUPPORT_FLAG_SCALING;
overlay_format_used = DXGI_FORMAT_NV12;
}
if (supports_overlays != SupportsOverlays() || if (supports_overlays != SupportsOverlays() ||
overlay_format_used != g_overlay_format_used) { overlay_format_used != g_overlay_format_used) {
// Record the new histograms // Record the new histograms
...@@ -639,6 +647,13 @@ void DirectCompositionSurfaceWin::EnableBGRA8OverlaysWithYUVOverlaySupport() { ...@@ -639,6 +647,13 @@ void DirectCompositionSurfaceWin::EnableBGRA8OverlaysWithYUVOverlaySupport() {
g_enable_bgra8_overlays_with_yuv_overlay_support = true; g_enable_bgra8_overlays_with_yuv_overlay_support = true;
} }
// static
void DirectCompositionSurfaceWin::ForceNV12OverlaySupport() {
// This has to be set before initializing overlay caps.
DCHECK(!OverlayCapsValid());
g_force_nv12_overlay_support = true;
}
bool DirectCompositionSurfaceWin::Initialize(GLSurfaceFormat format) { bool DirectCompositionSurfaceWin::Initialize(GLSurfaceFormat format) {
d3d11_device_ = QueryD3D11DeviceObjectFromANGLE(); d3d11_device_ = QueryD3D11DeviceObjectFromANGLE();
if (!d3d11_device_) { if (!d3d11_device_) {
......
...@@ -100,6 +100,10 @@ class GL_EXPORT DirectCompositionSurfaceWin : public GLSurfaceEGL, ...@@ -100,6 +100,10 @@ class GL_EXPORT DirectCompositionSurfaceWin : public GLSurfaceEGL,
// unsupported. So allow manually enabling BGRA8 overlay support. // unsupported. So allow manually enabling BGRA8 overlay support.
static void EnableBGRA8OverlaysWithYUVOverlaySupport(); static void EnableBGRA8OverlaysWithYUVOverlaySupport();
// Forces to enable NV12 overlay support regardless of the query results from
// IDXGIOutput3::CheckOverlaySupport().
static void ForceNV12OverlaySupport();
// GLSurfaceEGL implementation. // GLSurfaceEGL implementation.
bool Initialize(GLSurfaceFormat format) override; bool Initialize(GLSurfaceFormat format) override;
void Destroy() override; void Destroy() override;
......
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