X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_resource_buffer.h;h=69d6f72a11c0ae6e9f2106e0b83c8cf22104fa2a;hp=55e7321184faf4972891c35dfe2f861b98818c2c;hb=bd00fb2c060d3d90be670a2f0bbd6f9c9fd2b4ae;hpb=0203136e69bfa711edd69a4f69c4539cd877b5cb diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h index 55e7321184f..69d6f72a11c 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.h +++ b/src/gallium/drivers/svga/svga_resource_buffer.h @@ -90,7 +90,9 @@ struct svga_buffer * 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; @@ -100,23 +102,9 @@ struct svga_buffer 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. * @@ -143,12 +131,21 @@ struct svga_buffer unsigned offset; } uploaded; + /** + * For user buffers, this is the offset to the data about to be + * referenced by the next draw command, and hence the data that needs + * to be uploaded. + */ + unsigned source_offset; + /** * 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; @@ -203,7 +200,11 @@ svga_buffer(struct pipe_resource *buffer) 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; + } } @@ -238,9 +239,15 @@ void svga_context_flush_buffers(struct svga_context *svga); struct svga_winsys_buffer * -svga_winsys_buffer_create(struct svga_screen *ss, +svga_winsys_buffer_create(struct svga_context *svga, unsigned alignment, 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 */