~emersion/go-drm

go-drm/device.go -rw-r--r-- 282 bytes
7088ebfeSimon Ser Add support for Amlogic format modifiers 12 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package drm

import (
	"syscall"
)

func modeIsChr(mode uint32) bool {
	return mode&syscall.S_IFMT == syscall.S_IFCHR
}

func devIsDRM(dev uint64) bool {
	return major(dev) == drmMajor
}

func isDRM(stat *syscall.Stat_t) bool {
	return devIsDRM(stat.Rdev) && modeIsChr(stat.Mode)
}