#define SVGA_WINSYS_H_
#include "svga_types.h"
+#include "svga3d_types.h"
#include "svga_reg.h"
#include "svga3d_reg.h"
#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
*/
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.
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.
/** The more recent command issued to command buffer */
SVGAFifo3dCmdId last_command;
+
+ /** For HUD queries */
+ uint64_t num_commands;
+ uint64_t num_draw_commands;
};
*/
struct svga_winsys_surface *
(*surface_create)(struct svga_winsys_screen *sws,
- SVGA3dSurfaceFlags flags,
+ SVGA3dSurfaceAllFlags flags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
SVGA3dSurfaceFormat format,
SVGA3dSize size,
uint32 numLayers,
- uint32 numMipLevels);
+ uint32 numMipLevels,
+ uint32 numSamples);
/**
* Buffer management. Buffer attributes are mostly fixed over its lifetime.
/**
* 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.
/** 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.
*/
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;
};