return count;
}
+static int get_seamless_boot_stream_count(struct dc_state *ctx)
+{
+ uint8_t i;
+ uint8_t seamless_boot_stream_count = 0;
+
+ for (i = 0; i < ctx->stream_count; i++)
+ if (ctx->streams[i]->apply_seamless_boot_optimization)
+ seamless_boot_stream_count++;
+
+ return seamless_boot_stream_count;
+}
+
static bool create_links(
struct dc *dc,
uint32_t num_virtual_links)
full_pipe_count,
dc->res_pool->stream_enc_count);
- dc->optimize_seamless_boot_streams = 0;
dc->caps.max_links = dc->link_count;
dc->caps.max_audios = dc->res_pool->audio_count;
dc->caps.linear_pitch_alignment = 64;
dc->hwss.enable_accelerated_mode(dc, context);
}
- for (i = 0; i < context->stream_count; i++)
- if (context->streams[i]->apply_seamless_boot_optimization)
- dc->optimize_seamless_boot_streams++;
-
- if (context->stream_count > dc->optimize_seamless_boot_streams ||
+ if (context->stream_count > get_seamless_boot_stream_count(context) ||
context->stream_count == 0)
dc->hwss.prepare_bandwidth(dc, context);
dc_enable_stereo(dc, context, dc_streams, context->stream_count);
- if (context->stream_count > dc->optimize_seamless_boot_streams ||
+ if (context->stream_count > get_seamless_boot_stream_count(context) ||
context->stream_count == 0) {
/* Must wait for no flips to be pending before doing optimize bw */
wait_for_no_pipes_pending(dc, context);
int i;
struct dc_state *context = dc->current_state;
- if ((!dc->optimized_required) || dc->optimize_seamless_boot_streams > 0)
+ if ((!dc->optimized_required) || get_seamless_boot_stream_count(context) > 0)
return;
post_surface_trace(dc);
dc->hwss.optimize_bandwidth(dc, dc->current_state);
} else {
- if (dc->optimize_seamless_boot_streams == 0)
+ if (get_seamless_boot_stream_count(context) == 0)
dc->hwss.prepare_bandwidth(dc, dc->current_state);
core_link_enable_stream(dc->current_state, pipe_ctx);
int i, j;
struct pipe_ctx *top_pipe_to_program = NULL;
- if (dc->optimize_seamless_boot_streams > 0 && surface_count > 0) {
+ if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) {
/* Optimize seamless boot flag keeps clocks and watermarks high until
* first flip. After first flip, optimization is required to lower
* bandwidth. Important to note that it is expected UEFI will
*/
if (stream->apply_seamless_boot_optimization) {
stream->apply_seamless_boot_optimization = false;
- dc->optimize_seamless_boot_streams--;
- if (dc->optimize_seamless_boot_streams == 0)
+ if (get_seamless_boot_stream_count(context) == 0)
dc->optimized_required = true;
}
}
dc_allow_idle_optimizations(dc, false);
#endif
- if (dc->optimize_seamless_boot_streams == 0)
+ if (get_seamless_boot_stream_count(context) == 0)
dc->hwss.prepare_bandwidth(dc, context);
context_clock_trace(dc, context);