~emersion/drmdb

ref: fca493e0891500577fe6bfa91d10d27840599a81 drmdb/drmdoc/drmdoc.go -rw-r--r-- 1.6 KiB
fca493e0Simon Ser drmdoc: update docs 5 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
46
47
48
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_plane.c "standard plane 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
		}
	case drm.ObjectPlane:
		if doc, ok := standardPlaneProperties[name]; ok {
			return doc
		}
		if doc, ok := planeBlendingProperties[name]; ok {
			return doc
		}
	}
	// The following docs contain mixed plane, connector and CRTC props
	if doc, ok := explicitFencingProperties[name]; ok {
		return doc
	}
	if doc, ok := variableRefreshProperties[name]; ok {
		return doc
	}
	if doc, ok := colorManagementProperties[name]; ok {
		return doc
	}
	return ""
}