Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51572c2f authored by Yiwei Zhang's avatar Yiwei Zhang
Browse files

vulkan: respect consumer default dataspace upon PASS_THROUGH

Most of the HWC backends don't consume HAL_DATASPACE_ARBITRARY, and will
end up with client composition. This change fixes the Surface to clear
the prior requested dataspace leftover upon disconnect, and let vulkan
swapchain to skip setting dataspace upon PASS_THROUGH.

Bug: 239893387
Test: android.view.cts.DisplayRefreshRateTest#testRefreshRate with angle
Test: android.media.cts.EncodeDecodeTest with angle
Test: dEQP-EGL.* with angle
Test: dEQP-VK.wsi.android.*
Change-Id: Iba1d9160569ad6136127cf8055aa75f195fed3d9
parent 71e68dcf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
+9 −5
Original line number Diff line number Diff line
@@ -1218,12 +1218,16 @@ VkResult CreateSwapchainKHR(VkDevice device,
              native_pixel_format, 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(
        window, static_cast<int>(create_info->imageExtent.width),