glshared: Add watchdog touches to avoid timeouts on slow hardware am: 0d9250e9eb
authorChris Forbes <chrisforbes@google.com>
Thu, 11 Jan 2018 22:32:48 +0000 (22:32 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 11 Jan 2018 22:32:48 +0000 (22:32 +0000)
am: b355e0840c

Change-Id: I666e73b8b5e4c298937fe679676182a2ac0a0d47

OWNERS [new file with mode: 0644]
framework/common/tcuApp.cpp
framework/common/tcuApp.hpp
framework/qphelper/qpWatchDog.c
framework/qphelper/qpWatchDog.h
modules/gles31/functional/es31fNegativeSSBOBlockTests.cpp
modules/gles31/functional/es31fSRGBDecodeTests.cpp
scripts/build_android_mustpass.py
targets/x11_egl/x11_egl.cmake

diff --git a/OWNERS b/OWNERS
new file mode 100644 (file)
index 0000000..03695dd
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,4 @@
+phaulos@google.com
+tinazh@google.com
+misojarvi@google.com
+kraita@google.com
index 6227089..949f083 100644 (file)
@@ -203,10 +203,10 @@ bool App::iterate (void)
        return platformOk && testExecOk;
 }
 
-void App::onWatchdogTimeout (qpWatchDog* watchDog, void* userPtr)
+void App::onWatchdogTimeout (qpWatchDog* watchDog, void* userPtr, qpTimeoutReason reason)
 {
        DE_UNREF(watchDog);
-       static_cast<App*>(userPtr)->onWatchdogTimeout();
+       static_cast<App*>(userPtr)->onWatchdogTimeout(reason);
 }
 
 void App::onCrash (qpCrashHandler* crashHandler, void* userPtr)
@@ -215,7 +215,7 @@ void App::onCrash (qpCrashHandler* crashHandler, void* userPtr)
        static_cast<App*>(userPtr)->onCrash();
 }
 
-void App::onWatchdogTimeout (void)
+void App::onWatchdogTimeout (qpTimeoutReason reason)
 {
        if (!m_crashLock.tryLock() || m_crashed)
                return; // In crash handler already.
@@ -223,7 +223,7 @@ void App::onWatchdogTimeout (void)
        m_crashed = true;
 
        m_testCtx->getLog().terminateCase(QP_TEST_RESULT_TIMEOUT);
-       die("Watchdog timer timeout");
+       die("Watchdog timer timeout for %s", (reason == QP_TIMEOUT_REASON_INTERVAL_LIMIT ? "touch interval" : "total time"));
 }
 
 static void writeCrashToLog (void* userPtr, const char* infoString)
index 8233eb3..e714160 100644 (file)
@@ -69,10 +69,10 @@ public:
 protected:
        void                                    cleanup                         (void);
 
-       void                                    onWatchdogTimeout       (void);
+       void                                    onWatchdogTimeout       (qpTimeoutReason reason);
        void                                    onCrash                         (void);
 
-       static void                             onWatchdogTimeout       (qpWatchDog* watchDog, void* userPtr);
+       static void                             onWatchdogTimeout       (qpWatchDog* watchDog, void* userPtr, qpTimeoutReason reason);
        static void                             onCrash                         (qpCrashHandler* crashHandler, void* userPtr);
 
        Platform&                               m_platform;
index 84957b8..c691aa2 100644 (file)
@@ -69,11 +69,14 @@ static void watchDogThreadFunc (void* arg)
                deUint64        curTime                                 = deGetMicroseconds();
                int                     totalSecondsPassed              = (int)((curTime - dog->resetTime) / 1000000ull);
                int                     secondsSinceLastTouch   = (int)((curTime - dog->lastTouchTime) / 1000000ull);
+               deBool          overIntervalLimit               = secondsSinceLastTouch > dog->intervalTimeLimit;
+               deBool          overTotalLimit                  = totalSecondsPassed > dog->totalTimeLimit;
 
