summaryrefslogtreecommitdiff
path: root/tests/kms-test-connectors.py
blob: 4c58b99f8fbfa6d2df4bb8d4ccf637777060d97b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2017 Renesas Electronics Corporation

import kmstest
import pykms

class ConnectorsTest(kmstest.KMSTest):
    """Perform sanity checks on all connectors."""

    def main(self):
        for connector in self.card.connectors:
            self.start("connector %s" % connector.fullname)

            # Every connector should have at least one suitable CRTC
            crtcs = connector.get_possible_crtcs()
            if len(crtcs) == 0:
                self.fail("no possible CRTC")
                continue

            # Connected connectors should have at least one mode
            if connector.connected():
                modes = connector.get_modes()
                if len(modes) == 0:
                    self.fail("no mode available")
                    continue

            self.success()

ConnectorsTest().execute()