svga: assorted whitespace and formatting fixes

Remove trailing whitespace, etc.

Trivial.
This commit is contained in:
Brian Paul 2019-01-31 19:58:30 -07:00
parent a81eebf9bc
commit 96ea977c79
7 changed files with 52 additions and 56 deletions

View file

@ -31,11 +31,8 @@
#include "svga_context.h"
#include "svga_resource_buffer.h"
/***********************************************************************
* Constant buffers
*/
struct svga_constbuf
struct svga_constbuf
{
unsigned type;
float (*data)[4];
@ -44,9 +41,10 @@ struct svga_constbuf
static void svga_set_constant_buffer(struct pipe_context *pipe,
enum pipe_shader_type shader, uint index,
const struct pipe_constant_buffer *cb)
static void
svga_set_constant_buffer(struct pipe_context *pipe,
enum pipe_shader_type shader, uint index,
const struct pipe_constant_buffer *cb)
{
struct svga_screen *svgascreen = svga_screen(pipe->screen);
struct svga_context *svga = svga_context(pipe);
@ -95,8 +93,8 @@ static void svga_set_constant_buffer(struct pipe_context *pipe,
}
void svga_init_constbuffer_functions( struct svga_context *svga )
void
svga_init_constbuffer_functions(struct svga_context *svga)
{
svga->pipe.set_constant_buffer = svga_set_constant_buffer;
}

View file

@ -283,9 +283,9 @@ done:
static void
svga_buffer_transfer_flush_region( struct pipe_context *pipe,
struct pipe_transfer *transfer,
const struct pipe_box *box)
svga_buffer_transfer_flush_region(struct pipe_context *pipe,
struct pipe_transfer *transfer,
const struct pipe_box *box)
{
struct svga_screen *ss = svga_screen(pipe->screen);
struct svga_buffer *sbuf = svga_buffer(transfer->resource);
@ -303,8 +303,8 @@ svga_buffer_transfer_flush_region( struct pipe_context *pipe,
static void
svga_buffer_transfer_unmap( struct pipe_context *pipe,
struct pipe_transfer *transfer )
svga_buffer_transfer_unmap(struct pipe_context *pipe,
struct pipe_transfer *transfer)
{
struct svga_screen *ss = svga_screen(pipe->screen);
struct svga_context *svga = svga_context(pipe);
@ -349,11 +349,11 @@ svga_buffer_transfer_unmap( struct pipe_context *pipe,
static void
svga_buffer_destroy( struct pipe_screen *screen,
struct pipe_resource *buf )
svga_buffer_destroy(struct pipe_screen *screen,
struct pipe_resource *buf)
{
struct svga_screen *ss = svga_screen(screen);
struct svga_buffer *sbuf = svga_buffer( buf );
struct svga_screen *ss = svga_screen(screen);
struct svga_buffer *sbuf = svga_buffer(buf);
assert(!p_atomic_read(&buf->reference.count));
@ -395,7 +395,7 @@ struct u_resource_vtbl svga_buffer_vtbl =
struct pipe_resource *
svga_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *template)
const struct pipe_resource *template)
{
struct svga_screen *ss = svga_screen(screen);
struct svga_buffer *sbuf;
@ -483,7 +483,7 @@ struct pipe_resource *
svga_user_buffer_create(struct pipe_screen *screen,
void *ptr,
unsigned bytes,
unsigned bind)
unsigned bind)
{
struct svga_buffer *sbuf;
struct svga_screen *ss = svga_screen(screen);
@ -517,6 +517,3 @@ svga_user_buffer_create(struct pipe_screen *screen,
no_sbuf:
return NULL;
}

View file

@ -73,7 +73,7 @@ struct svga_buffer_surface
/**
* SVGA pipe buffer.
*/
struct svga_buffer
struct svga_buffer
{
struct u_resource b;
@ -82,30 +82,30 @@ struct svga_buffer
/**
* Regular (non DMA'able) memory.
*
*
* Used for user buffers or for buffers which we know before hand that can
* never be used by the virtual hardware directly, such as constant buffers.
*/
void *swbuf;
/**
/**
* Whether swbuf was created by the user or not.
*/
boolean user;
/**
* Creation key for the host surface handle.
*
* This structure describes all the host surface characteristics so that it
*
* This structure describes all the host surface characteristics so that it
* can be looked up in cache, since creating a host surface is often a slow
* operation.
*/
struct svga_host_surface_cache_key key;
/**
* Host surface handle.
*
* This is a platform independent abstraction for host SID. We create when
*
* This is a platform independent abstraction for host SID. We create when
* trying to bind.
*
* Only set for non-user buffers.
@ -237,8 +237,8 @@ svga_buffer(struct pipe_resource *resource)
* Returns TRUE for user buffers. We may
* decide to use an alternate upload path for these buffers.
*/
static inline boolean
svga_buffer_is_user_buffer( struct pipe_resource *buffer )
static inline boolean
svga_buffer_is_user_buffer(struct pipe_resource *buffer)
{
if (buffer) {
return svga_buffer(buffer)->user;
@ -324,11 +324,11 @@ struct pipe_resource *
svga_user_buffer_create(struct pipe_screen *screen,
void *ptr,
unsigned bytes,
unsigned usage);
unsigned usage);
struct pipe_resource *
svga_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *template);
const struct pipe_resource *template);
@ -351,7 +351,7 @@ svga_context_flush_buffers(struct svga_context *svga);
struct svga_winsys_buffer *
svga_winsys_buffer_create(struct svga_context *svga,
unsigned alignment,
unsigned alignment,
unsigned usage,
unsigned size);

View file

@ -116,7 +116,7 @@ svga_transfer_dma(struct svga_context *svga,
/* Ensure any pending operations on host surfaces are queued on the command
* buffer first.
*/
svga_surfaces_flush( svga );
svga_surfaces_flush(svga);
if (!st->swbuf) {
/* Do the DMA transfer in a single go */
@ -223,7 +223,7 @@ svga_texture_get_handle(struct pipe_screen *screen,
static void
svga_texture_destroy(struct pipe_screen *screen,
struct pipe_resource *pt)
struct pipe_resource *pt)
{
struct svga_screen *ss = svga_screen(screen);
struct svga_texture *tex = svga_texture(pt);
@ -241,7 +241,7 @@ svga_texture_destroy(struct pipe_screen *screen,
/* Destroy the backed surface handle if exists */
if (tex->backed_handle)
svga_screen_surface_destroy(ss, &tex->backed_key, &tex->backed_handle);
ss->hud.total_resource_bytes -= tex->size;
FREE(tex->defined);
@ -743,11 +743,11 @@ update_image_vgpu10(struct svga_context *svga,
*/
static void
svga_texture_transfer_unmap_dma(struct svga_context *svga,
struct svga_transfer *st)
struct svga_transfer *st)
{
struct svga_winsys_screen *sws = svga_screen(svga->pipe.screen)->sws;
if (st->hwbuf)
if (st->hwbuf)
sws->buffer_unmap(sws, st->hwbuf);
if (st->base.usage & PIPE_TRANSFER_WRITE) {
@ -775,7 +775,7 @@ svga_texture_transfer_unmap_dma(struct svga_context *svga,
*/
static void
svga_texture_transfer_unmap_direct(struct svga_context *svga,
struct svga_transfer *st)
struct svga_transfer *st)
{
struct pipe_transfer *transfer = &st->base;
struct svga_texture *tex = svga_texture(transfer->resource);
@ -830,9 +830,10 @@ svga_texture_transfer_unmap_direct(struct svga_context *svga,
}
}
static void
svga_texture_transfer_unmap(struct pipe_context *pipe,
struct pipe_transfer *transfer)
struct pipe_transfer *transfer)
{
struct svga_context *svga = svga_context(pipe);
struct svga_screen *ss = svga_screen(pipe->screen);
@ -1480,7 +1481,7 @@ svga_texture_transfer_unmap_upload(struct svga_context *svga,
struct svga_winsys_surface *dstsurf;
struct pipe_resource *texture = st->base.resource;
struct svga_texture *tex = svga_texture(texture);
enum pipe_error ret;
enum pipe_error ret;
unsigned subResource;
unsigned numMipLevels;
unsigned i, layer;
@ -1488,7 +1489,7 @@ svga_texture_transfer_unmap_upload(struct svga_context *svga,
assert(svga->tex_upload);
assert(st->upload.buf);
/* unmap the texture upload buffer */
u_upload_unmap(svga->tex_upload);

View file

@ -47,12 +47,12 @@ enum SVGA3dSurfaceFormat;
extern struct u_resource_vtbl svga_texture_vtbl;
struct svga_texture
struct svga_texture
{
struct u_resource b;
ushort *defined;
struct svga_sampler_view *cached_view;
unsigned view_age[SVGA_MAX_TEXTURE_LEVELS];
@ -62,8 +62,8 @@ struct svga_texture
/**
* Creation key for the host surface handle.
*
* This structure describes all the host surface characteristics so that it
*
* This structure describes all the host surface characteristics so that it
* can be looked up in cache, since creating a host surface is often a slow
* operation.
*/
@ -102,7 +102,7 @@ struct svga_texture
/** array indexed by cube face or 3D/array slice, one bit per mipmap level.
* Set if the level is marked as dirty.
*/
*/
ushort *dirty;
/**
@ -284,8 +284,8 @@ svga_texture_create(struct pipe_screen *screen,
struct pipe_resource *
svga_texture_from_handle(struct pipe_screen * screen,
const struct pipe_resource *template,
struct winsys_handle *whandle);
const struct pipe_resource *template,
struct winsys_handle *whandle);
boolean
svga_texture_generate_mipmap(struct pipe_context *pipe,

View file

@ -155,7 +155,7 @@ svga_init_swtnl(struct svga_context *svga)
struct svga_screen *screen = svga_screen(svga->pipe.screen);
svga->swtnl.backend = svga_vbuf_render_create(svga);
if(!svga->swtnl.backend)
if (!svga->swtnl.backend)
goto fail;
/*

View file

@ -578,7 +578,7 @@ svga_translate_decl_sm30(struct svga_shader_emitter *emit,
unsigned last = decl->Range.Last;
unsigned idx;
for(idx = first; idx <= last; idx++) {
for (idx = first; idx <= last; idx++) {
boolean ok = TRUE;
switch (decl->Declaration.File) {