Falling-back to direct allocation ensures allocation failure returns OOM.
If no OOM, the resource could be left then used while in an invalid state.
BUG=chromium:1045811,chromium:1047220,chromium:1047048
Change-Id: I927962b1dc6a7422a7d6eac114d82f28a42794a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15600
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Brings the list of dependencies for a standalone Dawn app down from:
obj/libdawn_native.a
obj/libdawn_utils.a
obj/src/dawn/libdawn_proc.a
obj/third_party/shaderc/libshaderc_spvc/spvc.o
obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
obj/third_party/SPIRV-Tools/libspvtools_opt.a
to
obj/libdawn_native.a
obj/src/dawn/libdawn_proc.a
Bug: dawn:327
Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
The SampleUtils uses CreateSwapChain with a nullptr surface. This is
currently valid with implementation-based swapchains so the argument
should be tagged as optional.
Bug: dawn:269
Change-Id: Ic00d5a67fb038d2771174bb36f99b66b84f1a252
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
signatures of Vulkan functions, changing their ABI and making us
incompatible with real drivers. This removes that magic, and replaces it
with an explicit wrapper, VkHandle, which has much of the same
functionality as the original VkNonDispatchableHandle.
It adds definitions for dawn_native::vulkan::VkBuffer et al, which
shadow the native ::VkBuffer et al. This retains type safety throughout
the Vulkan backend without changing every single usage.
Notably, the following things had to change:
- An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
arrays. This is implemented as a reinterpret_cast, which is still
safe as the new VkHandle still has the same memory layout properties
as VkNonDispatchableHandle did.
- When pointing to a VkHandle as an output pointer, it's now necessary
to explicitly get the native ::VkBuffer (via operator*) and point to
it.
Previously reviewed on:
https://dawn-review.googlesource.com/c/dawn/+/15580
Bug: chromium:1046362
Change-Id: I7d34ec38a805025f92165ea9a7ee07ae5c182076
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15641
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This reverts commit 4e17d5c248.
Reason for revert: broken on chromeos
Original change's description:
> Remove VK_DEFINE_NON_DISPATCHABLE_HANDLE magic, use explicit VkHandle wrapper
>
> Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
> signatures of Vulkan functions, changing their ABI and making us
> incompatible with real drivers. This removes that magic, and replaces it
> with an explicit wrapper, VkHandle, which has much of the same
> functionality as the original VkNonDispatchableHandle.
>
> It adds definitions for dawn_native::vulkan::VkBuffer et al, which
> shadow the native ::VkBuffer et al. This retains type safety throughout
> the Vulkan backend without changing every single usage.
>
> Notably, the following things had to change:
> - An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
> arrays. This is implemented as a reinterpret_cast, which is still
> safe as the new VkHandle still has the same memory layout properties
> as VkNonDispatchableHandle did.
> - When pointing to a VkHandle as an output pointer, it's now necessary
> to explicitly get the native ::VkBuffer (via operator*) and point to it.
>
> Bug: chromium:1046362
> Change-Id: I9c5691b6e295aca1b46d4e3d0203956e4d570285
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15580
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org
Change-Id: I500df2e34fd0f245ad04c517ff028ddd7bb5a2bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1046362
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15620
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
signatures of Vulkan functions, changing their ABI and making us
incompatible with real drivers. This removes that magic, and replaces it
with an explicit wrapper, VkHandle, which has much of the same
functionality as the original VkNonDispatchableHandle.
It adds definitions for dawn_native::vulkan::VkBuffer et al, which
shadow the native ::VkBuffer et al. This retains type safety throughout
the Vulkan backend without changing every single usage.
Notably, the following things had to change:
- An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
arrays. This is implemented as a reinterpret_cast, which is still
safe as the new VkHandle still has the same memory layout properties
as VkNonDispatchableHandle did.
- When pointing to a VkHandle as an output pointer, it's now necessary
to explicitly get the native ::VkBuffer (via operator*) and point to it.
Bug: chromium:1046362
Change-Id: I9c5691b6e295aca1b46d4e3d0203956e4d570285
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15580
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
BUG=dawn:325
Change-Id: I66bed7fec65cadecc956878bf11fc204b66ad195
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15500
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Roll third_party/SPIRV-Tools/ 323a81fc5..1b3441036 (9 commits)
323a81fc5e..1b3441036a
$ git log 323a81fc5..1b3441036 --date=short --no-merges --format='%ad %ae %s'
2020-01-24 syoussefi Fix chromium build (#3152)
2020-01-24 dneto Clarify mapping of target env to SPIR-V version (#3150)
2020-01-24 greg Use dummy switch instead of dummy loop in MergeReturn pass. (#3151)
2020-01-23 alanbaker Fix structured exit validation (#3141)
2020-01-23 dneto Add spvParseVulkanEnv (#3142)
2020-01-23 jaebaek Handle conflict between debug info and existing validation rule (#3104)
2020-01-23 syoussefi Use spirv-headers' BUILD.gn (#3148)
2020-01-23 syoussefi Roll external/spirv-headers/ af64a9e82..dc77030ac (4 commits) (#3147)
2020-01-21 afdx spirv-fuzz: Refactoring and type-related fixes (#3144)
Roll third_party/glslang/ b0ada8035..07a55839e (15 commits)
b0ada80356..07a55839ee
$ git log b0ada8035..07a55839e --date=short --no-merges --format='%ad %ae %s'
2020-01-27 rharrison Use correct enum type in case statement
2020-01-27 cepheus Build: Fix more build warnings caused by PR #2038.
2020-01-26 cepheus Build warning: Fix#2062, missing enum value in a switch.
2020-01-08 sk Public: replaced tabs with spaces
2020-01-08 sk CInterface: replaced tabs with spaces
2019-12-30 sk CInterface: added static asserts to compare C/C++ enums
2019-12-30 sk Added LAST_ELEMENT_MARKER for every enum used in the C interface
2019-12-26 sk CInterface: replaced SH_ prefix with GLSLANG_
2019-12-25 sk CInterface: added glslang_program_SPIRV_get_ptr()
2019-12-25 sk CInterface: added files to CMakeLists.txt
2019-12-25 sk CInterface: added _BIT suffix to glslang_messages_t and glslang_reflection_options_t, fixed const-correctness
2019-12-25 sk CInterface: reformatted according to .clang-format rules
2019-12-24 sk Added original glslang_c_interface implementation by Viktor Latypov
2019-12-24 laddoc Add Tess machine dependent built-in variables initialization for GLES 3.2
2019-10-18 timo.suoranta Fixes for gcc 9 / -Werror=deprecated-copy
Roll third_party/shaderc/ a4f9acedf..0681dd61d (2 commits)
a4f9acedf3..0681dd61d3
$ git log a4f9acedf..0681dd61d --date=short --no-merges --format='%ad %ae %s'
2020-01-27 rharrison Remove deprecated APIs (#974)
2020-01-24 dneto Handle new Glslang profile enum in switch (#973)
Roll third_party/spirv-cross/ f9818f080..68bf0f824 (6 commits)
f9818f0804..68bf0f824c
$ git log f9818f080..68bf0f824 --date=short --no-merges --format='%ad %ae %s'
2020-01-27 post Compile fix on older compilers.
2020-01-27 post GLSL: Support GL_ARB_enchanced_layouts for XFB.
2020-01-25 cdavis MSL: Move inline uniform blocks to the end of the argument buffer.
2019-12-16 cdavis MSL: Support inline uniform blocks in argument buffers.
2020-01-23 post Make SmallVector noexcept.
2020-01-22 42098783+barath121 Typo at line 324
Roll third_party/spirv-headers/ 204cd131c..dc77030ac (2 commits)
204cd131c4..dc77030acc
$ git log 204cd131c..dc77030ac --date=short --no-merges --format='%ad %ae %s'
2020-01-20 dneto Fix the license to match LICENSE
2020-01-20 syoussefi Add BUILD.gn
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: I696c1facf47a03e03e09c72c4d44449a37c1b971
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15480
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
The state-tracking of the webgpu.h swapchain is a bit complicated
because contrary to implementation-based swapchains, they have more
guarantees and a "replacing mechanism". For example instead of hoping
the implementation-based swapchain resize automatically, the
surface-based swapchain needs to be replaced by a new swapchain and
invalidated.
This mechanism of invalidation also needs to be triggered when the last
reference to the surface is lost because we don't want to risk the
application destroying the window from under us.
Adds tests for all the cases of invalidation I could think of apart from
device loss.
Bug: dawn:269
Change-Id: Id515dbb640e13c6e30bb1f1e93b8e54f1e2bba4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15400
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
If Device creation fails, several things are just partially initialized
and the destroy sequence crashes dereferencing null data.
This commit marks the Vulkan device as lost until after it is created.
This avoids parts of the destroy sequence which are unecessary since
the Device was never successfully created and no commands are in flight.
Bug: chromium:1043095
Change-Id: I8e121709fa19b215e118a615b639380d1db1f3f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15460
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
In the webgpu-headers PR it was decided that in the C header
WGPUChainedStruct would be included as a member instead of members being
inlined.
See https://github.com/webgpu-native/webgpu-headers/pull/30
Bug: dawn:160
Change-Id: I8caf91f3106578077c80778621a632411da44423
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15441
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit fixes two problems:
1) It includes testing/libfuzzer/libfuzzer_exports.h which exports
the LLVMFuzzerInitialize symbol. On Mac, not doing so causes it
to be removed by the linker.
2) It makes it so that dawn_use_swiftshader is enabled by default
when fuzzing, and enabling swiftshader also enables the Vulkan
backend.
Bug: chromium:1042426
Change-Id: Ic0ae0d59c91476b0079148f33a4b1ebd1cc6743c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15462
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
There was a typo in macro name used to do platform detection.
Bug:
Change-Id: I81958419b4283d1d0498f5edc48efc385a648e09
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit changes wgpu::Device::CreateSwapChain to take an additional
wgpu::Surface argument. Passing nullptr is enough to stay on the
previous swapchain implementation, until the new one is ready.
In order to support both the "old" implementation-based swapchains and
the "new" surface-based swapchains. SwapChainBase is now split into
three abstract classes:
- SwapChainBase that has a virtual method for each of the
wgpu::SwapChain methods.
- OldSwapChainBase that corresponds to the implementation-based
swapchains.
- NewSwapChainBase that will contain the surface-based swapchain
implementation and will eventually just be renamed to SwapChainBase.
The interaction of the surface-based swapchains with the Surface objects
aren't implemented yet, neither are the swapchain methods. Only creation
works.
Validation tests for surface-based swapchain creation are added in the
end2end test target because they need to create OS windows.
Bug: dawn:269
Change-Id: I7e07d6c666479867b9a16d7b1b8c181d5dbd69a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15281
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This macro is used only for testing texture zero initialization so it
didn't need to be in DawnTest.h
Bug:
Change-Id: Ifb7ed06d93ae1bc275c9fd4650858c9b27117b5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15360
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The _BitScanReverse64 intrinsic only exists when compiling for 64bit.
Replace it by two calls to _BitScanReverse (the 32bit one) when on
32bit.
Bug:
Change-Id: Ie294327ec914b0ca4a73732e4b78c1f2a08f100f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15321
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This includes moving the destruction of vkDevice from Destroy to the
Device Destructor since we need vkDevice to destroy child objects.
Bug: dawn:68
Change-Id: Id477206b2e3f80138b3708eedcee073303f1b696
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
- Fix a warning on 32bit for converting uint64_t to size_t for the
buffer mapped range.
- Fix a macro redifinition caused by including glfw3.h before windows.h
Bug:
Change-Id: I3897af55679d943b1dfc34b93bba7bd25d8fb7d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Roll third_party/SPIRV-Tools/ f8d7df760..323a81fc5 (2 commits)
f8d7df760c..323a81fc5e
$ git log f8d7df760..323a81fc5 --date=short --no-merges --format='%ad %ae %s'
2019-09-04 alanbaker Validate Vulkan 1.2 capabilities
2019-08-28 dneto Add basic support for Vulkan 1.2: SPV_ENV_VULKAN_1_2
Roll third_party/glslang/ d203754bc..3ed344dd7 (4 commits)
d203754bc1..3ed344dd78
$ git log d203754bc..3ed344dd7 --date=short --no-merges --format='%ad %ae %s'
2020-01-16 cepheus Fix#2059, and also attempt to skip test bots [skip ci]
2019-12-24 laddoc Add Error check flag in io mapper
2020-01-15 cepheus Update to latest SPIRV-Tools, supporting Vulkan 1.2.
2020-01-15 cepheus SPV/Vulkan: Add support for Vulkan 1.2, which defaults to SPIR-V 1.5.
Roll third_party/shaderc/ df0e683b5..f53792645 (2 commits)
df0e683b58..f53792645f
$ git log df0e683b5..f53792645 --date=short --no-merges --format='%ad %ae %s'
2020-01-15 rharrison Use the correct comparison when checking for not MSL (#960)
2020-01-15 dneto Support Vulkan 1.2 (#958)
Roll third_party/spirv-cross/ 172e39f03..f9818f080 (7 commits)
172e39f039..f9818f0804
$ git log 172e39f03..f9818f080 --date=short --no-merges --format='%ad %ae %s'
2020-01-16 post Update license headers to 2020.
2020-01-16 post Run format_all.sh.
2020-01-16 post MSL: Add support for force-activating IAB resources.
2020-01-16 post Deal with illegal names in types as well.
2020-01-15 post Reflection: Add array stride/matrix stride reflection.
2020-01-15 post Reflection: Emit reflection information for array size literalness.
2020-01-15 post GLSL: Implement geometry shader passthrough extension.
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: Icf361e327598702ecfc0a4cdd3014d0060f2c083
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15200
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This test often crashes on first run, but succeeds on retry.
Bug: dawn:145
Change-Id: I44303a01eaceded10ba277a837c5b5e7649df033
Tbr: cwallez@chromium.org
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15180
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This may be a short term solution before linking our own version
of the Vulkan Loader.
Bug: dawn:283
Change-Id: Ifeddeaa5170bccc912c61059071a83c2b5fd9524
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15121
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Handle DeviceLostCallback once DeviceLost error occurs.
Disallow any other commands or actions on device to happen after device
has been lost.
Bug: dawn:68
Change-Id: Icbbbadf278cae5e6213050d00439118789c863dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12801
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This is a reland of 2b3975f808
The previous CL failed to retain autoreleased ObjC objects which
should live longer than the autoreleasepool block. This reland fixes
the issue and adds tests for it.
Original change's description:
> Metal: Add CommandRecordingContext
>
> Introduces the idea of a CommandRecordingContext to the Metal backend,
> similar to other backends. This is a class to track which Metal encoder
> is open on the device-global pending MTLCommandBuffer.
> It will be needed to open/close encoders for lazy clearing.
>
> Bug: dawn:145
> Change-Id: Ief6b71a079d73943677d2b61382d1c36b88a4f87
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14780
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:145
Change-Id: I67494b35225ce8f6443a3fa9787d054522e5d422
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15042
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
BUG=dawn:274
Change-Id: Ia7bfc96a2a85bff5b30065e7b985e0d84c8dcd4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15120
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This avoids linter checks to trigger when importing updates of Dawn into
Google3.
Bug:
Change-Id: Ib038d8937cc6c294823b56d52b6f2c5e5e24ffac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15140
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This is another step to implement webgpu.h swapchains, Surface is
essentially a union type of all the types of windows that can be used to
create swapchains.
Changes to allow implementing wgpu::Surface and test its creation are:
- Add GLFWUtils.cpp/.h/_metal.mm that contains helpers used to use
WebGPU with GLFW. This deprecates BackendBinding.h that will be removed
when the NXT swapchain is removed.
- Add a `dawn_use_x11` GN variable to factor all the places in BUILD.gn
where we checked whether we should use X11.
- Add a `supports_glfw_for_windowing` GN variable in the main BUILD.gn
file to control which configuration tests and samples using GLFW can be
built.
- Add a ObjCUtils.h to contain some ObjC functionality that we'd need
in files that otherwise would be C++ (so that they can be compiled on
all platforms).
Bug: dawn:269
Change-Id: I25548142a1d1d1f05b0f4d71aa3bdc4698d19622
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15081
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
struct WGPUChainedStruct {
WGPUChainedStruct const * nextInChain;
WGPUSType sType;
};
And changes all the nextInChain to point to such structures. This adds
more type safety to extension structs and requires less casting to check
sTypes and friends.
Bug: dawn:269
Change-Id: I443f363cdb55dbec7c7f6e897245d4a7ea0ebe70
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15080
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch adds validations to the texture usage "Storage" when
creating a texture.
1. "Storage" usage cannot be used when SampleCount > 1
2. "Storage" usage can only be used with some texture formats. The
list of the formats can be found through the following link:
https://github.com/gpuweb/gpuweb/issues/513
BUG=dawn:267
TEST=dawn_unittests
Change-Id: Ifc7296d966ac0c600433948a63c3dd6a436c8d8b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15040
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>