File: mutter-relationships.md

package info (click to toggle)
mutter 49.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,732 kB
  • sloc: ansic: 397,916; xml: 3,384; python: 3,270; sh: 389; ruby: 167; makefile: 61; javascript: 26
file content (135 lines) | stat: -rw-r--r-- 4,256 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Compositor stage and hardware relationships

## Brief description of components

 - `MetaLogicalMonitor` is one monitor or more monitor occupying the same region of the compositor space. E.g. when mirroring two monitors, both belong to the same logical monitor.
 - `MetaMonitor` is a single physical monitor, but it can sometimes consist of more than one separate panel (for instance, 5K tiled monitors which literally require 2 cables due to lack of bandwidth)
 - `MetaOuptut` is a connector e.g. a DisplayPort connector or HDMI connector.
 - `MetaCrtc` represents a component on the display hardware that channels video memory to connectors.

## Entity relationship diagram

```mermaid
erDiagram
  MetaBackend ||--|| MetaMonitorManager : owns
  MetaBackend ||--|{ MetaGpu : owns
  MetaBackend ||--|| ClutterStage : owns
  MetaGpu ||--|{ MetaCrtc : owns
  MetaGpu ||--|{ MetaOutput : owns
  MetaCrtc |o..o{ MetaOutput : assigned
  MetaBackend ||--|{ MetaVirtualMonitor : owns
  MetaVirtualMonitor ||--|| MetaCrtc : owns
  MetaVirtualMonitor ||--|| MetaOutput : owns
  MetaMonitorManager ||--|{ MetaMonitor : owns
  MetaMonitorManager ||--|{ MetaLogicalMonitor : owns
  MetaLogicalMonitor ||..|{ MetaMonitor : has
  MetaMonitor ||..|{ MetaOutput : has
  ClutterStage ||--|{ ClutterStageView : has
  ClutterStageView ||..|| MetaCrtc : corresponds
  ClutterStageView ||--|| ClutterFrameClock : owns
  ClutterStageView ||..|| MetaLogicalMonitor : derive-scale
```

## Class diagrams

`MetaBackend`, `MetaGpu` and `MetaMonitorManager` class diagrams.

```mermaid
classDiagram
    MetaBackend <-- MetaBackendNative
    MetaBackend <-- MetaBackendX11
    class MetaBackend{
      MetaMonitorManager monitor_manager
      List~MetaGpu~ gpus
    }
    MetaGpu <-- MetaGpuKms
    MetaGpu <-- MetaGpuXrandr
    class MetaGpu{
      List~MetaOutput~
      List~MetaCrtc~
    }
    MetaMonitorManager <-- MetaMonitorManagerNative
    MetaMonitorManager <-- MetaMonitorManagerXrandr
    class MetaMonitorManager{
      List~MetaMonitor~ monitors
      List~MetaLogicalMonitor~ logical_monitors
    }
```

`MetaLogicalMonitor`, `MetaMonitor`, `MetaOutput` and `MetaCrtc` class diagrams.

```mermaid
classDiagram
    MetaLogicalMonitor
    class MetaLogicalMonitor{
      List~MetaMonitor~
    }
    MetaMonitor <-- MetaMonitorNormal
    MetaMonitor <-- MetaMonitorTiled
    class MetaMonitorNormal{
      MetaOutput output
    }
    class MetaMonitorTiled{
      List~MetaOutput~ output
    }
    MetaOutput <-- MetaOutputNative
    MetaOutputNative <-- MetaOutputKms
    MetaOutputNative <-- MetaOutputVirtual
    MetaOutput <-- MetaOutputXrandr
    MetaCrtc <-- MetaCrtcNative
    MetaCrtcNative <-- MetaCrtcKms
    MetaCrtcNative <-- MetaCrtcVirtual
    MetaCrtc <-- MetarCrtcXrandr
```

`ClutterStage` and `ClutterStageView` class diagram when using the Wayland session.

```mermaid
classDiagram
    class ClutterStage{
      List~ClutterStageView~
    }
    class ClutterStageView{
      MetaCrtc crtc
    }
```

`MetaKms` class diagram.

```mermaid
classDiagram
    class MetaKms{
      List~MetaKmsDevice~ devices
    }
    class MetaKmsDevice{
      List~MetaKmsConnector~
      List~MetaKmsCrtc~
      List~MetaKmsPlane~
      MetaKmsImplDevice impl_device
    }
    MetaKms "many" --> MetaKmsDevice : Owns
    MetaKmsDevice --> MetaKmsImplDevice : Owns
    MetaKmsImplDevice <-- MetaKmsImplDeviceAtomic
    MetaKmsImplDevice <-- MetaKmsImplDeviceSimple
```

## Native backend and mode setting

 * `MetaGpuKms`, `MetaCrtcKms` and `MetaOutputKms` are used for configuration.
 * `MetaKmsDevice`, `MetaKmsCrtc`, `MetaKmsConnector` and `MetaKmsPlane` are abstractions on top of kernel mode setting concepts.

```mermaid
erDiagram
  MetaBackendNative ||--|{ MetaGpuKms : owns
  MetaBackendNative ||--|| MetaKms : owns
  MetaKms ||--|{ MetaKmsDevice : owns
  MetaKmsDevice ||--|{ MetaKmsCrtc : owns
  MetaKmsDevice ||--|{ MetaKmsConnector : owns
  MetaKmsDevice ||--|{ MetaKmsPlane : owns
  MetaGpuKms ||--|{ MetaCrtcKms : owns
  MetaGpuKms ||--|{ MetaOutputKms : owns
  MetaCrtcKms |o..o{ MetaOutputKms : assigned
  MetaGpuKms |o..o| MetaKmsDevice : associated
  MetaCrtcKms |o..o| MetaKmsCrtc : associated
  MetaOutputKms |o..o| MetaKmsConnector : associated
```