1
2
3
4
5
6
7
8
9
10
11 #ifndef __XEN_DRM_FRONT_EVTCHNL_H_
12 #define __XEN_DRM_FRONT_EVTCHNL_H_
13
14 #include <linux/completion.h>
15 #include <linux/types.h>
16
17 #include <xen/interface/io/ring.h>
18 #include <xen/interface/io/displif.h>
19
20
21
22
23
24 #define GENERIC_OP_EVT_CHNL 0
25
26 enum xen_drm_front_evtchnl_state {
27 EVTCHNL_STATE_DISCONNECTED,
28 EVTCHNL_STATE_CONNECTED,
29 };
30
31 enum xen_drm_front_evtchnl_type {
32 EVTCHNL_TYPE_REQ,
33 EVTCHNL_TYPE_EVT,
34 };
35
36 struct xen_drm_front_drm_info;
37
38 struct xen_drm_front_evtchnl {
39 struct xen_drm_front_info *front_info;
40 int gref;
41 int port;
42 int irq;
43 int index;
44 enum xen_drm_front_evtchnl_state state;
45 enum xen_drm_front_evtchnl_type type;
46
47 u16 evt_id;
48
49 u16 evt_next_id;
50 union {
51 struct {
52 struct xen_displif_front_ring ring;
53 struct completion completion;
54
55 int resp_status;
56
57 struct mutex req_io_lock;
58 } req;
59 struct {
60 struct xendispl_event_page *page;
61 } evt;
62 } u;
63 };
64
65 struct xen_drm_front_evtchnl_pair {
66 struct xen_drm_front_evtchnl req;
67 struct xen_drm_front_evtchnl evt;
68 };
69
70 int xen_drm_front_evtchnl_create_all(struct xen_drm_front_info *front_info);
71
72 int xen_drm_front_evtchnl_publish_all(struct xen_drm_front_info *front_info);
73
74 void xen_drm_front_evtchnl_flush(struct xen_drm_front_evtchnl *evtchnl);
75
76 void xen_drm_front_evtchnl_set_state(struct xen_drm_front_info *front_info,
77 enum xen_drm_front_evtchnl_state state);
78
79 void xen_drm_front_evtchnl_free_all(struct xen_drm_front_info *front_info);
80
81 #endif