Cut the drm package comments back to what is not evident from the code

This commit is contained in:
flamingcow
2026-08-04 13:23:41 -07:00
parent 4fd3abaf25
commit 05e1958710
+5 -11
View File
@@ -1,7 +1,4 @@
// Package drm is the kernel mode-setting ABI, shared by the panel this draws on
// and the grabber that reads it back out. These structs are a layout contract,
// so a field added or reordered in one copy and not the other would silently
// misread the kernel: there is deliberately only one copy.
// Package drm is the kernel mode-setting ABI.
package drm
import (
@@ -93,9 +90,8 @@ type ModeCrtcPageFlip struct {
UserData uint64
}
// WaitVblank has only Type and Sequence ever set, and those sit at the same
// offsets in both arms of the kernel's union. The request below carries the
// union's own size rather than this struct's, which is larger.
// WaitVblank is larger than the kernel union it mirrors, so WaitVblankIO
// carries the union's size and only Type and Sequence are at valid offsets.
type WaitVblank struct {
Type uint32
Sequence uint32
@@ -122,7 +118,6 @@ var (
MapDumb = IOWR(0xb3, unsafe.Sizeof(ModeMapDumb{}))
)
// What ADDFB means by 32 bits per pixel and 24 bits of colour.
const (
redShift = 16
greenShift = 8
@@ -137,9 +132,8 @@ func Unpack(v uint32) (r, g, b uint8) {
return uint8(v >> redShift), uint8(v >> greenShift), uint8(v >> blueShift)
}
// Offset turns the quarter turn between the portrait canvas and the landscape
// panel, putting logical top on the panel's right edge. Drawing and reading
// back have to agree on this exactly.
// Offset maps the portrait canvas onto the landscape panel, a quarter turn that
// puts logical top on the panel's right edge.
func Offset(x, y, stride, panelW int) int {
return x*stride + (panelW-1-y)*4
}