~emersion/go-drm

14dacfd8e441dc733e619e265decc3432d726596 — Simon Ser 1 year, 11 months ago bdd0a2b
Add String method to capabilities
1 files changed, 48 insertions(+), 0 deletions(-)

M const.go
M const.go => const.go +48 -0
@@ 63,6 63,38 @@ const (
	CapSyncObj             Cap = 0x13
)

func (c Cap) String() string {
	switch c {
	case CapDumbBuffer:
		return "DUMB_BUFFER"
	case CapVblankHighCRTC:
		return "VBLANK_HIGH_CRTC"
	case CapDumbPreferredDepth:
		return "DUMB_PREFERRED_DEPTH"
	case CapDumbPreferredShadow:
		return "DUMB_PREFER_SHADOW"
	case CapPrime:
		return "PRIME"
	case CapTimestampMonotonic:
		return "TIMESTAMP_MONOTONIC"
	case CapAsyncPageFlip:
		return "ASYNC_PAGE_FLIP"
	case CapCursorWidth:
		return "CURSOR_WIDTH"
	case CapCursorHeight:
		return "CURSOR_HEIGHT"
	case CapAddFB2Modifiers:
		return "ADDFB2_MODIFIERS"
	case CapPageFlipTarget:
		return "PAGE_FLIP_TARGET"
	case CapCRTCInVBlankEvent:
		return "CRTC_IN_VBLANK_EVENT"
	case CapSyncObj:
		return "SYNCOBJ"
	}
	return "unknown"
}

type ClientCap uint64

const (


@@ 73,6 105,22 @@ const (
	ClientCapWritebackConnectors ClientCap = 5
)

func (c ClientCap) String() string {
	switch c {
	case ClientCapStereo3D:
		return "STEREO_3D"
	case ClientCapUniversalPlanes:
		return "UNIVERSAL_PLANES"
	case ClientCapAtomic:
		return "ATOMIC"
	case ClientCapAspectRatio:
		return "APSECT_RATIO"
	case ClientCapWritebackConnectors:
		return "WRITEBACK_CONNECTORS"
	}
	return "unknown"
}

const (
	CapPrimeImport = 0x1
	CapPrimeExport = 0x2