uint8_t ret = 0;
 
        drm_dbg_dp(aux->drm_dev,
-                  "Configure DSC to non-virtual dpcd synaptics\n");
+                  "MST_DSC Configure DSC to non-virtual dpcd synaptics\n");
 
        if (enable) {
                /* When DSC is enabled on previous boot and reboot with the hub,
                        apply_synaptics_fifo_reset_wa(aux);
 
                ret = drm_dp_dpcd_write(aux, DP_DSC_ENABLE, &enable, 1);
-               DRM_INFO("Send DSC enable to synaptics\n");
+               DRM_INFO("MST_DSC Send DSC enable to synaptics\n");
 
        } else {
                /* Synaptics hub not support virtual dpcd,
                 */
                if (!stream->link->link_status.link_active) {
                        ret = drm_dp_dpcd_write(aux, DP_DSC_ENABLE, &enable, 1);
-                       DRM_INFO("Send DSC disable to synaptics\n");
+                       DRM_INFO("MST_DSC Send DSC disable to synaptics\n");
                }
        }
 
                                                        DP_DSC_ENABLE,
                                                        &enable_passthrough, 1);
                                drm_dbg_dp(dev,
-                                          "Sent DSC pass-through enable to virtual dpcd port, ret = %u\n",
+                                          "MST_DSC Sent DSC pass-through enable to virtual dpcd port, ret = %u\n",
                                           ret);
                        }
 
                        ret = drm_dp_dpcd_write(aconnector->dsc_aux,
                                                DP_DSC_ENABLE, &enable_dsc, 1);
                        drm_dbg_dp(dev,
-                                  "Sent DSC decoding enable to %s port, ret = %u\n",
+                                  "MST_DSC Sent DSC decoding enable to %s port, ret = %u\n",
                                   (port->passthrough_aux) ? "remote RX" :
                                   "virtual dpcd",
                                   ret);
                        ret = drm_dp_dpcd_write(aconnector->dsc_aux,
                                                DP_DSC_ENABLE, &enable_dsc, 1);
                        drm_dbg_dp(dev,
-                                  "Sent DSC decoding disable to %s port, ret = %u\n",
+                                  "MST_DSC Sent DSC decoding disable to %s port, ret = %u\n",
                                   (port->passthrough_aux) ? "remote RX" :
                                   "virtual dpcd",
                                   ret);
                                                        DP_DSC_ENABLE,
                                                        &enable_passthrough, 1);
                                drm_dbg_dp(dev,
-                                          "Sent DSC pass-through disable to virtual dpcd port, ret = %u\n",
+                                          "MST_DSC Sent DSC pass-through disable to virtual dpcd port, ret = %u\n",
                                           ret);
                        }
                }
                if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE) {
                        ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
                        drm_dbg_dp(dev,
-                                  "Send DSC %s to SST RX\n",
+                                  "SST_DSC Send DSC %s to SST RX\n",
                                   enable_dsc ? "enable" : "disable");
                } else if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) {
                        ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
                        drm_dbg_dp(dev,
-                                  "Send DSC %s to DP-HDMI PCON\n",
+                                  "SST_DSC Send DSC %s to DP-HDMI PCON\n",
                                   enable_dsc ? "enable" : "disable");
                }
        }
 
        if (!aconnector)
                return NULL;
 
