Skip to content

Commit b5c5894

Browse files
committed
add what we know about the alpha blending register(s)
1 parent cb624a4 commit b5c5894

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

sys/dev/ic/summitreg.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: summitreg.h,v 1.14 2025/01/26 05:20:57 macallan Exp $ */
1+
/* $NetBSD: summitreg.h,v 1.15 2025/01/27 11:38:39 macallan Exp $ */
22

33
/*
44
* Copyright (c) 2024 Michael Lorenz
@@ -61,6 +61,7 @@
6161
#define FOE_BLEND_ROP 0x00000040 // IBO is used
6262
#define FOE_DITHER 0x00000080
6363
#define VISFX_IBO 0x921110 // ROP in lowest nibble
64+
#define VISFX_CBR 0x92111c // constant colour for blending
6465
#define VISFX_IAA0 0x921200 // XLUT, 16 entries
6566
#define VISFX_IAA(n) (0x921200 + ((n) << 2))
6667
#define VISFX_OTR 0x921148 // overlay transparency
@@ -151,6 +152,28 @@
151152
* 0x400 or 0x100 by themselves don't start a command either
152153
*/
153154

155+
/*
156+
* alpha blending operations
157+
* source and destination blend functions are in 0xf0 and 0x0f
158+
* how they're combined is in 0x700
159+
*/
160+
#define IBO_ROP 0 /* ROP in lower 4 bit */
161+
#define IBO_ADD 0x200
162+
#define IBO_S_MINUS_D 0x400 /* source - dest */
163+
#define IBO_D_MINUS_S 0x500 /* dest - source */
164+
#define IBO_MIN 0x600
165+
#define IBO_MAX 0x700
166+
167+
/* the blend functions seem to be: */
168+
#define IBO_ZERO 0
169+
#define IBO_ONE 1
170+
#define IBO_SRC 4 /* src alpha */
171+
#define IBO_ONE_MINUS_SRC 5 /* 1 - src alpha */
172+
#define IBO_CBR 14 /* alpha from CBR */
173+
#define IBO_ONE_MINUS_CBR 15 /* 1 - alpha from CBR */
174+
175+
#define SRC(n) ((n) << 4)
176+
#define DST(n) (n)
154177
/*
155178
* use unbuffered space for cursor registers
156179
* The _POS, _INDEX and _DATA registers work exactly like on HCRX

0 commit comments

Comments
 (0)