-               if ((secondsSinceLastTouch > dog->intervalTimeLimit) || (totalSecondsPassed > dog->totalTimeLimit))
+               if (overIntervalLimit || overTotalLimit)
                {
+                   qpTimeoutReason reason = overTotalLimit ? QP_TIMEOUT_REASON_TOTAL_LIMIT : QP_TIMEOUT_REASON_INTERVAL_LIMIT;
                        DBGPRINT(("watchDogThreadFunc(): call timeout func\n"));
-                       dog->timeOutFunc(dog, dog->timeOutUserPtr);
+                       dog->timeOutFunc(dog, dog->timeOutUserPtr, reason);
                        break;
                }
 
index 6ac8f6a..6247e66 100644 (file)
 
 typedef struct qpWatchDog_s    qpWatchDog;
 
-typedef void           (*qpWatchDogFunc)               (qpWatchDog* dog, void* userPtr);
+typedef enum qpTimeoutReason_e
+{
+       QP_TIMEOUT_REASON_INTERVAL_LIMIT = 0,
+       QP_TIMEOUT_REASON_TOTAL_LIMIT,
+
+       QP_TIMEOUT_REASON_LAST
+} qpTimeoutReason;
+
+typedef void           (*qpWatchDogFunc)               (qpWatchDog* dog, void* userPtr, qpTimeoutReason reason);
 
 DE_BEGIN_EXTERN_C
 
index bddd035..358b7a2 100644 (file)
@@ -76,16 +76,7 @@ public:
        void                    setSingleValue                                          (const SsboArgData argData);
        bool                    setAllValues                                            (const std::vector<SsboArgData> argDataList);
 
-       const std::string&      getContextVersion                               (void) const;
-       const std::string&      getStdFormat                                    (void) const;
-       const std::string&      getBindingPoint                                 (void) const;
-       const std::string&      getMatrixOrder                                  (void) const;
-       const std::string&      getMemberType                                   (void) const;
-       const std::string&      getMemberName                                   (void) const;
-       const std::string&      getMemberFixedArrayName                 (void) const;
-       const std::string&      getMemberVariableArray                  (void) const;
        bool                            getMemberReorder                                (void) const;
-       int                                     getNumberMembers                                (void) const;
 
        void                            resetValues                                             (void);
 
@@ -177,56 +168,11 @@ bool SsboArgs::setAllValues (const std::vector<SsboArgData> argDataList)
        return true;
 }
 
-const std::string& SsboArgs::getContextVersion (void) const
-{
-       return m_negativeContextVersion;
-}
-
-const std::string& SsboArgs::getStdFormat (void) const
-{
-       return m_stdFormat;
-}
-
-const std::string& SsboArgs::getBindingPoint (void) const
-{
-       return m_bindingPoint;
-}
-
-const std::string& SsboArgs::getMatrixOrder (void) const
-{
-       return m_matrixOrder;
-}
-
-const std::string& SsboArgs::getMemberType (void) const
-{
-       return m_memberType;
-}
-
-const std::string& SsboArgs::getMemberName (void) const
-{
-       return m_memberName;
-}
-
-const std::string& SsboArgs::getMemberFixedArrayName (void) const
-{
-       return m_memberFixedArrayerName;
-}
-
-const std::string& SsboArgs::getMemberVariableArray (void) const
-{
-       return m_memberVariableArray;
-}
-
 bool SsboArgs::getMemberReorder (void) const
 {
        return m_memberReorder;
 }
 
-int SsboArgs::getNumberMembers (void) const
-{
-       return m_numberMembers;
-}
-
 void SsboArgs::resetValues (void)
 {
        setDefaultValues();
index 41e3a8c..9a6cdf4 100644 (file)
@@ -312,11 +312,9 @@ public:
        void            setTextureUnit          (const deUint32 textureUnit);
        void            setIsActive                     (const bool isActive);
 
-       deUint32        getHandle                       (void) const;
        bool            getIsActive                     (void) const;
 
        void            bindToTexture           (void);
-       void            unbindFromTexture       (void);
 
 private:
        const glw::Functions*           m_gl;
@@ -388,11 +386,6 @@ void SRGBTestSampler::setIsActive (const bool isActive)
        m_isActive = isActive;
 }
 
