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

Commit cd6da6ea authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter Committed by android-build-merger
Browse files

Merge "Remove driver workaround" into oc-dev am: ac81f70b

am: ab1dff38

Change-Id: Ibf5c30be99fc7f96b49fee3ee006e06b73183447
parents b69ecede ab1dff38
Loading
Loading
Loading
Loading
+3 −19
Original line number Diff line number Diff line
@@ -981,25 +981,9 @@ VkResult CreateSwapchainKHR(VkDevice device,
    int gralloc_usage = 0;
    if (dispatch.GetSwapchainGrallocUsage2ANDROID) {
        uint64_t consumer_usage, producer_usage;
        if (GetData(device).driver_version == 256587285) {
            // HACK workaround for loader/driver mismatch during transition to
            // vkGetSwapchainGrallocUsage2ANDROID.
            typedef VkResult(VKAPI_PTR *
                             PFN_vkGetSwapchainGrallocUsage2ANDROID_HACK)(
                VkDevice device, VkFormat format, VkImageUsageFlags imageUsage,
                uint64_t * grallocConsumerUsage,
                uint64_t * grallocProducerUsage);
            auto get_swapchain_gralloc_usage =
                reinterpret_cast<PFN_vkGetSwapchainGrallocUsage2ANDROID_HACK>(
                    dispatch.GetSwapchainGrallocUsage2ANDROID);
            result = get_swapchain_gralloc_usage(
                device, create_info->imageFormat, create_info->imageUsage,
                &consumer_usage, &producer_usage);
        } else {
        result = dispatch.GetSwapchainGrallocUsage2ANDROID(
            device, create_info->imageFormat, create_info->imageUsage,
            swapchain_image_usage, &consumer_usage, &producer_usage);
        }
        if (result != VK_SUCCESS) {
            ALOGE("vkGetSwapchainGrallocUsage2ANDROID failed: %d", result);
            return VK_ERROR_SURFACE_LOST_KHR;