From: Marek Olšák Date: Sat, 19 Sep 2020 09:36:09 +0000 (-0400) Subject: radeonsi: add unlikely statements into si_draw_vbo X-Git-Tag: upstream/21.0.0~5115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b2f75f9ac2ac0f7cd7755cdd0799385c86166c6;p=platform%2Fupstream%2Fmesa.git radeonsi: add unlikely statements into si_draw_vbo Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 9a7f2f7..72d09d8 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -1829,7 +1829,7 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i indexbuf = NULL; u_upload_alloc(ctx->stream_uploader, start_offset, size, si_optimal_tcc_alignment(sctx, size), &offset, &indexbuf, &ptr); - if (!indexbuf) + if (unlikely(!indexbuf)) return; util_shorten_ubyte_elts_to_userptr(&sctx->b, info, 0, 0, index_offset + start, count, ptr); @@ -1847,7 +1847,7 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i u_upload_data(ctx->stream_uploader, start_offset, info->count * index_size, sctx->screen->info.tcc_cache_line_size, (char *)info->index.user + start_offset, &index_offset, &indexbuf); - if (!indexbuf) + if (unlikely(!indexbuf)) return; /* info->start will be added by the drawing code */ @@ -2021,7 +2021,7 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i sctx->do_update_shaders = true; } - if (sctx->do_update_shaders && !si_update_shaders(sctx)) + if (unlikely(sctx->do_update_shaders && !si_update_shaders(sctx))) goto return_cleanup; si_need_gfx_cs_space(sctx); @@ -2042,8 +2042,8 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i if (sctx->bo_list_add_all_gfx_resources) si_gfx_resources_add_all_to_bo_list(sctx); - if (!si_upload_vertex_buffer_descriptors(sctx) || - !si_upload_graphics_shader_descriptors(sctx)) + if (unlikely(!si_upload_vertex_buffer_descriptors(sctx) || + !si_upload_graphics_shader_descriptors(sctx))) goto return_cleanup; /* Vega10/Raven scissor bug workaround. When any context register is