{
        struct dc_stream_state *stream = pipe_ctx->stream;
        struct dc_link *link = stream->link;
-       struct link_encoder *link_encoder = link->link_enc;
+       struct link_encoder *link_encoder = NULL;
        struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;
        struct dp_mst_stream_allocation_table proposed_table = {0};
        struct fixed31_32 avg_time_slots_per_mtp;
        enum act_return_status ret;
        DC_LOGGER_INIT(link->ctx->logger);
 
+       /* Link encoder may have been dynamically assigned to non-physical display endpoint. */
+       if (link->ep_type == DISPLAY_ENDPOINT_PHY)
+               link_encoder = link->link_enc;
+       else if (link->dc->res_pool->funcs->link_encs_assign)
+               link_encoder = link_enc_cfg_get_link_enc_used_by_stream(pipe_ctx->stream->ctx->dc, stream);
+       ASSERT(link_encoder);
+
        /* enable_link_dp_mst already check link->enabled_stream_count
         * and stream is in link->stream[]. This is called during set mode,
         * stream_enc is available.
 {
        struct dc_stream_state *stream = pipe_ctx->stream;
        struct dc_link *link = stream->link;
-       struct link_encoder *link_encoder = link->link_enc;
+       struct link_encoder *link_encoder = NULL;
        struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;
        struct dp_mst_stream_allocation_table proposed_table = {0};
        struct fixed31_32 avg_time_slots_per_mtp = dc_fixpt_from_int(0);
        bool mst_mode = (link->type == dc_connection_mst_branch);
        DC_LOGGER_INIT(link->ctx->logger);
 
+       /* Link encoder may have been dynamically assigned to non-physical display endpoint. */
+       if (link->ep_type == DISPLAY_ENDPOINT_PHY)
+               link_encoder = link->link_enc;
+       else if (link->dc->res_pool->funcs->link_encs_assign)
+               link_encoder = link_enc_cfg_get_link_enc_used_by_stream(pipe_ctx->stream->ctx->dc, stream);
+       ASSERT(link_encoder);
+
        /* deallocate_mst_payload is called before disable link. When mode or
         * disable/enable monitor, new stream is created which is not in link
         * stream[] yet. For this, payload is not allocated yet, so de-alloc