Merge "vulkan: respect consumer default dataspace upon PASS_THROUGH"

This commit is contained in:
Treehugger Robot 2022-07-25 22:25:53 +00:00 committed by Gerrit Code Review
commit eae8088caa
2 changed files with 10 additions and 5 deletions

View file

@ -1924,6 +1924,7 @@ int Surface::disconnect(int api, IGraphicBufferProducer::DisconnectMode mode) {
mReqHeight = 0;
mReqUsage = 0;
mCrop.clear();
mDataSpace = Dataspace::UNKNOWN;
mScalingMode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
mTransform = 0;
mStickyTransform = 0;

View file

@ -1218,11 +1218,15 @@ VkResult CreateSwapchainKHR(VkDevice device,
native_pixel_format, strerror(-err), err);
return VK_ERROR_SURFACE_LOST_KHR;
}
err = native_window_set_buffers_data_space(window, native_dataspace);
if (err != android::OK) {
ALOGE("native_window_set_buffers_data_space(%d) failed: %s (%d)",
native_dataspace, strerror(-err), err);
return VK_ERROR_SURFACE_LOST_KHR;
/* Respect consumer default dataspace upon HAL_DATASPACE_ARBITRARY. */
if (native_dataspace != HAL_DATASPACE_ARBITRARY) {
err = native_window_set_buffers_data_space(window, native_dataspace);
if (err != android::OK) {
ALOGE("native_window_set_buffers_data_space(%d) failed: %s (%d)",
native_dataspace, strerror(-err), err);
return VK_ERROR_SURFACE_LOST_KHR;
}
}
err = native_window_set_buffers_dimensions(