return -1;
 }
 
+static void mark_seamless_boot_stream(
+               const struct dc  *dc,
+               struct dc_stream_state *stream)
+{
+       struct dc_bios *dcb = dc->ctx->dc_bios;
+
+       /* TODO: Check Linux */
+       if (dc->config.allow_seamless_boot_optimization &&
+                       !dcb->funcs->is_accelerated_mode(dcb)) {
+               if (dc_validate_seamless_boot_timing(dc, stream->sink, &stream->timing))
+                       stream->apply_seamless_boot_optimization = true;
+       }
+}
+
 enum dc_status resource_map_pool_resources(
                const struct dc  *dc,
                struct dc_state *context,
        struct dc_context *dc_ctx = dc->ctx;
        struct pipe_ctx *pipe_ctx = NULL;
        int pipe_idx = -1;
-       struct dc_bios *dcb = dc->ctx->dc_bios;
 
        calculate_phy_pix_clks(stream);
 
-       /* TODO: Check Linux */
-       if (dc->config.allow_seamless_boot_optimization &&
-                       !dcb->funcs->is_accelerated_mode(dcb)) {
-               if (dc_validate_seamless_boot_timing(dc, stream->sink, &stream->timing))
-                       stream->apply_seamless_boot_optimization = true;
-       }
+       mark_seamless_boot_stream(dc, stream);
 
-       if (stream->apply_seamless_boot_optimization)
+       if (stream->apply_seamless_boot_optimization) {
                pipe_idx = acquire_resource_from_hw_enabled_state(
                                &context->res_ctx,
                                pool,
                                stream);
+               if (pipe_idx < 0)
+                       /* hw resource was assigned to other stream */
+                       stream->apply_seamless_boot_optimization = false;
+       }
 
        if (pipe_idx < 0)
                /* acquire new resources */