void resource_unreference_clock_source(
struct resource_context *res_ctx,
- struct clock_source *clock_source)
+ struct clock_source **clock_source)
{
int i;
for (i = 0; i < res_ctx->pool->clk_src_count; i++) {
- if (res_ctx->pool->clock_sources[i] != clock_source)
+ if (res_ctx->pool->clock_sources[i] != *clock_source)
continue;
res_ctx->clock_source_ref_count[i]--;
if (res_ctx->clock_source_ref_count[i] == 0)
- clock_source->funcs->cs_power_down(clock_source);
+ (*clock_source)->funcs->cs_power_down(*clock_source);
break;
}
- if (res_ctx->pool->dp_clock_source == clock_source) {
+ if (res_ctx->pool->dp_clock_source == *clock_source) {
res_ctx->dp_clock_source_ref_count--;
if (res_ctx->dp_clock_source_ref_count == 0)
- clock_source->funcs->cs_power_down(clock_source);
+ (*clock_source)->funcs->cs_power_down(*clock_source);
}
+ *clock_source = NULL;
}
void resource_reference_clock_source(
if (pipe_with_clk_src->clock_source == NULL)
return false;
- if (pipe_with_clk_src->stream == NULL) {
- ASSERT(0);
- return false;
- }
-
if (pipe_with_clk_src->stream->signal == SIGNAL_TYPE_VIRTUAL)
return false;
pipe_ctx->stream = stream;
copy_pipe_ctx(old_pipe_ctx, pipe_ctx);
+ /* Split pipe resource, do not acquire back end */
+ if (!pipe_ctx->stream_enc)
+ continue;
+
set_stream_engine_in_use(
&context->res_ctx,
pipe_ctx->stream_enc);
if (clk_src &&
clk_src != pipe_ctx->clock_source) {
resource_unreference_clock_source(
- res_ctx, pipe_ctx->clock_source);
+ res_ctx, &pipe_ctx->clock_source);
pipe_ctx->clock_source = clk_src;
resource_reference_clock_source(res_ctx, clk_src);
pipe_ctx->mi->funcs->free_mem_input(
pipe_ctx->mi, context->target_count);
resource_unreference_clock_source(
- &context->res_ctx, pipe_ctx->clock_source);
+ &context->res_ctx, &pipe_ctx->clock_source);
dc->hwss.power_down_front_end((struct core_dc *)dc, pipe_ctx);
void resource_unreference_clock_source(
struct resource_context *res_ctx,
- struct clock_source *clock_source);
+ struct clock_source **clock_source);
void resource_reference_clock_source(
struct resource_context *res_ctx,