• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <gtest/gtest.h>
18 
19 #include <cstdlib>
20 
21 #include "include/igt_test_helper.h"
22 
23 namespace igt {
24 namespace {
25 
26 /**
27  * TEST: kms rotation crc
28  * Category: Display
29  * Description: Tests different rotations with different planes & formats
30  * Functionality: plane, rotation
31  * Mega feature: General Display Features
32  * Test category: functionality test
33  */
34 
35 class KmsRotationCrcTests : public ::testing::TestWithParam<IgtSubtestParams>,
36                             public IgtTestHelper {
37 public:
KmsRotationCrcTests()38   KmsRotationCrcTests() : IgtTestHelper("kms_rotation_crc") {}
39 };
40 
41 IgtSubtestParams subtests[] = {
42     {.name = "%s-rotation-180",
43      .desc = "Rotation test with 180 degree for (primary/sprite/cursor) planes",
44      .rationale = "plane rotation"},
45     {.name = "%s-rotation-%d",
46      .desc = "Rotation test with (90/270) degree for (primary/sprite) planes "
47              "of gen9+",
48      .rationale = "plane rotation"},
49     {.name = "bad-pixel-format",
50      .desc = "Checking unsupported pixel format for gen9+ with 90 degree of "
51              "rotation",
52      .rationale = "plane rotation"},
53     {.name = "bad-tiling",
54      .desc = "Checking unsupported tiling for gen9+ with 90 degree of rotation",
55      .rationale = "plane rotation"},
56     {.name = "multiplane-rotation",
57      .desc = "Rotation test on both planes by making them fully visible",
58      .rationale = "plane rotation"},
59     {.name = "multiplane-rotation-cropping-%s",
60      .desc =
61          "Rotation test on both planes by cropping left/(bottom/top) corner of "
62          "primary plane and right/(bottom/top) corner of sprite plane",
63      .rationale = "plane rotation"},
64 };
65 
TEST_P(KmsRotationCrcTests,RunSubTests)66 TEST_P(KmsRotationCrcTests, RunSubTests) { runSubTest(GetParam()); }
67 
68 INSTANTIATE_TEST_SUITE_P(KmsRotationCrcTests, KmsRotationCrcTests,
69                          ::testing::ValuesIn(subtests),
70                          IgtTestHelper::generateGTestName);
71 
72 } // namespace
73 } // namespace igt