~emersion/go-drm

ref: 66aafcb8e4628f28f778eb9eda337b1a7ddc8fe1 go-drm/fourcc.go -rw-r--r-- 510 bytes
66aafcb8Simon Ser Move String function outside of machine-generated code a month 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
package drm

//go:generate ./fourcc.py

type Format uint32

func (fmt Format) String() string {
	if s := fmt.str(); s != "" {
		return s
	}
	return "unknown"
}

type ModifierVendor uint8

func (vendor ModifierVendor) String() string {
	if s := vendor.str(); s != "" {
		return s
	}
	return "unknown"
}

type Modifier uint64

func (mod Modifier) String() string {
	if s := mod.str(); s != "" {
		return s
	}
	return "unknown"
}

func (mod Modifier) Vendor() ModifierVendor {
	return ModifierVendor(mod >> 56)
}