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

Commit b4c38593 authored by Michael Yang's avatar Michael Yang Committed by Courtney Goeltzenleuchter
Browse files

EGL: querying client extensions as well for EGL 1.5 extensions

According to the EGL specification, EGL_EXT_client_extensions is
expected in the set of supported client extensions that is queried
without initializing a display.

Bug: 129370892
Test: On EGL 1.4 device
Test: CtsDeqpTestCases:include-filter:dEQP-EGL.*
If device has all the necessary extensions, EGL version will be 1.5

Change-Id: I7138dd2228bd79940c7d2dc4f3c89491e94d8d02
parent f94f4244
Loading
Loading
Loading
Loading
+13 −2
Original line number Original line Diff line number Diff line
@@ -340,6 +340,17 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
            mVersionString = sVersionString15;
            mVersionString = sVersionString15;
            cnx->driverVersion = EGL_MAKE_VERSION(1, 5, 0);
            cnx->driverVersion = EGL_MAKE_VERSION(1, 5, 0);
        } else if ((cnx->major == 1) && (cnx->minor == 4)) {
        } else if ((cnx->major == 1) && (cnx->minor == 4)) {
            /* Querying extension strings for type Client */
            std::string typesExtString;
            static const char* clientExtensions =
                    cnx->egl.eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
            if (clientExtensions != nullptr && strlen(clientExtensions) > 0) {
                typesExtString.append(clientExtensions);
                typesExtString.append(" ");
            }

            /* Adding extension strings for type Display */
            typesExtString.append(disp.queryString.extensions);
            mVersionString = sVersionString14;
            mVersionString = sVersionString14;
            // Extensions needed for an EGL 1.4 implementation to be
            // Extensions needed for an EGL 1.4 implementation to be
            // able to support EGL 1.5 functionality
            // able to support EGL 1.5 functionality
@@ -356,9 +367,9 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
            };
            };
            bool extensionsFound = true;
            bool extensionsFound = true;
            for (const auto& name : egl15extensions) {
            for (const auto& name : egl15extensions) {
                extensionsFound &= findExtension(disp.queryString.extensions, name);
                extensionsFound &= findExtension(typesExtString.c_str(), name);
                ALOGV("Extension %s: %s", name,
                ALOGV("Extension %s: %s", name,
                      findExtension(disp.queryString.extensions, name) ? "Found" : "Missing");
                      findExtension(typesExtString.c_str(), name) ? "Found" : "Missing");
            }
            }
            // NOTE: From the spec:
            // NOTE: From the spec:
            // Creation of fence sync objects requires support from the bound
            // Creation of fence sync objects requires support from the bound