-deUint32 SRGBTestSampler::getHandle (void) const
-{
-       return m_samplerHandle;
-}
-
 bool SRGBTestSampler::getIsActive (void) const
 {
        return m_isActive;
@@ -403,11 +396,6 @@ void SRGBTestSampler::bindToTexture (void)
        m_gl->bindSampler(m_textureUnit, m_samplerHandle);
 }
 
-void SRGBTestSampler::unbindFromTexture (void)
-{
-       m_gl->bindSampler(m_textureUnit, 0);
-}
-
 class SRGBTestTexture
 {
 public:
@@ -431,7 +419,6 @@ public:
        deUint32        getHandle                       (void) const;
        deUint32        getGLTargetType         (void) const;
        SRGBDecode      getDecode                       (void) const;
-       bool            getHasSampler           (void) const;
 
        void            upload                          (void);
 
@@ -566,11 +553,6 @@ SRGBDecode SRGBTestTexture::getDecode (void) const
        return m_decoding;
 }
 
-bool SRGBTestTexture::getHasSampler (void) const
-{
-       return m_hasSampler;
-}
-
 void SRGBTestTexture::upload (void)
 {
        m_source.upload();
@@ -605,14 +587,10 @@ public:
        void                                                    setToggleRequired               (bool toggleRequired);
        void                                                    setUniformToggle                (int location, bool toggleDecodeValue);
 
-       int                                                             getUniformTotal                 (void) const;
        const std::vector<UniformData>& getUniformDataList              (void) const;
-       const UniformData&                              getUniformAtLocation    (int location) const;
        int                                                             getUniformLocation              (const std::string& name);
        deUint32                                                getHandle                               (void) const;
        bool                                                    getBlendRequired                (void) const;
-       bool                                                    getToggleRequired               (void) const;
-       const std::string&                              getFragmentShader               (void) const;
 
 private:
        std::string                                             genFunctionCall                 (ShaderSamplingType samplingType, const int uniformIdx);
@@ -714,21 +692,11 @@ void SRGBTestProgram::setUniformToggle (int location, bool toggleDecodeValue)
        }
 }
 
-int SRGBTestProgram::getUniformTotal (void) const
-{
-       return (int)m_uniformDataList.size();
-}
-
 const std::vector<UniformData>& SRGBTestProgram::getUniformDataList (void) const
 {
        return m_uniformDataList;
 }
 
-const UniformData& SRGBTestProgram::getUniformAtLocation (int location) const
-{
-       return m_uniformDataList[location];
-}
-
 int SRGBTestProgram::getUniformLocation (const std::string& name)
 {
        for (std::size_t idx = 0; idx < m_uniformDataList.size(); idx++)
@@ -753,16 +721,6 @@ bool SRGBTestProgram::getBlendRequired (void) const
        return m_blendRequired;
 }
 
