st/xorg: Replace compile-time acceleration switch with Option "2DAccel".
[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 boolean accel;
28
29 /* float[9] projective matrix bound to pictures */
30 struct {
31 float src[9];
32 float mask[9];
33 boolean has_src;
34 boolean has_mask;
35 } transform;
36
37 struct {
38 struct exa_pixmap_priv *src;
39 struct exa_pixmap_priv *dst;
40 } copy;
41 };
42
43 struct exa_pixmap_priv
44 {
45 int flags;
46 int tex_flags;
47
48 int picture_format;
49
50 struct pipe_texture *tex;
51 struct pipe_texture *depth_stencil_tex;
52
53 struct pipe_transfer *map_transfer;
54 unsigned map_count;
55 };
56
57 #define XORG_FALLBACK(s, arg...) \
58 do { \
59 if (ms->debug_fallback) { \
60 xf86DrvMsg(pScrn->scrnIndex, X_INFO, \
61 "%s fallback " s "\n", __FUNCTION__, ##arg); \
62 } \
63 return FALSE; \
64 } while(0)
65
66 struct pipe_surface *
67 xorg_gpu_surface(struct pipe_screen *scrn, struct exa_pixmap_priv *priv);
68
69 void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
70 struct pipe_fence_handle **fence);
71 void xorg_exa_finish(struct exa_context *exa);
72
73 #endif