+       DRM_DEBUG_DRIVER("%s: Create aconnector 0x%p for port 0x%p\n", __func__, aconnector, port);
+
        connector = &aconnector->base;
        aconnector->mst_output_port = port;
        aconnector->mst_root = master;
                if (params[i].sink) {
                        if (params[i].sink->sink_signal != SIGNAL_TYPE_VIRTUAL &&
                                params[i].sink->sink_signal != SIGNAL_TYPE_NONE)
-                               DRM_DEBUG_DRIVER("%s i=%d dispname=%s\n", __func__, i,
+                               DRM_DEBUG_DRIVER("MST_DSC %s i=%d dispname=%s\n", __func__, i,
                                        params[i].sink->edid_caps.display_name);
                }
 
-               DRM_DEBUG_DRIVER("dsc=%d bits_per_pixel=%d pbn=%d\n",
+               DRM_DEBUG_DRIVER("MST_DSC dsc=%d bits_per_pixel=%d pbn=%d\n",
                        params[i].timing->flags.DSC,
                        params[i].timing->dsc_cfg.bits_per_pixel,
                        vars[i + k].pbn);
                if (next_index == -1)
                        break;
 
+               DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index);
                vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
                ret = drm_dp_atomic_find_time_slots(state,
                                                    params[next_index].port->mgr,
 
                ret = drm_dp_mst_atomic_check(state);
                if (ret == 0) {
+                       DRM_DEBUG_DRIVER("MST_DSC index #%d, greedily disable dsc\n", next_index);
                        vars[next_index].dsc_enabled = false;
                        vars[next_index].bpp_x16 = 0;
                } else {
+                       DRM_DEBUG_DRIVER("MST_DSC index #%d, restore minimum compression\n", next_index);
                        vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
                        ret = drm_dp_atomic_find_time_slots(state,
                                                            params[next_index].port->mgr,
        return 0;
 }
 
+static void log_dsc_params(int count, struct dsc_mst_fairness_vars *vars, int k)
+{
+       int i;
+
+       for (i = 0; i < count; i++)
+               DRM_DEBUG_DRIVER("MST_DSC DSC params: stream #%d --- dsc_enabled = %d, bpp_x16 = %d, pbn = %d\n",
+                                i, vars[i + k].dsc_enabled, vars[i + k].bpp_x16, vars[i + k].pbn);
+}
+
 static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
                                            struct dc_state *dc_state,
                                            struct dc_link *dc_link,
                return PTR_ERR(mst_state);
 
        /* Set up params */
+       DRM_DEBUG_DRIVER("%s: MST_DSC Set up params for %d streams\n", __func__, dc_state->stream_count);
        for (i = 0; i < dc_state->stream_count; i++) {
                struct dc_dsc_policy dsc_policy = {0};
 
                        params[count].bw_range.stream_kbps = dc_bandwidth_in_kbps_from_timing(&stream->timing,
                                        dc_link_get_highest_encoding_format(dc_link));
 
+               DRM_DEBUG_DRIVER("MST_DSC #%d stream 0x%p - max_kbps = %u, min_kbps = %u, uncompressed_kbps = %u\n",
+                       count, stream, params[count].bw_range.max_kbps, params[count].bw_range.min_kbps,
+                       params[count].bw_range.stream_kbps);
                count++;
        }
 
        *link_vars_start_index += count;
 
        /* Try no compression */
+       DRM_DEBUG_DRIVER("MST_DSC Try no compression\n");
        for (i = 0; i < count; i++) {
                vars[i + k].aconnector = params[i].aconnector;
                vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
                return ret;
        }
 
+       log_dsc_params(count, vars, k);
+
        /* Try max compression */
+       DRM_DEBUG_DRIVER("MST_DSC Try max compression\n");
        for (i = 0; i < count; i++) {
                if (params[i].compression_possible && params[i].clock_force_enable != DSC_CLK_FORCE_DISABLE) {
                        vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.min_kbps, fec_overhead_multiplier_x1000);
        if (ret != 0)
                return ret;
 
+       log_dsc_params(count, vars, k);
+
        /* Optimize degree of compression */
+       DRM_DEBUG_DRIVER("MST_DSC Try optimize compression\n");
        ret = increase_dsc_bpp(state, mst_state, dc_link, params, vars, count, k);
-       if (ret < 0)
+       if (ret < 0) {
+               DRM_DEBUG_DRIVER("MST_DSC Failed to optimize compression\n");
                return ret;
+       }
 
+       log_dsc_params(count, vars, k);
+
+       DRM_DEBUG_DRIVER("MST_DSC Try disable compression\n");
        ret = try_disable_dsc(state, dc_link, params, vars, count, k);
-       if (ret < 0)
+       if (ret < 0) {
+               DRM_DEBUG_DRIVER("MST_DSC Failed to disable compression\n");
                return ret;
+       }
+
+       log_dsc_params(count, vars, k);
 
        set_dsc_configs_from_fairness_vars(params, vars, count, k);
 
 
        /* only check phy used by dsc mst branch */
        if (dc_link->type != dc_connection_mst_branch)
-               return false;
+               goto out;
 
        /* add a check for older MST DSC with no virtual DPCDs */
        if (needs_dsc_aux_workaround(dc_link)  &&
                (!(dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_SUPPORT ||
                dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_PASSTHROUGH_SUPPORT)))
-               return false;
+               goto out;
 
        for (i = 0; i < MAX_PIPES; i++)
                stream_on_link[i] = NULL;
 
+       DRM_DEBUG_DRIVER("%s: MST_DSC check on %d streams in new dc_state\n", __func__, dc_state->stream_count);
+
        /* check if there is mode change in new request */
        for (i = 0; i < dc_state->stream_count; i++) {
                struct drm_crtc_state *new_crtc_state;
                if (!stream)
                        continue;
 
+               DRM_DEBUG_DRIVER("%s:%d MST_DSC checking #%d stream 0x%p\n", __func__, __LINE__, i, stream);
+
                /* check if stream using the same link for mst */
                if (stream->link != dc_link)
                        continue;
                new_stream_on_link_num++;
 
                new_conn_state = drm_atomic_get_new_connector_state(state, &aconnector->base);
-               if (!new_conn_state)
+               if (!new_conn_state) {
+                       DRM_DEBUG_DRIVER("%s:%d MST_DSC no new_conn_state for stream 0x%p, aconnector 0x%p\n",
+                                        __func__, __LINE__, stream, aconnector);
                        continue;
+               }
 
                if (IS_ERR(new_conn_state))
                        continue;
                        continue;
 
                new_crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc);
-               if (!new_crtc_state)
+               if (!new_crtc_state) {
+                       DRM_DEBUG_DRIVER("%s:%d MST_DSC no new_crtc_state for crtc of stream 0x%p, aconnector 0x%p\n",
+                                               __func__, __LINE__, stream, aconnector);
                        continue;
+               }
 
                if (IS_ERR(new_crtc_state))
                        continue;
 
                if (new_crtc_state->enable && new_crtc_state->active) {
                        if (new_crtc_state->mode_changed || new_crtc_state->active_changed ||
-                               new_crtc_state->connectors_changed)
-                               return true;
+                                       new_crtc_state->connectors_changed) {
+                               DRM_DEBUG_DRIVER("%s:%d MST_DSC dsc recompte required."
+                                                "stream 0x%p in new dc_state\n",
+                                                __func__, __LINE__, stream);
+                               is_dsc_need_re_compute = true;
+                               goto out;
+                       }
                }
        }
 
-       if (new_stream_on_link_num == 0)
-               return false;
+       if (new_stream_on_link_num == 0) {
+               DRM_DEBUG_DRIVER("%s:%d MST_DSC no mode change request for streams in new dc_state\n",
+                                __func__, __LINE__);
+               is_dsc_need_re_compute = false;
+               goto out;
+       }
+
+       DRM_DEBUG_DRIVER("%s: MST_DSC check on %d streams in current dc_state\n",
+                        __func__, dc->current_state->stream_count);
 
        /* check current_state if there stream on link but it is not in
         * new request state
 
                if (j == new_stream_on_link_num) {
                        /* not in new state */
+                       DRM_DEBUG_DRIVER("%s:%d MST_DSC dsc recompute required."
+                                        "stream 0x%p in current dc_state but not in new dc_state\n",
+                                               __func__, __LINE__, stream);
                        is_dsc_need_re_compute = true;
                        break;
                }
        }
 
