X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_resource_buffer.h;h=ee12acf69719bc24730109faee012fee9be86f9c;hb=daf4254d07328381ed013aac25e25d6021fbfd14;hp=55e7321184faf4972891c35dfe2f861b98818c2c;hpb=c7f5c9a3dc6350252e73b541bb85ab3ed9e64a9c;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h index 55e7321184f..ee12acf6971 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.h +++ b/src/gallium/drivers/svga/svga_resource_buffer.h @@ -42,7 +42,6 @@ #define SVGA_BUFFER_MAX_RANGES 32 -struct svga_screen; struct svga_context; struct svga_winsys_buffer; struct svga_winsys_surface; @@ -90,7 +89,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 +101,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. * @@ -141,6 +128,12 @@ struct svga_buffer * is the relative offset within that buffer. */ unsigned offset; + + /** + * Range of user buffer that is uploaded in @buffer at @offset. + */ + unsigned start; + unsigned end; } uploaded; /** @@ -149,6 +142,8 @@ struct svga_buffer * 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 +198,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,7 +237,7 @@ 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);