#define SVGA_BUFFER_MAX_RANGES 32
-struct svga_screen;
struct svga_context;
struct svga_winsys_buffer;
struct svga_winsys_surface;
* Host surface handle.
*
* This is a platform independent abstraction for host SID. We create when
- * trying to bind
+ * trying to bind.
+ *
+ * Only set for non-user buffers.
*/
struct svga_winsys_surface *handle;
struct {
/**
* Number of concurrent mappings.
- *
- * XXX: It is impossible to guarantee concurrent maps work in all
- * circumstances -- pipe_buffers really need transfer objects too.
*/
unsigned count;
- /**
- * Whether this buffer is currently mapped for writing.
- */
- boolean writing;
-
- /**
- * Whether the application will tell us explicity which ranges it touched
- * or not.
- */
- boolean flush_explicit;
-
/**
* Dirty ranges.
*
* is the relative offset within that buffer.
*/
unsigned offset;
- } uploaded;
- /**
- * The offset in the source user buffer that matches the
- * uploaded offset
- */
- unsigned source_offset;
+ /**
+ * Range of user buffer that is uploaded in @buffer at @offset.
+ */
+ unsigned start;
+ unsigned end;
+ } uploaded;
/**
* DMA'ble memory.
* A piece of GMR memory, with the same size of the buffer. It is created
* when mapping the buffer, and will be used to upload vertex data to the
* host.
+ *
+ * Only set for non-user buffers.
*/
struct svga_winsys_buffer *hwbuf;
* a context. It is only valid if the dma.pending is set above.
*/
struct list_head head;
+
+ unsigned size; /**< Approximate size in bytes */
};
static INLINE boolean
svga_buffer_is_user_buffer( struct pipe_resource *buffer )
{
- return svga_buffer(buffer)->user;
+ if (buffer) {
+ return svga_buffer(buffer)->user;
+ } else {
+ return FALSE;
+ }
}
unsigned usage,
unsigned size);
-void
-svga_redefine_user_buffer(struct pipe_context *ctx,
- struct pipe_resource *resource,
- unsigned offset,
- unsigned size);
-
#endif /* SVGA_BUFFER_H */