2 * linux/include/linux/xenfb.h -- Xen virtual frame buffer device
6 * Anthony Liguori <aliguori@us.ibm.com>
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive for
13 #ifndef _LINUX_XENFB_H
14 #define _LINUX_XENFB_H
16 #include <asm/types.h>
20 #define XENFB_OUT_EVENT_SIZE 40
22 #define XENFB_TYPE_MOTION 1
23 #define XENFB_TYPE_UPDATE 2
25 struct xenfb_motion /* currently unused */
27 __u8 type; /* XENFB_TYPE_MOTION */
28 __u16 x; /* The new x coordinate */
29 __u16 y; /* The new y coordinate */
34 __u8 type; /* XENFB_TYPE_UPDATE */
35 __u16 x; /* source x */
36 __u16 y; /* source y */
37 __u16 width; /* rect width */
38 __u16 height; /* rect height */
44 struct xenfb_motion motion;
45 struct xenfb_update update;
46 char _[XENFB_OUT_EVENT_SIZE];
51 #define XENFB_IN_EVENT_SIZE 40
53 #define XENFB_TYPE_SET_EVENTS 1
55 #define XENFB_FLAG_MOTION 1
56 #define XENFB_FLAG_UPDATE 2
57 #define XENFB_FLAG_COPY 4
58 #define XENFB_FLAG_FILL 8
60 struct xenfb_set_events
62 __u8 type; /* XENFB_TYPE_SET_EVENTS */
63 __u32 flags; /* combination of XENFB_FLAG_* */
69 struct xenfb_set_events set_events;
70 char _[XENFB_OUT_EVENT_SIZE];
75 #define XENFB_IN_RING_SIZE 1024
76 #define XENFB_IN_RING_LEN (XENFB_IN_RING_SIZE / XENFB_IN_EVENT_SIZE)
77 #define XENFB_IN_RING_OFFS 1024
78 #define XENFB_IN_RING(page) \
79 ((union xenfb_in_event *)((char *)(page) + XENFB_IN_RING_OFFS))
80 #define XENFB_IN_RING_REF(page, idx) \
81 (XENFB_IN_RING((page))[(idx) % XENFB_IN_RING_LEN])
83 #define XENFB_OUT_RING_SIZE 2048
84 #define XENFB_OUT_RING_LEN (XENFB_OUT_RING_SIZE / XENFB_OUT_EVENT_SIZE)
85 #define XENFB_OUT_RING_OFFS (XENFB_IN_RING_OFFS + XENFB_IN_RING_SIZE)
86 #define XENFB_OUT_RING(page) \
87 ((union xenfb_out_event *)((char *)(page) + XENFB_OUT_RING_OFFS))
88 #define XENFB_OUT_RING_REF(page, idx) \
89 (XENFB_OUT_RING((page))[(idx) % XENFB_OUT_RING_LEN])
93 __u16 width; /* the width of the framebuffer (in pixels) */
94 __u16 height; /* the height of the framebuffer (in pixels) */
95 __u32 line_length; /* the length of a row of pixels (in bytes) */
96 __u32 mem_length; /* the length of the framebuffer (in bytes) */
97 __u8 depth; /* the depth of a pixel (in bits) */
99 unsigned long pd[2]; /* FIXME rename to pgdir? */
100 /* FIXME pd[1] unused at this time, shrink? */
102 __u32 in_cons, in_prod;
103 __u32 out_cons, out_prod;
106 void xenfb_resume(void);