1#ifndef XORG_EXA_H
2#define XORG_EXA_H
3
4#include "xorg_tracker.h"
5
6#include "pipe/p_state.h"
7
8struct cso_context;
9struct xorg_shaders;
10
11/* src + mask + dst */
12#define MAX_EXA_SAMPLERS 3
13
14struct 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_sampler_view *bound_sampler_views[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      PixmapPtr tmp_pix;
41   } copy;
42};
43
44struct exa_pixmap_priv
45{
46   int width, height;
47
48   int flags;
49   int tex_flags;
50
51   int picture_format;
52
53   struct pipe_resource *tex;
54   struct pipe_resource *depth_stencil_tex;
55
56   struct pipe_transfer *map_transfer;
57   unsigned map_count;
58};
59
60#define XORG_FALLBACK(s, arg...)                              \
61do {                                                          \
62   if (ms->debug_fallback) {                                  \
63      xf86DrvMsg(pScrn->scrnIndex, X_INFO,                    \
64                 "%s fallback " s "\n", __FUNCTION__, ##arg); \
65   }                                                          \
66   return FALSE;                                              \
67} while(0)
68
69struct pipe_surface *
70xorg_gpu_surface(struct pipe_context *pipe, struct exa_pixmap_priv *priv);
71
72void xorg_exa_flush(struct exa_context *exa,
73                    struct pipe_fence_handle **fence);
74void xorg_exa_finish(struct exa_context *exa);
75
76#endif
77