OSDN Git Service

test/jpege: skip >4k res test cases on CHV/BSW
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Fri, 28 Apr 2017 02:08:00 +0000 (19:08 -0700)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 3 May 2017 05:39:47 +0000 (13:39 +0800)
Only Gen9+ supports res > 4K for JPEG encoding.

Fixes #149

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
test/i965_jpeg_encode_test.cpp
test/i965_jpeg_test_data.h

index d57aa67..eeba035 100644 (file)
@@ -74,6 +74,7 @@ class JPEGEncodeInputTest
 public:
     JPEGEncodeInputTest()
         : JPEGEncodeTest::JPEGEncodeTest()
+        , is_supported(true)
         , surfaces() // empty
         , coded(VA_INVALID_ID) // invalid
         , renderBuffers() // empty
@@ -88,8 +89,11 @@ protected:
 
         struct i965_driver_data *i965(*this);
         ASSERT_PTR(i965);
-        if (not HAS_JPEG_ENCODING(i965))
+
+        if (not HAS_JPEG_ENCODING(i965)) {
+            is_supported = false;
             return;
+        }
 
         TestInputCreator::SharedConst creator;
         std::string sFourcc;
@@ -97,6 +101,13 @@ protected:
 
         ASSERT_PTR(creator.get()) << "Invalid test input creator parameter";
 
+        const std::array<unsigned, 2> res = creator->getResolution();
+        bool is_big_size = (res.at(0) > 4096) or (res.at(1) > 4096);
+        if (IS_CHERRYVIEW(i965->intel.device_info) and is_big_size) {
+            is_supported = false;
+            return;
+        }
+
         ASSERT_EQ(4u, sFourcc.size())
             << "Invalid fourcc parameter '" << sFourcc << "'";
 
@@ -277,6 +288,7 @@ protected:
             createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
     }
 
+    bool                is_supported;
     Surfaces            surfaces;
     VABufferID          coded;
     Buffers             renderBuffers;
@@ -394,9 +406,7 @@ protected:
 
 TEST_P(JPEGEncodeInputTest, Full)
 {
-    struct i965_driver_data *i965(*this);
-    ASSERT_PTR(i965);
-    if (not HAS_JPEG_ENCODING(i965)) {
+    if (not is_supported) {
         RecordProperty("skipped", true);
         std::cout << "[  SKIPPED ] " << getFullTestName()
             << " is unsupported on this hardware" << std::endl;
index 0105d47..9128140 100644 (file)
@@ -439,17 +439,19 @@ namespace Encode {
             ::std::ostream&, const TestInputCreator::Shared&);
         friend ::std::ostream& operator<<(
             ::std::ostream&, const TestInputCreator::SharedConst&);
+        virtual std::array<unsigned, 2> getResolution() const = 0;
 
     protected:
-        virtual std::array<unsigned, 2> getResolution() const = 0;
         virtual void repr(::std::ostream& os) const = 0;
     };
 
     class RandomSizeCreator
         : public TestInputCreator
     {
-    protected:
+    public:
         std::array<unsigned, 2> getResolution() const;
+
+    protected:
         void repr(::std::ostream&) const;
     };
 
@@ -458,9 +460,9 @@ namespace Encode {
     {
     public:
         FixedSizeCreator(const std::array<unsigned, 2>&);
+        std::array<unsigned, 2> getResolution() const;
 
     protected:
-        std::array<unsigned, 2> getResolution() const;
         void repr(::std::ostream& os) const;
 
     private: