Commit afaacef4 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Move audio to stream_res

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipes->audio/pipes->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i
's/pipe_with_clk_src->audio/pipe_with_clk_src->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/ctx->audio->/ctx->stream_res\.audio->/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe->audio/pipe->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_ctx->audio/pipe_ctx->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[pipe_offset\]\.audio/pipe_ctx\[pipe_offset\]\.stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/grouped_pipes\[i\]->audio/grouped_pipes\[i\]->stream_^Cs\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/grouped_pipes\[0\]->audio/grouped_pipes\[0\]->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/grouped_pipes\[1\]->audio/grouped_pipes\[1\]->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[i\]->audio/pipe_ctx\[i\]->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx_old->audio/pipe_ctx_old->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_set\[j\]->audio/pipe_set\[j\]->stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[i\]\.audio/pipe_ctx\[i\]\.stream_res\.audio/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipes\[i\]\.audio/pipes\[i\]\.stream_res\.audio/g'
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0b73b84c
...@@ -1305,9 +1305,9 @@ static enum dc_status enable_link(struct pipe_ctx *pipe_ctx) ...@@ -1305,9 +1305,9 @@ static enum dc_status enable_link(struct pipe_ctx *pipe_ctx)
break; break;
} }
if (pipe_ctx->audio && status == DC_OK) { if (pipe_ctx->stream_res.audio && status == DC_OK) {
/* notify audio driver for audio modes of monitor */ /* notify audio driver for audio modes of monitor */
pipe_ctx->audio->funcs->az_enable(pipe_ctx->audio); pipe_ctx->stream_res.audio->funcs->az_enable(pipe_ctx->stream_res.audio);
/* un-mute audio */ /* un-mute audio */
/* TODO: audio should be per stream rather than per link */ /* TODO: audio should be per stream rather than per link */
......
...@@ -1097,7 +1097,7 @@ bool resource_attach_surfaces_to_context( ...@@ -1097,7 +1097,7 @@ bool resource_attach_surfaces_to_context(
free_pipe->stream_res.tg = tail_pipe->stream_res.tg; free_pipe->stream_res.tg = tail_pipe->stream_res.tg;
free_pipe->stream_res.opp = tail_pipe->stream_res.opp; free_pipe->stream_res.opp = tail_pipe->stream_res.opp;
free_pipe->stream_res.stream_enc = tail_pipe->stream_res.stream_enc; free_pipe->stream_res.stream_enc = tail_pipe->stream_res.stream_enc;
free_pipe->audio = tail_pipe->audio; free_pipe->stream_res.audio = tail_pipe->stream_res.audio;
free_pipe->clock_source = tail_pipe->clock_source; free_pipe->clock_source = tail_pipe->clock_source;
free_pipe->top_pipe = tail_pipe; free_pipe->top_pipe = tail_pipe;
tail_pipe->bottom_pipe = free_pipe; tail_pipe->bottom_pipe = free_pipe;
...@@ -1481,7 +1481,7 @@ enum dc_status resource_map_pool_resources( ...@@ -1481,7 +1481,7 @@ enum dc_status resource_map_pool_resources(
pipe_ctx->clock_source); pipe_ctx->clock_source);
set_audio_in_use(&context->res_ctx, pool, set_audio_in_use(&context->res_ctx, pool,
pipe_ctx->audio); pipe_ctx->stream_res.audio);
} }
} }
...@@ -1518,7 +1518,7 @@ enum dc_status resource_map_pool_resources( ...@@ -1518,7 +1518,7 @@ enum dc_status resource_map_pool_resources(
if (!stream->sink->converter_disable_audio && if (!stream->sink->converter_disable_audio &&
dc_is_audio_capable_signal(pipe_ctx->stream->signal) && dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&
stream->audio_info.mode_count) { stream->audio_info.mode_count) {
pipe_ctx->audio = find_first_free_audio( pipe_ctx->stream_res.audio = find_first_free_audio(
&context->res_ctx, pool); &context->res_ctx, pool);
/* /*
...@@ -1526,10 +1526,10 @@ enum dc_status resource_map_pool_resources( ...@@ -1526,10 +1526,10 @@ enum dc_status resource_map_pool_resources(
* There are asics which has number of audio * There are asics which has number of audio
* resources less then number of pipes * resources less then number of pipes
*/ */
if (pipe_ctx->audio) if (pipe_ctx->stream_res.audio)
set_audio_in_use( set_audio_in_use(
&context->res_ctx, pool, &context->res_ctx, pool,
pipe_ctx->audio); pipe_ctx->stream_res.audio);
} }
context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst; context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst;
...@@ -2375,7 +2375,7 @@ bool pipe_need_reprogram( ...@@ -2375,7 +2375,7 @@ bool pipe_need_reprogram(
if (pipe_ctx_old->stream->signal != pipe_ctx->stream->signal) if (pipe_ctx_old->stream->signal != pipe_ctx->stream->signal)
return true; return true;
if (pipe_ctx_old->audio != pipe_ctx->audio) if (pipe_ctx_old->stream_res.audio != pipe_ctx->stream_res.audio)
return true; return true;
if (pipe_ctx_old->clock_source != pipe_ctx->clock_source if (pipe_ctx_old->clock_source != pipe_ctx->clock_source
......
...@@ -729,7 +729,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx) ...@@ -729,7 +729,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
tg->funcs->set_early_control(tg, early_control); tg->funcs->set_early_control(tg, early_control);
/* enable audio only within mode set */ /* enable audio only within mode set */
if (pipe_ctx->audio != NULL) { if (pipe_ctx->stream_res.audio != NULL) {
if (dc_is_dp_signal(pipe_ctx->stream->signal)) if (dc_is_dp_signal(pipe_ctx->stream->signal))
pipe_ctx->stream_res.stream_enc->funcs->dp_audio_enable(pipe_ctx->stream_res.stream_enc); pipe_ctx->stream_res.stream_enc->funcs->dp_audio_enable(pipe_ctx->stream_res.stream_enc);
} }
...@@ -748,8 +748,8 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) ...@@ -748,8 +748,8 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
struct dc_stream_state *stream = pipe_ctx->stream; struct dc_stream_state *stream = pipe_ctx->stream;
struct dc_link *link = stream->sink->link; struct dc_link *link = stream->sink->link;
if (pipe_ctx->audio) { if (pipe_ctx->stream_res.audio) {
pipe_ctx->audio->funcs->az_disable(pipe_ctx->audio); pipe_ctx->stream_res.audio->funcs->az_disable(pipe_ctx->stream_res.audio);
if (dc_is_dp_signal(pipe_ctx->stream->signal)) if (dc_is_dp_signal(pipe_ctx->stream->signal))
pipe_ctx->stream_res.stream_enc->funcs->dp_audio_disable( pipe_ctx->stream_res.stream_enc->funcs->dp_audio_disable(
...@@ -758,7 +758,7 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) ...@@ -758,7 +758,7 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_disable( pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_disable(
pipe_ctx->stream_res.stream_enc); pipe_ctx->stream_res.stream_enc);
pipe_ctx->audio = NULL; pipe_ctx->stream_res.audio = NULL;
/* TODO: notify audio driver for if audio modes list changed /* TODO: notify audio driver for if audio modes list changed
* add audio mode list change flag */ * add audio mode list change flag */
...@@ -1094,7 +1094,7 @@ static enum dc_status apply_single_controller_ctx_to_hw( ...@@ -1094,7 +1094,7 @@ static enum dc_status apply_single_controller_ctx_to_hw(
pipe_ctx->stream_res.stream_enc, pipe_ctx->stream_res.stream_enc,
&stream->timing, &stream->timing,
stream->phy_pix_clk, stream->phy_pix_clk,
pipe_ctx->audio != NULL); pipe_ctx->stream_res.audio != NULL);
if (dc_is_dvi_signal(pipe_ctx->stream->signal)) if (dc_is_dvi_signal(pipe_ctx->stream->signal))
pipe_ctx->stream_res.stream_enc->funcs->dvi_set_stream_attribute( pipe_ctx->stream_res.stream_enc->funcs->dvi_set_stream_attribute(
...@@ -1792,13 +1792,13 @@ enum dc_status dce110_apply_ctx_to_hw( ...@@ -1792,13 +1792,13 @@ enum dc_status dce110_apply_ctx_to_hw(
if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A) if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
continue; continue;
if (pipe_ctx->audio != NULL) { if (pipe_ctx->stream_res.audio != NULL) {
struct audio_output audio_output; struct audio_output audio_output;
build_audio_output(pipe_ctx, &audio_output); build_audio_output(pipe_ctx, &audio_output);
pipe_ctx->audio->funcs->wall_dto_setup( pipe_ctx->stream_res.audio->funcs->wall_dto_setup(
pipe_ctx->audio, pipe_ctx->stream_res.audio,
pipe_ctx->stream->signal, pipe_ctx->stream->signal,
&audio_output.crtc_info, &audio_output.crtc_info,
&audio_output.pll_info); &audio_output.pll_info);
...@@ -1820,13 +1820,13 @@ enum dc_status dce110_apply_ctx_to_hw( ...@@ -1820,13 +1820,13 @@ enum dc_status dce110_apply_ctx_to_hw(
if (!dc_is_dp_signal(pipe_ctx->stream->signal)) if (!dc_is_dp_signal(pipe_ctx->stream->signal))
continue; continue;
if (pipe_ctx->audio != NULL) { if (pipe_ctx->stream_res.audio != NULL) {
struct audio_output audio_output; struct audio_output audio_output;
build_audio_output(pipe_ctx, &audio_output); build_audio_output(pipe_ctx, &audio_output);
pipe_ctx->audio->funcs->wall_dto_setup( pipe_ctx->stream_res.audio->funcs->wall_dto_setup(
pipe_ctx->audio, pipe_ctx->stream_res.audio,
pipe_ctx->stream->signal, pipe_ctx->stream->signal,
&audio_output.crtc_info, &audio_output.crtc_info,
&audio_output.pll_info); &audio_output.pll_info);
...@@ -1853,7 +1853,7 @@ enum dc_status dce110_apply_ctx_to_hw( ...@@ -1853,7 +1853,7 @@ enum dc_status dce110_apply_ctx_to_hw(
if (pipe_ctx->top_pipe) if (pipe_ctx->top_pipe)
continue; continue;
if (context->res_ctx.pipe_ctx[i].audio != NULL) { if (context->res_ctx.pipe_ctx[i].stream_res.audio != NULL) {
struct audio_output audio_output; struct audio_output audio_output;
...@@ -1862,17 +1862,17 @@ enum dc_status dce110_apply_ctx_to_hw( ...@@ -1862,17 +1862,17 @@ enum dc_status dce110_apply_ctx_to_hw(
if (dc_is_dp_signal(pipe_ctx->stream->signal)) if (dc_is_dp_signal(pipe_ctx->stream->signal))
pipe_ctx->stream_res.stream_enc->funcs->dp_audio_setup( pipe_ctx->stream_res.stream_enc->funcs->dp_audio_setup(
pipe_ctx->stream_res.stream_enc, pipe_ctx->stream_res.stream_enc,
pipe_ctx->audio->inst, pipe_ctx->stream_res.audio->inst,
&pipe_ctx->stream->audio_info); &pipe_ctx->stream->audio_info);
else else
pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_setup( pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_setup(
pipe_ctx->stream_res.stream_enc, pipe_ctx->stream_res.stream_enc,
pipe_ctx->audio->inst, pipe_ctx->stream_res.audio->inst,
&pipe_ctx->stream->audio_info, &pipe_ctx->stream->audio_info,
&audio_output.crtc_info); &audio_output.crtc_info);
pipe_ctx->audio->funcs->az_configure( pipe_ctx->stream_res.audio->funcs->az_configure(
pipe_ctx->audio, pipe_ctx->stream_res.audio,
pipe_ctx->stream->signal, pipe_ctx->stream->signal,
&audio_output.crtc_info, &audio_output.crtc_info,
&pipe_ctx->stream->audio_info); &pipe_ctx->stream->audio_info);
......
...@@ -156,6 +156,7 @@ struct stream_resource { ...@@ -156,6 +156,7 @@ struct stream_resource {
struct output_pixel_processor *opp; struct output_pixel_processor *opp;
struct timing_generator *tg; struct timing_generator *tg;
struct stream_encoder *stream_enc; struct stream_encoder *stream_enc;
struct audio *audio;
}; };
struct plane_resource { struct plane_resource {
...@@ -176,8 +177,6 @@ struct pipe_ctx { ...@@ -176,8 +177,6 @@ struct pipe_ctx {
struct display_clock *dis_clk; struct display_clock *dis_clk;
struct clock_source *clock_source; struct clock_source *clock_source;
struct audio *audio;
struct pixel_clk_params pix_clk_params; struct pixel_clk_params pix_clk_params;
struct pll_settings pll_settings; struct pll_settings pll_settings;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment