Squashed commit of the following:
[mesa.git] / src / gallium / state_trackers / xorg / xorg_exa.h
index 5b515be1397d85f54dc707eb789468bef7008c19..a35e9a5c9012d6d27fdbb7e4d0fe2abfeea90501 100644 (file)
@@ -14,37 +14,69 @@ struct xorg_shaders;
 struct exa_context
 {
    ExaDriverPtr pExa;
-   struct pipe_context *ctx;
+   struct pipe_context *pipe;
    struct pipe_screen *scrn;
-   struct cso_context *cso;
-   struct xorg_shaders *shaders;
+   struct xorg_renderer *renderer;
 
-   struct pipe_constant_buffer vs_const_buffer;
-   struct pipe_constant_buffer fs_const_buffer;
-
-   struct pipe_texture *bound_textures[MAX_EXA_SAMPLERS];
+   struct pipe_sampler_view *bound_sampler_views[MAX_EXA_SAMPLERS];
    int num_bound_samplers;
 
    float solid_color[4];
-};
+   boolean has_solid_color;
+
+   boolean accel;
+
+   /* float[9] projective matrix bound to pictures */
+   struct {
+      float    src[9];
+      float   mask[9];
+      boolean has_src;
+      boolean has_mask;
+   } transform;
+
+   struct {
+      boolean use_surface_copy;
+
+      struct exa_pixmap_priv *src;
+      struct exa_pixmap_priv *dst;
 
+      struct pipe_surface *src_surface;
+      struct pipe_surface *dst_surface;
+
+      struct pipe_resource *src_texture;
+   } copy;
+};
 
 struct exa_pixmap_priv
 {
+   int width, height;
+
    int flags;
    int tex_flags;
 
-   struct pipe_texture *tex;
-   struct pipe_texture *depth_stencil_tex;
-   unsigned int color;
-   struct pipe_surface *src_surf; /* for copies */
+   int picture_format;
+
+   struct pipe_resource *tex;
+   struct pipe_resource *depth_stencil_tex;
 
    struct pipe_transfer *map_transfer;
    unsigned map_count;
 };
 
+#define XORG_FALLBACK(s, arg...)                              \
+do {                                                          \
+   if (ms->debug_fallback) {                                  \
+      xf86DrvMsg(pScrn->scrnIndex, X_INFO,                    \
+                 "%s fallback " s "\n", __FUNCTION__, ##arg); \
+   }                                                          \
+   return FALSE;                                              \
+} while(0)
+
 struct pipe_surface *
-exa_gpu_surface(struct exa_context *exa, struct exa_pixmap_priv *priv);
+xorg_gpu_surface(struct pipe_screen *scrn, struct exa_pixmap_priv *priv);
 
+void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
+                    struct pipe_fence_handle **fence);
+void xorg_exa_finish(struct exa_context *exa);
 
 #endif