2 * fbif.h -- Xen virtual frame buffer device
4 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
5 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
12 #ifndef __XEN_PUBLIC_IO_FBIF_H__
13 #define __XEN_PUBLIC_IO_FBIF_H__
15 #include <asm/types.h>
17 /* Out events (frontend -> backend) */
20 * Out events may be sent only when requested by backend, and receipt
21 * of an unknown out event is an error.
24 /* Event type 1 currently not used */
26 * Framebuffer update notification event
27 * Capable frontend sets feature-update in xenstore.
28 * Backend requests it by setting request-update in xenstore.
30 #define XENFB_TYPE_UPDATE 2
34 __u8 type; /* XENFB_TYPE_UPDATE */
35 __s32 x; /* source x */
36 __s32 y; /* source y */
37 __s32 width; /* rect width */
38 __s32 height; /* rect height */
41 #define XENFB_OUT_EVENT_SIZE 40
46 struct xenfb_update update;
47 char pad[XENFB_OUT_EVENT_SIZE];
50 /* In events (backend -> frontend) */
53 * Frontends should ignore unknown in events.
54 * No in events currently defined.
57 #define XENFB_IN_EVENT_SIZE 40
62 char pad[XENFB_IN_EVENT_SIZE];
67 #define XENFB_IN_RING_SIZE 1024
68 #define XENFB_IN_RING_LEN (XENFB_IN_RING_SIZE / XENFB_IN_EVENT_SIZE)
69 #define XENFB_IN_RING_OFFS 1024
70 #define XENFB_IN_RING(page) \
71 ((union xenfb_in_event *)((char *)(page) + XENFB_IN_RING_OFFS))
72 #define XENFB_IN_RING_REF(page, idx) \
73 (XENFB_IN_RING((page))[(idx) % XENFB_IN_RING_LEN])
75 #define XENFB_OUT_RING_SIZE 2048
76 #define XENFB_OUT_RING_LEN (XENFB_OUT_RING_SIZE / XENFB_OUT_EVENT_SIZE)
77 #define XENFB_OUT_RING_OFFS (XENFB_IN_RING_OFFS + XENFB_IN_RING_SIZE)
78 #define XENFB_OUT_RING(page) \
79 ((union xenfb_out_event *)((char *)(page) + XENFB_OUT_RING_OFFS))
80 #define XENFB_OUT_RING_REF(page, idx) \
81 (XENFB_OUT_RING((page))[(idx) % XENFB_OUT_RING_LEN])
85 __u32 in_cons, in_prod;
86 __u32 out_cons, out_prod;
88 __s32 width; /* the width of the framebuffer (in pixels) */
89 __s32 height; /* the height of the framebuffer (in pixels) */
90 __u32 line_length; /* the length of a row of pixels (in bytes) */
91 __u32 mem_length; /* the length of the framebuffer (in bytes) */
92 __u8 depth; /* the depth of a pixel (in bits) */
95 * Framebuffer page directory
97 * Each directory page holds PAGE_SIZE / sizeof(*pd)
98 * framebuffer pages, and can thus map up to PAGE_SIZE *
99 * PAGE_SIZE / sizeof(*pd) bytes. With PAGE_SIZE == 4096 and
100 * sizeof(unsigned long) == 4, that's 4 Megs. Two directory
101 * pages should be enough for a while.
107 * Wart: xenkbd needs to know resolution. Put it here until a better
108 * solution is found, but don't leak it to the backend.
111 #define XENFB_WIDTH 800
112 #define XENFB_HEIGHT 600
113 #define XENFB_DEPTH 32