~emersion/drmdb

ref: a85c27af65ce9e831bcaf14da813dc24b495d376 drmdb/drmdoc/drmdoc.go -rw-r--r-- 1.4 KiB
a85c27afSimon Ser Filter capabilities by driver name 4 months ago
                                                                                
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
package drmdoc

//go:generate go run generate.go drivers/gpu/drm/drm_connector.c "standard connector properties"
//go:generate go run generate.go drivers/gpu/drm/drm_connector.c "HDMI connector properties"
//go:generate go run generate.go drivers/gpu/drm/drm_crtc.c "standard CRTC properties"
//go:generate go run generate.go drivers/gpu/drm/drm_blend.c "overview" "plane blending properties"
//go:generate go run generate.go drivers/gpu/drm/drm_color_mgmt.c "overview" "color management properties"
//go:generate go run generate.go drivers/gpu/drm/drm_atomic_uapi.c "explicit fencing properties"
//go:generate go run generate.go drivers/gpu/drm/drm_connector.c "Variable refresh properties"

import (
	"git.sr.ht/~emersion/go-drm"
)

func Prop(obj drm.ObjectType, name string) string {
	switch obj {
	case drm.ObjectConnector:
		if doc, ok := standardConnectorProperties[name]; ok {
			return doc
		}
		if doc, ok := hdmiConnectorProperties[name]; ok {
			return doc
		}
	case drm.ObjectCRTC:
		if doc, ok := standardCRTCProperties[name]; ok {
			return doc
		}
		if doc, ok := colorManagementProperties[name]; ok {
			return doc
		}
	case drm.ObjectPlane:
		if doc, ok := planeBlendingProperties[name]; ok {
			return doc
		}
	}
	// Explicit fencing and VRR docs contain mixed plane, connector and CRTC
	// props
	if doc, ok := explicitFencingProperties[name]; ok {
		return doc
	}
	if doc, ok := variableRefreshProperties[name]; ok {
		return doc
	}
	return ""
}