From ad02e8d4bcbb06c8b1be78c2f2a0f7dafabd27d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Mon, 26 Mar 2018 15:10:16 +0300 Subject: [PATCH] Fixes to EGL.functional.hdr_metadata.* tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Adjust given values to fit uint16_t (range used in smpte2086 and cta861.3 specs). - Allow EGL_BAD_PARAMETER error happen when setting parameters, per spec this means values passed are not supported by the implementation. Output attribute and given values in this case for debugging purposes. v2: skip unsupported but check supported attributes (Courtney) Change-Id: I1f386b414c95e65d3532bf10719dc7671e826489 Signed-off-by: Tapani Pälli (cherry picked from commit 07048b63e90dc2c1e89c069535bb7958a128f887) Bug: 77150763 Change-Id: Ia0401e760d863a85707f98dd2a1e7e7f268f5597 Test: run on pixel --- modules/egl/teglWideColorTests.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/modules/egl/teglWideColorTests.cpp b/modules/egl/teglWideColorTests.cpp index 9a4cd96c1..4cbe92377 100644 --- a/modules/egl/teglWideColorTests.cpp +++ b/modules/egl/teglWideColorTests.cpp @@ -1225,12 +1225,26 @@ void WideColorSurfaceTest::executeTest (void) { for (deUint32 i = 0; i < m_testAttribList.size(); i +=2) { - if (!egl.surfaceAttrib(m_eglDisplay, surface, m_testAttribList[i], m_testAttribList[i+1])) { - TCU_FAIL("Unable to set HDR metadata on surface"); + if (!egl.surfaceAttrib(m_eglDisplay, surface, m_testAttribList[i], m_testAttribList[i+1])) + { + // Implementation can return EGL_BAD_PARAMETER if given value is not supported. + EGLint error = egl.getError(); + if (error != EGL_BAD_PARAMETER) + TCU_FAIL("Unable to set HDR metadata on surface"); + + log << tcu::TestLog::Message << + "Warning: Metadata value " << m_testAttribList[i+1] << " for attrib 0x" << + std::hex << m_testAttribList[i] << std::dec << + " not supported by the implementation." << tcu::TestLog::EndMessage; + m_testAttribList[i+1] = EGL_BAD_PARAMETER; } } for (deUint32 i = 0; i < m_testAttribList.size(); i +=2) { + // Skip unsupported values. + if (m_testAttribList[i+1] == EGL_BAD_PARAMETER) + continue; + EGLint value; egl.querySurface(m_eglDisplay, surface, m_testAttribList[i], &value); TCU_CHECK(value == m_testAttribList[i+1]); @@ -1474,7 +1488,7 @@ void Smpte2086ColorTest::executeTest (void) EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT, METADATA_SCALE(0.320), EGL_SMPTE2086_WHITE_POINT_X_EXT, METADATA_SCALE(0.2200), EGL_SMPTE2086_WHITE_POINT_Y_EXT, METADATA_SCALE(0.2578), - EGL_SMPTE2086_MAX_LUMINANCE_EXT, METADATA_SCALE(123.0), + EGL_SMPTE2086_MAX_LUMINANCE_EXT, METADATA_SCALE(1.31), EGL_SMPTE2086_MIN_LUMINANCE_EXT, METADATA_SCALE(0.123), EGL_NONE }; @@ -1549,8 +1563,8 @@ void Cta8613ColorTest::executeTest (void) const EGLint testAttrs[] = { - EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT, METADATA_SCALE(234), - EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT, METADATA_SCALE(67), + EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT, METADATA_SCALE(1.31), + EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT, METADATA_SCALE(0.6), EGL_NONE }; testObj.addTestAttributes(testAttrs); -- 2.34.1