]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drm/amd/display: define DC_LOGGER for logger
[linux.git] / drivers / gpu / drm / amd / display / dc / core / dc_link_dp.c
index 9a041641a53952c4929582142207cd157f9c90c8..3b5053570229cdcbb977b6d00674e02fb75b2cd6 100644 (file)
@@ -11,6 +11,8 @@
 #include "dpcd_defs.h"
 
 #include "resource.h"
+#define DC_LOGGER \
+       link->ctx->logger
 
 /* maximum pre emphasis level allowed for each voltage swing level*/
 static const enum dc_pre_emphasis voltage_swing_to_pre_emphasis[] = {
@@ -63,8 +65,7 @@ static void wait_for_training_aux_rd_interval(
 
        udelay(default_wait_in_micro_secs);
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s:\n wait = %d\n",
+       DC_LOG_HW_LINK_TRAINING("%s:\n wait = %d\n",
                __func__,
                default_wait_in_micro_secs);
 }
@@ -79,8 +80,7 @@ static void dpcd_set_training_pattern(
                &dpcd_pattern.raw,
                1);
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s\n %x pattern = %x\n",
+       DC_LOG_HW_LINK_TRAINING("%s\n %x pattern = %x\n",
                __func__,
                DP_TRAINING_PATTERN_SET,
                dpcd_pattern.v1_4.TRAINING_PATTERN_SET);
@@ -116,8 +116,7 @@ static void dpcd_set_link_settings(
        core_link_write_dpcd(link, DP_DOWNSPREAD_CTRL,
        &downspread.raw, sizeof(downspread));
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s\n %x rate = %x\n %x lane = %x\n %x spread = %x\n",
+       DC_LOG_HW_LINK_TRAINING("%s\n %x rate = %x\n %x lane = %x\n %x spread = %x\n",
                __func__,
                DP_LINK_BW_SET,
                lt_settings->link_settings.link_rate,
@@ -151,8 +150,7 @@ static enum dpcd_training_patterns
                break;
        default:
                ASSERT(0);
-               DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-                       "%s: Invalid HW Training pattern: %d\n",
+               DC_LOG_HW_LINK_TRAINING("%s: Invalid HW Training pattern: %d\n",
                        __func__, pattern);
                break;
        }
@@ -184,8 +182,7 @@ static void dpcd_set_lt_pattern_and_lane_settings(
        dpcd_lt_buffer[DP_TRAINING_PATTERN_SET - dpcd_base_lt_offset]
                = dpcd_pattern.raw;
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s\n %x pattern = %x\n",
+       DC_LOG_HW_LINK_TRAINING("%s\n %x pattern = %x\n",
                __func__,
                DP_TRAINING_PATTERN_SET,
                dpcd_pattern.v1_4.TRAINING_PATTERN_SET);
@@ -219,8 +216,7 @@ static void dpcd_set_lt_pattern_and_lane_settings(
                dpcd_lane,
                size_in_bytes);
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s:\n %x VS set = %x  PE set = %x max VS Reached = %x  max PE Reached = %x\n",
+       DC_LOG_HW_LINK_TRAINING("%s:\n %x VS set = %x  PE set = %x max VS Reached = %x  max PE Reached = %x\n",
                __func__,
                DP_TRAINING_LANE0_SET,
                dpcd_lane[0].bits.VOLTAGE_SWING_SET,
@@ -456,14 +452,12 @@ static void get_lane_status_and_drive_settings(
 
        ln_status_updated->raw = dpcd_buf[2];
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s:\n%x Lane01Status = %x\n %x Lane23Status = %x\n ",
+       DC_LOG_HW_LINK_TRAINING("%s:\n%x Lane01Status = %x\n %x Lane23Status = %x\n ",
                __func__,
                DP_LANE0_1_STATUS, dpcd_buf[0],
                DP_LANE2_3_STATUS, dpcd_buf[1]);
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s:\n %x Lane01AdjustRequest = %x\n %x Lane23AdjustRequest = %x\n",
+       DC_LOG_HW_LINK_TRAINING("%s:\n %x Lane01AdjustRequest = %x\n %x Lane23AdjustRequest = %x\n",
                __func__,
                DP_ADJUST_REQUEST_LANE0_1,
                dpcd_buf[4],
@@ -556,8 +550,7 @@ static void dpcd_set_lane_settings(
        }
        */
 
-       DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
-               "%s\n %x VS set = %x  PE set = %x max VS Reached = %x  max PE Reached = %x\n",
+       DC_LOG_HW_LINK_TRAINING("%s\n %x VS set = %x  PE set = %x max VS Reached = %x  max PE Reached = %x\n",
                __func__,
                DP_TRAINING_LANE0_SET,
                dpcd_lane[0].bits.VOLTAGE_SWING_SET,
@@ -669,16 +662,14 @@ static bool perform_post_lt_adj_req_sequence(
                }
 
                if (!req_drv_setting_changed) {
-                       DC_LOG_WARNING(link->ctx->logger,
-                               "%s: Post Link Training Adjust Request Timed out\n",
+                       DC_LOG_WARNING("%s: Post Link Training Adjust Request Timed out\n",
                                __func__);
 
                        ASSERT(0);
                        return true;
                }
        }
-       DC_LOG_WARNING(link->ctx->logger,
-               "%s: Post Link Training Adjust Request limit reached\n",
+       DC_LOG_WARNING("%s: Post Link Training Adjust Request limit reached\n",
                __func__);
 
        ASSERT(0);
@@ -885,8 +876,7 @@ static enum link_training_result perform_clock_recovery_sequence(
 
        if (retry_count >= LINK_TRAINING_MAX_CR_RETRY) {
                ASSERT(0);
-               DC_LOG_ERROR(link->ctx->logger,
-                       "%s: Link Training Error, could not get CR after %d tries. Possibly voltage swing issue",
+               DC_LOG_ERROR("%s: Link Training Error, could not get CR after %d tries. Possibly voltage swing issue",
                        __func__,
                        LINK_TRAINING_MAX_CR_RETRY);
 
@@ -1606,8 +1596,7 @@ static bool hpd_rx_irq_check_link_loss_status(
        if (sink_status_changed ||
                !hpd_irq_dpcd_data->bytes.lane_status_updated.bits.INTERLANE_ALIGN_DONE) {
 
-               DC_LOG_HW_HPD_IRQ(link->ctx->logger,
-                       "%s: Link Status changed.\n", __func__);
+               DC_LOG_HW_HPD_IRQ("%s: Link Status changed.\n", __func__);
 
                return_code = true;
 
@@ -1620,8 +1609,7 @@ static bool hpd_rx_irq_check_link_loss_status(
                        sizeof(irq_reg_rx_power_state));
 
                if (dpcd_result != DC_OK) {
-                       DC_LOG_HW_HPD_IRQ(link->ctx->logger,
-                               "%s: DPCD read failed to obtain power state.\n",
+                       DC_LOG_HW_HPD_IRQ("%s: DPCD read failed to obtain power state.\n",
                                __func__);
                } else {
                        if (irq_reg_rx_power_state != DP_SET_POWER_D0)
@@ -1982,8 +1970,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
         * PSR and device auto test, refer to function handle_sst_hpd_irq
         * in DAL2.1*/
 
-       DC_LOG_HW_HPD_IRQ(link->ctx->logger,
-               "%s: Got short pulse HPD on link %d\n",
+       DC_LOG_HW_HPD_IRQ("%s: Got short pulse HPD on link %d\n",
                __func__, link->link_index);
 
 
@@ -1997,8 +1984,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
                *out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
 
        if (result != DC_OK) {
-               DC_LOG_HW_HPD_IRQ(link->ctx->logger,
-                       "%s: DPCD read failed to obtain irq data\n",
+               DC_LOG_HW_HPD_IRQ("%s: DPCD read failed to obtain irq data\n",
                        __func__);
                return false;
        }
@@ -2016,8 +2002,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
        }
 
        if (!allow_hpd_rx_irq(link)) {
-               DC_LOG_HW_HPD_IRQ(link->ctx->logger,
-                       "%s: skipping HPD handling on %d\n",
+               DC_LOG_HW_HPD_IRQ("%s: skipping HPD handling on %d\n",
                        __func__, link->link_index);
                return false;
        }