-bool SRGBTestProgram::getToggleRequired (void) const
-{
-       return m_toggleRequired;
-}
-
-const std::string& SRGBTestProgram::getFragmentShader (void) const
-{
-       return m_shaderFragment;
-}
-
 std::string SRGBTestProgram::genFunctionCall (ShaderSamplingType samplingType, const int uniformIdx)
 {
        std::ostringstream functionCall;
@@ -905,13 +863,8 @@ public:
 
        void                                    setSamplingGroup                                (const ShaderSamplingGroup samplingGroup);
        void                                    setSamplingLocations                    (const int px, const int py);
-       void                                    setShaderProgramBlendRequired   (const int programIdx, const bool blend);
-       void                                    setShaderProgramToggleRequired  (const int programIdx, const bool toggle);
        void                                    setUniformToggle                                (const int programIdx, const std::string& uniformName, bool toggleDecode);
 
-       deUint32                                getShaderProgramHandle                  (const int programIdx) const;
-       deUint32                                getTextureHandle                                (const int textureIdx) const;
-
        void                                    addTexture                                              (const glu::TextureTestUtil::TextureType        targetType,
                                                                                                                         const int                                                                      width,
                                                                                                                         const int                                                                      height,
@@ -1105,32 +1058,6 @@ void SRGBTestCase::setSamplingLocations (const int px, const int py)
        m_py = py;
 }
 
-void SRGBTestCase::setShaderProgramBlendRequired (const int programIdx, const bool blend)
-{
-       m_shaderProgramList[programIdx]->setBlendRequired(blend);
-}
-
-void SRGBTestCase::setShaderProgramToggleRequired (const int programIdx, const bool toggle)
-{
-       m_shaderProgramList[programIdx]->setToggleRequired(toggle);
-}
-
-void SRGBTestCase::setUniformToggle (const int programIdx, const std::string& uniformName, bool toggleDecodeValue)
-{
-       int uniformLocation = m_shaderProgramList[programIdx]->getUniformLocation(uniformName);
-       m_shaderProgramList[programIdx]->setUniformToggle(uniformLocation, toggleDecodeValue);
-}
-
-deUint32 SRGBTestCase::getShaderProgramHandle (const int programIdx) const
-{
-       return m_shaderProgramList[programIdx]->getHandle();
-}
-
-deUint32 SRGBTestCase::getTextureHandle (const int textureIdx) const
-{
-       return m_textureSourceList[textureIdx]->getHandle();
-}
-
 void SRGBTestCase::addTexture (        const glu::TextureTestUtil::TextureType targetType,
                                                                const int                                                               width,
                                                                const int                                                               height,
index dae0b99..f63c9f6 100644 (file)
@@ -441,7 +441,7 @@ MASTER_GLES31_COMMON_FILTERS        = [
                exclude("gles31-hw-issues.txt"),
                exclude("gles31-driver-issues.txt"),
                exclude("gles31-test-issues.txt"),
-               exclude("gles31-spec-issues.txt")
+               exclude("gles31-spec-issues.txt"),
        ]
 MASTER_GLES31_PKG                              = Package(module = GLES31_MODULE, configurations = [
                # Master
@@ -501,7 +501,7 @@ MASTER_VULKAN_FILTERS                       = [
                exclude("vk-not-applicable.txt"),
                exclude("vk-excluded-tests.txt"),
                exclude("vk-test-issues.txt"),
-               exclude("vk-waivers.txt")
+               exclude("vk-waivers.txt"),
        ]
 MASTER_VULKAN_PKG                              = Package(module = VULKAN_MODULE, configurations = [
                Configuration(name                      = "master",
index 8e8155b..b36eb30 100644 (file)
@@ -30,5 +30,26 @@ if (NOT X11_FOUND)
        message(FATAL_ERROR "X11 development package not found")
 endif ()
 
+# Support GLES1, we use pkg-config because some distributions do not ship
+# GLES1 libraries and headers, this way user can override search path by
+# using PKG_CONFIG_PATH environment variable
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(GLES1 glesv1_cm)
+if (GLES1_LIBRARIES)
+       set(DEQP_SUPPORT_GLES1  ON)
+       set(DEQP_GLES1_LIBRARIES ${GLES1_LIBRARIES})
+       set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -L${GLES1_LIBRARY_DIRS})
+       if ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
+               # PKG_GLES1_INCLUDE_DIRS empty, see if matching include
+               # path (GLES/gl.h) exists beside library directory
+               set(GLES1_INCLUDE "${GLES1_LIBDIR}/../include")
+               if (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
+                       include_directories(${GLES1_INCLUDE})
+               else()
+                       message(FATAL_ERROR "Could not find include path for GLES1 headers")
+               endif (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
+       endif ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
+endif (GLES1_LIBRARIES)
+
 set(DEQP_PLATFORM_LIBRARIES ${X11_LIBRARIES})
 include_directories(${X11_INCLUDE_DIR})