drm/amd/display: Move audio to stream_res
authorHarry Wentland <harry.wentland@amd.com>
Sun, 30 Jul 2017 18:59:17 +0000 (14:59 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:16:10 +0000 (18:16 -0400)
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: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/inc/core_types.h

index 6a3d2ad97d5d4d62556247276ccb535aaa12dcf7..9665fc127fe2745de8f62ae6efb63b2e7f9f5ea7 100644 (file)
@@ -1305,9 +1305,9 @@ static enum dc_status enable_link(struct pipe_ctx *pipe_ctx)
                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 */
-               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 */
                /* TODO: audio should be per stream rather than per link */
index 13feff1003d811382694cf905b5cbc08f4b1f4ff..5c1d3c5680902b6a2a68f4add7085569276c8b65 100644 (file)
@@ -1097,7 +1097,7 @@ bool resource_attach_surfaces_to_context(
                        free_pipe->stream_res.tg = tail_pipe->stream_res.tg;
                        free_pipe->stream_res.opp = tail_pipe->stream_res.opp;
                        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->top_pipe = tail_pipe;
                        tail_pipe->bottom_pipe = free_pipe;
@@ -1481,7 +1481,7 @@ enum dc_status resource_map_pool_resources(
                                pipe_ctx->clock_source);
 
                        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(
                if (!stream->sink->converter_disable_audio &&
                        dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&
                        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);
 
                        /*
@@ -1526,10 +1526,10 @@ enum dc_status resource_map_pool_resources(
                         * There are asics which has number of audio
                         * resources less then number of pipes
                         */
-                       if (pipe_ctx->audio)
+                       if (pipe_ctx->stream_res.audio)
                                set_audio_in_use(
                                        &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;
@@ -2375,7 +2375,7 @@ bool pipe_need_reprogram(
        if (pipe_ctx_old->stream->signal != pipe_ctx->stream->signal)
                return true;
 
-       if (pipe_ctx_old->audio != pipe_ctx->audio)
+       if (pipe_ctx_old->stream_res.audio != pipe_ctx->stream_res.audio)
                return true;
 
        if (pipe_ctx_old->clock_source != pipe_ctx->clock_source
index 48d151039fe826201c17f0f6fce5be45a4559983..ef5d496656e5092b2dc28bbb0063961358184970 100644 (file)
@@ -729,7 +729,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
        tg->funcs->set_early_control(tg, early_control);
 
        /* 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))
                        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)
        struct dc_stream_state *stream = pipe_ctx->stream;
        struct dc_link *link = stream->sink->link;
 
-       if (pipe_ctx->audio) {
-               pipe_ctx->audio->funcs->az_disable(pipe_ctx->audio);
+       if (pipe_ctx->stream_res.audio) {
+               pipe_ctx->stream_res.audio->funcs->az_disable(pipe_ctx->stream_res.audio);
 
                if (dc_is_dp_signal(pipe_ctx->stream->signal))
                        pipe_ctx->stream_res.stream_enc->funcs->dp_audio_disable(
@@ -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);
 
-               pipe_ctx->audio = NULL;
+               pipe_ctx->stream_res.audio = NULL;
 
                /* TODO: notify audio driver for if audio modes list changed
                 * add audio mode list change flag */
@@ -1094,7 +1094,7 @@ static enum dc_status apply_single_controller_ctx_to_hw(
                        pipe_ctx->stream_res.stream_enc,
                        &stream->timing,
                        stream->phy_pix_clk,
-                       pipe_ctx->audio != NULL);
+                       pipe_ctx->stream_res.audio != NULL);
 
        if (dc_is_dvi_signal(pipe_ctx->stream->signal))
                pipe_ctx->stream_res.stream_enc->funcs->dvi_set_stream_attribute(
@@ -1792,13 +1792,13 @@ enum dc_status dce110_apply_ctx_to_hw(
                if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
                        continue;
 
-               if (pipe_ctx->audio != NULL) {
+               if (pipe_ctx->stream_res.audio != NULL) {
                        struct audio_output audio_output;
 
                        build_audio_output(pipe_ctx, &audio_output);
 
-                       pipe_ctx->audio->funcs->wall_dto_setup(
-                               pipe_ctx->audio,
+                       pipe_ctx->stream_res.audio->funcs->wall_dto_setup(
+                               pipe_ctx->stream_res.audio,
                                pipe_ctx->stream->signal,
                                &audio_output.crtc_info,
                                &audio_output.pll_info);
@@ -1820,13 +1820,13 @@ enum dc_status dce110_apply_ctx_to_hw(
                        if (!dc_is_dp_signal(pipe_ctx->stream->signal))
                                continue;
 
-                       if (pipe_ctx->audio != NULL) {
+                       if (pipe_ctx->stream_res.audio != NULL) {
                                struct audio_output audio_output;
 
                                build_audio_output(pipe_ctx, &audio_output);
 
-                               pipe_ctx->audio->funcs->wall_dto_setup(
-                                       pipe_ctx->audio,
+                               pipe_ctx->stream_res.audio->funcs->wall_dto_setup(
+                                       pipe_ctx->stream_res.audio,
                                        pipe_ctx->stream->signal,
                                        &audio_output.crtc_info,
                                        &audio_output.pll_info);
@@ -1853,7 +1853,7 @@ enum dc_status dce110_apply_ctx_to_hw(
                if (pipe_ctx->top_pipe)
                        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;
 
@@ -1862,17 +1862,17 @@ enum dc_status dce110_apply_ctx_to_hw(
                        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,
-                                               pipe_ctx->audio->inst,
+                                               pipe_ctx->stream_res.audio->inst,
                                                &pipe_ctx->stream->audio_info);
                        else
                                pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_setup(
                                                pipe_ctx->stream_res.stream_enc,
-                                               pipe_ctx->audio->inst,
+                                               pipe_ctx->stream_res.audio->inst,
                                                &pipe_ctx->stream->audio_info,
                                                &audio_output.crtc_info);
 
-                       pipe_ctx->audio->funcs->az_configure(
-                                       pipe_ctx->audio,
+                       pipe_ctx->stream_res.audio->funcs->az_configure(
+                                       pipe_ctx->stream_res.audio,
                                        pipe_ctx->stream->signal,
                                        &audio_output.crtc_info,
                                        &pipe_ctx->stream->audio_info);
index 4d35c6d120a77d00f3eca98b8c798e46de372daa..6f09653ac2cb17b47699176c729f08a5b6575817 100644 (file)
@@ -156,6 +156,7 @@ struct stream_resource {
        struct output_pixel_processor *opp;
        struct timing_generator *tg;
        struct stream_encoder *stream_enc;
+       struct audio *audio;
 };
 
 struct plane_resource {
@@ -176,8 +177,6 @@ struct pipe_ctx {
        struct display_clock *dis_clk;
        struct clock_source *clock_source;
 
-       struct audio *audio;
-
        struct pixel_clk_params pix_clk_params;
        struct pll_settings pll_settings;