summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2019-07-04 11:41:41 -0400
committerIlia Mirkin <[email protected]>2019-07-22 22:13:51 -0400
commit0e30c6b8a7e84211bb417362ec73f24ef134ae34 (patch)
tree7567deb41938d64e8fadcac7514deece8f7c1613 /src/gallium/drivers/virgl
parent365f24705f9703962b6749f4fafe7cd92d9c60b1 (diff)
gallium: switch boolean -> bool at the interface definitions
This is a relatively minimal change to adjust all the gallium interfaces to use bool instead of boolean. I tried to avoid making unrelated changes inside of drivers to flip boolean -> bool to reduce the risk of regressions (the compiler will much more easily allow "dirty" values inside a char-based boolean than a C99 _Bool). This has been build-tested on amd64 with: Gallium drivers: nouveau r300 r600 radeonsi freedreno swrast etnaviv v3d vc4 i915 svga virgl swr panfrost iris lima kmsro Gallium st: mesa xa xvmc xvmc vdpau va Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r--src/gallium/drivers/virgl/virgl_query.c16
-rw-r--r--src/gallium/drivers/virgl/virgl_resource.c8
-rw-r--r--src/gallium/drivers/virgl/virgl_resource.h6
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c70
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.h2
5 files changed, 51 insertions, 51 deletions
diff --git a/src/gallium/drivers/virgl/virgl_query.c b/src/gallium/drivers/virgl/virgl_query.c
index df571ec4905..e8ef4557d5a 100644
--- a/src/gallium/drivers/virgl/virgl_query.c
+++ b/src/gallium/drivers/virgl/virgl_query.c
@@ -81,7 +81,7 @@ static inline struct virgl_query *virgl_query(struct pipe_query *q)
static void virgl_render_condition(struct pipe_context *ctx,
struct pipe_query *q,
- boolean condition,
+ bool condition,
enum pipe_render_cond_flag mode)
{
struct virgl_context *vctx = virgl_context(ctx);
@@ -136,7 +136,7 @@ static void virgl_destroy_query(struct pipe_context *ctx,
FREE(query);
}
-static boolean virgl_begin_query(struct pipe_context *ctx,
+static bool virgl_begin_query(struct pipe_context *ctx,
struct pipe_query *q)
{
struct virgl_context *vctx = virgl_context(ctx);
@@ -171,10 +171,10 @@ static bool virgl_end_query(struct pipe_context *ctx,
return true;
}
-static boolean virgl_get_query_result(struct pipe_context *ctx,
- struct pipe_query *q,
- boolean wait,
- union pipe_query_result *result)
+static bool virgl_get_query_result(struct pipe_context *ctx,
+ struct pipe_query *q,
+ bool wait,
+ union pipe_query_result *result)
{
struct virgl_query *query = virgl_query(q);
@@ -230,14 +230,14 @@ static boolean virgl_get_query_result(struct pipe_context *ctx,
}
static void
-virgl_set_active_query_state(struct pipe_context *pipe, boolean enable)
+virgl_set_active_query_state(struct pipe_context *pipe, bool enable)
{
}
static void
virgl_get_query_result_resource(struct pipe_context *ctx,
struct pipe_query *q,
- boolean wait,
+ bool wait,
enum pipe_query_value_type result_type,
int index,
struct pipe_resource *resource,
diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c
index 74da5ef968c..ca4db39dab1 100644
--- a/src/gallium/drivers/virgl/virgl_resource.c
+++ b/src/gallium/drivers/virgl/virgl_resource.c
@@ -698,15 +698,15 @@ void virgl_resource_destroy(struct pipe_screen *screen,
FREE(res);
}
-boolean virgl_resource_get_handle(struct pipe_screen *screen,
- struct pipe_resource *resource,
- struct winsys_handle *whandle)
+bool virgl_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_resource *resource,
+ struct winsys_handle *whandle)
{
struct virgl_screen *vs = virgl_screen(screen);
struct virgl_resource *res = virgl_resource(resource);
if (res->u.b.target == PIPE_BUFFER)
- return FALSE;
+ return false;
return vs->vws->resource_get_handle(vs->vws, res->hw_res,
res->metadata.stride[0],
diff --git a/src/gallium/drivers/virgl/virgl_resource.h b/src/gallium/drivers/virgl/virgl_resource.h
index 95ed3e8ef13..2151f36cf1c 100644
--- a/src/gallium/drivers/virgl/virgl_resource.h
+++ b/src/gallium/drivers/virgl/virgl_resource.h
@@ -171,9 +171,9 @@ void virgl_resource_destroy_transfer(struct virgl_context *vctx,
void virgl_resource_destroy(struct pipe_screen *screen,
struct pipe_resource *resource);
-boolean virgl_resource_get_handle(struct pipe_screen *screen,
- struct pipe_resource *resource,
- struct winsys_handle *whandle);
+bool virgl_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_resource *resource,
+ struct winsys_handle *whandle);
void virgl_resource_dirty(struct virgl_resource *res, uint32_t level);
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index db3a520508e..35becc1bd6a 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -541,7 +541,7 @@ virgl_get_compute_param(struct pipe_screen *screen,
return 0;
}
-static boolean
+static bool
has_format_bit(struct virgl_supported_format_mask *mask,
enum virgl_formats fmt)
{
@@ -553,7 +553,7 @@ has_format_bit(struct virgl_supported_format_mask *mask,
return (mask->bitmask[val / 32] & (1u << bit)) != 0;
}
-boolean
+bool
virgl_has_readback_format(struct pipe_screen *screen,
enum virgl_formats fmt)
{
@@ -562,7 +562,7 @@ virgl_has_readback_format(struct pipe_screen *screen,
fmt);
}
-static boolean
+static bool
virgl_is_vertex_format_supported(struct pipe_screen *screen,
enum pipe_format format)
{
@@ -572,15 +572,15 @@ virgl_is_vertex_format_supported(struct pipe_screen *screen,
format_desc = util_format_description(format);
if (!format_desc)
- return FALSE;
+ return false;
if (format == PIPE_FORMAT_R11G11B10_FLOAT) {
int vformat = VIRGL_FORMAT_R11G11B10_FLOAT;
int big = vformat / 32;
int small = vformat % 32;
if (!(vscreen->caps.caps.v1.vertexbuffer.bitmask[big] & (1 << small)))
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
/* Find the first non-VOID channel. */
@@ -591,25 +591,25 @@ virgl_is_vertex_format_supported(struct pipe_screen *screen,
}
if (i == 4)
- return FALSE;
+ return false;
if (format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
- return FALSE;
+ return false;
if (format_desc->channel[i].type == UTIL_FORMAT_TYPE_FIXED)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
-static boolean
+static bool
virgl_format_check_bitmask(enum pipe_format format,
uint32_t bitmask[16],
- boolean may_emulate_bgra)
+ bool may_emulate_bgra)
{
int big = format / 32;
int small = format % 32;
if ((bitmask[big] & (1 << small)))
- return TRUE;
+ return true;
/* On GLES hosts we don't advertise BGRx_SRGB, but we may be able
* emulate it by using a swizzled RGBx */
@@ -619,15 +619,15 @@ virgl_format_check_bitmask(enum pipe_format format,
else if (format == PIPE_FORMAT_B8G8R8X8_SRGB)
format = PIPE_FORMAT_R8G8B8X8_SRGB;
else {
- return FALSE;
+ return false;
}
big = format / 32;
small = format % 32;
if (bitmask[big] & (1 << small))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/**
@@ -635,7 +635,7 @@ virgl_format_check_bitmask(enum pipe_format format,
* \param format the format to test
* \param type one of PIPE_TEXTURE, PIPE_SURFACE
*/
-static boolean
+static bool
virgl_is_format_supported( struct pipe_screen *screen,
enum pipe_format format,
enum pipe_texture_target target,
@@ -664,22 +664,22 @@ virgl_is_format_supported( struct pipe_screen *screen,
format_desc = util_format_description(format);
if (!format_desc)
- return FALSE;
+ return false;
if (util_format_is_intensity(format))
- return FALSE;
+ return false;
if (sample_count > 1) {
if (!vscreen->caps.caps.v1.bset.texture_multisample)
- return FALSE;
+ return false;
if (bind & PIPE_BIND_SHADER_IMAGE) {
if (sample_count > vscreen->caps.caps.v2.max_image_samples)
- return FALSE;
+ return false;
}
if (sample_count > vscreen->caps.caps.v1.max_samples)
- return FALSE;
+ return false;
}
if (bind & PIPE_BIND_VERTEX_BUFFER) {
@@ -687,20 +687,20 @@ virgl_is_format_supported( struct pipe_screen *screen,
}
if (util_format_is_compressed(format) && target == PIPE_BUFFER)
- return FALSE;
+ return false;
/* Allow 3-comp 32 bit textures only for TBOs (needed for ARB_tbo_rgb32) */
if ((format == PIPE_FORMAT_R32G32B32_FLOAT ||
format == PIPE_FORMAT_R32G32B32_SINT ||
format == PIPE_FORMAT_R32G32B32_UINT) &&
target != PIPE_BUFFER)
- return FALSE;
+ return false;
if ((format_desc->layout == UTIL_FORMAT_LAYOUT_RGTC ||
format_desc->layout == UTIL_FORMAT_LAYOUT_ETC ||
format_desc->layout == UTIL_FORMAT_LAYOUT_S3TC) &&
target == PIPE_TEXTURE_3D)
- return FALSE;
+ return false;
may_emulate_bgra = (vscreen->caps.caps.v2.capability_bits &
VIRGL_CAP_APP_TWEAK_SUPPORT) &&
@@ -712,7 +712,7 @@ virgl_is_format_supported( struct pipe_screen *screen,
return TRUE;
if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS)
- return FALSE;
+ return false;
/*
* Although possible, it is unnatural to render into compressed or YUV
@@ -721,17 +721,17 @@ virgl_is_format_supported( struct pipe_screen *screen,
*/
if (format_desc->block.width != 1 ||
format_desc->block.height != 1)
- return FALSE;
+ return false;
if (!virgl_format_check_bitmask(format,
vscreen->caps.caps.v1.render.bitmask,
may_emulate_bgra))
- return FALSE;
+ return false;
}
if (bind & PIPE_BIND_DEPTH_STENCIL) {
if (format_desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS)
- return FALSE;
+ return false;
}
/*
@@ -762,11 +762,11 @@ virgl_is_format_supported( struct pipe_screen *screen,
}
if (i == 4)
- return FALSE;
+ return false;
/* no L4A4 */
if (format_desc->nr_channels < 4 && format_desc->channel[i].size == 4)
- return FALSE;
+ return false;
out_lookup:
return virgl_format_check_bitmask(format,
@@ -798,10 +798,10 @@ static void virgl_fence_reference(struct pipe_screen *screen,
vws->fence_reference(vws, ptr, fence);
}
-static boolean virgl_fence_finish(struct pipe_screen *screen,
- struct pipe_context *ctx,
- struct pipe_fence_handle *fence,
- uint64_t timeout)
+static bool virgl_fence_finish(struct pipe_screen *screen,
+ struct pipe_context *ctx,
+ struct pipe_fence_handle *fence,
+ uint64_t timeout)
{
struct virgl_screen *vscreen = virgl_screen(screen);
struct virgl_winsys *vws = vscreen->vws;
diff --git a/src/gallium/drivers/virgl/virgl_screen.h b/src/gallium/drivers/virgl/virgl_screen.h
index 097bba61127..3c7c596e1eb 100644
--- a/src/gallium/drivers/virgl/virgl_screen.h
+++ b/src/gallium/drivers/virgl/virgl_screen.h
@@ -65,7 +65,7 @@ virgl_screen(struct pipe_screen *pipe)
return (struct virgl_screen *)pipe;
}
-boolean
+bool
virgl_has_readback_format(struct pipe_screen *screen, enum virgl_formats fmt);
/* GL_ARB_map_buffer_alignment requires 64 as the minimum alignment value. In