summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-06-09 21:19:51 -0600
committerBrian Paul <[email protected]>2017-06-13 07:52:54 -0600
commite5eb9b43631b38120812673f2a9f0cd6b79b0c8e (patch)
tree26f7296c43117070c9c329e169561d89079952fd /src/gallium/auxiliary
parent40a8385d8b7db27a6d8b7a8f3a6500b8694bcc5e (diff)
gallium/util: whitespace, formatting fixes in u_upload_mgr.c
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 9528495038c..4bb14d6218b 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2009 VMware, Inc.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,7 +22,7 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
/* Helper utility for uploading user buffers & other data, and
@@ -59,7 +59,7 @@ struct u_upload_mgr *
u_upload_create(struct pipe_context *pipe, unsigned default_size,
unsigned bind, enum pipe_resource_usage usage)
{
- struct u_upload_mgr *upload = CALLOC_STRUCT( u_upload_mgr );
+ struct u_upload_mgr *upload = CALLOC_STRUCT(u_upload_mgr);
if (!upload)
return NULL;
@@ -104,7 +104,8 @@ u_upload_clone(struct pipe_context *pipe, struct u_upload_mgr *upload)
upload->usage);
}
-static void upload_unmap_internal(struct u_upload_mgr *upload, boolean destroying)
+static void
+upload_unmap_internal(struct u_upload_mgr *upload, boolean destroying)
{
if (!destroying && upload->map_persistent)
return;
@@ -124,30 +125,32 @@ static void upload_unmap_internal(struct u_upload_mgr *upload, boolean destroyin
}
-void u_upload_unmap( struct u_upload_mgr *upload )
+void
+u_upload_unmap(struct u_upload_mgr *upload)
{
upload_unmap_internal(upload, FALSE);
}
-static void u_upload_release_buffer(struct u_upload_mgr *upload)
+static void
+u_upload_release_buffer(struct u_upload_mgr *upload)
{
/* Unmap and unreference the upload buffer. */
upload_unmap_internal(upload, TRUE);
- pipe_resource_reference( &upload->buffer, NULL );
+ pipe_resource_reference(&upload->buffer, NULL);
}
-void u_upload_destroy( struct u_upload_mgr *upload )
+void
+u_upload_destroy(struct u_upload_mgr *upload)
{
- u_upload_release_buffer( upload );
- FREE( upload );
+ u_upload_release_buffer(upload);
+ FREE(upload);
}
static void
-u_upload_alloc_buffer(struct u_upload_mgr *upload,
- unsigned min_size)
+u_upload_alloc_buffer(struct u_upload_mgr *upload, unsigned min_size)
{
struct pipe_screen *screen = upload->pipe->screen;
struct pipe_resource buffer;
@@ -155,9 +158,9 @@ u_upload_alloc_buffer(struct u_upload_mgr *upload,
/* Release the old buffer, if present:
*/
- u_upload_release_buffer( upload );
+ u_upload_release_buffer(upload);
- /* Allocate a new one:
+ /* Allocate a new one:
*/
size = align(MAX2(upload->default_size, min_size), 4096);
@@ -232,7 +235,7 @@ u_upload_alloc(struct u_upload_mgr *upload,
offset,
buffer_size - offset,
upload->map_flags,
- &upload->transfer);
+ &upload->transfer);
if (unlikely(!upload->map)) {
upload->transfer = NULL;
*out_offset = ~0;
@@ -256,13 +259,14 @@ u_upload_alloc(struct u_upload_mgr *upload,
upload->offset = offset + size;
}
-void u_upload_data(struct u_upload_mgr *upload,
- unsigned min_out_offset,
- unsigned size,
- unsigned alignment,
- const void *data,
- unsigned *out_offset,
- struct pipe_resource **outbuf)
+void
+u_upload_data(struct u_upload_mgr *upload,
+ unsigned min_out_offset,
+ unsigned size,
+ unsigned alignment,
+ const void *data,
+ unsigned *out_offset,
+ struct pipe_resource **outbuf)
{
uint8_t *ptr;