~emersion/drmdb

c52cf9b0a89014a254ede726b746bddbe6054dfb — Simon Ser 5 months ago b284b70
Fix bitmask pretty-printing

The kernel sets the enum values to the number of left shifts, the enum
values aren't bits we can use directly.

See for instance drm_plane_create_rotation_property [1].

[1]: https://cgit.freedesktop.org/drm-tip/tree/drivers/gpu/drm/drm_blend.c#n282
1 files changed, 2 insertions(+), 1 deletions(-)

M drmtree/drmtree.go
M drmtree/drmtree.go => drmtree/drmtree.go +2 -1
@@ 488,7 488,8 @@ func (m *PropertyMap) FormatTree(tf treefmt.Formatter) {
				entries := prop.Spec.(PropertySpecEnum)
				var names []string
				for _, e := range entries {
					if e.Value&u == e.Value {
					bit := uint64(1 << e.Value)
					if u&bit != 0 {
						names = append(names, e.Name)
					}
				}