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

Commit 7f983a8f authored by Jesse Hall's avatar Jesse Hall
Browse files

vulkan: Allow AHB extension to get to the driver

We don't need to do anything special with the AHB extension at the
driver layer, but it's defined as a "known extension" so that we can
export symbols for it. So it didn't fall into the generic extension
path, but we also didn't add it to the list to pass on to the driver.
So drivers were never seeing that the extension was enabled.

Remove switch default cases, so that -Wswitch can catch bugs like this
in the future.

Test: in-progress MediaVulkanGpuTest (ag/3789901/18)
Bug: 77297007
Change-Id: I3fe460240cfd1f868b7275abbb0289b806bc7603
parent ccd34846
Loading
Loading
Loading
Loading
+54 −7
Original line number Diff line number Diff line
@@ -500,13 +500,36 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
                // both we and HAL can take part in
                hook_extensions_.set(ext_bit);
                break;
            case ProcHook::EXTENSION_UNKNOWN:
            case ProcHook::KHR_get_physical_device_properties2:
                // HAL's extensions
            case ProcHook::EXTENSION_UNKNOWN:
                // Extensions we don't need to do anything about at this level
                break;
            default:
                ALOGW("Ignored invalid instance extension %s", name);

            case ProcHook::KHR_incremental_present:
            case ProcHook::KHR_shared_presentable_image:
            case ProcHook::KHR_swapchain:
            case ProcHook::EXT_hdr_metadata:
            case ProcHook::ANDROID_external_memory_android_hardware_buffer:
            case ProcHook::ANDROID_native_buffer:
            case ProcHook::GOOGLE_display_timing:
            case ProcHook::EXTENSION_CORE:
            case ProcHook::EXTENSION_COUNT:
                // Device and meta extensions. If we ever get here it's a bug in
                // our code. But enumerating them lets us avoid having a default
                // case, and default hides other bugs.
                ALOGE(
                    "CreateInfoWrapper::FilterExtension: invalid instance "
                    "extension '%s'. FIX ME",
                    name);
                return;

            // Don't use a default case. Without it, -Wswitch will tell us
            // at compile time if someone adds a new ProcHook extension but
            // doesn't handle it above. That's a real bug that has
            // not-immediately-obvious effects.
            //
            // default:
            //     break;
        }
    } else {
        switch (ext_bit) {
@@ -524,12 +547,36 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
            case ProcHook::EXT_hdr_metadata:
                hook_extensions_.set(ext_bit);
                break;
            case ProcHook::ANDROID_external_memory_android_hardware_buffer:
            case ProcHook::EXTENSION_UNKNOWN:
                // HAL's extensions
                // Extensions we don't need to do anything about at this level
                break;
            default:
                ALOGW("Ignored invalid device extension %s", name);

            case ProcHook::KHR_android_surface:
            case ProcHook::KHR_get_physical_device_properties2:
            case ProcHook::KHR_get_surface_capabilities2:
            case ProcHook::KHR_surface:
            case ProcHook::EXT_debug_report:
            case ProcHook::EXT_swapchain_colorspace:
            case ProcHook::ANDROID_native_buffer:
            case ProcHook::EXTENSION_CORE:
            case ProcHook::EXTENSION_COUNT:
                // Instance and meta extensions. If we ever get here it's a bug
                // in our code. But enumerating them lets us avoid having a
                // default case, and default hides other bugs.
                ALOGE(
                    "CreateInfoWrapper::FilterExtension: invalid device "
                    "extension '%s'. FIX ME",
                    name);
                return;

            // Don't use a default case. Without it, -Wswitch will tell us
            // at compile time if someone adds a new ProcHook extension but
            // doesn't handle it above. That's a real bug that has
            // not-immediately-obvious effects.
            //
            // default:
            //     break;
        }
    }