diff options
author | Thomas Hellstrom <[email protected]> | 2019-05-10 13:45:19 +0200 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2019-05-17 08:44:31 +0200 |
commit | 1a66ead1c75246224bf43e82a07b4fdb2891959a (patch) | |
tree | c878186234c2971df45bf90f05d2d131af0522f2 /src/gallium/winsys/svga/drm | |
parent | a119da3bc9bde850717f9f03a2eeddef520b9416 (diff) |
pipebuffer, winsys/svga: Add functionality to update pb_validate_entry flags
In order to be able to add access modes to a pb_validate_entry, update
the pb_validate_add_buffer function to take a pointer hash table and also
to return whether the buffer was already on the validate list.
Update the svga winsys accordingly.
Signed-off-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/winsys/svga/drm')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_context.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c index addb58d165a..d073cd4859f 100644 --- a/src/gallium/winsys/svga/drm/vmw_context.c +++ b/src/gallium/winsys/svga/drm/vmw_context.c @@ -370,24 +370,15 @@ vmw_swc_add_validate_buffer(struct vmw_svga_winsys_context *vswc, struct pb_buffer *pb_buf, unsigned flags) { - enum pipe_error ret; + MAYBE_UNUSED enum pipe_error ret; unsigned translated_flags; + boolean already_present; - /* - * TODO: Update pb_validate to provide a similar functionality - * (Check buffer already present before adding) - */ - if (util_hash_table_get(vswc->hash, pb_buf) != pb_buf) { - translated_flags = vmw_translate_to_pb_flags(flags); - ret = pb_validate_add_buffer(vswc->validate, pb_buf, translated_flags); - /* TODO: Update pipebuffer to reserve buffers and not fail here */ - assert(ret == PIPE_OK); - (void)ret; - (void)util_hash_table_set(vswc->hash, pb_buf, pb_buf); - return TRUE; - } - - return FALSE; + translated_flags = vmw_translate_to_pb_flags(flags); + ret = pb_validate_add_buffer(vswc->validate, pb_buf, translated_flags, + vswc->hash, &already_present); + assert(ret == PIPE_OK); + return !already_present; } static void |