+out:
+       DRM_DEBUG_DRIVER("%s: MST_DSC dsc recompute %s\n",
+                        __func__, is_dsc_need_re_compute ? "required" : "not required");
+
        return is_dsc_need_re_compute;
 }
 
 
                aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
 
+               DRM_DEBUG_DRIVER("%s: MST_DSC compute mst dsc configs for stream 0x%p, aconnector 0x%p\n",
+                               __func__, stream, aconnector);
+
                if (!aconnector || !aconnector->dc_sink || !aconnector->mst_output_port)
                        continue;
 
                stream = dc_state->streams[i];
 
                if (stream->timing.flags.DSC == 1)
-                       if (dc_stream_add_dsc_to_resource(stream->ctx->dc, dc_state, stream) != DC_OK)
+                       if (dc_stream_add_dsc_to_resource(stream->ctx->dc, dc_state, stream) != DC_OK) {
+                               DRM_DEBUG_DRIVER("%s:%d MST_DSC Failed to request dsc hw resource for stream 0x%p\n",
+                                                       __func__, __LINE__, stream);
                                return -EINVAL;
+                       }
        }
 
        return ret;
 
                aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
 
+               DRM_DEBUG_DRIVER("MST_DSC pre compute mst dsc configs for #%d stream 0x%p, aconnector 0x%p\n",
+                                       i, stream, aconnector);
+
                if (!aconnector || !aconnector->dc_sink || !aconnector->mst_output_port)
                        continue;
 
        int ret = 0;
 
        if (!is_dsc_precompute_needed(state)) {
-               DRM_INFO_ONCE("DSC precompute is not needed.\n");
+               DRM_INFO_ONCE("%s:%d MST_DSC dsc precompute is not needed\n", __func__, __LINE__);
                return 0;
        }
        ret = dm_atomic_get_state(state, dm_state_ptr);
        if (ret != 0) {
-               DRM_INFO_ONCE("dm_atomic_get_state() failed\n");
+               DRM_INFO_ONCE("%s:%d MST_DSC dm_atomic_get_state() failed\n", __func__, __LINE__);
                return ret;
        }
        dm_state = *dm_state_ptr;
 
        ret = pre_compute_mst_dsc_configs_for_state(state, local_dc_state, vars);
        if (ret != 0) {
-               DRM_INFO_ONCE("pre_compute_mst_dsc_configs_for_state() failed\n");
+               DRM_INFO_ONCE("%s:%d MST_DSC dsc pre_compute_mst_dsc_configs_for_state() failed\n",
+                               __func__, __LINE__);
                ret = -EINVAL;
                goto clean_exit;
        }
 
                if (local_dc_state->streams[i] &&
                    dc_is_timing_changed(stream, local_dc_state->streams[i])) {
-                       DRM_INFO_ONCE("crtc[%d] needs mode_changed\n", i);
+                       DRM_INFO_ONCE("%s:%d MST_DSC crtc[%d] needs mode_change\n", __func__, __LINE__, i);
                } else {
                        int ind = find_crtc_index_in_state_by_stream(state, stream);
 
-                       if (ind >= 0)
+                       if (ind >= 0) {
+                               DRM_INFO_ONCE("%s:%d MST_DSC no mode changed for stream 0x%p\n",
+                                               __func__, __LINE__, stream);
                                state->crtcs[ind].new_state->mode_changed = 0;
+                       }
                }
        }
 clean_exit:
        end_to_end_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps);
 
        if (stream_kbps <= end_to_end_bw_in_kbps) {
-               DRM_DEBUG_DRIVER("No DSC needed. End-to-end bw sufficient.");
+               DRM_DEBUG_DRIVER("MST_DSC no dsc required. End-to-end bw sufficient\n");
                return DC_OK;
        }
 
                /*capable of dsc passthough. dsc bitstream along the entire path*/
                if (aconnector->mst_output_port->passthrough_aux) {
                        if (bw_range.min_kbps > end_to_end_bw_in_kbps) {
-                               DRM_DEBUG_DRIVER("DSC passthrough. Max dsc compression can't fit into end-to-end bw\n");
+                               DRM_DEBUG_DRIVER("MST_DSC dsc passthrough and decode at endpoint"
+                                                "Max dsc compression bw can't fit into end-to-end bw\n");
                                return DC_FAIL_BANDWIDTH_VALIDATE;
                        }
                } else {
                        /*Get last DP link BW capability*/
                        if (dp_get_link_current_set_bw(&aconnector->mst_output_port->aux, &end_link_bw)) {
                                if (stream_kbps > end_link_bw) {
-                                       DRM_DEBUG_DRIVER("DSC decode at last link. Mode required bw can't fit into available bw\n");
+                                       DRM_DEBUG_DRIVER("MST_DSC dsc decode at last link."
+                                                        "Mode required bw can't fit into last link\n");
                                        return DC_FAIL_BANDWIDTH_VALIDATE;
                                }
                        }
                                virtual_channel_bw_in_kbps = kbps_from_pbn(immediate_upstream_port->full_pbn);
                                virtual_channel_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps);
                                if (bw_range.min_kbps > virtual_channel_bw_in_kbps) {
-                                       DRM_DEBUG_DRIVER("DSC decode at last link. Max dsc compression can't fit into MST available bw\n");
+                                       DRM_DEBUG_DRIVER("MST_DSC dsc decode at last link."
+                                                        "Max dsc compression can't fit into MST available bw\n");
                                        return DC_FAIL_BANDWIDTH_VALIDATE;
                                }
                        }
                                dc_link_get_highest_encoding_format(stream->link),
                                &stream->timing.dsc_cfg)) {
                        stream->timing.flags.DSC = 1;
-                       DRM_DEBUG_DRIVER("Require dsc and dsc config found\n");
+                       DRM_DEBUG_DRIVER("MST_DSC require dsc and dsc config found\n");
                } else {
-                       DRM_DEBUG_DRIVER("Require dsc but can't find appropriate dsc config\n");
+                       DRM_DEBUG_DRIVER("MST_DSC require dsc but can't find appropriate dsc config\n");
                        return DC_FAIL_BANDWIDTH_VALIDATE;
                }
 
 
                if (branch_max_throughput_mps != 0 &&
                        ((stream->timing.pix_clk_100hz / 10) >  branch_max_throughput_mps * 1000)) {
-                       DRM_DEBUG_DRIVER("DSC is required but max throughput mps fails");
+                       DRM_DEBUG_DRIVER("MST_DSC require dsc but max throughput mps fails\n");
                        return DC_FAIL_BANDWIDTH_VALIDATE;
                }
        } else {
-               DRM_DEBUG_DRIVER("DSC is required but can't find common dsc config.");
+               DRM_DEBUG_DRIVER("MST_DSC require dsc but can't find common dsc config\n");
                return DC_FAIL_BANDWIDTH_VALIDATE;
        }
 #endif