44#define SVGA_MAX_WIDTH 2360
45#define SVGA_MAX_HEIGHT 1770
46#define SVGA_MAX_BITS_PER_PIXEL 32
47#define SVGA_MAX_DEPTH 24
49#define SVGA_FB_MAX_SIZE \
50 ((((SVGA_MAX_WIDTH * SVGA_MAX_HEIGHT * SVGA_MAX_BITS_PER_PIXEL / 8) >> PAGE_SHIFT) + 1) \
53#define SVGA_MAX_PSEUDOCOLOR_DEPTH 8
54#define SVGA_MAX_PSEUDOCOLORS (1 << SVGA_MAX_PSEUDOCOLOR_DEPTH)
55#define SVGA_NUM_PALETTE_REGS (3 * SVGA_MAX_PSEUDOCOLORS)
57#define SVGA_MAGIC 0x900000UL
58#define SVGA_MAKE_ID(ver) (SVGA_MAGIC << 8 | (ver))
61#define SVGA_VERSION_2 2
62#define SVGA_ID_2 SVGA_MAKE_ID(SVGA_VERSION_2)
66#define SVGA_VERSION_1 1
67#define SVGA_ID_1 SVGA_MAKE_ID(SVGA_VERSION_1)
70#define SVGA_VERSION_0 0
71#define SVGA_ID_0 SVGA_MAKE_ID(SVGA_VERSION_0)
74#define SVGA_ID_INVALID 0xFFFFFFFF
77#define SVGA_OLD_PALETTE_BASE 17
80#define SVGA_LEGACY_BASE_PORT 0x4560
81#define SVGA_INDEX_PORT 0x0
82#define SVGA_VALUE_PORT 0x1
83#define SVGA_BIOS_PORT 0x2
84#define SVGA_NUM_PORTS 0x3
87#define SVGA_LEGACY_ACCEL_PORT 0x3
90#define SVGA_CURSOR_ON_HIDE 0x0
91#define SVGA_CURSOR_ON_SHOW 0x1
92#define SVGA_CURSOR_ON_REMOVE_FROM_FB \
95#define SVGA_CURSOR_ON_RESTORE_TO_FB \
107 SVGA_REG_MAX_WIDTH = 4,
108 SVGA_REG_MAX_HEIGHT = 5,
110 SVGA_REG_BITS_PER_PIXEL = 7,
111 SVGA_REG_PSEUDOCOLOR = 8,
112 SVGA_REG_RED_MASK = 9,
113 SVGA_REG_GREEN_MASK = 10,
114 SVGA_REG_BLUE_MASK = 11,
115 SVGA_REG_BYTES_PER_LINE = 12,
116 SVGA_REG_FB_START = 13,
117 SVGA_REG_FB_OFFSET = 14,
118 SVGA_REG_VRAM_SIZE = 15,
119 SVGA_REG_FB_SIZE = 16,
123 SVGA_REG_CAPABILITIES = 17,
124 SVGA_REG_MEM_START = 18,
125 SVGA_REG_MEM_SIZE = 19,
126 SVGA_REG_CONFIG_DONE = 20,
129 SVGA_REG_GUEST_ID = 23,
130 SVGA_REG_CURSOR_ID = 24,
131 SVGA_REG_CURSOR_X = 25,
132 SVGA_REG_CURSOR_Y = 26,
133 SVGA_REG_CURSOR_ON = 27,
134 SVGA_REG_HOST_BITS_PER_PIXEL = 28,
135 SVGA_REG_SCRATCH_SIZE = 29,
136 SVGA_REG_MEM_REGS = 30,
137 SVGA_REG_NUM_DISPLAYS = 31,
138 SVGA_REG_PITCHLOCK = 32,
141 SVGA_PALETTE_BASE = 1024,
143 SVGA_SCRATCH_BASE = SVGA_PALETTE_BASE + SVGA_NUM_PALETTE_REGS
154#define SVGA_CAP_NONE 0x00000
155#define SVGA_CAP_RECT_FILL 0x00001
156#define SVGA_CAP_RECT_COPY 0x00002
157#define SVGA_CAP_RECT_PAT_FILL 0x00004
158#define SVGA_CAP_LEGACY_OFFSCREEN 0x00008
159#define SVGA_CAP_RASTER_OP 0x00010
160#define SVGA_CAP_CURSOR 0x00020
161#define SVGA_CAP_CURSOR_BYPASS 0x00040
162#define SVGA_CAP_CURSOR_BYPASS_2 0x00080
163#define SVGA_CAP_8BIT_EMULATION 0x00100
164#define SVGA_CAP_ALPHA_CURSOR 0x00200
165#define SVGA_CAP_GLYPH 0x00400
166#define SVGA_CAP_GLYPH_CLIPPING 0x00800
167#define SVGA_CAP_OFFSCREEN_1 0x01000
168#define SVGA_CAP_ALPHA_BLEND 0x02000
169#define SVGA_CAP_3D 0x04000
170#define SVGA_CAP_EXTENDED_FIFO 0x08000
171#define SVGA_CAP_MULTIMON 0x10000
172#define SVGA_CAP_PITCHLOCK 0x20000
178#define SVGA_ROP_CLEAR 0x00
179#define SVGA_ROP_AND 0x01
180#define SVGA_ROP_AND_REVERSE 0x02
181#define SVGA_ROP_COPY 0x03
182#define SVGA_ROP_AND_INVERTED 0x04
183#define SVGA_ROP_NOOP 0x05
184#define SVGA_ROP_XOR 0x06
185#define SVGA_ROP_OR 0x07
186#define SVGA_ROP_NOR 0x08
187#define SVGA_ROP_EQUIV 0x09
188#define SVGA_ROP_INVERT 0x0a
189#define SVGA_ROP_OR_REVERSE 0x0b
190#define SVGA_ROP_COPY_INVERTED 0x0c
191#define SVGA_ROP_OR_INVERTED 0x0d
192#define SVGA_ROP_NAND 0x0e
193#define SVGA_ROP_SET 0x0f
194#define SVGA_ROP_UNSUPPORTED 0x10
196#define SVGA_NUM_SUPPORTED_ROPS 16
197#define SVGA_ROP_ALL (MASK(SVGA_NUM_SUPPORTED_ROPS))
198#define SVGA_IS_VALID_ROP(rop) (rop < SVGA_NUM_SUPPORTED_ROPS)
241#define SVGA_BLENDOP_CLEAR 0
242#define SVGA_BLENDOP_SRC 1
243#define SVGA_BLENDOP_DST 2
244#define SVGA_BLENDOP_OVER 3
245#define SVGA_BLENDOP_OVER_REVERSE 4
246#define SVGA_BLENDOP_IN 5
247#define SVGA_BLENDOP_IN_REVERSE 6
248#define SVGA_BLENDOP_OUT 7
249#define SVGA_BLENDOP_OUT_REVERSE 8
250#define SVGA_BLENDOP_ATOP 9
251#define SVGA_BLENDOP_ATOP_REVERSE 10
252#define SVGA_BLENDOP_XOR 11
253#define SVGA_BLENDOP_ADD 12
254#define SVGA_BLENDOP_SATURATE 13
256#define SVGA_NUM_BLENDOPS 14
257#define SVGA_IS_VALID_BLENDOP(op) (op >= 0 && op < SVGA_NUM_BLENDOPS)
259#define SVGA_BLENDFLAG_CONSTANT_SOURCE_ALPHA 0x01
260#define SVGA_BLENDFLAG_CONSTANT_DEST_ALPHA 0x02
261#define SVGA_NUM_BLENDFLAGS 2
262#define SVGA_BLENDFLAG_ALL (MASK(SVGA_NUM_BLENDFLAGS))
263#define SVGA_IS_VALID_BLENDFLAG(flag) ((flag & ~SVGA_BLENDFLAG_ALL) == 0)
283 SVGA_FIFO_CAPABILITIES = 4,
286 SVGA_FIFO_3D_HWVERSION,
305#define SVGA_FIFO_CAP_NONE 0
306#define SVGA_FIFO_CAP_FENCE (1 << 0)
307#define SVGA_FIFO_CAP_ACCELFRONT (1 << 1)
308#define SVGA_FIFO_CAP_PITCHLOCK (1 << 2)
316#define SVGA_FIFO_FLAG_NONE 0
317#define SVGA_FIFO_FLAG_ACCELFRONT (1 << 0)
323#define SVGA_MAX_ID 499
330#define SVGA_BITMAP_SIZE(w, h) ((((w) + 31) >> 5) * (h))
331#define SVGA_BITMAP_SCANLINE_SIZE(w) (((w) + 31) >> 5)
332#define SVGA_PIXMAP_SIZE(w, h, bpp) (((((w) * (bpp)) + 31) >> 5) * (h))
333#define SVGA_PIXMAP_SCANLINE_SIZE(w, bpp) ((((w) * (bpp)) + 31) >> 5)
334#define SVGA_GLYPH_SIZE(w, h) ((((((w) + 7) >> 3) * (h)) + 3) >> 2)
335#define SVGA_GLYPH_SCANLINE_SIZE(w) (((w) + 7) >> 3)
340#define SVGA_BITMAP_INCREMENT(w) ((((w) + 31) >> 5) * sizeof(uint32))
341#define SVGA_PIXMAP_INCREMENT(w, bpp) (((((w) * (bpp)) + 31) >> 5) * sizeof(uint32))
346#define SVGA_COLOR_TRANSPARENT (~0)
352#define SVGA_CMD_INVALID_CMD 0
356#define SVGA_CMD_UPDATE 1
360#define SVGA_CMD_RECT_FILL 2
364#define SVGA_CMD_RECT_COPY 3
368#define SVGA_CMD_DEFINE_BITMAP 4
372#define SVGA_CMD_DEFINE_BITMAP_SCANLINE 5
376#define SVGA_CMD_DEFINE_PIXMAP 6
380#define SVGA_CMD_DEFINE_PIXMAP_SCANLINE 7
384#define SVGA_CMD_RECT_BITMAP_FILL 8
388#define SVGA_CMD_RECT_PIXMAP_FILL 9
392#define SVGA_CMD_RECT_BITMAP_COPY 10
397#define SVGA_CMD_RECT_PIXMAP_COPY 11
401#define SVGA_CMD_FREE_OBJECT 12
405#define SVGA_CMD_RECT_ROP_FILL 13
409#define SVGA_CMD_RECT_ROP_COPY 14
413#define SVGA_CMD_RECT_ROP_BITMAP_FILL 15
417#define SVGA_CMD_RECT_ROP_PIXMAP_FILL 16
421#define SVGA_CMD_RECT_ROP_BITMAP_COPY 17
426#define SVGA_CMD_RECT_ROP_PIXMAP_COPY 18
430#define SVGA_CMD_DEFINE_CURSOR 19
436#define SVGA_CMD_DISPLAY_CURSOR 20
440#define SVGA_CMD_MOVE_CURSOR 21
444#define SVGA_CMD_DEFINE_ALPHA_CURSOR 22
449#define SVGA_CMD_DRAW_GLYPH 23
453#define SVGA_CMD_DRAW_GLYPH_CLIPPED 24
458#define SVGA_CMD_UPDATE_VERBOSE 25
462#define SVGA_CMD_SURFACE_FILL 26
466#define SVGA_CMD_SURFACE_COPY 27
471#define SVGA_CMD_SURFACE_ALPHA_BLEND 28
477#define SVGA_CMD_FRONT_ROP_FILL 29
481#define SVGA_CMD_FENCE 30
485#define SVGA_CMD_MAX 31
487#define SVGA_CMD_MAX_ARGS 64
492#define SVGA_VRAM_MAX_SIZE (16 * 1024 * 1024)
494#define SVGA_VRAM_SIZE_WS (16 * 1024 * 1024)
495#define SVGA_MEM_SIZE_WS (2 * 1024 * 1024)
496#define SVGA_VRAM_SIZE_SERVER (4 * 1024 * 1024)
497#define SVGA_MEM_SIZE_SERVER (256 * 1024)
499#if defined(VMX86_SERVER)
500#define SVGA_VRAM_SIZE SVGA_VRAM_SIZE_SERVER
501#define SVGA_MEM_SIZE SVGA_MEM_SIZE_SERVER
503#define SVGA_VRAM_SIZE SVGA_VRAM_SIZE_WS
504#define SVGA_MEM_SIZE SVGA_MEM_SIZE_WS
534#define SVGA_FB_LEGACY_START 0x7EFC0000
535#define SVGA_FB_LEGACY_START_BIGMEM 0xE0000000