Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa
[mesa.git] / src / gallium / state_trackers / xorg / xorg_exa.h
1 #ifndef XORG_EXA_H
2 #define XORG_EXA_H
3
4 #include "xorg_tracker.h"
5
6 #include <pipe/p_state.h>
7
8 struct cso_context;
9 struct xorg_shaders;
10
11 /* src + mask + dst */
12 #define MAX_EXA_SAMPLERS 3
13
14 struct exa_context
15 {
16 ExaDriverPtr pExa;
17 struct pipe_context *pipe;
18 struct pipe_screen *scrn;
19 struct xorg_renderer *renderer;
20
21 struct pipe_texture *bound_textures[MAX_EXA_SAMPLERS];
22 int num_bound_samplers;
23
24 float solid_color[4];
25 boolean has_solid_color;
26
27 struct {
28 struct exa_pixmap_priv *src;
29 struct exa_pixmap_priv *dst;
30 } copy;
31 };
32
33 struct exa_pixmap_priv
34 {
35 int flags;
36 int tex_flags;
37
38 struct pipe_texture *tex;
39 struct pipe_texture *depth_stencil_tex;
40
41 struct pipe_transfer *map_transfer;
42 unsigned map_count;
43 };
44
45 #define XORG_FALLBACK(s, arg...) \
46 do { \
47 if (ms->debug_fallback) { \
48 xf86DrvMsg(pScrn->scrnIndex, X_INFO, \
49 "%s fallback " s "\n", __FUNCTION__, ##arg); \
50 } \
51 return FALSE; \
52 } while(0)
53
54 struct pipe_surface *
55 xorg_gpu_surface(struct pipe_screen *scrn, struct exa_pixmap_priv *priv);
56
57 void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
58 struct pipe_fence_handle **fence);
59 void xorg_exa_finish(struct exa_context *exa);
60
61 #endif