OLD | NEW |
(Empty) | |
| 1 #ifndef _VA_DRICOMMON_H_ |
| 2 #define _VA_DRICOMMON_H_ |
| 3 |
| 4 #ifndef ANDROID |
| 5 #include <X11/Xlib.h> |
| 6 #include <xf86drm.h> |
| 7 #include <drm.h> |
| 8 #include <drm_sarea.h> |
| 9 #endif |
| 10 |
| 11 #include <va/va_backend.h> |
| 12 |
| 13 #ifdef ANDROID |
| 14 #define XID unsigned int |
| 15 #define Bool int |
| 16 #endif |
| 17 |
| 18 enum |
| 19 { |
| 20 VA_NONE = 0, |
| 21 VA_DRI1 = 1, |
| 22 VA_DRI2 = 2, |
| 23 VA_DUMMY = 3 |
| 24 }; |
| 25 |
| 26 union dri_buffer |
| 27 { |
| 28 struct { |
| 29 unsigned int attachment; |
| 30 unsigned int name; |
| 31 unsigned int pitch; |
| 32 unsigned int cpp; |
| 33 unsigned int flags; |
| 34 } dri2; |
| 35 }; |
| 36 |
| 37 struct dri_drawable |
| 38 { |
| 39 XID x_drawable; |
| 40 int is_window; |
| 41 int x; |
| 42 int y; |
| 43 unsigned int width; |
| 44 unsigned int height; |
| 45 struct dri_drawable *next; |
| 46 }; |
| 47 |
| 48 #define DRAWABLE_HASH_SZ 32 |
| 49 struct dri_state |
| 50 { |
| 51 int fd; |
| 52 int driConnectedFlag; /* 0: disconnected, 1: DRI, 2: DRI2 */ |
| 53 #ifndef ANDROID |
| 54 struct dri_drawable *drawable_hash[DRAWABLE_HASH_SZ]; |
| 55 |
| 56 struct dri_drawable *(*createDrawable)(VADriverContextP ctx, XID x_drawable)
; |
| 57 void (*destroyDrawable)(VADriverContextP ctx, struct dri_drawable *dri_drawa
ble); |
| 58 void (*swapBuffer)(VADriverContextP ctx, struct dri_drawable *dri_drawable); |
| 59 union dri_buffer *(*getRenderingBuffer)(VADriverContextP ctx, struct dri_dra
wable *dri_drawable); |
| 60 void (*close)(VADriverContextP ctx); |
| 61 #endif |
| 62 }; |
| 63 |
| 64 Bool isDRI2Connected(VADriverContextP ctx, char **driver_name); |
| 65 void free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable); |
| 66 void free_drawable_hashtable(VADriverContextP ctx); |
| 67 struct dri_drawable *dri_get_drawable(VADriverContextP ctx, XID drawable); |
| 68 void dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable); |
| 69 union dri_buffer *dri_get_rendering_buffer(VADriverContextP ctx, struct dri_draw
able *dri_drawable); |
| 70 |
| 71 #endif /* _VA_DRICOMMON_H_ */ |
OLD | NEW |