summaryrefslogtreecommitdiff
path: root/src/sna/gen2_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-13 22:24:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-14 09:21:12 +0100
commitad4786b285074b5bd70b3ad0bea6ec1b77ad6740 (patch)
treeaab0649444e06516357e3f77d69c6e22a4c06d84 /src/sna/gen2_render.c
parenta05c3547bba52288bae872ea672ffe2f4dab2ffa (diff)
downloadxf86-video-intel-ad4786b285074b5bd70b3ad0bea6ec1b77ad6740.tar.gz
xf86-video-intel-ad4786b285074b5bd70b3ad0bea6ec1b77ad6740.tar.bz2
xf86-video-intel-ad4786b285074b5bd70b3ad0bea6ec1b77ad6740.zip
sna: Aim for consistency and use stdbool except for core X APIs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen2_render.c')
-rw-r--r--src/sna/gen2_render.c246
1 files changed, 123 insertions, 123 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 93880a890..622ba1fb6 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -57,8 +57,8 @@
#define VERTEX(v) batch_emit_float(sna, v)
static const struct blendinfo {
- Bool dst_alpha;
- Bool src_alpha;
+ bool dst_alpha;
+ bool src_alpha;
uint32_t src_blend;
uint32_t dst_blend;
} gen2_blend_op[] = {
@@ -148,7 +148,7 @@ gen2_get_dst_format(uint32_t format)
#undef BIAS
}
-static Bool
+static bool
gen2_check_dst_format(uint32_t format)
{
switch (format) {
@@ -160,9 +160,9 @@ gen2_check_dst_format(uint32_t format)
case PICT_a8:
case PICT_a4r4g4b4:
case PICT_x4r4g4b4:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
@@ -229,32 +229,32 @@ gen2_sampler_tiling_bits(uint32_t tiling)
return bits;
}
-static Bool
+static bool
gen2_check_filter(PicturePtr picture)
{
switch (picture->filter) {
case PictFilterNearest:
case PictFilterBilinear:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
-static Bool
+static bool
gen2_check_repeat(PicturePtr picture)
{
if (!picture->repeat)
- return TRUE;
+ return true;
switch (picture->repeatType) {
case RepeatNone:
case RepeatNormal:
case RepeatPad:
case RepeatReflect:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
@@ -406,7 +406,7 @@ gen2_get_blend_factors(const struct sna_composite_op *op,
}
static uint32_t gen2_get_blend_cntl(int op,
- Bool has_component_alpha,
+ bool has_component_alpha,
uint32_t dst_format)
{
uint32_t sblend, dblend;
@@ -503,7 +503,7 @@ static void gen2_emit_invariant(struct sna *sna)
ENABLE_COLOR_WRITE |
ENABLE_TEX_CACHE);
- sna->render_state.gen2.need_invariant = FALSE;
+ sna->render_state.gen2.need_invariant = false;
}
static void
@@ -1104,14 +1104,14 @@ static void gen2_render_composite_done(struct sna *sna,
sna_render_composite_redirect_done(sna, op);
}
-static Bool
+static bool
gen2_composite_solid_init(struct sna *sna,
struct sna_composite_channel *channel,
uint32_t color)
{
channel->filter = PictFilterNearest;
channel->repeat = RepeatNormal;
- channel->is_solid = TRUE;
+ channel->is_solid = true;
channel->width = 1;
channel->height = 1;
channel->pict_format = PICT_a8r8g8b8;
@@ -1121,12 +1121,12 @@ gen2_composite_solid_init(struct sna *sna,
channel->scale[0] = channel->scale[1] = 1;
channel->offset[0] = channel->offset[1] = 0;
- return TRUE;
+ return true;
}
#define xFixedToDouble(f) pixman_fixed_to_double(f)
-static Bool
+static bool
gen2_composite_linear_init(struct sna *sna,
PicturePtr picture,
struct sna_composite_channel *channel,
@@ -1161,7 +1161,7 @@ gen2_composite_linear_init(struct sna *sna,
channel->filter = PictFilterNearest;
channel->repeat = picture->repeat ? picture->repeatType : RepeatNone;
- channel->is_linear = TRUE;
+ channel->is_linear = true;
channel->width = channel->bo->pitch / 4;
channel->height = 1;
channel->pict_format = PICT_a8r8g8b8;
@@ -1229,17 +1229,17 @@ gen2_composite_linear_init(struct sna *sna,
return channel->bo != NULL;
}
-static Bool source_is_covered(PicturePtr picture,
+static bool source_is_covered(PicturePtr picture,
int x, int y,
int width, int height)
{
int x1, y1, x2, y2;
if (picture->repeat && picture->repeatType != RepeatNone)
- return TRUE;
+ return true;
if (picture->pDrawable == NULL)
- return FALSE;
+ return false;
if (picture->transform) {
pixman_box16_t sample;
@@ -1268,7 +1268,7 @@ static Bool source_is_covered(PicturePtr picture,
y2 <= picture->pDrawable->height;
}
-static Bool
+static bool
gen2_check_card_format(struct sna *sna,
PicturePtr picture,
struct sna_composite_channel *channel,
@@ -1279,24 +1279,24 @@ gen2_check_card_format(struct sna *sna,
for (i = 0; i < ARRAY_SIZE(i8xx_tex_formats); i++) {
if (i8xx_tex_formats[i].fmt == format)
- return TRUE;
+ return true;
}
for (i = 0; i < ARRAY_SIZE(i85x_tex_formats); i++) {
if (i85x_tex_formats[i].fmt == format) {
if (sna->kgem.gen >= 21)
- return TRUE;
+ return true;
if (source_is_covered(picture, x, y, w,h)) {
channel->is_opaque = true;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
static int
@@ -1315,10 +1315,10 @@ gen2_composite_picture(struct sna *sna,
DBG(("%s: (%d, %d)x(%d, %d), dst=(%d, %d)\n",
__FUNCTION__, x, y, w, h, dst_x, dst_y));
- channel->is_solid = FALSE;
- channel->is_linear = FALSE;
- channel->is_opaque = FALSE;
- channel->is_affine = TRUE;
+ channel->is_solid = false;
+ channel->is_linear = false;
+ channel->is_opaque = false;
+ channel->is_affine = true;
channel->transform = NULL;
if (sna_picture_is_solid(picture, &color))
@@ -1398,7 +1398,7 @@ gen2_composite_picture(struct sna *sna,
x, y, w, h, dst_x, dst_y);
}
-static Bool
+static bool
gen2_composite_set_target(struct sna *sna,
struct sna_composite_op *op,
PicturePtr dst)
@@ -1412,19 +1412,19 @@ gen2_composite_set_target(struct sna *sna,
priv = sna_pixmap_force_to_gpu(op->dst.pixmap, MOVE_WRITE | MOVE_READ);
if (priv == NULL)
- return FALSE;
+ return false;
if (priv->gpu_bo->pitch < 8) {
struct kgem_bo *bo;
if (priv->pinned)
- return FALSE;
+ return false;
bo = kgem_replace_bo(&sna->kgem, priv->gpu_bo,
op->dst.width, op->dst.height, 8,
op->dst.pixmap->drawable.bitsPerPixel);
if (bo == NULL)
- return FALSE;
+ return false;
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = bo;
@@ -1437,10 +1437,10 @@ gen2_composite_set_target(struct sna *sna,
get_drawable_deltas(dst->pDrawable, op->dst.pixmap,
&op->dst.x, &op->dst.y);
- return TRUE;
+ return true;
}
-static Bool
+static bool
try_blt(struct sna *sna,
PicturePtr dst,
PicturePtr src,
@@ -1450,34 +1450,34 @@ try_blt(struct sna *sna,
if (sna->kgem.mode != KGEM_RENDER) {
DBG(("%s: already performing BLT\n", __FUNCTION__));
- return TRUE;
+ return true;
}
if (too_large(width, height)) {
DBG(("%s: operation too large for 3D pipe (%d, %d)\n",
__FUNCTION__, width, height));
- return TRUE;
+ return true;
}
if (too_large(dst->pDrawable->width, dst->pDrawable->height)) {
DBG(("%s: target too large for 3D pipe (%d, %d)\n",
__FUNCTION__,
dst->pDrawable->width, dst->pDrawable->height));
- return TRUE;
+ return true;
}
/* If it is a solid, try to use the BLT paths */
if (sna_picture_is_solid(src, &color))
- return TRUE;
+ return true;
if (!src->pDrawable)
- return FALSE;
+ return false;
if (too_large(src->pDrawable->width, src->pDrawable->height)) {
DBG(("%s: source too large for 3D pipe (%d, %d)\n",
__FUNCTION__,
src->pDrawable->width, src->pDrawable->height));
- return TRUE;
+ return true;
}
return is_cpu(src->pDrawable);
}
@@ -1486,14 +1486,14 @@ static bool
is_unhandled_gradient(PicturePtr picture)
{
if (picture->pDrawable)
- return FALSE;
+ return false;
switch (picture->pSourcePict->type) {
case SourcePictTypeSolidFill:
case SourcePictTypeLinear:
- return FALSE;
+ return false;
default:
- return TRUE;
+ return true;
}
}
@@ -1564,7 +1564,7 @@ gen2_composite_fallback(struct sna *sna,
if (!gen2_check_dst_format(dst->format)) {
DBG(("%s: unknown destination format: %d\n",
__FUNCTION__, dst->format));
- return TRUE;
+ return true;
}
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
@@ -1586,11 +1586,11 @@ gen2_composite_fallback(struct sna *sna,
*/
if (src_pixmap == dst_pixmap && src_fallback) {
DBG(("%s: src is dst and will fallback\n",__FUNCTION__));
- return TRUE;
+ return true;
}
if (mask_pixmap == dst_pixmap && mask_fallback) {
DBG(("%s: mask is dst and will fallback\n",__FUNCTION__));
- return TRUE;
+ return true;
}
/* If anything is on the GPU, push everything out to the GPU */
@@ -1598,18 +1598,18 @@ gen2_composite_fallback(struct sna *sna,
if (priv && priv->gpu_damage && !priv->clear) {
DBG(("%s: dst is already on the GPU, try to use GPU\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
if (src_pixmap && !src_fallback) {
DBG(("%s: src is already on the GPU, try to use GPU\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
if (mask_pixmap && !mask_fallback) {
DBG(("%s: mask is already on the GPU, try to use GPU\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
/* However if the dst is not on the GPU and we need to
@@ -1619,25 +1619,25 @@ gen2_composite_fallback(struct sna *sna,
if (src_fallback) {
DBG(("%s: dst is on the CPU and src will fallback\n",
__FUNCTION__));
- return TRUE;
+ return true;
}
if (mask && mask_fallback) {
DBG(("%s: dst is on the CPU and mask will fallback\n",
__FUNCTION__));
- return TRUE;
+ return true;
}
if (too_large(dst_pixmap->drawable.width,
dst_pixmap->drawable.height) &&
(priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage))) {
DBG(("%s: dst is on the CPU and too large\n", __FUNCTION__));
- return TRUE;
+ return true;
}
DBG(("%s: dst is not on the GPU and the operation should not fallback\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
static int
@@ -1648,40 +1648,40 @@ reuse_source(struct sna *sna,
uint32_t color;
if (src_x != msk_x || src_y != msk_y)
- return FALSE;
+ return false;
if (src == mask) {
DBG(("%s: mask is source\n", __FUNCTION__));
*mc = *sc;
mc->bo = kgem_bo_reference(mc->bo);
- return TRUE;
+ return true;
}
if (sna_picture_is_solid(mask, &color))
return gen2_composite_solid_init(sna, mc, color);
if (sc->is_solid)
- return FALSE;
+ return false;
if (src->pDrawable == NULL || mask->pDrawable != src->pDrawable)
- return FALSE;
+ return false;
DBG(("%s: mask reuses source drawable\n", __FUNCTION__));
if (!sna_transform_equal(src->transform, mask->transform))
- return FALSE;
+ return false;
if (!sna_picture_alphamap_equal(src, mask))
- return FALSE;
+ return false;
if (!gen2_check_repeat(mask))
- return FALSE;
+ return false;
if (!gen2_check_filter(mask))
- return FALSE;
+ return false;
if (!gen2_check_format(sna, mask))
- return FALSE;
+ return false;
DBG(("%s: reusing source channel for mask with a twist\n",
__FUNCTION__));
@@ -1691,10 +1691,10 @@ reuse_source(struct sna *sna,
mc->filter = mask->filter;
mc->pict_format = mask->format;
mc->bo = kgem_bo_reference(mc->bo);
- return TRUE;
+ return true;
}
-static Bool
+static bool
gen2_render_composite(struct sna *sna,
uint8_t op,
PicturePtr src,
@@ -1711,12 +1711,12 @@ gen2_render_composite(struct sna *sna,
if (op >= ARRAY_SIZE(gen2_blend_op)) {
DBG(("%s: fallback due to unhandled blend op: %d\n",
__FUNCTION__, op));
- return FALSE;
+ return false;
}
#if NO_COMPOSITE
if (mask)
- return FALSE;
+ return false;
return sna_blt_composite(sna, op,
src, dst,
@@ -1736,10 +1736,10 @@ gen2_render_composite(struct sna *sna,
dst_x, dst_y,
width, height,
tmp))
- return TRUE;
+ return true;
if (gen2_composite_fallback(sna, src, mask, dst))
- return FALSE;
+ return false;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
@@ -1752,7 +1752,7 @@ gen2_render_composite(struct sna *sna,
if (!gen2_composite_set_target(sna, tmp, dst)) {
DBG(("%s: unable to set render target\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
if (mask == NULL && sna->kgem.mode == KGEM_BLT &&
@@ -1761,7 +1761,7 @@ gen2_render_composite(struct sna *sna,
src_x, src_y,
dst_x, dst_y,
width, height, tmp))
- return TRUE;
+ return true;
sna_render_reduce_damage(tmp, dst_x, dst_y, width, height);
@@ -1770,7 +1770,7 @@ gen2_render_composite(struct sna *sna,
tmp->dst.bo->pitch > MAX_3D_PITCH) {
if (!sna_render_composite_redirect(sna, tmp,
dst_x, dst_y, width, height))
- return FALSE;
+ return false;
}
switch (gen2_composite_picture(sna, src, &tmp->src,
@@ -1809,13 +1809,13 @@ gen2_render_composite(struct sna *sna,
* and on the source value. We can only get one of those
* into the single source value that we get to blend with.
*/
- tmp->has_component_alpha = TRUE;
+ tmp->has_component_alpha = true;
if (gen2_blend_op[op].src_alpha &&
(gen2_blend_op[op].src_blend != BLENDFACTOR_ZERO)) {
if (op != PictOpOver)
- return FALSE;
+ return false;
- tmp->need_magic_ca_pass = TRUE;
+ tmp->need_magic_ca_pass = true;
tmp->op = PictOpOutReverse;
}
}
@@ -1865,7 +1865,7 @@ gen2_render_composite(struct sna *sna,
}
gen2_emit_composite_state(sna, tmp);
- return TRUE;
+ return true;
cleanup_mask:
if (tmp->mask.bo)
@@ -1876,7 +1876,7 @@ cleanup_src:
cleanup_dst:
if (tmp->redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return FALSE;
+ return false;
}
fastcall static void
@@ -2094,7 +2094,7 @@ static void gen2_emit_composite_spans_state(struct sna *sna,
I1_LOAD_S(2) | I1_LOAD_S(3) | I1_LOAD_S(8) | 2);
BATCH(!op->base.src.is_solid << 12);
BATCH(S3_CULLMODE_NONE | S3_VERTEXHAS_XY | S3_DIFFUSE_PRESENT);
- BATCH(gen2_get_blend_cntl(op->base.op, FALSE, op->base.dst.format));
+ BATCH(gen2_get_blend_cntl(op->base.op, false, op->base.dst.format));
if (memcmp(sna->kgem.batch + sna->render_state.gen2.ls1 + 1,
sna->kgem.batch + unwind + 1,
3 * sizeof(uint32_t)) == 0)
@@ -2191,7 +2191,7 @@ gen2_render_composite_spans_done(struct sna *sna,
sna_render_composite_redirect_done(sna, &op->base);
}
-static Bool
+static bool
gen2_render_composite_spans(struct sna *sna,
uint8_t op,
PicturePtr src,
@@ -2206,17 +2206,17 @@ gen2_render_composite_spans(struct sna *sna,
src_x, src_y, dst_x, dst_y, width, height));
#if NO_COMPOSITE_SPANS
- return FALSE;
+ return false;
#endif
if (op >= ARRAY_SIZE(gen2_blend_op)) {
DBG(("%s: fallback due to unhandled blend op: %d\n",
__FUNCTION__, op));
- return FALSE;
+ return false;
}
if (gen2_composite_fallback(sna, src, NULL, dst))
- return FALSE;
+ return false;
if (need_tiling(sna, width, height)) {
DBG(("%s: tiling, operation (%dx%d) too wide for pipeline\n",
@@ -2225,7 +2225,7 @@ gen2_render_composite_spans(struct sna *sna,
if (!is_gpu(dst->pDrawable)) {
DBG(("%s: fallback, tiled operation not on GPU\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
return sna_tiling_composite_spans(op, src, dst,
@@ -2236,7 +2236,7 @@ gen2_render_composite_spans(struct sna *sna,
if (!gen2_composite_set_target(sna, &tmp->base, dst)) {
DBG(("%s: unable to set render target\n",
__FUNCTION__));
- return FALSE;
+ return false;
}
sna_render_reduce_damage(&tmp->base, dst_x, dst_y, width, height);
@@ -2245,7 +2245,7 @@ gen2_render_composite_spans(struct sna *sna,
tmp->base.dst.bo->pitch > MAX_3D_PITCH) {
if (!sna_render_composite_redirect(sna, &tmp->base,
dst_x, dst_y, width, height))
- return FALSE;
+ return false;
}
switch (gen2_composite_picture(sna, src, &tmp->base.src,
@@ -2294,7 +2294,7 @@ gen2_render_composite_spans(struct sna *sna,
}
gen2_emit_composite_spans_state(sna, tmp);
- return TRUE;
+ return true;
cleanup_src:
if (tmp->base.src.bo)
@@ -2302,7 +2302,7 @@ cleanup_src:
cleanup_dst:
if (tmp->base.redirect.real_bo)
kgem_bo_destroy(&sna->kgem, tmp->base.dst.bo);
- return FALSE;
+ return false;
}
static void
@@ -2347,7 +2347,7 @@ static void gen2_emit_fill_composite_state(struct sna *sna,
I1_LOAD_S(2) | I1_LOAD_S(3) | I1_LOAD_S(8) | 2);
BATCH(0);
BATCH(S3_CULLMODE_NONE | S3_VERTEXHAS_XY);
- BATCH(gen2_get_blend_cntl(op->op, FALSE, op->dst.format));
+ BATCH(gen2_get_blend_cntl(op->op, false, op->dst.format));
if (memcmp(sna->kgem.batch + sna->render_state.gen2.ls1 + 1,
sna->kgem.batch + ls1 + 1,
3 * sizeof(uint32_t)) == 0)
@@ -2364,7 +2364,7 @@ static void gen2_emit_fill_composite_state(struct sna *sna,
}
}
-static Bool
+static bool
gen2_render_fill_boxes_try_blt(struct sna *sna,
CARD8 op, PictFormat format,
const xRenderColor *color,
@@ -2375,7 +2375,7 @@ gen2_render_fill_boxes_try_blt(struct sna *sna,
uint32_t pixel;
if (op > PictOpSrc)
- return FALSE;
+ return false;
if (op == PictOpClear) {
alu = GXclear;
@@ -2386,7 +2386,7 @@ gen2_render_fill_boxes_try_blt(struct sna *sna,
color->blue,
color->alpha,
format))
- return FALSE;
+ return false;
else
alu = GXcopy;
@@ -2395,7 +2395,7 @@ gen2_render_fill_boxes_try_blt(struct sna *sna,
pixel, box, n);
}
-static inline Bool prefer_blt_fill(struct sna *sna)
+static inline bool prefer_blt_fill(struct sna *sna)
{
#if PREFER_BLT_FILL
return true;
@@ -2404,7 +2404,7 @@ static inline Bool prefer_blt_fill(struct sna *sna)
#endif
}
-static inline Bool prefer_blt_copy(struct sna *sna, unsigned flags)
+static inline bool prefer_blt_copy(struct sna *sna, unsigned flags)
{
#if PREFER_BLT_COPY
return true;
@@ -2413,7 +2413,7 @@ static inline Bool prefer_blt_copy(struct sna *sna, unsigned flags)
#endif
}
-static Bool
+static bool
gen2_render_fill_boxes(struct sna *sna,
CARD8 op,
PictFormat format,
@@ -2427,7 +2427,7 @@ gen2_render_fill_boxes(struct sna *sna,
if (op >= ARRAY_SIZE(gen2_blend_op)) {
DBG(("%s: fallback due to unhandled blend op: %d\n",
__FUNCTION__, op));
- return FALSE;
+ return false;
}
#if NO_FILL_BOXES
@@ -2448,10 +2448,10 @@ gen2_render_fill_boxes(struct sna *sna,
if (gen2_render_fill_boxes_try_blt(sna, op, format, color,
dst, dst_bo,
box, n))
- return TRUE;
+ return true;
if (!gen2_check_dst_format(format))
- return FALSE;
+ return false;
assert(dst_bo->pitch >= 8);
return sna_tiling_fill_boxes(sna, op, format, color,
@@ -2462,7 +2462,7 @@ gen2_render_fill_boxes(struct sna *sna,
gen2_render_fill_boxes_try_blt(sna, op, format, color,
dst, dst_bo,
box, n))
- return TRUE;
+ return true;
if (op == PictOpClear)
pixel = 0;
@@ -2472,7 +2472,7 @@ gen2_render_fill_boxes(struct sna *sna,
color->blue,
color->alpha,
PICT_a8r8g8b8))
- return FALSE;
+ return false;
DBG(("%s: using shader for op=%d, format=%x, pixel=%x\n",
__FUNCTION__, op, (int)format, pixel));
@@ -2516,7 +2516,7 @@ gen2_render_fill_boxes(struct sna *sna,
} while (n);
gen2_vertex_flush(sna, &tmp);
- return TRUE;
+ return true;
}
static void gen2_emit_fill_state(struct sna *sna,
@@ -2621,7 +2621,7 @@ gen2_render_fill_op_done(struct sna *sna, const struct sna_fill_op *op)
gen2_vertex_flush(sna, &op->base);
}
-static Bool
+static bool
gen2_render_fill(struct sna *sna, uint8_t alu,
PixmapPtr dst, struct kgem_bo *dst_bo,
uint32_t color,
@@ -2640,7 +2640,7 @@ gen2_render_fill(struct sna *sna, uint8_t alu,
dst_bo, dst->drawable.bitsPerPixel,
color,
tmp))
- return TRUE;
+ return true;
/* Must use the BLT if we can't RENDER... */
if (too_large(dst->drawable.width, dst->drawable.height) ||
@@ -2677,10 +2677,10 @@ gen2_render_fill(struct sna *sna, uint8_t alu,
tmp->done = gen2_render_fill_op_done;
gen2_emit_fill_state(sna, &tmp->base);
- return TRUE;
+ return true;
}
-static Bool
+static bool
gen2_render_fill_one_try_blt(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
uint32_t color,
int16_t x1, int16_t y1, int16_t x2, int16_t y2,
@@ -2698,7 +2698,7 @@ gen2_render_fill_one_try_blt(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
color, &box, 1);
}
-static Bool
+static bool
gen2_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
uint32_t color,
int16_t x1, int16_t y1,
@@ -2716,7 +2716,7 @@ gen2_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
if (prefer_blt_fill(sna) &&
gen2_render_fill_one_try_blt(sna, dst, bo, color,
x1, y1, x2, y2, alu))
- return TRUE;
+ return true;
/* Must use the BLT if we can't RENDER... */
if (too_large(dst->drawable.width, dst->drawable.height) ||
@@ -2728,7 +2728,7 @@ gen2_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
kgem_submit(&sna->kgem);
if (gen2_render_fill_one_try_blt(sna, dst, bo, color,
x1, y1, x2, y2, alu))
- return TRUE;
+ return true;
assert(kgem_check_bo(&sna->kgem, bo, NULL));
}
@@ -2757,7 +2757,7 @@ gen2_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
VERTEX(y1);
gen2_vertex_flush(sna, &tmp);
- return TRUE;
+ return true;
}
static void
@@ -2855,7 +2855,7 @@ static void gen2_emit_copy_state(struct sna *sna, const struct sna_composite_op
gen2_emit_texture(sna, &op->src, 0);
}
-static Bool
+static bool
gen2_render_copy_boxes(struct sna *sna, uint8_t alu,
PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,
PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy,
@@ -2865,7 +2865,7 @@ gen2_render_copy_boxes(struct sna *sna, uint8_t alu,
#if NO_COPY_BOXES
if (!sna_blt_compare_depth(&src->drawable, &dst->drawable))
- return FALSE;
+ return false;
return sna_blt_copy_boxes(sna, alu,
src_bo, src_dx, src_dy,
@@ -2884,7 +2884,7 @@ gen2_render_copy_boxes(struct sna *sna, uint8_t alu,
dst_bo, dst_dx, dst_dy,
dst->drawable.bitsPerPixel,
box, n))
- return TRUE;
+ return true;
if (src_bo == dst_bo || /* XXX handle overlap using 3D ? */
too_large(src->drawable.width, src->drawable.height) ||
@@ -2983,7 +2983,7 @@ fallback:
gen2_vertex_flush(sna, &tmp);
sna_render_composite_redirect_done(sna, &tmp);
- return TRUE;
+ return true;
fallback_tiled:
return sna_tiling_copy_boxes(sna, alu,
@@ -3026,7 +3026,7 @@ gen2_render_copy_done(struct sna *sna, const struct sna_copy_op *op)
gen2_vertex_flush(sna, &op->base);
}
-static Bool
+static bool
gen2_render_copy(struct sna *sna, uint8_t alu,
PixmapPtr src, struct kgem_bo *src_bo,
PixmapPtr dst, struct kgem_bo *dst_bo,
@@ -3034,7 +3034,7 @@ gen2_render_copy(struct sna *sna, uint8_t alu,
{
#if NO_COPY
if (!sna_blt_compare_depth(&src->drawable, &dst->drawable))
- return FALSE;
+ return false;
return sna_blt_copy(sna, alu,
src_bo, dst_bo,
@@ -3049,7 +3049,7 @@ gen2_render_copy(struct sna *sna, uint8_t alu,
src_bo, dst_bo,
dst->drawable.bitsPerPixel,
tmp))
- return TRUE;
+ return true;
/* Must use the BLT if we can't RENDER... */
if (too_large(src->drawable.width, src->drawable.height) ||
@@ -3058,7 +3058,7 @@ gen2_render_copy(struct sna *sna, uint8_t alu,
dst_bo->pitch < 8 || dst_bo->pitch > MAX_3D_PITCH) {
fallback:
if (!sna_blt_compare_depth(&src->drawable, &dst->drawable))
- return FALSE;
+ return false;
return sna_blt_copy(sna, alu, src_bo, dst_bo,
dst->drawable.bitsPerPixel,
@@ -3089,13 +3089,13 @@ fallback:
tmp->done = gen2_render_copy_done;
gen2_emit_composite_state(sna, &tmp->base);
- return TRUE;
+ return true;
}
static void
gen2_render_reset(struct sna *sna)
{
- sna->render_state.gen2.need_invariant = TRUE;
+ sna->render_state.gen2.need_invariant = true;
sna->render_state.gen2.logic_op_enabled = 0;
sna->render_state.gen2.vertex_offset = 0;
sna->render_state.gen2.target = 0;
@@ -3124,7 +3124,7 @@ gen2_render_context_switch(struct kgem *kgem,
sna->blt_state.fill_bo = 0;
}
-Bool gen2_render_init(struct sna *sna)
+bool gen2_render_init(struct sna *sna)
{
struct sna_render *render = &sna->render;
@@ -3148,5 +3148,5 @@ Bool gen2_render_init(struct sna *sna)
render->max_3d_size = MAX_3D_SIZE;
render->max_3d_pitch = MAX_3D_PITCH;
- return TRUE;
+ return true;
}