gallium: switch boolean -> bool at the interface definitions
[mesa.git] / src / gallium / drivers / svga / svga_winsys.h
index 7c2fb70a0afa3e647c6a4191503d7c8056805ab3..30d3f8776d935741277436f79cbb93b471296f27 100644 (file)
@@ -36,6 +36,7 @@
 #define SVGA_WINSYS_H_
 
 #include "svga_types.h"
+#include "svga3d_types.h"
 #include "svga_reg.h"
 #include "svga3d_reg.h"
 
@@ -80,13 +81,15 @@ struct winsys_handle;
 #define SVGA_FENCE_FLAG_EXEC      (1 << 0)
 #define SVGA_FENCE_FLAG_QUERY     (1 << 1)
 
-#define SVGA_SURFACE_USAGE_SHARED  (1 << 0)
-#define SVGA_SURFACE_USAGE_SCANOUT (1 << 1)
+#define SVGA_SURFACE_USAGE_SHARED   (1 << 0)
+#define SVGA_SURFACE_USAGE_SCANOUT  (1 << 1)
+#define SVGA_SURFACE_USAGE_COHERENT (1 << 2)
 
 #define SVGA_QUERY_FLAG_SET        (1 << 0)
 #define SVGA_QUERY_FLAG_REF        (1 << 1)
 
-#define SVGA_HINT_FLAG_CAN_PRE_FLUSH (1 << 0)  /* Can preemptively flush */
+#define SVGA_HINT_FLAG_CAN_PRE_FLUSH   (1 << 0)  /* Can preemptively flush */
+#define SVGA_HINT_FLAG_EXPORT_FENCE_FD (1 << 1)  /* Export a Fence FD */
 
 /**
  * SVGA mks statistics info
@@ -373,11 +376,17 @@ struct svga_winsys_context
     */
    uint32 hints;
 
+   /**
+    * File descriptor for imported fence
+    */
+   int32 imported_fence_fd;
+
    /**
     ** BEGIN new functions for guest-backed surfaces.
     **/
 
    boolean have_gb_objects;
+   boolean force_coherent;
 
    /**
     * Map a guest-backed surface.
@@ -404,13 +413,6 @@ struct svga_winsys_context
                     struct svga_winsys_surface *surface,
                     boolean *rebind);
 
-   /**
-    * Invalidate the content of this surface
-    */
-   enum pipe_error
-   (*surface_invalidate)(struct svga_winsys_context *swc,
-                         struct svga_winsys_surface *surface);
-
    /**
     * Create and define a DX GB shader that resides in the device COTable.
     * Caller of this function will issue the DXDefineShader command.
@@ -447,6 +449,10 @@ struct svga_winsys_context
 
    /** The more recent command issued to command buffer */
    SVGAFifo3dCmdId last_command;
+
+   /** For HUD queries */
+   uint64_t num_commands;
+   uint64_t num_draw_commands;
 };
 
 
@@ -519,7 +525,7 @@ struct svga_winsys_screen
     */
    struct svga_winsys_surface *
    (*surface_create)(struct svga_winsys_screen *sws,
-                     SVGA3dSurfaceFlags flags,
+                     SVGA3dSurfaceAllFlags flags,
                      SVGA3dSurfaceFormat format,
                      unsigned usage,
                      SVGA3dSize size,
@@ -572,7 +578,8 @@ struct svga_winsys_screen
                          SVGA3dSurfaceFormat format,
                          SVGA3dSize size,
                          uint32 numLayers,
-                         uint32 numMipLevels);
+                         uint32 numMipLevels,
+                         uint32 numSamples);
 
    /**
     * Buffer management. Buffer attributes are mostly fixed over its lifetime.
@@ -625,13 +632,41 @@ struct svga_winsys_screen
 
    /**
     * Wait for the fence to finish.
+    * \param timeout in nanoseconds (may be PIPE_TIMEOUT_INFINITE).
+    *                0 to return immediately, if the API suports it.
     * \param flags  driver-specific meaning
     * \return zero on success.
     */
    int (*fence_finish)( struct svga_winsys_screen *sws,
                         struct pipe_fence_handle *fence,
+                        uint64_t timeout,
                         unsigned flag );
 
+   /**
+    * Get the file descriptor associated with the fence
+    * \param duplicate duplicate the fd before returning it
+    * \return zero on success.
+    */
+   int (*fence_get_fd)( struct svga_winsys_screen *sws,
+                        struct pipe_fence_handle *fence,
+                        boolean duplicate );
+
+   /**
+    * Create a fence using the given file descriptor
+    * \return zero on success.
+    */
+   void (*fence_create_fd)( struct svga_winsys_screen *sws,
+                            struct pipe_fence_handle **fence,
+                            int32_t fd );
+
+   /**
+    * Accumulates fence FD from other devices into the current context
+    * \param context_fd FD the context will be waiting on
+    * \return zero on success
+    */
+   int (*fence_server_sync)( struct svga_winsys_screen *sws,
+                             int32_t *context_fd,
+                             struct pipe_fence_handle *fence );
 
    /**
     ** BEGIN new functions for guest-backed surfaces.
@@ -643,6 +678,8 @@ struct svga_winsys_screen
    /** Can we do DMA with guest-backed objects enabled? */
    bool have_gb_dma;
 
+   /** Do we support coherent surface memory? */
+   bool have_coherent;
    /**
     * Create and define a GB shader.
     */
@@ -713,16 +750,26 @@ struct svga_winsys_screen
    void
    (*stats_time_pop)();
 
+   /**
+    * Send a host log message
+    */
+   void
+   (*host_log)(struct svga_winsys_screen *sws, const char *message);
 
    /** Have VGPU v10 hardware? */
    boolean have_vgpu10;
 
+   /** Have SM4_1 hardware? */
+   boolean have_sm4_1;
+
    /** To rebind resources at the beginnning of a new command buffer */
    boolean need_to_rebind_resources;
 
    boolean have_generate_mipmap_cmd;
    boolean have_set_predication_cmd;
    boolean have_transfer_from_buffer_cmd;
+   boolean have_fence_fd;
+   boolean have_intra_surface_copy;
 };