[PATCH 01/76] drm/amd/dal: bring all of dc under a single log category table
Harry Wentland
harry.wentland at amd.com
Mon Nov 21 23:00:21 UTC 2016
From: Dmytro Laktyushkin <Dmytro.Laktyushkin at amd.com>
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
.../gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c | 60 --
.../gpu/drm/amd/dal/dc/adapter/adapter_service.c | 12 +-
.../amd/dal/dc/asic_capability/asic_capability.c | 4 +-
.../dc/asic_capability/hawaii_asic_capability.c | 4 +-
drivers/gpu/drm/amd/dal/dc/basics/Makefile | 3 +-
drivers/gpu/drm/amd/dal/dc/basics/log_helpers.c | 100 +++
drivers/gpu/drm/amd/dal/dc/basics/logger.c | 674 +++------------------
drivers/gpu/drm/amd/dal/dc/basics/logger.h | 4 +-
drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c | 4 +-
drivers/gpu/drm/amd/dal/dc/core/dc.c | 27 +-
drivers/gpu/drm/amd/dal/dc/core/dc_link.c | 59 +-
drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c | 6 +-
drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c | 68 +--
drivers/gpu/drm/amd/dal/dc/core/dc_resource.c | 4 +-
drivers/gpu/drm/amd/dal/dc/core/dc_target.c | 30 +-
drivers/gpu/drm/amd/dal/dc/dc.h | 5 +-
.../gpu/drm/amd/dal/dc/dce/dce110_stream_encoder.c | 6 +-
drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c | 6 +-
.../drm/amd/dal/dc/dce110/dce110_clock_source.c | 48 +-
.../gpu/drm/amd/dal/dc/dce110/dce110_compressor.c | 48 +-
.../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c | 14 +-
.../drm/amd/dal/dc/dce110/dce110_link_encoder.c | 52 +-
.../gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c | 4 +-
.../gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c | 4 +-
.../gpu/drm/amd/dal/dc/dce110/dce110_resource.c | 25 +-
.../amd/dal/dc/dce110/dce110_timing_generator.c | 3 +-
.../amd/dal/dc/dce110/dce110_timing_generator_v.c | 18 +-
.../amd/dal/dc/dce110/dce110_transform_bit_depth.c | 20 +-
.../drm/amd/dal/dc/dce112/dce112_clock_source.c | 4 +-
.../gpu/drm/amd/dal/dc/dce112/dce112_compressor.c | 48 +-
.../drm/amd/dal/dc/dce112/dce112_opp_formatter.c | 3 +-
.../gpu/drm/amd/dal/dc/dce112/dce112_resource.c | 25 +-
.../gpu/drm/amd/dal/dc/dce80/dce80_compressor.c | 48 +-
.../gpu/drm/amd/dal/dc/dce80/dce80_link_encoder.c | 12 +-
drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c | 4 +-
.../gpu/drm/amd/dal/dc/dce80/dce80_opp_regamma.c | 4 +-
.../amd/dal/dc/dce80/dce80_transform_bit_depth.c | 8 +-
.../gpu/drm/amd/dal/dc/dce80/dce80_transform_scl.c | 8 +-
drivers/gpu/drm/amd/dal/dc/dm_helpers.h | 38 --
drivers/gpu/drm/amd/dal/dc/dm_services_types.h | 32 +-
.../amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c | 2 +-
.../amd/dal/dc/gpu/dce110/display_clock_dce110.c | 28 +-
.../amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c | 2 +-
.../amd/dal/dc/gpu/dce112/display_clock_dce112.c | 28 +-
.../drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c | 12 +-
.../dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c | 6 +-
.../drm/amd/dal/dc/irq/dce110/irq_service_dce110.c | 12 +-
drivers/gpu/drm/amd/dal/dc/irq/irq_service.c | 12 +-
drivers/gpu/drm/amd/dal/dc/os_types.h | 61 ++
drivers/gpu/drm/amd/dal/include/fixed31_32.h | 2 +
drivers/gpu/drm/amd/dal/include/fixed32_32.h | 3 +
drivers/gpu/drm/amd/dal/include/logger_interface.h | 116 ++--
drivers/gpu/drm/amd/dal/include/logger_types.h | 351 ++---------
53 files changed, 558 insertions(+), 1623 deletions(-)
create mode 100644 drivers/gpu/drm/amd/dal/dc/basics/log_helpers.c
create mode 100644 drivers/gpu/drm/amd/dal/dc/os_types.h
diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c
index 58863ce10304..e503677110c3 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c
@@ -42,12 +42,6 @@
#include "dm_helpers.h"
-/* Maximum line char number for connectivity log,
- * in case of output EDID, needs at least 256x3 bytes plus some other
- * message, so set line size to 896.
- */
-#define CONN_MAX_LINE_SIZE 896
-
/* dm_helpers_parse_edid_caps
*
* Parse edid caps
@@ -487,57 +481,3 @@ bool dm_helpers_submit_i2c(
return result;
}
-
-void dm_helper_conn_log(struct dc_context *ctx,
- const struct dc_link *link,
- uint8_t *hex_data,
- int hex_data_count,
- enum conn_event event,
- const char *msg,
- ...)
-{
- struct amdgpu_device *adev = ctx->driver_context;
- struct drm_device *dev = adev->ddev;
- struct amdgpu_connector *aconnector = get_connector_for_link(dev, link);
- char buffer[CONN_MAX_LINE_SIZE] = { 0 };
- va_list args;
- int size;
- enum log_minor minor = event;
-
- if (!aconnector) {
- DRM_ERROR("Failed to found connector for link!");
- return;
- }
-
- va_start(args, msg);
-
- sprintf(buffer, "[%s] ", aconnector->base.name);
-
- size = strlen(buffer);
-
- size += dm_log_to_buffer(
- &buffer[size], CONN_MAX_LINE_SIZE, msg, args);
-
- if (buffer[strlen(buffer) - 1] == '\n') {
- buffer[strlen(buffer) - 1] = '\0';
- size--;
- }
-
- if (hex_data_count > (CONN_MAX_LINE_SIZE - size))
- return;
-
- if (hex_data) {
- int i;
-
- for (i = 0; i < hex_data_count; i++)
- sprintf(&buffer[size + i * 3], "%2.2X ", hex_data[i]);
- }
-
- strcat(buffer, "^\n");
-
- dal_logger_write(ctx->logger,
- LOG_MAJOR_CONNECTIVITY,
- minor,
- buffer);
- va_end(args);
-}
diff --git a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
index c7904ca92ddf..57228a87d5a1 100644
--- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
+++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
@@ -221,9 +221,7 @@ static void initialize_backlight_caps(
struct dc_bios *dcb = as->ctx->dc_bios;
if (!(PM_GET_EXTENDED_BRIGHNESS_CAPS & as->platform_methods_mask)) {
- dal_logger_write(as->ctx->logger,
- LOG_MAJOR_BACKLIGHT,
- LOG_MINOR_BACKLIGHT_BRIGHTESS_CAPS,
+ dm_logger_write(as->ctx->logger, LOG_BACKLIGHT,
"This method is not supported\n");
return;
}
@@ -362,16 +360,12 @@ static void log_overriden_features(
uint32_t value)
{
if (bool_feature)
- dal_logger_write(as->ctx->logger,
- LOG_MAJOR_FEATURE_OVERRIDE,
- LOG_MINOR_FEATURE_OVERRIDE,
+ dm_logger_write(as->ctx->logger, LOG_FEATURE_OVERRIDE,
"Overridden %s is %s now\n",
feature_name,
(value == 0) ? "disabled" : "enabled");
else
- dal_logger_write(as->ctx->logger,
- LOG_MAJOR_FEATURE_OVERRIDE,
- LOG_MINOR_FEATURE_OVERRIDE,
+ dm_logger_write(as->ctx->logger, LOG_FEATURE_OVERRIDE,
"Overridden %s new value: %d\n",
feature_name,
value);
diff --git a/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c b/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
index 540372b4626f..3e83b1e4ab9e 100644
--- a/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
+++ b/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
@@ -118,9 +118,7 @@ static bool construct(
}
if (false == asic_supported) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_MASK_ALL,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: ASIC not supported!\n", __func__);
}
diff --git a/drivers/gpu/drm/amd/dal/dc/asic_capability/hawaii_asic_capability.c b/drivers/gpu/drm/amd/dal/dc/asic_capability/hawaii_asic_capability.c
index 2913e572975c..d5eb323f5e87 100644
--- a/drivers/gpu/drm/amd/dal/dc/asic_capability/hawaii_asic_capability.c
+++ b/drivers/gpu/drm/amd/dal/dc/asic_capability/hawaii_asic_capability.c
@@ -94,9 +94,7 @@ void dal_hawaii_asic_capability_create(struct asic_capability *cap,
cap->data[ASIC_DATA_MEMORYTYPE_MULTIPLIER] = 4;
break;
default:
- dal_logger_write(cap->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_MASK_ALL,
+ dm_logger_write(cap->ctx->logger, LOG_ERROR,
"%s:Unrecognized memory type!", __func__);
cap->data[ASIC_DATA_MEMORYTYPE_MULTIPLIER] = 2;
break;
diff --git a/drivers/gpu/drm/amd/dal/dc/basics/Makefile b/drivers/gpu/drm/amd/dal/dc/basics/Makefile
index 93e23714e411..ab37b670a6d3 100644
--- a/drivers/gpu/drm/amd/dal/dc/basics/Makefile
+++ b/drivers/gpu/drm/amd/dal/dc/basics/Makefile
@@ -3,7 +3,8 @@
# It provides the general basic services required by other DAL
# subcomponents.
-BASICS = conversion.o fixpt31_32.o fixpt32_32.o grph_object_id.o logger.o register_logger.o signal_types.o vector.o
+BASICS = conversion.o fixpt31_32.o fixpt32_32.o grph_object_id.o \
+ logger.o log_helpers.o register_logger.o signal_types.o vector.o
AMD_DAL_BASICS = $(addprefix $(AMDDALPATH)/dc/basics/,$(BASICS))
diff --git a/drivers/gpu/drm/amd/dal/dc/basics/log_helpers.c b/drivers/gpu/drm/amd/dal/dc/basics/log_helpers.c
new file mode 100644
index 000000000000..61f36a7f322b
--- /dev/null
+++ b/drivers/gpu/drm/amd/dal/dc/basics/log_helpers.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2012-16 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+#include "core_types.h"
+#include "logger.h"
+#include "include/logger_interface.h"
+
+#define NUM_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
+
+struct dc_signal_type_info {
+ enum signal_type type;
+ char name[MAX_NAME_LEN];
+};
+
+static const struct dc_signal_type_info signal_type_info_tbl[] = {
+ {SIGNAL_TYPE_NONE, "NC"},
+ {SIGNAL_TYPE_DVI_SINGLE_LINK, "DVI"},
+ {SIGNAL_TYPE_DVI_DUAL_LINK, "DDVI"},
+ {SIGNAL_TYPE_HDMI_TYPE_A, "HDMIA"},
+ {SIGNAL_TYPE_LVDS, "LVDS"},
+ {SIGNAL_TYPE_RGB, "VGA"},
+ {SIGNAL_TYPE_DISPLAY_PORT, "DP"},
+ {SIGNAL_TYPE_DISPLAY_PORT_MST, "MST"},
+ {SIGNAL_TYPE_EDP, "eDP"},
+ {SIGNAL_TYPE_WIRELESS, "Wireless"},
+ {SIGNAL_TYPE_VIRTUAL, "Virtual"}
+};
+
+void dc_conn_log(struct dc_context *ctx,
+ const struct dc_link *link,
+ uint8_t *hex_data,
+ int hex_data_count,
+ enum dc_log_type event,
+ const char *msg,
+ ...)
+{
+ int i;
+ va_list args;
+ struct log_entry entry = { 0 };
+ enum signal_type signal;
+
+ if (link->local_sink)
+ signal = link->local_sink->sink_signal;
+ else
+ signal = link->connector_signal;
+
+ if (link->type == dc_connection_mst_branch)
+ signal = SIGNAL_TYPE_DISPLAY_PORT_MST;
+
+ dm_logger_open(ctx->logger, &entry, event);
+
+ for (i = 0; i < NUM_ELEMENTS(signal_type_info_tbl); i++)
+ if (signal == signal_type_info_tbl[i].type)
+ break;
+
+ dm_logger_append(&entry, "[%s][ConnIdx:%d] ",
+ signal_type_info_tbl[i].name,
+ link->link_index);
+
+ va_start(args, msg);
+ entry.buf_offset += dm_log_to_buffer(
+ &entry.buf[entry.buf_offset],
+ LOG_MAX_LINE_SIZE - entry.buf_offset,
+ msg, args);
+
+ if (entry.buf[strlen(entry.buf) - 1] == '\n') {
+ entry.buf[strlen(entry.buf) - 1] = '\0';
+ entry.buf_offset--;
+ }
+
+ if (hex_data)
+ for (i = 0; i < hex_data_count; i++)
+ dm_logger_append(&entry, "%2.2X ", hex_data[i]);
+
+ dm_logger_append(&entry, "^\n");
+ dm_logger_close(&entry);
+ va_end(args);
+}
diff --git a/drivers/gpu/drm/amd/dal/dc/basics/logger.c b/drivers/gpu/drm/amd/dal/dc/basics/logger.c
index 67a1ee241aa2..3c16fe1d91ff 100644
--- a/drivers/gpu/drm/amd/dal/dc/basics/logger.c
+++ b/drivers/gpu/drm/amd/dal/dc/basics/logger.c
@@ -22,276 +22,79 @@
* Authors: AMD
*
*/
-#include <stdarg.h>
#include "dm_services.h"
-#include "include/dal_types.h"
#include "include/logger_interface.h"
#include "logger.h"
-/* TODO: for now - empty, use DRM defines from dal services.
- Need to define appropriate levels of prints, and implement
- this component
-void dal_log(const char *format, ...)
-{
-}
-*/
-
-/* ----------- Logging Major/Minor names ------------ */
#define NUM_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
-static const struct log_minor_info component_minor_info_tbl[] = {
- {LOG_MINOR_COMPONENT_LINK_SERVICE, "LS"},
- {LOG_MINOR_COMPONENT_DAL_INTERFACE, "DalIf"},
- {LOG_MINOR_COMPONENT_HWSS, "HWSS"},
- {LOG_MINOR_COMPONENT_ADAPTER_SERVICE, "AS"},
- {LOG_MINOR_COMPONENT_DISPLAY_SERVICE, "DS"},
- {LOG_MINOR_COMPONENT_TOPOLOGY_MANAGER, "TM"},
- {LOG_MINOR_COMPONENT_ENCODER, "Encoder"},
- {LOG_MINOR_COMPONENT_I2C_AUX, "I2cAux"},
- {LOG_MINOR_COMPONENT_AUDIO, "Audio"},
- {LOG_MINOR_COMPONENT_DISPLAY_CAPABILITY_SERVICE, "Dcs"},
- {LOG_MINOR_COMPONENT_DMCU, "Dmcu"},
- {LOG_MINOR_COMPONENT_GPU, "GPU"},
- {LOG_MINOR_COMPONENT_CONTROLLER, "Cntrlr"},
- {LOG_MINOR_COMPONENT_ISR, "ISR"},
- {LOG_MINOR_COMPONENT_BIOS, "BIOS"},
- {LOG_MINOR_COMPONENT_DC, "DC"},
- {LOG_MINOR_COMPONENT_IRQ_SERVICE, "IRQ SERVICE"},
-
-};
-
-static const struct log_minor_info hw_trace_minor_info_tbl[] = {
- {LOG_MINOR_HW_TRACE_MST, "Mst" },
- {LOG_MINOR_HW_TRACE_TRAVIS, "Travis" },
- {LOG_MINOR_HW_TRACE_HOTPLUG, "Hotplug" },
- {LOG_MINOR_HW_TRACE_LINK_TRAINING, "LinkTraining" },
- {LOG_MINOR_HW_TRACE_SET_MODE, "SetMode" },
- {LOG_MINOR_HW_TRACE_RESUME_S3, "ResumeS3" },
- {LOG_MINOR_HW_TRACE_RESUME_S4, "ResumeS4" },
- {LOG_MINOR_HW_TRACE_BOOTUP, "BootUp" },
- {LOG_MINOR_HW_TRACE_AUDIO, "Audio"},
- {LOG_MINOR_HW_TRACE_HPD_IRQ, "HpdIrq" },
- {LOG_MINOR_HW_TRACE_INTERRUPT, "Interrupt" },
- {LOG_MINOR_HW_TRACE_MPO, "Planes" },
-};
-
-static const struct log_minor_info mst_minor_info_tbl[] = {
- {LOG_MINOR_MST_IRQ_HPD_RX, "IrqHpdRx"},
- {LOG_MINOR_MST_IRQ_TIMER, "IrqTimer"},
- {LOG_MINOR_MST_NATIVE_AUX, "NativeAux"},
- {LOG_MINOR_MST_SIDEBAND_MSG, "SB"},
- {LOG_MINOR_MST_MSG_TRANSACTION, "MT"},
- {LOG_MINOR_MST_SIDEBAND_MSG_PARSED, "SB Parsed"},
- {LOG_MINOR_MST_MSG_TRANSACTION_PARSED, "MT Parsed"},
- {LOG_MINOR_MST_AUX_MSG_DPCD_ACCESS, "AuxMsgDpcdAccess"},
- {LOG_MINOR_MST_PROGRAMMING, "Programming"},
- {LOG_MINOR_MST_TOPOLOGY_DISCOVERY, "TopologyDiscovery"},
- {LOG_MINOR_MST_CONVERTER_CAPS, "ConverterCaps"},
-};
-
-static const struct log_minor_info dcs_minor_info_tbl[] = {
- {LOG_MINOR_DCS_EDID_EMULATOR, "EdidEmul"},
- {LOG_MINOR_DCS_DONGLE_DETECTION, "DongleDetect"},
-};
-
-static const struct log_minor_info dcp_minor_info_tbl[] = {
- { LOG_MINOR_DCP_GAMMA_GRPH, "GammaGrph"},
- { LOG_MINOR_DCP_GAMMA_OVL, "GammaOvl"},
- { LOG_MINOR_DCP_CSC_GRPH, "CscGrph"},
- { LOG_MINOR_DCP_CSC_OVL, "CscOvl"},
- { LOG_MINOR_DCP_SCALER, "Scaler"},
- { LOG_MINOR_DCP_SCALER_TABLES, "ScalerTables"},
+static const struct dc_log_type_info log_type_info_tbl[] = {
+ {LOG_ERROR, "Error"},
+ {LOG_WARNING, "Warning"},
+ {LOG_DC, "DC_Interface"},
+ {LOG_SURFACE, "Surface"},
+ {LOG_HW_HOTPLUG, "HW_Hotplug"},
+ {LOG_HW_LINK_TRAINING, "HW_LKTN"},
+ {LOG_HW_SET_MODE, "HW_Mode"},
+ {LOG_HW_RESUME_S3, "HW_Resume"},
+ {LOG_HW_AUDIO, "HW_Audio"},
+ {LOG_HW_HPD_IRQ, "HW_HPDIRQ"},
+ {LOG_MST, "MST"},
+ {LOG_SCALER, "Scaler"},
+ {LOG_BIOS, "BIOS"},
+ {LOG_BANDWIDTH_CALCS, "BWCalcs"},
+ {LOG_BANDWIDTH_VALIDATION, "BWValidation"},
+ {LOG_I2C_AUX, "I2C_AUX"},
+ {LOG_SYNC, "Sync"},
+ {LOG_BACKLIGHT, "Backlight"},
+ {LOG_FEATURE_OVERRIDE, "Override"},
+ {LOG_DETECTION_EDID_PARSER, "Edid"},
+ {LOG_DETECTION_DP_CAPS, "DP_Caps"},
+ {LOG_RESOURCE, "Resource"},
+ {LOG_DML, "DML"},
+ {LOG_EVENT_MODE_SET, "Mode"},
+ {LOG_EVENT_DETECTION, "Detect"},
+ {LOG_EVENT_LINK_TRAINING, "LKTN"},
+ {LOG_EVENT_LINK_LOSS, "LinkLoss"},
+ {LOG_EVENT_UNDERFLOW, "Underflow"}
};
-static const struct log_minor_info bios_minor_info_tbl[] = {
- {LOG_MINOR_BIOS_CMD_TABLE, "CmdTbl"},
-};
-
-static const struct log_minor_info reg_minor_info_tbl[] = {
- {LOG_MINOR_REGISTER_INDEX, "Index"},
-};
-
-static const struct log_minor_info info_packet_minor_info_tbl[] = {
- {LOG_MINOR_INFO_PACKETS_HDMI, "Hdmi"},
-};
-
-static const struct log_minor_info dsat_minor_info_tbl[] = {
- {LOG_MINOR_DSAT_LOGGER, "Logger"},
- {LOG_MINOR_DSAT_EDID_OVERRIDE, "EDID_Override"},
-};
-
-static const struct log_minor_info ec_minor_info_tbl[] = {
- {LOG_MINOR_EC_PPLIB_NOTIFY, "PPLib_Notify" }, /* PPLib notifies DAL */
- {LOG_MINOR_EC_PPLIB_QUERY, "PPLib_Query" } /* DAL requested info from
- PPLib */
-};
-static const struct log_minor_info bwm_minor_info_tbl[] = {
- {LOG_MINOR_BWM_MODE_VALIDATION, "ModeValidation"},
- {LOG_MINOR_BWM_REQUIRED_BANDWIDTH_CALCS, "Req_Bandw_Calcs"}
-};
-
-static const struct log_minor_info mode_enum_minor_info_tbl[] = {
- {LOG_MINOR_MODE_ENUM_BEST_VIEW_CANDIDATES, "BestviewCandidates"},
- {LOG_MINOR_MODE_ENUM_VIEW_SOLUTION, "ViewSolution"},
- {LOG_MINOR_MODE_ENUM_TS_LIST_BUILD, "TsListBuild"},
- {LOG_MINOR_MODE_ENUM_TS_LIST, "TsList"},
- {LOG_MINOR_MODE_ENUM_MASTER_VIEW_LIST, "MasterViewList"},
- {LOG_MINOR_MODE_ENUM_MASTER_VIEW_LIST_UPDATE, "MasterViewListUpdate"},
-};
-
-static const struct log_minor_info i2caux_minor_info_tbl[] = {
- {LOG_MINOR_I2C_AUX_LOG, "Log"},
- {LOG_MINOR_I2C_AUX_AUX_TIMESTAMP, "Timestamp"},
- {LOG_MINOR_I2C_AUX_CFG, "Config"}
-};
-
-static const struct log_minor_info line_buffer_minor_info_tbl[] = {
- {LOG_MINOR_LINE_BUFFER_POWERGATING, "PowerGating"}
-};
-
-static const struct log_minor_info hwss_minor_info_tbl[] = {
- {LOG_MINOR_HWSS_TAPS_VALIDATION, "HWSS Taps"}
-};
-
-static const struct log_minor_info optimization_minor_info_tbl[] = {
- {LOG_MINOR_OPTMZ_GENERAL, "General Optimizations"},
- {LOG_MINOR_OPTMZ_DO_NOT_TURN_OFF_VCC_DURING_SET_MODE,
- "Skip Vcc Off During Set Mode"}
-};
-
-static const struct log_minor_info perf_measure_minor_info_tbl[] = {
- {LOG_MINOR_PERF_MEASURE_GENERAL, "General Performance Measurement"},
- {LOG_MINOR_PERF_MEASURE_HEAP_MEMORY, "Heap Memory Management"}
-};
-
-static const struct log_minor_info sync_minor_info_tbl[] = {
- {LOG_MINOR_SYNC_HW_CLOCK_ADJUST, "Pixel Rate Tune-up"},
- {LOG_MINOR_SYNC_TIMING, "Timing"}
-};
-
-static const struct log_minor_info backlight_minor_info_tbl[] = {
- {LOG_MINOR_BACKLIGHT_BRIGHTESS_CAPS, "Caps"},
- {LOG_MINOR_BACKLIGHT_DMCU_DELTALUT, "DMCU Delta LUT"},
- {LOG_MINOR_BACKLIGHT_DMCU_BUILD_DELTALUT, "Build DMCU Delta LUT"},
- {LOG_MINOR_BACKLIGHT_INTERFACE, "Interface"},
- {LOG_MINOR_BACKLIGHT_LID, "Lid Status"}
-};
-
-static const struct log_minor_info override_feature_minor_info_tbl[] = {
- {LOG_MINOR_FEATURE_OVERRIDE, "overriden feature"},
-};
-
-static const struct log_minor_info detection_minor_info_tbl[] = {
- {LOG_MINOR_DETECTION_EDID_PARSER, "EDID Parser"},
- {LOG_MINOR_DETECTION_DP_CAPS, "DP caps"},
-};
-
-static const struct log_minor_info tm_minor_info_tbl[] = {
- {LOG_MINOR_TM_INFO, "INFO"},
- {LOG_MINOR_TM_IFACE_TRACE, "IFACE_TRACE"},
- {LOG_MINOR_TM_RESOURCES, "RESOURCES"},
- {LOG_MINOR_TM_ENCODER_CTL, "ENCODER_CTL"},
- {LOG_MINOR_TM_ENG_ASN, "ENG_ASN"},
- {LOG_MINOR_TM_CONTROLLER_ASN, "CONTROLLER_ASN"},
- {LOG_MINOR_TM_PWR_GATING, "PWR_GATING"},
- {LOG_MINOR_TM_BUILD_DSP_PATH, "BUILD_PATH"},
- {LOG_MINOR_TM_DISPLAY_DETECT, "DISPLAY_DETECT"},
- {LOG_MINOR_TM_LINK_SRV, "LINK_SRV"},
- {LOG_MINOR_TM_NOT_IMPLEMENTED, "NOT_IMPL"},
- {LOG_MINOR_TM_COFUNC_PATH, "COFUNC_PATH"}
-};
-
-static const struct log_minor_info ds_minor_info_tbl[] = {
- {LOG_MINOR_DS_MODE_SETTING, "Mode_Setting"},
-};
-
-static const struct log_minor_info connectivity_minor_info_tbl[] = {
- {LOG_MINOR_CONNECTIVITY_MODE_SET, "Mode"},
- {LOG_MINOR_CONNECTIVITY_DETECTION, "Detect"},
- {LOG_MINOR_CONNECTIVITY_LINK_TRAINING, "LKTN"},
- {LOG_MINOR_CONNECTIVITY_LINK_LOSS, "LinkLoss"},
- {LOG_MINOR_CONNECTIVITY_UNDERFLOW, "Underflow"},
-};
-
-struct log_major_mask_info {
- struct log_major_info major_info;
- uint32_t default_mask;
- const struct log_minor_info *minor_tbl;
- uint32_t tbl_element_cnt;
-};
-
-/* A mask for each Major.
- * Use a mask or zero. */
-#define LG_ERR_MSK 0xffffffff
-#define LG_WRN_MSK 0xffffffff
-#define LG_TM_MSK (1 << LOG_MINOR_TM_RESOURCES)
-#define LG_FO_MSK (1 << LOG_MINOR_FEATURE_OVERRIDE)
-#define LG_EC_MSK ((1 << LOG_MINOR_EC_PPLIB_NOTIFY) | \
- (1 << LOG_MINOR_EC_PPLIB_QUERY))
-#define LG_DSAT_MSK (1 << LOG_MINOR_DSAT_EDID_OVERRIDE)
-#define LG_DT_MSK (1 << LOG_MINOR_DETECTION_EDID_PARSER)
-
-/* IFT - InterFaceTrace */
-#define LG_IFT_MSK (1 << LOG_MINOR_COMPONENT_DC)
-
-#define LG_HW_TR_AUD_MSK (1 << LOG_MINOR_HW_TRACE_AUDIO)
-#define LG_HW_TR_INTERRUPT_MSK (1 << LOG_MINOR_HW_TRACE_INTERRUPT) | \
- (1 << LOG_MINOR_HW_TRACE_HPD_IRQ)
-#define LG_HW_TR_PLANES_MSK (1 << LOG_MINOR_HW_TRACE_MPO)
-#define LG_ALL_MSK 0xffffffff
-#define LG_DCP_MSK ~(1 << LOG_MINOR_DCP_SCALER)
-
-#define LG_SYNC_MSK (1 << LOG_MINOR_SYNC_TIMING)
-
-#define LG_BWM_MSK (1 << LOG_MINOR_BWM_MODE_VALIDATION)
-
-#define LG_WARN_MSK ~(1 << LOG_MINOR_COMPONENT_TOPOLOGY_MANAGER)
-
-#define LG_IF_MSK ~(1 << LOG_MINOR_COMPONENT_SURFACE)
-
-#define LG_HW_TRACE_MSK (LG_ALL_MSK & \
- ~((1 << LOG_MINOR_HW_TRACE_LINK_TRAINING) \
- | (1 << LOG_MINOR_HW_TRACE_AUDIO)))
-
-static const struct log_major_mask_info log_major_mask_info_tbl[] = {
- /* LogMajor major name default MinorTble tblElementCnt */
- {{LOG_MAJOR_ERROR, "Error" }, LG_ALL_MSK, component_minor_info_tbl, NUM_ELEMENTS(component_minor_info_tbl)},
- {{LOG_MAJOR_WARNING, "Warning" }, LG_WARN_MSK, component_minor_info_tbl, NUM_ELEMENTS(component_minor_info_tbl)},
- {{LOG_MAJOR_INTERFACE_TRACE, "IfTrace" }, LG_IF_MSK, component_minor_info_tbl, NUM_ELEMENTS(component_minor_info_tbl)},
- {{LOG_MAJOR_HW_TRACE, "HwTrace" }, LG_HW_TRACE_MSK, hw_trace_minor_info_tbl, NUM_ELEMENTS(hw_trace_minor_info_tbl)},
- {{LOG_MAJOR_MST, "MST" }, LG_ALL_MSK, mst_minor_info_tbl, NUM_ELEMENTS(mst_minor_info_tbl)},
- {{LOG_MAJOR_DCS, "DCS" }, LG_ALL_MSK, dcs_minor_info_tbl, NUM_ELEMENTS(dcs_minor_info_tbl)},
- {{LOG_MAJOR_DCP, "DCP" }, LG_DCP_MSK, dcp_minor_info_tbl, NUM_ELEMENTS(dcp_minor_info_tbl)},
- {{LOG_MAJOR_BIOS, "Bios" }, LG_ALL_MSK, bios_minor_info_tbl, NUM_ELEMENTS(bios_minor_info_tbl)},
- {{LOG_MAJOR_REGISTER, "Register" }, LG_ALL_MSK, reg_minor_info_tbl, NUM_ELEMENTS(reg_minor_info_tbl)},
- {{LOG_MAJOR_INFO_PACKETS, "InfoPacket" }, LG_ALL_MSK, info_packet_minor_info_tbl, NUM_ELEMENTS(info_packet_minor_info_tbl)},
- {{LOG_MAJOR_DSAT, "DSAT" }, LG_ALL_MSK, dsat_minor_info_tbl, NUM_ELEMENTS(dsat_minor_info_tbl)},
- {{LOG_MAJOR_EC, "EC" }, LG_ALL_MSK, ec_minor_info_tbl, NUM_ELEMENTS(ec_minor_info_tbl)},
- {{LOG_MAJOR_BWM, "BWM" }, LG_BWM_MSK, bwm_minor_info_tbl, NUM_ELEMENTS(bwm_minor_info_tbl)},
- {{LOG_MAJOR_MODE_ENUM, "ModeEnum" }, LG_ALL_MSK, mode_enum_minor_info_tbl, NUM_ELEMENTS(mode_enum_minor_info_tbl)},
- {{LOG_MAJOR_I2C_AUX, "I2cAux" }, LG_ALL_MSK, i2caux_minor_info_tbl, NUM_ELEMENTS(i2caux_minor_info_tbl)},
- {{LOG_MAJOR_LINE_BUFFER, "LineBuffer" }, LG_ALL_MSK, line_buffer_minor_info_tbl, NUM_ELEMENTS(line_buffer_minor_info_tbl)},
- {{LOG_MAJOR_HWSS, "HWSS" }, LG_ALL_MSK, hwss_minor_info_tbl, NUM_ELEMENTS(hwss_minor_info_tbl)},
- {{LOG_MAJOR_OPTIMIZATION, "Optimization"}, LG_ALL_MSK, optimization_minor_info_tbl, NUM_ELEMENTS(optimization_minor_info_tbl)},
- {{LOG_MAJOR_PERF_MEASURE, "PerfMeasure" }, LG_ALL_MSK, perf_measure_minor_info_tbl, NUM_ELEMENTS(perf_measure_minor_info_tbl)},
- {{LOG_MAJOR_SYNC, "Sync" }, LG_SYNC_MSK,sync_minor_info_tbl, NUM_ELEMENTS(sync_minor_info_tbl)},
- {{LOG_MAJOR_BACKLIGHT, "Backlight" }, LG_ALL_MSK, backlight_minor_info_tbl, NUM_ELEMENTS(backlight_minor_info_tbl)},
- {{LOG_MAJOR_INTERRUPTS, "Interrupts" }, LG_ALL_MSK, component_minor_info_tbl, NUM_ELEMENTS(component_minor_info_tbl)},
- {{LOG_MAJOR_TM, "TM" }, LG_TM_MSK, tm_minor_info_tbl, NUM_ELEMENTS(tm_minor_info_tbl)},
- {{LOG_MAJOR_DISPLAY_SERVICE, "DS" }, LG_ALL_MSK, ds_minor_info_tbl, NUM_ELEMENTS(ds_minor_info_tbl)},
- {{LOG_MAJOR_FEATURE_OVERRIDE, "FeatureOverride" }, LG_ALL_MSK, override_feature_minor_info_tbl, NUM_ELEMENTS(override_feature_minor_info_tbl)},
- {{LOG_MAJOR_DETECTION, "Detection" }, LG_ALL_MSK, detection_minor_info_tbl, NUM_ELEMENTS(detection_minor_info_tbl)},
- {{LOG_MAJOR_CONNECTIVITY, "Conn" }, LG_ALL_MSK, connectivity_minor_info_tbl, NUM_ELEMENTS(connectivity_minor_info_tbl)},
-};
+#define DC_DEFAULT_LOG_MASK ((1 << LOG_ERROR) | \
+ (1 << LOG_WARNING) | \
+ (1 << LOG_EVENT_MODE_SET) | \
+ (1 << LOG_EVENT_DETECTION) | \
+ (1 << LOG_EVENT_LINK_TRAINING) | \
+ (1 << LOG_EVENT_LINK_LOSS) | \
+ (1 << LOG_EVENT_UNDERFLOW) | \
+ (1 << LOG_RESOURCE) | \
+ (1 << LOG_FEATURE_OVERRIDE) | \
+ (1 << LOG_DETECTION_EDID_PARSER) | \
+ (1 << LOG_DC) | \
+ (1 << LOG_HW_HOTPLUG) | \
+ (1 << LOG_HW_SET_MODE) | \
+ (1 << LOG_HW_RESUME_S3) | \
+ (1 << LOG_HW_HPD_IRQ) | \
+ (1 << LOG_SYNC) | \
+ (1 << LOG_BANDWIDTH_VALIDATION) | \
+ (1 << LOG_MST) | \
+ (1 << LOG_BIOS) | \
+ (1 << LOG_DETECTION_EDID_PARSER) | \
+ (1 << LOG_DETECTION_DP_CAPS) | \
+ (1 << LOG_BACKLIGHT)) | \
+ (1 << LOG_I2C_AUX)/* | \
+ (1 << LOG_SURFACE) | \
+ (1 << LOG_SCALER) | \
+ (1 << LOG_DML) | \
+ (1 << LOG_HW_LINK_TRAINING) | \
+ (1 << LOG_HW_AUDIO)| \
+ (1 << LOG_BANDWIDTH_CALCS)*/
/* ----------- Object init and destruction ----------- */
static bool construct(struct dc_context *ctx, struct dal_logger *logger)
{
- uint32_t i;
/* malloc buffer and init offsets */
-
logger->log_buffer_size = DAL_LOGGER_BUFFER_MAX_SIZE;
logger->log_buffer = (char *)dm_alloc(logger->log_buffer_size *
sizeof(char));
@@ -299,8 +102,6 @@ static bool construct(struct dc_context *ctx, struct dal_logger *logger)
if (!logger->log_buffer)
return false;
- /* todo: Fill buffer with \0 if not done by dal_alloc */
-
/* Initialize both offsets to start of buffer (empty) */
logger->buffer_read_offset = 0;
logger->buffer_write_offset = 0;
@@ -314,20 +115,7 @@ static bool construct(struct dc_context *ctx, struct dal_logger *logger)
logger->ctx = ctx;
- /* malloc and init minor mask array */
- logger->log_enable_mask_minors =
- (uint32_t *)dm_alloc(NUM_ELEMENTS(log_major_mask_info_tbl)
- * sizeof(uint32_t));
- if (!logger->log_enable_mask_minors)
- return false;
-
- /* Set default values for mask */
- for (i = 0; i < NUM_ELEMENTS(log_major_mask_info_tbl); i++) {
-
- uint32_t dflt_mask = log_major_mask_info_tbl[i].default_mask;
-
- logger->log_enable_mask_minors[i] = dflt_mask;
- }
+ logger->mask = DC_DEFAULT_LOG_MASK;
return true;
}
@@ -338,11 +126,6 @@ static void destruct(struct dal_logger *logger)
dm_free(logger->log_buffer);
logger->log_buffer = NULL;
}
-
- if (logger->log_enable_mask_minors) {
- dm_free(logger->log_enable_mask_minors);
- logger->log_enable_mask_minors = NULL;
- }
}
struct dal_logger *dal_logger_create(struct dc_context *ctx)
@@ -373,28 +156,13 @@ uint32_t dal_logger_destroy(struct dal_logger **logger)
/* ------------------------------------------------------------------------ */
-static void lock(struct dal_logger *logger)
-{
- /* Todo: lock mutex? */
-}
-static void unlock(struct dal_logger *logger)
-{
- /* Todo: unlock mutex */
-}
-
-bool dal_logger_should_log(
+static bool dal_logger_should_log(
struct dal_logger *logger,
- enum log_major major,
- enum log_minor minor)
+ enum dc_log_type log_type)
{
- if (major < LOG_MAJOR_COUNT) {
-
- uint32_t minor_mask = logger->log_enable_mask_minors[major];
-
- if ((minor_mask & (1 << minor)) != 0)
- return true;
- }
+ if (logger->mask & (1 << log_type))
+ return true;
return false;
}
@@ -407,8 +175,8 @@ static void log_to_debug_console(struct log_entry *entry)
return;
if (entry->buf_offset) {
- switch (entry->major) {
- case LOG_MAJOR_ERROR:
+ switch (entry->type) {
+ case LOG_ERROR:
dm_error("%s", entry->buf);
break;
default:
@@ -519,56 +287,21 @@ static void log_to_internal_buffer(struct log_entry *entry)
}
}
-
- unlock(logger);
}
-static void log_timestamp(struct log_entry *entry)
+static void log_heading(struct log_entry *entry)
{
-/* dal_logger_append(entry, "00:00:00 ");*/
-}
-
-static void log_major_minor(struct log_entry *entry)
-{
- uint32_t i;
- enum log_major major = entry->major;
- enum log_minor minor = entry->minor;
-
- for (i = 0; i < NUM_ELEMENTS(log_major_mask_info_tbl); i++) {
-
- const struct log_major_mask_info *maj_mask_info =
- &log_major_mask_info_tbl[i];
-
- if (maj_mask_info->major_info.major == major) {
+ int j;
- dal_logger_append(entry, "[%s_",
- maj_mask_info->major_info.major_name);
+ for (j = 0; j < NUM_ELEMENTS(log_type_info_tbl); j++) {
- if (maj_mask_info->minor_tbl != NULL) {
- uint32_t j;
+ const struct dc_log_type_info *info = &log_type_info_tbl[j];
- for (j = 0; j < maj_mask_info->tbl_element_cnt; j++) {
-
- const struct log_minor_info *min_info = &maj_mask_info->minor_tbl[j];
-
- if (min_info->minor == minor)
- dal_logger_append(entry, "%s]\t", min_info->minor_name);
- }
- }
-
- break;
- }
+ if (info->type == entry->type)
+ dm_logger_append(entry, "[%s]\t", info->name);
}
}
-static void log_heading(struct log_entry *entry,
- enum log_major major,
- enum log_minor minor)
-{
- log_timestamp(entry);
- log_major_minor(entry);
-}
-
static void append_entry(
struct log_entry *entry,
char *buffer,
@@ -591,23 +324,20 @@ static void append_entry(
/* Warning: Be careful that 'msg' is null terminated and the total size is
* less than DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE (256) including '\0'
*/
-void dal_logger_write(
+void dm_logger_write(
struct dal_logger *logger,
- enum log_major major,
- enum log_minor minor,
+ enum dc_log_type log_type,
const char *msg,
...)
{
- if (logger && dal_logger_should_log(logger, major, minor)) {
+ if (logger && dal_logger_should_log(logger, log_type)) {
uint32_t size;
va_list args;
- char buffer[DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE];
+ char buffer[LOG_MAX_LINE_SIZE];
struct log_entry entry;
va_start(args, msg);
- entry.major = LOG_MAJOR_COUNT;
- entry.minor = 0;
entry.logger = logger;
entry.buf = buffer;
@@ -615,13 +345,12 @@ void dal_logger_write(
entry.buf_offset = 0;
entry.max_buf_bytes = DAL_LOGGER_BUFFER_MAX_SIZE * sizeof(char);
- entry.major = major;
- entry.minor = minor;
+ entry.type = log_type;
- log_heading(&entry, major, minor);
+ log_heading(&entry);
size = dm_log_to_buffer(
- buffer, DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE, msg, args);
+ buffer, LOG_MAX_LINE_SIZE, msg, args);
entry.buf_offset += size;
@@ -635,10 +364,10 @@ void dal_logger_write(
}
}
-/* Same as dal_logger_write, except without open() and close(), which must
+/* Same as dm_logger_write, except without open() and close(), which must
* be done separately.
*/
-void dal_logger_append(
+void dm_logger_append(
struct log_entry *entry,
const char *msg,
...)
@@ -653,18 +382,18 @@ void dal_logger_append(
logger = entry->logger;
if (logger && logger->open_count > 0 &&
- dal_logger_should_log(logger, entry->major, entry->minor)) {
+ dal_logger_should_log(logger, entry->type)) {
uint32_t size;
va_list args;
- char buffer[DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE];
+ char buffer[LOG_MAX_LINE_SIZE];
va_start(args, msg);
size = dm_log_to_buffer(
- buffer, DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE, msg, args);
+ buffer, LOG_MAX_LINE_SIZE, msg, args);
- if (size < DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE - 1) {
+ if (size < LOG_MAX_LINE_SIZE - 1) {
append_entry(entry, buffer, size);
} else {
append_entry(entry, "LOG_ERROR, line too long\n", 27);
@@ -674,95 +403,17 @@ void dal_logger_append(
}
}
-uint32_t dal_logger_read(
- struct dal_logger *logger, /* <[in] */
- uint32_t output_buffer_size, /* <[in] */
- char *output_buffer, /* >[out] */
- uint32_t *bytes_read, /* >[out] */
- bool single_line)
-{
- uint32_t bytes_remaining = 0;
- uint32_t bytes_read_count = 0;
- bool keep_reading = true;
-
- if (!logger || output_buffer == NULL || output_buffer_size == 0) {
- BREAK_TO_DEBUGGER();
- *bytes_read = 0;
- return 0;
- }
-
- lock(logger);
-
- /* Read until null terminator (if single_line==true,
- * max buffer size, or until we've read everything new
- */
-
- do {
- char cur;
-
- /* Stop when we've read everything */
- if (logger->buffer_read_offset ==
- logger->buffer_write_offset) {
-
- break;
- }
-
- cur = logger->log_buffer[logger->buffer_read_offset];
- logger->buffer_read_offset++;
-
- /* Wrap read pointer if at end */
- if (logger->buffer_read_offset == logger->log_buffer_size) {
-
- logger->buffer_read_offset = 0;
- logger->read_wrap_count++;
- }
-
- /* Don't send null terminators to buffer */
- if (cur != '\0') {
- output_buffer[bytes_read_count] = cur;
- bytes_read_count++;
- } else if (single_line) {
- keep_reading = false;
- }
-
- } while (bytes_read_count <= output_buffer_size && keep_reading);
-
- /* We assume that reading can never be ahead of writing */
- if (logger->write_wrap_count > logger->read_wrap_count) {
- bytes_remaining = logger->log_buffer_size -
- logger->buffer_read_offset +
- logger->buffer_write_offset;
- } else {
- bytes_remaining = logger->buffer_write_offset -
- logger->buffer_read_offset;
- }
-
- /* reset write/read wrap count to 0 if we've read everything */
- if (bytes_remaining == 0) {
-
- logger->write_wrap_count = 0;
- logger->read_wrap_count = 0;
- }
-
- *bytes_read = bytes_read_count;
- unlock(logger);
-
- return bytes_remaining;
-}
-
-void dal_logger_open(
+void dm_logger_open(
struct dal_logger *logger,
struct log_entry *entry, /* out */
- enum log_major major,
- enum log_minor minor)
+ enum dc_log_type log_type)
{
if (!entry) {
BREAK_TO_DEBUGGER();
return;
}
- entry->major = LOG_MAJOR_COUNT;
- entry->minor = 0;
+ entry->type = log_type;
entry->logger = logger;
entry->buf = dm_alloc(DAL_LOGGER_BUFFER_MAX_SIZE * sizeof(char));
@@ -771,13 +422,11 @@ void dal_logger_open(
entry->max_buf_bytes = DAL_LOGGER_BUFFER_MAX_SIZE * sizeof(char);
logger->open_count++;
- entry->major = major;
- entry->minor = minor;
- log_heading(entry, major, minor);
+ log_heading(entry);
}
-void dal_logger_close(struct log_entry *entry)
+void dm_logger_close(struct log_entry *entry)
{
struct dal_logger *logger = entry->logger;
@@ -804,148 +453,3 @@ cleanup:
entry->max_buf_bytes = 0;
}
}
-
-uint32_t dal_logger_get_mask(
- struct dal_logger *logger,
- enum log_major lvl_major, enum log_minor lvl_minor)
-{
- uint32_t log_mask = 0;
-
- if (logger && lvl_major < LOG_MAJOR_COUNT)
- log_mask = logger->log_enable_mask_minors[lvl_major];
-
- log_mask &= 1 << lvl_minor;
- return log_mask;
-}
-
-uint32_t dal_logger_set_mask(
- struct dal_logger *logger,
- enum log_major lvl_major, enum log_minor lvl_minor)
-{
-
- if (logger && lvl_major < LOG_MAJOR_COUNT) {
- if (lvl_minor == LOG_MINOR_MASK_ALL) {
- logger->log_enable_mask_minors[lvl_major] = 0xFFFFFFFF;
- } else {
- logger->log_enable_mask_minors[lvl_major] |=
- (1 << lvl_minor);
- }
- return 0;
- }
- return 1;
-}
-
-uint32_t dal_logger_get_masks(
- struct dal_logger *logger,
- enum log_major lvl_major)
-{
- uint32_t log_mask = 0;
-
- if (logger && lvl_major < LOG_MAJOR_COUNT)
- log_mask = logger->log_enable_mask_minors[lvl_major];
-
- return log_mask;
-}
-
-void dal_logger_set_masks(
- struct dal_logger *logger,
- enum log_major lvl_major, uint32_t log_mask)
-{
- if (logger && lvl_major < LOG_MAJOR_COUNT)
- logger->log_enable_mask_minors[lvl_major] = log_mask;
-}
-
-uint32_t dal_logger_unset_mask(
- struct dal_logger *logger,
- enum log_major lvl_major, enum log_minor lvl_minor)
-{
-
- if (lvl_major < LOG_MAJOR_COUNT) {
- if (lvl_minor == LOG_MINOR_MASK_ALL) {
- logger->log_enable_mask_minors[lvl_major] = 0;
- } else {
- logger->log_enable_mask_minors[lvl_major] &=
- ~(1 << lvl_minor);
- }
- return 0;
- }
- return 1;
-}
-
-uint32_t dal_logger_get_flags(
- struct dal_logger *logger)
-{
-
- return logger->flags.value;
-}
-
-void dal_logger_set_flags(
- struct dal_logger *logger,
- union logger_flags flags)
-{
-
- logger->flags = flags;
-}
-
-uint32_t dal_logger_get_buffer_size(struct dal_logger *logger)
-{
- return DAL_LOGGER_BUFFER_MAX_SIZE;
-}
-
-uint32_t dal_logger_set_buffer_size(
- struct dal_logger *logger,
- uint32_t new_size)
-{
- /* ToDo: implement dynamic size */
-
- /* return new size */
- return DAL_LOGGER_BUFFER_MAX_SIZE;
-}
-
-const struct log_major_info *dal_logger_enum_log_major_info(
- struct dal_logger *logger,
- unsigned int enum_index)
-{
- const struct log_major_info *major_info;
-
- if (enum_index >= NUM_ELEMENTS(log_major_mask_info_tbl))
- return NULL;
-
- major_info = &log_major_mask_info_tbl[enum_index].major_info;
- return major_info;
-}
-
-const struct log_minor_info *dal_logger_enum_log_minor_info(
- struct dal_logger *logger,
- enum log_major major,
- unsigned int enum_index)
-{
- const struct log_minor_info *minor_info = NULL;
- uint32_t i;
-
- for (i = 0; i < NUM_ELEMENTS(log_major_mask_info_tbl); i++) {
-
- const struct log_major_mask_info *maj_mask_info =
- &log_major_mask_info_tbl[i];
-
- if (maj_mask_info->major_info.major == major) {
-
- if (maj_mask_info->minor_tbl != NULL) {
- uint32_t j;
-
- for (j = 0; j < maj_mask_info->tbl_element_cnt; j++) {
-
- minor_info = &maj_mask_info->minor_tbl[j];
-
- if (minor_info->minor == enum_index)
- return minor_info;
- }
- }
-
- break;
- }
- }
- return NULL;
-
-}
-
diff --git a/drivers/gpu/drm/amd/dal/dc/basics/logger.h b/drivers/gpu/drm/amd/dal/dc/basics/logger.h
index 12d8ae6b18bb..2f7a5df4c811 100644
--- a/drivers/gpu/drm/amd/dal/dc/basics/logger.h
+++ b/drivers/gpu/drm/amd/dal/dc/basics/logger.h
@@ -33,7 +33,7 @@
/*Connectivity log needs to output EDID, which needs at lease 256x3 bytes,
* change log line size to 896 to meet the request.
*/
-#define DAL_LOGGER_BUFFER_MAX_LOG_LINE_SIZE 896
+#define LOG_MAX_LINE_SIZE 896
#include "include/logger_types.h"
@@ -58,7 +58,7 @@ struct dal_logger {
char *log_buffer; /* Pointer to malloc'ed buffer */
uint32_t log_buffer_size; /* Size of circular buffer */
- uint32_t *log_enable_mask_minors; /*array of masks for major elements*/
+ uint32_t mask; /*array of masks for major elements*/
union logger_flags flags;
struct dc_context *ctx;
diff --git a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
index f98f2882b0fd..0647156f313c 100644
--- a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
+++ b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
@@ -3374,9 +3374,7 @@ static enum bp_result patch_bios_image_from_ext_display_connection_info(
opm_object,
&ext_display_connection_info_tbl) != BP_RESULT_OK) {
- dal_logger_write(bp->base.ctx->logger,
- LOG_MAJOR_BIOS,
- LOG_MINOR_BIOS_CMD_TABLE,
+ dm_logger_write(bp->base.ctx->logger, LOG_BIOS,
"%s: Failed to read Connection Info Table", __func__);
return BP_RESULT_UNSUPPORTED;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index e039cc4ec54c..47db0fd82fe6 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -653,9 +653,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)
core_dc->public.config.gpu_vm_support = init_params->flags.gpu_vm_support;
- dal_logger_write(core_dc->ctx->logger,
- LOG_MAJOR_INTERFACE_TRACE,
- LOG_MINOR_COMPONENT_DC,
+ dm_logger_write(core_dc->ctx->logger, LOG_DC,
"Display Core initialized\n");
return &core_dc->public;
@@ -733,9 +731,7 @@ bool dc_validate_resources(
context_alloc_fail:
if (result != DC_OK) {
- dal_logger_write(core_dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_TOPOLOGY_MANAGER,
+ dm_logger_write(core_dc->ctx->logger, LOG_WARNING,
"%s:resource validation failed, dc_status:%d\n",
__func__,
result);
@@ -765,9 +761,7 @@ bool dc_validate_guaranteed(
context_alloc_fail:
if (result != DC_OK) {
- dal_logger_write(core_dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_TOPOLOGY_MANAGER,
+ dm_logger_write(core_dc->ctx->logger, LOG_WARNING,
"%s:guaranteed validation failed, dc_status:%d\n",
__func__,
result);
@@ -1044,9 +1038,7 @@ bool dc_commit_targets(
if (false == targets_changed(core_dc, targets, target_count))
return DC_OK;
- dal_logger_write(core_dc->ctx->logger,
- LOG_MAJOR_INTERFACE_TRACE,
- LOG_MINOR_COMPONENT_DC,
+ dm_logger_write(core_dc->ctx->logger, LOG_DC,
"%s: %d targets\n",
__func__,
target_count);
@@ -1056,8 +1048,7 @@ bool dc_commit_targets(
dc_target_log(target,
core_dc->ctx->logger,
- LOG_MAJOR_INTERFACE_TRACE,
- LOG_MINOR_COMPONENT_DC);
+ LOG_DC);
set[i].target = targets[i];
set[i].surface_count = 0;
@@ -1070,9 +1061,7 @@ bool dc_commit_targets(
result = core_dc->res_pool->funcs->validate_with_context(core_dc, set, target_count, context);
if (result != DC_OK){
- dal_logger_write(core_dc->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_DC,
+ dm_logger_write(core_dc->ctx->logger, LOG_ERROR,
"%s: Context validation failed! dc_status:%d\n",
__func__,
result);
@@ -1196,9 +1185,7 @@ bool dc_pre_update_surfaces_to_target(
resource_validate_ctx_copy_construct(core_dc->current_context, context);
- dal_logger_write(core_dc->ctx->logger,
- LOG_MAJOR_INTERFACE_TRACE,
- LOG_MINOR_COMPONENT_DC,
+ dm_logger_write(core_dc->ctx->logger, LOG_DC,
"%s: commit %d surfaces to target 0x%x\n",
__func__,
new_surface_count,
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
index 39bf829a9fa6..44ed32575b02 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
@@ -58,8 +58,7 @@
#endif
#define LINK_INFO(...) \
- dal_logger_write(dc_ctx->logger, \
- LOG_MAJOR_HW_TRACE, LOG_MINOR_HW_TRACE_HOTPLUG, \
+ dm_logger_write(dc_ctx->logger, LOG_HW_HOTPLUG, \
__VA_ARGS__)
/*******************************************************************************
@@ -499,9 +498,7 @@ static enum dc_edid_status read_edid(
&sink->public.edid_caps);
--edid_retry;
if (edid_status == EDID_BAD_CHECKSUM)
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_DETECTION_EDID_PARSER,
+ dm_logger_write(link->ctx->logger, LOG_WARNING,
"Bad EDID checksum, retry remain: %d\n",
edid_retry);
} while (edid_status == EDID_BAD_CHECKSUM && edid_retry > 0);
@@ -705,15 +702,11 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
switch (edid_status) {
case EDID_BAD_CHECKSUM:
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_DETECTION_EDID_PARSER,
+ dm_logger_write(link->ctx->logger, LOG_ERROR,
"EDID checksum invalid.\n");
break;
case EDID_NO_RESPONSE:
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_DETECTION_EDID_PARSER,
+ dm_logger_write(link->ctx->logger, LOG_ERROR,
"No EDID read.\n");
return false;
@@ -734,9 +727,7 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
"%s: [Block %d] ", sink->public.edid_caps.display_name, i);
}
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_DETECTION,
- LOG_MINOR_DETECTION_EDID_PARSER,
+ dm_logger_write(link->ctx->logger, LOG_DETECTION_EDID_PARSER,
"%s: "
"manufacturer_id = %X, "
"product_id = %X, "
@@ -757,9 +748,7 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
sink->public.edid_caps.audio_mode_count);
for (i = 0; i < sink->public.edid_caps.audio_mode_count; i++) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_DETECTION,
- LOG_MINOR_DETECTION_EDID_PARSER,
+ dm_logger_write(link->ctx->logger, LOG_DETECTION_EDID_PARSER,
"%s: mode number = %d, "
"format_code = %d, "
"channel_count = %d, "
@@ -1010,8 +999,7 @@ static bool construct(
}
break;
default:
- dal_logger_write(dc_ctx->logger,
- LOG_MAJOR_WARNING, LOG_MINOR_TM_LINK_SRV,
+ dm_logger_write(dc_ctx->logger, LOG_WARNING,
"Unsupported Connector type:%d!\n", link->link_id.id);
goto create_fail;
}
@@ -1198,8 +1186,7 @@ static void dpcd_configure_panel_mode(
ASSERT(result == DDC_RESULT_SUCESSFULL);
}
}
- dal_logger_write(link->ctx->logger, LOG_MAJOR_DETECTION,
- LOG_MINOR_DETECTION_DP_CAPS,
+ dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
"Link: %d eDP panel mode supported: %d "
"eDP panel mode enabled: %d \n",
link->public.link_index,
@@ -1430,8 +1417,7 @@ bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
int i;
uint32_t dmcu_status;
- dal_logger_write(ctx->logger, LOG_MAJOR_BACKLIGHT,
- LOG_MINOR_BACKLIGHT_INTERFACE,
+ dm_logger_write(ctx->logger, LOG_BACKLIGHT,
"New Backlight level: %d (0x%X)\n", level, level);
dmcu_status = dm_read_reg(ctx, mmDMCU_STATUS);
@@ -1475,8 +1461,7 @@ bool dc_link_set_abm_level(const struct dc_link *dc_link, uint32_t level)
struct core_link *link = DC_LINK_TO_CORE(dc_link);
struct dc_context *ctx = link->ctx;
- dal_logger_write(ctx->logger, LOG_MAJOR_BACKLIGHT,
- LOG_MINOR_BACKLIGHT_INTERFACE,
+ dm_logger_write(ctx->logger, LOG_BACKLIGHT,
"New abm level: %d (0x%X)\n", level, level);
link->link_enc->funcs->set_dmcu_abm_level(link->link_enc, level);
@@ -1763,26 +1748,20 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
link, pipe_ctx->stream_enc, &proposed_table);
}
else
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_DC,
+ dm_logger_write(link->ctx->logger, LOG_WARNING,
"Failed to update"
"MST allocation table for"
"pipe idx:%d\n",
pipe_ctx->pipe_idx);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_MST,
- LOG_MINOR_MST_PROGRAMMING,
+ dm_logger_write(link->ctx->logger, LOG_MST,
"%s "
"stream_count: %d: \n ",
__func__,
link->mst_stream_alloc_table.stream_count);
for (i = 0; i < MAX_CONTROLLER_NUM; i++) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_MST,
- LOG_MINOR_MST_PROGRAMMING,
+ dm_logger_write(link->ctx->logger, LOG_MST,
"stream_enc[%d]: 0x%x "
"stream[%d].vcp_id: %d "
"stream[%d].slot_count: %d\n",
@@ -1859,9 +1838,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
link, pipe_ctx->stream_enc, &proposed_table);
}
else {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_DC,
+ dm_logger_write(link->ctx->logger, LOG_WARNING,
"Failed to update"
"MST allocation table for"
"pipe idx:%d\n",
@@ -1869,18 +1846,14 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
}
}
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_MST,
- LOG_MINOR_MST_PROGRAMMING,
+ dm_logger_write(link->ctx->logger, LOG_MST,
"%s"
"stream_count: %d: ",
__func__,
link->mst_stream_alloc_table.stream_count);
for (i = 0; i < MAX_CONTROLLER_NUM; i++) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_MST,
- LOG_MINOR_MST_PROGRAMMING,
+ dm_logger_write(link->ctx->logger, LOG_MST,
"stream_enc[%d]: 0x%x "
"stream[%d].vcp_id: %d "
"stream[%d].slot_count: %d\n",
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c
index 1a7a871ab3e7..ffcd2a10d6f6 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c
@@ -541,10 +541,8 @@ static uint8_t aux_read_edid_block(
&cmd);
if (false == result)
- dal_logger_write(
- ddc->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_DISPLAY_CAPABILITY_SERVICE,
+ dm_logger_write(
+ ddc->ctx->logger, LOG_ERROR,
"%s: Writing of EDID Segment (0x30) failed!\n",
__func__);
}
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c
index 77b90ca4083f..a2064acffcaa 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c
@@ -81,9 +81,7 @@ static void wait_for_training_aux_rd_interval(
udelay(default_wait_in_micro_secs);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s:\n wait = %d\n",
__func__,
default_wait_in_micro_secs);
@@ -99,9 +97,7 @@ static void dpcd_set_training_pattern(
&dpcd_pattern.raw,
1);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s\n %x pattern = %x\n",
__func__,
DPCD_ADDRESS_TRAINING_PATTERN_SET,
@@ -138,9 +134,7 @@ static void dpcd_set_link_settings(
core_link_write_dpcd(link, DPCD_ADDRESS_DOWNSPREAD_CNTL,
&downspread.raw, sizeof(downspread));
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s\n %x rate = %x\n %x lane = %x\n %x spread = %x\n",
__func__,
DPCD_ADDRESS_LINK_BW_SET,
@@ -175,9 +169,7 @@ static enum dpcd_training_patterns
break;
default:
ASSERT(0);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s: Invalid HW Training pattern: %d\n",
__func__, pattern);
break;
@@ -210,9 +202,7 @@ static void dpcd_set_lt_pattern_and_lane_settings(
dpcd_lt_buffer[DPCD_ADDRESS_TRAINING_PATTERN_SET - dpcd_base_lt_offset]
= dpcd_pattern.raw;
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s\n %x pattern = %x\n",
__func__,
DPCD_ADDRESS_TRAINING_PATTERN_SET,
@@ -247,9 +237,7 @@ static void dpcd_set_lt_pattern_and_lane_settings(
dpcd_lane,
size_in_bytes);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s:\n %x VS set = %x PE set = %x \
max VS Reached = %x max PE Reached = %x\n",
__func__,
@@ -487,17 +475,13 @@ static void get_lane_status_and_drive_settings(
ln_status_updated->raw = dpcd_buf[2];
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s:\n%x Lane01Status = %x\n %x Lane23Status = %x\n ",
__func__,
DPCD_ADDRESS_LANE_01_STATUS, dpcd_buf[0],
DPCD_ADDRESS_LANE_23_STATUS, dpcd_buf[1]);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s:\n %x Lane01AdjustRequest = %x\n %x Lane23AdjustRequest = %x\n",
__func__,
DPCD_ADDRESS_ADJUST_REQUEST_LANE0_1,
@@ -591,9 +575,7 @@ static void dpcd_set_lane_settings(
}
*/
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
+ dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
"%s\n %x VS set = %x PE set = %x \
max VS Reached = %x max PE Reached = %x\n",
__func__,
@@ -708,9 +690,7 @@ static bool perform_post_lt_adj_req_sequence(
}
if (!req_drv_setting_changed) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_LINK_SERVICE,
+ dm_logger_write(link->ctx->logger, LOG_WARNING,
"%s: Post Link Training Adjust Request Timed out\n",
__func__);
@@ -718,9 +698,7 @@ static bool perform_post_lt_adj_req_sequence(
return true;
}
}
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_LINK_SERVICE,
+ dm_logger_write(link->ctx->logger, LOG_WARNING,
"%s: Post Link Training Adjust Request limit reached\n",
__func__);
@@ -912,9 +890,7 @@ static bool perform_clock_recovery_sequence(
if (retry_count >= LINK_TRAINING_MAX_CR_RETRY) {
ASSERT(0);
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_LINK_SERVICE,
+ dm_logger_write(link->ctx->logger, LOG_ERROR,
"%s: Link Training Error, could not \
get CR after %d tries. \
Possibly voltage swing issue", __func__,
@@ -1404,9 +1380,7 @@ static bool hpd_rx_irq_check_link_loss_status(
if (dpcd_result != DC_OK) {
irq_reg_rx_power_state = DP_PWR_STATE_D0;
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_HPD_IRQ,
+ dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
"%s: DPCD read failed to obtain power state.\n",
__func__);
}
@@ -1444,9 +1418,7 @@ static bool hpd_rx_irq_check_link_loss_status(
!hpd_irq_dpcd_data->bytes.lane_status_updated.bits.
INTERLANE_ALIGN_DONE) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_HPD_IRQ,
+ dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
"%s: Link Status changed.\n",
__func__);
@@ -1807,9 +1779,7 @@ bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link)
* PSR and device auto test, refer to function handle_sst_hpd_irq
* in DAL2.1*/
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_HPD_IRQ,
+ dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
"%s: Got short pulse HPD on link %d\n",
__func__, link->public.link_index);
@@ -1821,9 +1791,7 @@ bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link)
result = read_hpd_rx_irq_data(link, &hpd_irq_dpcd_data);
if (result != DC_OK) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_HPD_IRQ,
+ dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
"%s: DPCD read failed to obtain irq data\n",
__func__);
return false;
@@ -1839,9 +1807,7 @@ bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link)
}
if (!allow_hpd_rx_irq(link)) {
- dal_logger_write(link->ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_HPD_IRQ,
+ dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
"%s: skipping HPD handling on %d\n",
__func__, link->public.link_index);
return false;
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c b/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c
index 1541913ff405..204b49bae9ee 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c
@@ -559,9 +559,7 @@ bool resource_build_scaling_params(
pipe_ctx->xfm, &pipe_ctx->scl_data, &surface->scaling_quality);
}
- dal_logger_write(pipe_ctx->stream->ctx->logger,
- LOG_MAJOR_DCP,
- LOG_MINOR_DCP_SCALER,
+ dm_logger_write(pipe_ctx->stream->ctx->logger, LOG_SCALER,
"%s: Viewport:\nheight:%d width:%d x:%d "
"y:%d\n dst_rect:\nheight:%d width:%d x:%d "
"y:%d\n",
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
index bfc94d7fca06..48eb7b0e0350 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
@@ -285,18 +285,16 @@ uint32_t dc_target_get_scanoutpos(
void dc_target_log(
const struct dc_target *dc_target,
- struct dal_logger *dal_logger,
- enum log_major log_major,
- enum log_minor log_minor)
+ struct dal_logger *dm_logger,
+ enum dc_log_type log_type)
{
int i;
const struct core_target *core_target =
CONST_DC_TARGET_TO_CORE(dc_target);
- dal_logger_write(dal_logger,
- log_major,
- log_minor,
+ dm_logger_write(dm_logger,
+ log_type,
"core_target 0x%x: stream_count=%d\n",
core_target,
core_target->public.stream_count);
@@ -305,9 +303,8 @@ void dc_target_log(
const struct core_stream *core_stream =
DC_STREAM_TO_CORE(core_target->public.streams[i]);
- dal_logger_write(dal_logger,
- log_major,
- log_minor,
+ dm_logger_write(dm_logger,
+ log_type,
"core_stream 0x%x: src: %d, %d, %d, %d; dst: %d, %d, %d, %d;\n",
core_stream,
core_stream->public.src.x,
@@ -318,22 +315,19 @@ void dc_target_log(
core_stream->public.dst.y,
core_stream->public.dst.width,
core_stream->public.dst.height);
- dal_logger_write(dal_logger,
- log_major,
- log_minor,
+ dm_logger_write(dm_logger,
+ log_type,
"\tpix_clk_khz: %d, h_total: %d, v_total: %d\n",
core_stream->public.timing.pix_clk_khz,
core_stream->public.timing.h_total,
core_stream->public.timing.v_total);
- dal_logger_write(dal_logger,
- log_major,
- log_minor,
+ dm_logger_write(dm_logger,
+ log_type,
"\tsink name: %s, serial: %d\n",
core_stream->sink->public.edid_caps.display_name,
core_stream->sink->public.edid_caps.serial_number);
- dal_logger_write(dal_logger,
- log_major,
- log_minor,
+ dm_logger_write(dm_logger,
+ log_type,
"\tlink: %d\n",
core_stream->sink->link->public.link_index);
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index 2f8a552b9f71..2a6117ae85e3 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -342,9 +342,8 @@ void dc_target_retain(const struct dc_target *dc_target);
void dc_target_release(const struct dc_target *dc_target);
void dc_target_log(
const struct dc_target *dc_target,
- struct dal_logger *dal_logger,
- enum log_major log_major,
- enum log_minor log_minor);
+ struct dal_logger *dc_logger,
+ enum dc_log_type log_type);
uint8_t dc_get_current_target_count(const struct dc *dc);
struct dc_target *dc_get_target_at_index(const struct dc *dc, uint8_t i);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce/dce110_stream_encoder.c b/drivers/gpu/drm/amd/dal/dc/dce/dce110_stream_encoder.c
index 75bb309fe1d4..f2f66ea49fea 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce/dce110_stream_encoder.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce/dce110_stream_encoder.c
@@ -165,10 +165,8 @@ static void dce110_update_hdmi_info_packet(
break;
default:
/* invalid HW packet index */
- dal_logger_write(
- ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(
+ ctx->logger, LOG_WARNING,
"Invalid HW packet index: %s()\n",
__func__);
return;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c b/drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c
index 2701ece250d8..6296d8fda690 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c
@@ -66,8 +66,7 @@ static void write_indirect_azalia_reg(struct audio *audio,
REG_SET(AZALIA_F0_CODEC_ENDPOINT_DATA, 0,
AZALIA_ENDPOINT_REG_DATA, reg_data);
- dal_logger_write(CTX->logger,
- LOG_MAJOR_HW_TRACE, LOG_MINOR_HW_TRACE_AUDIO,
+ dm_logger_write(CTX->logger, LOG_HW_AUDIO,
"AUDIO:write_indirect_azalia_reg: index: %u data: %u\n",
reg_index, reg_data);
}
@@ -85,8 +84,7 @@ static uint32_t read_indirect_azalia_reg(struct audio *audio, uint32_t reg_index
/* AZALIA_F0_CODEC_ENDPOINT_DATA endpoint data */
value = REG_READ(AZALIA_F0_CODEC_ENDPOINT_DATA);
- dal_logger_write(CTX->logger,
- LOG_MAJOR_HW_TRACE, LOG_MINOR_HW_TRACE_AUDIO,
+ dm_logger_write(CTX->logger, LOG_HW_AUDIO,
"AUDIO:read_indirect_azalia_reg: index: %u data: %u\n",
reg_index, value);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_clock_source.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_clock_source.c
index 5bc7f8d9455d..0e81aec6ef78 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_clock_source.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_clock_source.c
@@ -280,9 +280,7 @@ static uint32_t calculate_pixel_clock_pll_dividers(
uint32_t max_ref_divider;
if (pll_settings->adjusted_pix_clk == 0) {
- dal_logger_write(calc_pll_cs->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
"%s Bad requested pixel clock", __func__);
return MAX_PLL_CALC_ERROR;
}
@@ -343,17 +341,13 @@ static uint32_t calculate_pixel_clock_pll_dividers(
* ## SVS Wed 15 Jul 2009 */
if (min_post_divider > max_post_divider) {
- dal_logger_write(calc_pll_cs->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
"%s Post divider range is invalid", __func__);
return MAX_PLL_CALC_ERROR;
}
if (min_ref_divider > max_ref_divider) {
- dal_logger_write(calc_pll_cs->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
"%s Reference divider range is invalid", __func__);
return MAX_PLL_CALC_ERROR;
}
@@ -470,9 +464,7 @@ static uint32_t dce110_get_pix_clk_dividers(
if (pix_clk_params == NULL || pll_settings == NULL
|| pix_clk_params->requested_pix_clk == 0) {
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_ERROR,
"%s: Invalid parameters!!\n", __func__);
return pll_calc_error;
}
@@ -516,9 +508,7 @@ static uint32_t dce110_get_pix_clk_dividers(
if (!pll_adjust_pix_clk(clk_src, pix_clk_params, pll_settings)) {
/* Should never happen, ASSERT and fill up values to be able
* to continue. */
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_ERROR,
"%s: Failed to adjust pixel clock!!", __func__);
pll_settings->actual_pix_clk =
pix_clk_params->requested_pix_clk;
@@ -840,16 +830,12 @@ static void get_ss_info_from_atombios(
uint32_t i;
if (ss_entries_num == NULL) {
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_SYNC,
- LOG_MINOR_SYNC_HW_CLOCK_ADJUST,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
"Invalid entry !!!\n");
return;
}
if (spread_spectrum_data == NULL) {
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_SYNC,
- LOG_MINOR_SYNC_HW_CLOCK_ADJUST,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
"Invalid array pointer!!!\n");
return;
}
@@ -892,9 +878,7 @@ static void get_ss_info_from_atombios(
++i, ++ss_info_cur, ++ss_data_cur) {
if (ss_info_cur->type.STEP_AND_DELAY_INFO != false) {
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_SYNC,
- LOG_MINOR_SYNC_HW_CLOCK_ADJUST,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
"Invalid ATOMBIOS SS Table!!!\n");
goto out_free_data;
}
@@ -904,13 +888,9 @@ static void get_ss_info_from_atombios(
if (as_signal == AS_SIGNAL_TYPE_HDMI
&& ss_info_cur->spread_spectrum_percentage > 6){
/* invalid input, do nothing */
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_SYNC,
- LOG_MINOR_SYNC_HW_CLOCK_ADJUST,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
"Invalid SS percentage ");
- dal_logger_write(clk_src->base.ctx->logger,
- LOG_MAJOR_SYNC,
- LOG_MINOR_SYNC_HW_CLOCK_ADJUST,
+ dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
"for HDMI in ATOMBIOS info Table!!!\n");
continue;
}
@@ -1022,16 +1002,12 @@ static bool calc_pll_max_vco_construct(
if (init_data->num_fract_fb_divider_decimal_point == 0 ||
init_data->num_fract_fb_divider_decimal_point_precision >
init_data->num_fract_fb_divider_decimal_point) {
- dal_logger_write(calc_pll_cs->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
"The dec point num or precision is incorrect!");
return false;
}
if (init_data->num_fract_fb_divider_decimal_point_precision == 0) {
- dal_logger_write(calc_pll_cs->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
"Incorrect fract feedback divider precision num!");
return false;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_compressor.c
index 8597d82b89b4..7612efb27939 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_compressor.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_compressor.c
@@ -130,10 +130,8 @@ static uint32_t lpt_memory_control_config(struct dce110_compressor *cp110,
LOW_POWER_TILING_NUM_PIPES);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT NUM_PIPES!!!",
__func__);
break;
@@ -178,10 +176,8 @@ static uint32_t lpt_memory_control_config(struct dce110_compressor *cp110,
LOW_POWER_TILING_NUM_BANKS);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT NUM_BANKS!!!",
__func__);
break;
@@ -214,10 +210,8 @@ static uint32_t lpt_memory_control_config(struct dce110_compressor *cp110,
LOW_POWER_TILING_PIPE_INTERLEAVE_SIZE);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT INTERLEAVE_SIZE!!!",
__func__);
break;
@@ -260,19 +254,15 @@ static uint32_t lpt_memory_control_config(struct dce110_compressor *cp110,
LOW_POWER_TILING_ROW_SIZE);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT ROW_SIZE!!!",
__func__);
break;
}
} else {
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: LPT MC Configuration is not provided",
__func__);
}
@@ -322,10 +312,8 @@ static void wait_for_fbc_state_changed(
}
if (counter == 10) {
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: wait counter exceeded, changes to HW not applied",
__func__);
}
@@ -538,10 +526,8 @@ void dce110_compressor_program_compressed_surface_address_and_pitch(
if (compressor->min_compress_ratio == FBC_COMPRESS_RATIO_1TO1)
fbc_pitch = fbc_pitch / 8;
else
- dal_logger_write(
- compressor->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ compressor->ctx->logger, LOG_WARNING,
"%s: Unexpected DCE11 compression ratio",
__func__);
@@ -705,10 +691,8 @@ void dce110_compressor_program_lpt_control(
LOW_POWER_TILING_MODE);
break;
default:
- dal_logger_write(
- compressor->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ compressor->ctx->logger, LOG_WARNING,
"%s: Invalid selected DRAM channels for LPT!!!",
__func__);
break;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
index 169077062854..2fd2bc794de4 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
@@ -1534,18 +1534,12 @@ static void set_plane_config(
struct resource_context *res_ctx)
{
struct mem_input *mi = pipe_ctx->mi;
- struct pipe_ctx *old_pipe = NULL;
struct dc_context *ctx = pipe_ctx->stream->ctx;
struct core_surface *surface = pipe_ctx->surface;
struct xfm_grph_csc_adjustment adjust;
struct out_csc_color_matrix tbl_entry;
unsigned int i;
- if (dc->current_context)
- old_pipe =
- &dc->current_context->
- res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
-
memset(&adjust, 0, sizeof(adjust));
memset(&tbl_entry, 0, sizeof(tbl_entry));
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
@@ -1963,9 +1957,7 @@ static void dce110_program_front_end_for_pipe(
&surface->public.tiling_info,
surface->public.rotation);
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_INTERFACE_TRACE,
- LOG_MINOR_COMPONENT_SURFACE,
+ dm_logger_write(dc->ctx->logger, LOG_SURFACE,
"Pipe:%d 0x%x: addr hi:0x%x, "
"addr low:0x%x, "
"src: %d, %d, %d,"
@@ -1988,9 +1980,7 @@ static void dce110_program_front_end_for_pipe(
pipe_ctx->surface->public.clip_rect.width,
pipe_ctx->surface->public.clip_rect.height);
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_INTERFACE_TRACE,
- LOG_MINOR_COMPONENT_SURFACE,
+ dm_logger_write(dc->ctx->logger, LOG_SURFACE,
"Pipe %d: width, height, x, y\n"
"viewport:%d, %d, %d, %d\n"
"recout: %d, %d, %d, %d\n",
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
index 6bdb2023b63a..c36cdadf35f2 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
@@ -651,9 +651,7 @@ static void link_encoder_edp_wait_for_hpd_ready(
dal_gpio_destroy_irq(&hpd);
if (false == edp_hpd_high) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: wait timed out!\n", __func__);
}
}
@@ -682,9 +680,7 @@ void dce110_link_encoder_edp_power_control(
/* Send VBIOS command to prompt eDP panel power */
- dal_logger_write(ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
"%s: Panel Power action: %s\n",
__func__, (power_up ? "On":"Off"));
@@ -701,16 +697,12 @@ void dce110_link_encoder_edp_power_control(
if (BP_RESULT_OK != bp_result) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Panel Power bp_result: %d\n",
__func__, bp_result);
}
} else {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
"%s: Skipping Panel Power action: %s\n",
__func__, (power_up ? "On":"Off"));
}
@@ -770,18 +762,14 @@ void dce110_link_encoder_edp_backlight_control(
}
if (enable && is_panel_backlight_on(enc110)) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
"%s: panel already powered up. Do nothing.\n",
__func__);
return;
}
if (!enable && !is_panel_powered_on(enc110)) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
"%s: panel already powered down. Do nothing.\n",
__func__);
return;
@@ -789,9 +777,7 @@ void dce110_link_encoder_edp_backlight_control(
/* Send VBIOS command to control eDP panel backlight */
- dal_logger_write(ctx->logger,
- LOG_MAJOR_HW_TRACE,
- LOG_MINOR_HW_TRACE_RESUME_S3,
+ dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
"%s: backlight action: %s\n",
__func__, (enable ? "On":"Off"));
@@ -1069,9 +1055,7 @@ bool dce110_link_encoder_construct(
enc110->base.preferred_engine = ENGINE_ID_UNKNOWN;
}
- dal_logger_write(init_data->ctx->logger,
- LOG_MAJOR_I2C_AUX,
- LOG_MINOR_I2C_AUX_CFG,
+ dm_logger_write(init_data->ctx->logger, LOG_I2C_AUX,
"Using channel: %s [%d]\n",
DECODE_CHANNEL_ID(init_data->channel),
init_data->channel);
@@ -1160,9 +1144,7 @@ void dce110_link_encoder_hw_init(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
@@ -1270,9 +1252,7 @@ void dce110_link_encoder_enable_tmds_output(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
@@ -1313,9 +1293,7 @@ void dce110_link_encoder_enable_dp_output(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
@@ -1356,9 +1334,7 @@ void dce110_link_encoder_enable_dp_mst_output(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
@@ -1403,9 +1379,7 @@ void dce110_link_encoder_disable_output(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
index 6da8310c6b88..758884803ef3 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
@@ -870,9 +870,7 @@ void dce110_allocate_mem_input(
} while (retry_count > 0);
if (field == 0)
- dal_logger_write(mi->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(mi->ctx->logger, LOG_ERROR,
"%s: DMIF allocation failed",
__func__);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c
index 8b9725c57e1e..62051abcfe2f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c
@@ -422,9 +422,7 @@ static void program_pwl(
}
if (counter == max_tries) {
- dal_logger_write(opp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(opp110->base.ctx->logger, LOG_WARNING,
"%s: regamma lut was not powered on "
"in a timely manner,"
" programming still proceeds\n",
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
index be67f04642da..db7686842e36 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
@@ -778,10 +778,8 @@ enum dc_status dce110_validate_bandwidth(
{
enum dc_status result = DC_ERROR_UNEXPECTED;
- dal_logger_write(
- dc->ctx->logger,
- LOG_MAJOR_BWM,
- LOG_MINOR_BWM_REQUIRED_BANDWIDTH_CALCS,
+ dm_logger_write(
+ dc->ctx->logger, LOG_BANDWIDTH_CALCS,
"%s: start",
__func__);
@@ -797,9 +795,7 @@ enum dc_status dce110_validate_bandwidth(
result = DC_OK;
if (result == DC_FAIL_BANDWIDTH_VALIDATE)
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_BWM,
- LOG_MINOR_BWM_MODE_VALIDATION,
+ dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_VALIDATION,
"%s: %dx%d@%d Bandwidth validation failed!\n",
__func__,
context->targets[0]->public.streams[0]->timing.h_addressable,
@@ -809,12 +805,11 @@ enum dc_status dce110_validate_bandwidth(
if (memcmp(&dc->current_context->bw_results,
&context->bw_results, sizeof(context->bw_results))) {
struct log_entry log_entry;
- dal_logger_open(
+ dm_logger_open(
dc->ctx->logger,
&log_entry,
- LOG_MAJOR_BWM,
- LOG_MINOR_BWM_REQUIRED_BANDWIDTH_CALCS);
- dal_logger_append(&log_entry, "%s: finish,\n"
+ LOG_BANDWIDTH_CALCS);
+ dm_logger_append(&log_entry, "%s: finish,\n"
"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
"stutMark_b: %d stutMark_a: %d\n",
__func__,
@@ -824,7 +819,7 @@ enum dc_status dce110_validate_bandwidth(
context->bw_results.urgent_wm_ns[0].a_mark,
context->bw_results.stutter_exit_wm_ns[0].b_mark,
context->bw_results.stutter_exit_wm_ns[0].a_mark);
- dal_logger_append(&log_entry,
+ dm_logger_append(&log_entry,
"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
"stutMark_b: %d stutMark_a: %d\n",
context->bw_results.nbp_state_change_wm_ns[1].b_mark,
@@ -833,7 +828,7 @@ enum dc_status dce110_validate_bandwidth(
context->bw_results.urgent_wm_ns[1].a_mark,
context->bw_results.stutter_exit_wm_ns[1].b_mark,
context->bw_results.stutter_exit_wm_ns[1].a_mark);
- dal_logger_append(&log_entry,
+ dm_logger_append(&log_entry,
"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
"stutMark_b: %d stutMark_a: %d stutter_mode_enable: %d\n",
context->bw_results.nbp_state_change_wm_ns[2].b_mark,
@@ -843,7 +838,7 @@ enum dc_status dce110_validate_bandwidth(
context->bw_results.stutter_exit_wm_ns[2].b_mark,
context->bw_results.stutter_exit_wm_ns[2].a_mark,
context->bw_results.stutter_mode_enable);
- dal_logger_append(&log_entry,
+ dm_logger_append(&log_entry,
"cstate: %d pstate: %d nbpstate: %d sync: %d dispclk: %d\n"
"sclk: %d sclk_sleep: %d yclk: %d blackout_recovery_time_us: %d\n",
context->bw_results.cpuc_state_change_enable,
@@ -855,7 +850,7 @@ enum dc_status dce110_validate_bandwidth(
context->bw_results.required_sclk_deep_sleep,
context->bw_results.required_yclk,
context->bw_results.blackout_recovery_time_us);
- dal_logger_close(&log_entry);
+ dm_logger_close(&log_entry);
}
return result;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator.c
index de948452cd7a..120f4bd619b5 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator.c
@@ -1844,8 +1844,7 @@ bool dce110_tg_set_blank(struct timing_generator *tg,
}
if (counter == 100) {
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"timing generator %d blank timing out.\n",
tg110->controller_id);
return false;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator_v.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator_v.c
index a34025aa8a34..aadeeb33c53f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator_v.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_timing_generator_v.c
@@ -112,8 +112,7 @@ static bool dce110_timing_generator_v_blank_crtc(struct timing_generator *tg)
}
if (!counter) {
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"timing generator %d blank timing out.\n",
tg110->controller_id);
return false;
@@ -635,8 +634,7 @@ static uint32_t dce110_timing_generator_v_get_vblank_counter(struct timing_gener
static bool dce110_timing_generator_v_did_triggered_reset_occur(
struct timing_generator *tg)
{
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"Timing Sync not supported on underlay pipe\n");
return false;
}
@@ -645,8 +643,7 @@ static void dce110_timing_generator_v_setup_global_swap_lock(
struct timing_generator *tg,
const struct dcp_gsl_params *gsl_params)
{
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"Timing Sync not supported on underlay pipe\n");
return;
}
@@ -655,8 +652,7 @@ static void dce110_timing_generator_v_enable_reset_trigger(
struct timing_generator *tg,
int source_tg_inst)
{
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"Timing Sync not supported on underlay pipe\n");
return;
}
@@ -664,8 +660,7 @@ static void dce110_timing_generator_v_enable_reset_trigger(
static void dce110_timing_generator_v_disable_reset_trigger(
struct timing_generator *tg)
{
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"Timing Sync not supported on underlay pipe\n");
return;
}
@@ -673,8 +668,7 @@ static void dce110_timing_generator_v_disable_reset_trigger(
static void dce110_timing_generator_v_tear_down_global_swap_lock(
struct timing_generator *tg)
{
- dal_logger_write(tg->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(tg->ctx->logger, LOG_ERROR,
"Timing Sync not supported on underlay pipe\n");
return;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
index 20d680ab0942..01168b46df84 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
@@ -566,9 +566,7 @@ int32_t dce110_transform_get_max_num_of_supported_lines(
break;
default:
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Invalid LB pixel depth",
__func__);
ASSERT_CRITICAL(false);
@@ -649,9 +647,7 @@ bool dce110_transform_get_current_pixel_storage_depth(
*depth = LB_PIXEL_DEPTH_36BPP;
break;
default:
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Invalid LB pixel depth",
__func__);
*depth = LB_PIXEL_DEPTH_30BPP;
@@ -762,9 +758,7 @@ bool dce110_transform_set_pixel_storage_depth(
if (!(xfm110->lb_pixel_depth_supported & depth)) {
/*we should use unsupported capabilities
* unless it is required by w/a*/
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Capability not supported",
__func__);
}
@@ -829,9 +823,7 @@ bool dce110_transform_v_get_current_pixel_storage_depth(
*depth = LB_PIXEL_DEPTH_36BPP;
break;
default:
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Invalid LB pixel depth",
__func__);
*depth = LB_PIXEL_DEPTH_30BPP;
@@ -900,9 +892,7 @@ bool dce110_transform_v_set_pixel_storage_depth(
if (!(xfm110->lb_pixel_depth_supported & depth)) {
/*we should use unsupported capabilities
* unless it is required by w/a*/
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Capability not supported",
__func__);
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_clock_source.c b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_clock_source.c
index 80aa6df99fc9..d9db22607300 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_clock_source.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_clock_source.c
@@ -58,9 +58,7 @@ uint32_t dce112_get_pix_clk_dividers(
if (pix_clk_params == NULL || pll_settings == NULL
|| pix_clk_params->requested_pix_clk == 0) {
- dal_logger_write(cs->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(cs->ctx->logger, LOG_ERROR,
"%s: Invalid parameters!!\n", __func__);
return 0;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_compressor.c b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_compressor.c
index 1940d9868e90..1b0792e0219a 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_compressor.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_compressor.c
@@ -130,10 +130,8 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
LOW_POWER_TILING_NUM_PIPES);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT NUM_PIPES!!!",
__func__);
break;
@@ -178,10 +176,8 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
LOW_POWER_TILING_NUM_BANKS);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT NUM_BANKS!!!",
__func__);
break;
@@ -214,10 +210,8 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
LOW_POWER_TILING_PIPE_INTERLEAVE_SIZE);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT INTERLEAVE_SIZE!!!",
__func__);
break;
@@ -260,19 +254,15 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
LOW_POWER_TILING_ROW_SIZE);
break;
default:
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT ROW_SIZE!!!",
__func__);
break;
}
} else {
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: LPT MC Configuration is not provided",
__func__);
}
@@ -322,10 +312,8 @@ static void wait_for_fbc_state_changed(
}
if (counter == 10) {
- dal_logger_write(
- cp110->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp110->base.ctx->logger, LOG_WARNING,
"%s: wait counter exceeded, changes to HW not applied",
__func__);
}
@@ -538,10 +526,8 @@ void dce112_compressor_program_compressed_surface_address_and_pitch(
if (compressor->min_compress_ratio == FBC_COMPRESS_RATIO_1TO1)
fbc_pitch = fbc_pitch / 8;
else
- dal_logger_write(
- compressor->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ compressor->ctx->logger, LOG_WARNING,
"%s: Unexpected DCE11 compression ratio",
__func__);
@@ -705,10 +691,8 @@ void dce112_compressor_program_lpt_control(
LOW_POWER_TILING_MODE);
break;
default:
- dal_logger_write(
- compressor->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ compressor->ctx->logger, LOG_WARNING,
"%s: Invalid selected DRAM channels for LPT!!!",
__func__);
break;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_opp_formatter.c b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_opp_formatter.c
index c39251a287af..2d9072138834 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_opp_formatter.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_opp_formatter.c
@@ -184,8 +184,7 @@ static void program_formatter_reset_dig_resync_fifo(struct output_pixel_processo
}
if (counter == 0)
- dal_logger_write(opp->ctx->logger, LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(opp->ctx->logger, LOG_ERROR,
"%s:opp program formattter reset dig resync info time out.\n",
__func__);
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
index 0c976efb6178..ab203dfd2914 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
@@ -768,10 +768,8 @@ enum dc_status dce112_validate_bandwidth(
{
enum dc_status result = DC_ERROR_UNEXPECTED;
- dal_logger_write(
- dc->ctx->logger,
- LOG_MAJOR_BWM,
- LOG_MINOR_BWM_REQUIRED_BANDWIDTH_CALCS,
+ dm_logger_write(
+ dc->ctx->logger, LOG_BANDWIDTH_CALCS,
"%s: start",
__func__);
@@ -787,21 +785,18 @@ enum dc_status dce112_validate_bandwidth(
result = DC_OK;
if (result == DC_FAIL_BANDWIDTH_VALIDATE)
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_BWM,
- LOG_MINOR_BWM_MODE_VALIDATION,
+ dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_VALIDATION,
"%s: Bandwidth validation failed!",
__func__);
if (memcmp(&dc->current_context->bw_results,
&context->bw_results, sizeof(context->bw_results))) {
struct log_entry log_entry;
- dal_logger_open(
+ dm_logger_open(
dc->ctx->logger,
&log_entry,
- LOG_MAJOR_BWM,
- LOG_MINOR_BWM_REQUIRED_BANDWIDTH_CALCS);
- dal_logger_append(&log_entry, "%s: finish,\n"
+ LOG_BANDWIDTH_CALCS);
+ dm_logger_append(&log_entry, "%s: finish,\n"
"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
"stutMark_b: %d stutMark_a: %d\n",
__func__,
@@ -811,7 +806,7 @@ enum dc_status dce112_validate_bandwidth(
context->bw_results.urgent_wm_ns[0].a_mark,
context->bw_results.stutter_exit_wm_ns[0].b_mark,
context->bw_results.stutter_exit_wm_ns[0].a_mark);
- dal_logger_append(&log_entry,
+ dm_logger_append(&log_entry,
"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
"stutMark_b: %d stutMark_a: %d\n",
context->bw_results.nbp_state_change_wm_ns[1].b_mark,
@@ -820,7 +815,7 @@ enum dc_status dce112_validate_bandwidth(
context->bw_results.urgent_wm_ns[1].a_mark,
context->bw_results.stutter_exit_wm_ns[1].b_mark,
context->bw_results.stutter_exit_wm_ns[1].a_mark);
- dal_logger_append(&log_entry,
+ dm_logger_append(&log_entry,
"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
"stutMark_b: %d stutMark_a: %d stutter_mode_enable: %d\n",
context->bw_results.nbp_state_change_wm_ns[2].b_mark,
@@ -830,7 +825,7 @@ enum dc_status dce112_validate_bandwidth(
context->bw_results.stutter_exit_wm_ns[2].b_mark,
context->bw_results.stutter_exit_wm_ns[2].a_mark,
context->bw_results.stutter_mode_enable);
- dal_logger_append(&log_entry,
+ dm_logger_append(&log_entry,
"cstate: %d pstate: %d nbpstate: %d sync: %d dispclk: %d\n"
"sclk: %d sclk_sleep: %d yclk: %d blackout_recovery_time_us: %d\n",
context->bw_results.cpuc_state_change_enable,
@@ -842,7 +837,7 @@ enum dc_status dce112_validate_bandwidth(
context->bw_results.required_sclk_deep_sleep,
context->bw_results.required_yclk,
context->bw_results.blackout_recovery_time_us);
- dal_logger_close(&log_entry);
+ dm_logger_close(&log_entry);
}
return result;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_compressor.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_compressor.c
index a05a3cb7b7d2..667be43aaa07 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_compressor.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_compressor.c
@@ -142,10 +142,8 @@ static uint32_t lpt_memory_control_config(struct dce80_compressor *cp80,
LOW_POWER_TILING_NUM_PIPES);
break;
default:
- dal_logger_write(
- cp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp80->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT NUM_PIPES!!!",
__func__);
break;
@@ -190,10 +188,8 @@ static uint32_t lpt_memory_control_config(struct dce80_compressor *cp80,
LOW_POWER_TILING_NUM_BANKS);
break;
default:
- dal_logger_write(
- cp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp80->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT NUM_BANKS!!!",
__func__);
break;
@@ -226,10 +222,8 @@ static uint32_t lpt_memory_control_config(struct dce80_compressor *cp80,
LOW_POWER_TILING_PIPE_INTERLEAVE_SIZE);
break;
default:
- dal_logger_write(
- cp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp80->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT INTERLEAVE_SIZE!!!",
__func__);
break;
@@ -272,19 +266,15 @@ static uint32_t lpt_memory_control_config(struct dce80_compressor *cp80,
LOW_POWER_TILING_ROW_SIZE);
break;
default:
- dal_logger_write(
- cp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp80->base.ctx->logger, LOG_WARNING,
"%s: Invalid LPT ROW_SIZE!!!",
__func__);
break;
}
} else {
- dal_logger_write(
- cp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp80->base.ctx->logger, LOG_WARNING,
"%s: LPT MC Configuration is not provided",
__func__);
}
@@ -334,10 +324,8 @@ static void wait_for_fbc_state_changed(
}
if (counter == 10) {
- dal_logger_write(
- cp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ cp80->base.ctx->logger, LOG_WARNING,
"%s: wait counter exceeded, changes to HW not applied",
__func__);
}
@@ -538,10 +526,8 @@ void dce80_compressor_program_compressed_surface_address_and_pitch(
if (compressor->min_compress_ratio == FBC_COMPRESS_RATIO_1TO1)
fbc_pitch = fbc_pitch / 8;
else
- dal_logger_write(
- compressor->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ compressor->ctx->logger, LOG_WARNING,
"%s: Unexpected DCE8 compression ratio",
__func__);
@@ -686,10 +672,8 @@ void dce80_compressor_program_lpt_control(
LOW_POWER_TILING_MODE);
break;
default:
- dal_logger_write(
- compressor->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(
+ compressor->ctx->logger, LOG_WARNING,
"%s: Invalid selected DRAM channels for LPT!!!",
__func__);
break;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_link_encoder.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_link_encoder.c
index fab427cf926f..bd364eeb6916 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_link_encoder.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_link_encoder.c
@@ -123,9 +123,7 @@ static void dce80_link_encoder_enable_tmds_output(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
@@ -183,9 +181,7 @@ static void dce80_link_encoder_enable_dp_output(
result = link_transmitter_control(enc110, &cntl);
if (result != BP_RESULT_OK) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_ENCODER,
+ dm_logger_write(ctx->logger, LOG_ERROR,
"%s: Failed to execute VBIOS command table!\n",
__func__);
BREAK_TO_DEBUGGER();
@@ -308,9 +304,7 @@ bool dce80_link_encoder_construct(
break;
}
- dal_logger_write(init_data->ctx->logger,
- LOG_MAJOR_I2C_AUX,
- LOG_MINOR_I2C_AUX_CFG,
+ dm_logger_write(init_data->ctx->logger, LOG_I2C_AUX,
"Using channel: %s [%d]\n",
DECODE_CHANNEL_ID(init_data->channel),
init_data->channel);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c
index c8841c17cb64..5e08a2dfb039 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c
@@ -143,9 +143,7 @@ static void allocate_mem_input(
} while (retry_count > 0);
if (field == 0)
- dal_logger_write(mi->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(mi->ctx->logger, LOG_ERROR,
"%s: DMIF allocation failed",
__func__);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_regamma.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_regamma.c
index 14362b40f68b..648e3ef35d91 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_regamma.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_regamma.c
@@ -427,9 +427,7 @@ static void program_pwl(
}
if (counter == max_tries) {
- dal_logger_write(opp80->base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_CONTROLLER,
+ dm_logger_write(opp80->base.ctx->logger, LOG_WARNING,
"%s: regamma lut was not powered on "
"in a timely manner,"
" programming still proceeds\n",
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
index fd29892c5402..264d260320a6 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
@@ -591,9 +591,7 @@ bool dce80_transform_get_current_pixel_storage_depth(
*depth = LB_PIXEL_DEPTH_36BPP;
break;
default:
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Invalid LB pixel depth",
__func__);
*depth = LB_PIXEL_DEPTH_30BPP;
@@ -706,9 +704,7 @@ bool dce80_transform_set_pixel_storage_depth(
if (!(xfm80->lb_pixel_depth_supported & depth)) {
/*we should use unsupported capabilities
* unless it is required by w/a*/
- dal_logger_write(xfm->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(xfm->ctx->logger, LOG_WARNING,
"%s: Capability not supported",
__func__);
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_scl.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_scl.c
index 1e30bbb58efc..140acc1993f3 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_scl.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_scl.c
@@ -666,9 +666,7 @@ bool dce80_transform_set_scaler(
program_two_taps_filter(xfm80, false, true);
if (!program_multi_taps_filter(xfm80, data, false)) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_DCP,
- LOG_MINOR_DCP_SCALER,
+ dm_logger_write(ctx->logger, LOG_SCALER,
"Failed vertical taps programming\n");
return false;
}
@@ -680,9 +678,7 @@ bool dce80_transform_set_scaler(
program_two_taps_filter(xfm80, false, false);
if (!program_multi_taps_filter(xfm80, data, true)) {
- dal_logger_write(ctx->logger,
- LOG_MAJOR_DCP,
- LOG_MINOR_DCP_SCALER,
+ dm_logger_write(ctx->logger, LOG_SCALER,
"Failed horizontal taps programming\n");
return false;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/dm_helpers.h b/drivers/gpu/drm/amd/dal/dc/dm_helpers.h
index 6fa69703f929..d6c52d31f0f0 100644
--- a/drivers/gpu/drm/amd/dal/dc/dm_helpers.h
+++ b/drivers/gpu/drm/amd/dal/dc/dm_helpers.h
@@ -35,42 +35,11 @@
struct dp_mst_stream_allocation_table;
-enum conn_event {
- CONN_EVENT_MODE_SET,
- CONN_EVENT_DETECTION,
- CONN_EVENT_LINK_TRAINING,
- CONN_EVENT_LINK_LOSS,
- CONN_EVENT_UNDERFLOW,
-};
-
enum dc_edid_status dm_helpers_parse_edid_caps(
struct dc_context *ctx,
const struct dc_edid *edid,
struct dc_edid_caps *edid_caps);
-
-/* Connectivity log format:
- * [time stamp] [drm] [Major_minor] [connector name] message.....
- * eg:
- * [ 26.590965] [drm] [Conn_LKTN] [DP-1] HBRx4 pass VS=0, PE=0^
- * [ 26.881060] [drm] [Conn_Mode] [DP-1] {2560x1080, 2784x1111 at 185580Khz}^
- */
-
-#define CONN_DATA_DETECT(link, hex_data, hex_len, ...) \
- dm_helper_conn_log(link->ctx, &link->public, hex_data, hex_len, \
- CONN_EVENT_DETECTION, ##__VA_ARGS__)
-
-#define CONN_DATA_LINK_LOSS(link, hex_data, hex_len, ...) \
- dm_helper_conn_log(link->ctx, &link->public, hex_data, hex_len, \
- CONN_EVENT_LINK_LOSS, ##__VA_ARGS__)
-
-#define CONN_MSG_LT(link, ...) \
- dm_helper_conn_log(link->ctx, &link->public, NULL, 0, \
- CONN_EVENT_LINK_TRAINING, ##__VA_ARGS__)
-
-#define CONN_MSG_MODE(link, ...) \
- dm_helper_conn_log(link->ctx, &link->public, NULL, 0, \
- CONN_EVENT_MODE_SET, ##__VA_ARGS__)
/*
* Writes payload allocation table in immediate downstream device.
*/
@@ -128,12 +97,5 @@ bool dm_helpers_submit_i2c(
const struct dc_link *link,
struct i2c_command *cmd);
-void dm_helper_conn_log(struct dc_context *ctx,
- const struct dc_link *link,
- uint8_t *hex_data,
- int hex_data_count,
- enum conn_event event,
- const char *msg,
- ...);
#endif /* __DM_HELPERS__ */
diff --git a/drivers/gpu/drm/amd/dal/dc/dm_services_types.h b/drivers/gpu/drm/amd/dal/dc/dm_services_types.h
index 0223053767f6..44bad17fa318 100644
--- a/drivers/gpu/drm/amd/dal/dc/dm_services_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dm_services_types.h
@@ -26,37 +26,7 @@
#ifndef __DM_SERVICES_TYPES_H__
#define __DM_SERVICES_TYPES_H__
-#if defined __KERNEL__
-
-#include <asm/byteorder.h>
-#include <linux/types.h>
-#include <drm/drmP.h>
-
-#include "cgs_linux.h"
-
-#if defined(__BIG_ENDIAN) && !defined(BIGENDIAN_CPU)
-#define BIGENDIAN_CPU
-#elif defined(__LITTLE_ENDIAN) && !defined(LITTLEENDIAN_CPU)
-#define LITTLEENDIAN_CPU
-#endif
-
-#undef READ
-#undef WRITE
-#undef FRAME_SIZE
-
-#define dm_output_to_console(fmt, ...) DRM_INFO(fmt, ##__VA_ARGS__)
-
-#define dm_error(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__)
-
-#define dm_debug(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
-
-#define dm_vlog(fmt, args) vprintk(fmt, args)
-
-#define dm_min(x, y) min(x, y)
-#define dm_max(x, y) max(x, y)
-
-#endif
-
+#include "os_types.h"
#include "dc_types.h"
struct dm_pp_clock_range {
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c
index 36a08a5a8164..7671e49ffa49 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c
@@ -35,7 +35,7 @@
* Macro definitions
*****************************************************************************/
-#define NOT_IMPLEMENTED() DAL_LOGGER_NOT_IMPL(LOG_MINOR_COMPONENT_GPU, \
+#define NOT_IMPLEMENTED() DAL_LOGGER_NOT_IMPL( \
"%s:%s()\n", __FILE__, __func__)
/******************************************************************************
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
index 1f5bed80bdea..024972ee0242 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
@@ -150,9 +150,7 @@ static bool set_min_clocks_state(
if (clocks_state > dc->max_clks_state) {
/*Requested state exceeds max supported state.*/
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Requested state exceeds max supported state");
return false;
} else if (clocks_state == base->cur_min_clks_state) {
@@ -176,9 +174,7 @@ static bool set_min_clocks_state(
break;
case CLOCKS_STATE_INVALID:
default:
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Requested state invalid state");
return false;
}
@@ -298,9 +294,7 @@ static uint32_t get_validation_clock(struct display_clock *dc)
case CLOCKS_STATE_INVALID:
default:
/*Invalid Clocks State*/
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc->ctx->logger, LOG_WARNING,
"Invalid clock state");
/* just return the display engine clock for
* lowest supported state*/
@@ -461,9 +455,7 @@ static uint32_t calc_single_display_min_clks(
bool panning_allowed = false; /* TODO: receive this value from AS */
if (params == NULL) {
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Invalid input parameter in %s",
__func__);
return 0;
@@ -483,9 +475,7 @@ static uint32_t calc_single_display_min_clks(
params->source_view.height,
params->dest_view.height);
} else {
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Destination height or width is 0!\n");
}
@@ -790,9 +780,7 @@ static enum clocks_state get_required_clocks_state(
if (!req_clocks) {
/* NULL pointer*/
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc->ctx->logger, LOG_WARNING,
"%s: Invalid parameter",
__func__);
return CLOCKS_STATE_INVALID;
@@ -949,9 +937,7 @@ static bool dal_display_clock_dce110_construct(
dc110->dfs_bypass_disp_clk = 0;
if (!display_clock_integrated_info_construct(dc110, as))
- dal_logger_write(dc_base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc_base->ctx->logger, LOG_WARNING,
"Cannot obtain VBIOS integrated info\n");
dc110->gpu_pll_ss_percentage = 0;
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c
index bf244579e0f1..cef5008cd08d 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c
@@ -35,7 +35,7 @@
* Macro definitions
*****************************************************************************/
-#define NOT_IMPLEMENTED() DAL_LOGGER_NOT_IMPL(LOG_MINOR_COMPONENT_GPU, \
+#define NOT_IMPLEMENTED() DAL_LOGGER_NOT_IMPL(\
"%s:%s()\n", __FILE__, __func__)
/******************************************************************************
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce112/display_clock_dce112.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce112/display_clock_dce112.c
index 77ccb92da623..73f30ddf2d52 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce112/display_clock_dce112.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce112/display_clock_dce112.c
@@ -125,9 +125,7 @@ bool dispclk_dce112_set_min_clocks_state(
if (clocks_state > dc->max_clks_state) {
/*Requested state exceeds max supported state.*/
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Requested state exceeds max supported state");
return false;
} else if (clocks_state == base->cur_min_clks_state) {
@@ -151,9 +149,7 @@ bool dispclk_dce112_set_min_clocks_state(
break;
case CLOCKS_STATE_INVALID:
default:
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Requested state invalid state");
return false;
}
@@ -275,9 +271,7 @@ uint32_t dispclk_dce112_get_validation_clock(struct display_clock *dc)
case CLOCKS_STATE_INVALID:
default:
/*Invalid Clocks State*/
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc->ctx->logger, LOG_WARNING,
"Invalid clock state");
/* just return the display engine clock for
* lowest supported state*/
@@ -438,9 +432,7 @@ static uint32_t calc_single_display_min_clks(
bool panning_allowed = false; /* TODO: receive this value from AS */
if (params == NULL) {
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Invalid input parameter in %s",
__func__);
return 0;
@@ -460,9 +452,7 @@ static uint32_t calc_single_display_min_clks(
params->source_view.height,
params->dest_view.height);
} else {
- dal_logger_write(base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(base->ctx->logger, LOG_WARNING,
"Destination height or width is 0!\n");
}
@@ -754,9 +744,7 @@ enum clocks_state dispclk_dce112_get_required_clocks_state(
if (!req_clocks) {
/* NULL pointer*/
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc->ctx->logger, LOG_WARNING,
"%s: Invalid parameter",
__func__);
return CLOCKS_STATE_INVALID;
@@ -876,9 +864,7 @@ bool dal_display_clock_dce112_construct(
dc112->dfs_bypass_disp_clk = 0;
if (!display_clock_integrated_info_construct(dc112, as))
- dal_logger_write(dc_base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc_base->ctx->logger, LOG_WARNING,
"Cannot obtain VBIOS integrated info\n");
dc112->gpu_pll_ss_percentage = 0;
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
index 109e249c39ec..6c5c656c0166 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
@@ -587,9 +587,7 @@ static bool set_min_clocks_state(
if (clocks_state > disp_clk->max_clks_state) {
/*Requested state exceeds max supported state.*/
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc->ctx->logger, LOG_WARNING,
"Requested state exceeds max supported state");
return false;
} else if (clocks_state == dc->cur_min_clks_state) {
@@ -613,9 +611,7 @@ static bool set_min_clocks_state(
break;
case CLOCKS_STATE_INVALID:
default:
- dal_logger_write(dc->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc->ctx->logger, LOG_WARNING,
"Requested state invalid state");
return false;
}
@@ -897,9 +893,7 @@ static bool display_clock_construct(
display_clock_ss_construct(disp_clk, as);
if (!display_clock_integrated_info_construct(disp_clk, as)) {
- dal_logger_write(dc_base->ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_GPU,
+ dm_logger_write(dc_base->ctx->logger, LOG_WARNING,
"Cannot obtain VBIOS integrated info");
}
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c
index 3a20c4342774..b4ced869c4bd 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c
@@ -898,10 +898,8 @@ bool i2c_hw_engine_dce110_construct(
XTAL_REF_DIV);
if (xtal_ref_div == 0) {
- dal_logger_write(
- hw_engine->base.base.base.ctx->logger,
- LOG_MAJOR_WARNING,
- LOG_MINOR_COMPONENT_I2C_AUX,
+ dm_logger_write(
+ hw_engine->base.base.base.ctx->logger, LOG_WARNING,
"Invalid base timer divider\n",
__func__);
xtal_ref_div = 2;
diff --git a/drivers/gpu/drm/amd/dal/dc/irq/dce110/irq_service_dce110.c b/drivers/gpu/drm/amd/dal/dc/irq/dce110/irq_service_dce110.c
index 32af9b45c858..f3eda1b4eebf 100644
--- a/drivers/gpu/drm/amd/dal/dc/irq/dce110/irq_service_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/irq/dce110/irq_service_dce110.c
@@ -161,10 +161,8 @@ bool dal_irq_service_dummy_set(
const struct irq_source_info *info,
bool enable)
{
- dal_logger_write(
- irq_service->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_IRQ_SERVICE,
+ dm_logger_write(
+ irq_service->ctx->logger, LOG_ERROR,
"%s: called for non-implemented irq source\n",
__func__);
return false;
@@ -174,10 +172,8 @@ bool dal_irq_service_dummy_ack(
struct irq_service *irq_service,
const struct irq_source_info *info)
{
- dal_logger_write(
- irq_service->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_IRQ_SERVICE,
+ dm_logger_write(
+ irq_service->ctx->logger, LOG_ERROR,
"%s: called for non-implemented irq source\n",
__func__);
return false;
diff --git a/drivers/gpu/drm/amd/dal/dc/irq/irq_service.c b/drivers/gpu/drm/amd/dal/dc/irq/irq_service.c
index 328c77034bc5..fbaa2fc00ddb 100644
--- a/drivers/gpu/drm/amd/dal/dc/irq/irq_service.c
+++ b/drivers/gpu/drm/amd/dal/dc/irq/irq_service.c
@@ -97,10 +97,8 @@ bool dal_irq_service_set(
find_irq_source_info(irq_service, source);
if (!info) {
- dal_logger_write(
- irq_service->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_IRQ_SERVICE,
+ dm_logger_write(
+ irq_service->ctx->logger, LOG_ERROR,
"%s: cannot find irq info table entry for %d\n",
__func__,
source);
@@ -137,10 +135,8 @@ bool dal_irq_service_ack(
find_irq_source_info(irq_service, source);
if (!info) {
- dal_logger_write(
- irq_service->ctx->logger,
- LOG_MAJOR_ERROR,
- LOG_MINOR_COMPONENT_IRQ_SERVICE,
+ dm_logger_write(
+ irq_service->ctx->logger, LOG_ERROR,
"%s: cannot find irq info table entry for %d\n",
__func__,
source);
diff --git a/drivers/gpu/drm/amd/dal/dc/os_types.h b/drivers/gpu/drm/amd/dal/dc/os_types.h
new file mode 100644
index 000000000000..459a2741eccb
--- /dev/null
+++ b/drivers/gpu/drm/amd/dal/dc/os_types.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2012-16 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+#ifndef _OS_TYPES_H_
+#define _OS_TYPES_H_
+
+#if defined __KERNEL__
+
+#include <asm/byteorder.h>
+#include <linux/types.h>
+#include <drm/drmP.h>
+
+#include "cgs_linux.h"
+
+#if defined(__BIG_ENDIAN) && !defined(BIGENDIAN_CPU)
+#define BIGENDIAN_CPU
+#elif defined(__LITTLE_ENDIAN) && !defined(LITTLEENDIAN_CPU)
+#define LITTLEENDIAN_CPU
+#endif
+
+#undef READ
+#undef WRITE
+#undef FRAME_SIZE
+
+#define dm_output_to_console(fmt, ...) DRM_INFO(fmt, ##__VA_ARGS__)
+
+#define dm_error(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__)
+
+#define dm_debug(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
+
+#define dm_vlog(fmt, args) vprintk(fmt, args)
+
+#define dm_min(x, y) min(x, y)
+#define dm_max(x, y) max(x, y)
+
+#endif
+
+
+#endif /* _OS_TYPES_H_ */
diff --git a/drivers/gpu/drm/amd/dal/include/fixed31_32.h b/drivers/gpu/drm/amd/dal/include/fixed31_32.h
index 05f04a68232a..c28de167250f 100644
--- a/drivers/gpu/drm/amd/dal/include/fixed31_32.h
+++ b/drivers/gpu/drm/amd/dal/include/fixed31_32.h
@@ -26,6 +26,8 @@
#ifndef __DAL_FIXED31_32_H__
#define __DAL_FIXED31_32_H__
+#include "os_types.h"
+
/*
* @brief
* Arithmetic operations on real numbers
diff --git a/drivers/gpu/drm/amd/dal/include/fixed32_32.h b/drivers/gpu/drm/amd/dal/include/fixed32_32.h
index 5fca9573930b..c7ddd0e435eb 100644
--- a/drivers/gpu/drm/amd/dal/include/fixed32_32.h
+++ b/drivers/gpu/drm/amd/dal/include/fixed32_32.h
@@ -23,9 +23,12 @@
*
*/
+
#ifndef __DAL_FIXED32_32_H__
#define __DAL_FIXED32_32_H__
+#include "os_types.h"
+
struct fixed32_32 {
uint64_t value;
};
diff --git a/drivers/gpu/drm/amd/dal/include/logger_interface.h b/drivers/gpu/drm/amd/dal/include/logger_interface.h
index e4e6b3a62044..859215630914 100644
--- a/drivers/gpu/drm/amd/dal/include/logger_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/logger_interface.h
@@ -28,13 +28,8 @@
#include "logger_types.h"
-struct dal_logger;
struct dc_context;
-union logger_flags;
-
-/*
- * TODO: This logger functionality needs to be implemented and reworked.
- */
+struct dc_link;
/*
*
@@ -46,92 +41,45 @@ struct dal_logger *dal_logger_create(struct dc_context *ctx);
uint32_t dal_logger_destroy(struct dal_logger **logger);
-uint32_t dal_logger_get_mask(
- struct dal_logger *logger,
- enum log_major lvl_major, enum log_minor lvl_minor);
-
-uint32_t dal_logger_set_mask(
- struct dal_logger *logger,
- enum log_major lvl_major, enum log_minor lvl_minor);
-
-uint32_t dal_logger_get_masks(
- struct dal_logger *logger,
- enum log_major lvl_major);
-
-void dal_logger_set_masks(
- struct dal_logger *logger,
- enum log_major lvl_major, uint32_t log_mask);
-
-uint32_t dal_logger_unset_mask(
+void dm_logger_write(
struct dal_logger *logger,
- enum log_major lvl_major, enum log_minor lvl_minor);
-
-bool dal_logger_should_log(
- struct dal_logger *logger,
- enum log_major major,
- enum log_minor minor);
-
-uint32_t dal_logger_get_flags(
- struct dal_logger *logger);
-
-void dal_logger_set_flags(
- struct dal_logger *logger,
- union logger_flags flags);
-
-void dal_logger_write(
- struct dal_logger *logger,
- enum log_major major,
- enum log_minor minor,
+ enum dc_log_type log_type,
const char *msg,
...);
-void dal_logger_append(
+void dm_logger_append(
struct log_entry *entry,
const char *msg,
...);
-uint32_t dal_logger_read(
- struct dal_logger *logger,
- uint32_t output_buffer_size,
- char *output_buffer,
- uint32_t *bytes_read,
- bool single_line);
-
-void dal_logger_open(
+void dm_logger_open(
struct dal_logger *logger,
struct log_entry *entry,
- enum log_major major,
- enum log_minor minor);
-
-void dal_logger_close(struct log_entry *entry);
+ enum dc_log_type log_type);
-uint32_t dal_logger_get_buffer_size(struct dal_logger *logger);
-
-uint32_t dal_logger_set_buffer_size(
- struct dal_logger *logger,
- uint32_t new_size);
+void dm_logger_close(struct log_entry *entry);
-const struct log_major_info *dal_logger_enum_log_major_info(
- struct dal_logger *logger,
- unsigned int enum_index);
+void dc_conn_log(struct dc_context *ctx,
+ const struct dc_link *link,
+ uint8_t *hex_data,
+ int hex_data_count,
+ enum dc_log_type event,
+ const char *msg,
+ ...);
-const struct log_minor_info *dal_logger_enum_log_minor_info(
- struct dal_logger *logger,
- enum log_major major,
- unsigned int enum_index);
/* Any function which is empty or have incomplete implementation should be
* marked by this macro.
* Note that the message will be printed exactly once for every function
* it is used in order to avoid repeating of the same message. */
-#define DAL_LOGGER_NOT_IMPL(log_minor, fmt, ...) \
+#define DAL_LOGGER_NOT_IMPL(fmt, ...) \
{ \
static bool print_not_impl = true; \
\
if (print_not_impl == true) { \
print_not_impl = false; \
- dal_logger_write(ctx->logger, LOG_MAJOR_WARNING, \
- log_minor, "DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \
+ dm_logger_write(ctx->logger, LOG_WARNING, \
+ "DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \
} \
}
@@ -140,13 +88,35 @@ const struct log_minor_info *dal_logger_enum_log_minor_info(
*****************************************************************************/
#define DC_ERROR(...) \
- dal_logger_write(dc_ctx->logger, \
- LOG_MAJOR_ERROR, LOG_MINOR_COMPONENT_DC, \
+ dm_logger_write(dc_ctx->logger, LOG_ERROR, \
__VA_ARGS__);
#define DC_SYNC_INFO(...) \
- dal_logger_write(dc_ctx->logger, \
- LOG_MAJOR_SYNC, LOG_MINOR_SYNC_TIMING, \
+ dm_logger_write(dc_ctx->logger, LOG_SYNC, \
__VA_ARGS__);
+
+/* Connectivity log format:
+ * [time stamp] [drm] [Major_minor] [connector name] message.....
+ * eg:
+ * [ 26.590965] [drm] [Conn_LKTN] [DP-1] HBRx4 pass VS=0, PE=0^
+ * [ 26.881060] [drm] [Conn_Mode] [DP-1] {2560x1080, 2784x1111 at 185580Khz}^
+ */
+
+#define CONN_DATA_DETECT(link, hex_data, hex_len, ...) \
+ dc_conn_log(link->ctx, &link->public, hex_data, hex_len, \
+ LOG_EVENT_DETECTION, ##__VA_ARGS__)
+
+#define CONN_DATA_LINK_LOSS(link, hex_data, hex_len, ...) \
+ dc_conn_log(link->ctx, &link->public, hex_data, hex_len, \
+ LOG_EVENT_LINK_LOSS, ##__VA_ARGS__)
+
+#define CONN_MSG_LT(link, ...) \
+ dc_conn_log(link->ctx, &link->public, NULL, 0, \
+ LOG_EVENT_LINK_TRAINING, ##__VA_ARGS__)
+
+#define CONN_MSG_MODE(link, ...) \
+ dc_conn_log(link->ctx, &link->public, NULL, 0, \
+ LOG_EVENT_MODE_SET, ##__VA_ARGS__)
+
#endif /* __DAL_LOGGER_INTERFACE_H__ */
diff --git a/drivers/gpu/drm/amd/dal/include/logger_types.h b/drivers/gpu/drm/amd/dal/include/logger_types.h
index ce2b649fad7b..1ea60bb9e716 100644
--- a/drivers/gpu/drm/amd/dal/include/logger_types.h
+++ b/drivers/gpu/drm/amd/dal/include/logger_types.h
@@ -26,305 +26,43 @@
#ifndef __DAL_LOGGER_TYPES_H__
#define __DAL_LOGGER_TYPES_H__
-/*
- * TODO: This logger functionality needs to be implemented and reworked.
- */
-
-struct dal_logger;
-
-enum log_major {
-/*00*/
- LOG_MAJOR_ERROR = 0, /*< DAL subcomponent error MSG*/
-/*01*/ LOG_MAJOR_WARNING, /*< DAL subcomponent warning MSG*/
-/*02*/ LOG_MAJOR_INTERFACE_TRACE,/*< DAL subcomponent interface tracing*/
-/*03*/ LOG_MAJOR_HW_TRACE, /*< Log ASIC register read/write,
- * ATOMBIOS exec table call and delays*/
-
-/*04*/ LOG_MAJOR_MST, /*< related to multi-stream*/
-/*05*/ LOG_MAJOR_DCS, /*< related to Dcs*/
-/*06*/ LOG_MAJOR_DCP, /*< related to Dcp grph and ovl,gamam and csc*/
-/*07*/ LOG_MAJOR_BIOS, /*< related to BiosParser*/
-/*08*/ LOG_MAJOR_REGISTER, /*< register access*/
-/*09*/ LOG_MAJOR_INFO_PACKETS, /*< info packets*/
-/*10*/ LOG_MAJOR_DSAT, /*< related
- * to Display System Analysis Tool*/
-/*11*/ LOG_MAJOR_EC, /*< External Components - MCIL Events/queries,
- * PPLib notifications/queries*/
-/*12*/ LOG_MAJOR_BWM, /*< related to Bandwidth Manager*/
-/*13*/ LOG_MAJOR_MODE_ENUM, /*< related to mode enumeration*/
-/*14*/ LOG_MAJOR_I2C_AUX, /*< i2c and aux channel log*/
-/*15*/ LOG_MAJOR_LINE_BUFFER, /*< Line Buffer object logging activity*/
-/*16*/ LOG_MAJOR_HWSS, /*< HWSS object logging activity*/
-/*17*/ LOG_MAJOR_OPTIMIZATION, /*< Optimization code path*/
-/*18*/ LOG_MAJOR_PERF_MEASURE, /*< Performance measurement dumps*/
-/*19*/ LOG_MAJOR_SYNC, /*< related to HW and SW Synchronization*/
-/*20*/ LOG_MAJOR_BACKLIGHT, /*< related to backlight */
-/*21*/ LOG_MAJOR_INTERRUPTS, /*< logging for all interrupts */
-
-/*22*/ LOG_MAJOR_TM, /*< related to Topology Manager*/
-/*23*/ LOG_MAJOR_DISPLAY_SERVICE, /*< related to Display Service*/
-/*24*/ LOG_MAJOR_FEATURE_OVERRIDE, /*< related to features*/
-/*25*/ LOG_MAJOR_DETECTION, /*< related to detection*/
-/*26*/ LOG_MAJOR_CONNECTIVITY, /*< related to connectivity*/
- LOG_MAJOR_COUNT, /*< count of the Major categories*/
-};
-
-/**
-* @brief defines minor switch for logging. each of these define sub category
-* of log message per LogMajor
-*/
+#include "os_types.h"
-enum log_minor {
+#define MAX_NAME_LEN 32
- /* Special case for 'all' checkbox */
- LOG_MINOR_MASK_ALL = (uint32_t)-1, /* 0xFFFFFFFF */
-/**
-* @brief defines minor category for
-* LOG_MAJOR_ERROR,
-* LOG_MAJOR_WARNING,
-* LOG_MAJOR_INTERFACE_TRACE
-*
-* @note each DAL subcomponent should have a corresponding enum
-*/
- LOG_MINOR_COMPONENT_LINK_SERVICE = 0,
- LOG_MINOR_COMPONENT_DAL_INTERFACE,
- LOG_MINOR_COMPONENT_HWSS,
- LOG_MINOR_COMPONENT_ADAPTER_SERVICE,
- LOG_MINOR_COMPONENT_DISPLAY_SERVICE,
- LOG_MINOR_COMPONENT_TOPOLOGY_MANAGER,
- LOG_MINOR_COMPONENT_ENCODER,
- LOG_MINOR_COMPONENT_I2C_AUX,
- LOG_MINOR_COMPONENT_AUDIO,
- LOG_MINOR_COMPONENT_DISPLAY_CAPABILITY_SERVICE,
- LOG_MINOR_COMPONENT_DMCU,
- LOG_MINOR_COMPONENT_GPU,
- LOG_MINOR_COMPONENT_CONTROLLER,
- LOG_MINOR_COMPONENT_ISR,
- LOG_MINOR_COMPONENT_BIOS,
- LOG_MINOR_COMPONENT_DC,
- LOG_MINOR_COMPONENT_SURFACE,
- LOG_MINOR_COMPONENT_IRQ_SERVICE,
-
-/**
-* @brief define minor category for LogMajor_HardwareTrace
-*
-* @note defines functionality based HW programming trace
-*/
- LOG_MINOR_HW_TRACE_MST = 0,
- LOG_MINOR_HW_TRACE_TRAVIS,
- LOG_MINOR_HW_TRACE_HOTPLUG,
- LOG_MINOR_HW_TRACE_LINK_TRAINING,
- LOG_MINOR_HW_TRACE_SET_MODE,
- LOG_MINOR_HW_TRACE_RESUME_S3,
- LOG_MINOR_HW_TRACE_RESUME_S4,
- LOG_MINOR_HW_TRACE_BOOTUP,
- LOG_MINOR_HW_TRACE_AUDIO,
- LOG_MINOR_HW_TRACE_HPD_IRQ,
- LOG_MINOR_HW_TRACE_INTERRUPT,
- LOG_MINOR_HW_TRACE_MPO,
-
-/**
-* @brief defines minor category for LogMajor_Mst
-*
-* @note define sub functionality related to MST
-*/
- LOG_MINOR_MST_IRQ_HPD_RX = 0,
- LOG_MINOR_MST_IRQ_TIMER,
- LOG_MINOR_MST_NATIVE_AUX,
- LOG_MINOR_MST_SIDEBAND_MSG,
- LOG_MINOR_MST_MSG_TRANSACTION,
- LOG_MINOR_MST_SIDEBAND_MSG_PARSED,
- LOG_MINOR_MST_MSG_TRANSACTION_PARSED,
- LOG_MINOR_MST_AUX_MSG_DPCD_ACCESS,
- LOG_MINOR_MST_PROGRAMMING,
- LOG_MINOR_MST_TOPOLOGY_DISCOVERY,
- LOG_MINOR_MST_CONVERTER_CAPS,
-
-/**
-* @brief defines minor category for LogMajor_DCS
-*
-* @note should define sub functionality related to Dcs
-*/
- LOG_MINOR_DCS_EDID_EMULATOR = 0,
- LOG_MINOR_DCS_DONGLE_DETECTION,
-
-/**
-* @brief defines minor category for DCP
-*
-* @note should define sub functionality related to Dcp
-*/
- LOG_MINOR_DCP_GAMMA_GRPH = 0,
- LOG_MINOR_DCP_GAMMA_OVL,
- LOG_MINOR_DCP_CSC_GRPH,
- LOG_MINOR_DCP_CSC_OVL,
- LOG_MINOR_DCP_SCALER,
- LOG_MINOR_DCP_SCALER_TABLES,
-/**
-* @brief defines minor category for LogMajor_Bios
-*
-* @note define sub functionality related to BiosParser
-*/
- LOG_MINOR_BIOS_CMD_TABLE = 0,
-/**
-* @brief defines minor category for LogMajor_Bios
-*
-* @note define sub functionality related to BiosParser
-*/
- LOG_MINOR_REGISTER_INDEX = 0,
-/**
-* @brief defines minor category for info packets
-*
-*/
- LOG_MINOR_INFO_PACKETS_HDMI = 0,
-
-/**
-* @brief defines minor category for LOG_MAJOR_DSAT
-*
-* @note define sub functionality related to Display System Analysis Tool
-*/
- LOG_MINOR_DSAT_LOGGER = 0,
- LOG_MINOR_DSAT_GET_EDID,
- LOG_MINOR_DSAT_EDID_OVERRIDE,
- LOG_MINOR_DSAT_SET_ADJUSTMENTS,
- LOG_MINOR_DSAT_GET_ADJUSTMENTS,
-
-/**
-* @brief defines minor category for LOG_MAJOR_EC
-*
-* @note define sub functionality related to External components notifications
-*/
- LOG_MINOR_EC_PPLIB_NOTIFY = 0,
- LOG_MINOR_EC_PPLIB_QUERY,
-
-/**
-* @brief defines minor category for LOG_MAJOR_BWM
-*
-* @note define sub functionality related to Bandwidth Manager
-*/
- LOG_MINOR_BWM_MODE_VALIDATION = 0,
- LOG_MINOR_BWM_REQUIRED_BANDWIDTH_CALCS,
-
-/**
-* @brief define minor category for LogMajor_ModeEnum
-*
-* @note defines functionality mode enumeration trace
-*/
- LOG_MINOR_MODE_ENUM_BEST_VIEW_CANDIDATES = 0,
- LOG_MINOR_MODE_ENUM_VIEW_SOLUTION,
- LOG_MINOR_MODE_ENUM_TS_LIST_BUILD,
- LOG_MINOR_MODE_ENUM_TS_LIST,
- LOG_MINOR_MODE_ENUM_MASTER_VIEW_LIST,
- LOG_MINOR_MODE_ENUM_MASTER_VIEW_LIST_UPDATE,
-
-/**
-* @brief defines minor category for LogMajor_I2C_AUX
-*
-* @note define sub functionality related to I2c and Aux Channel Log
-*/
- LOG_MINOR_I2C_AUX_LOG = 0,
- LOG_MINOR_I2C_AUX_AUX_TIMESTAMP,
- LOG_MINOR_I2C_AUX_CFG,
-
-/**
-* @brief defines minor category for LogMajor_LineBuffer
-*
-* @note define sub functionality related to LineBuffer
-*/
- LOG_MINOR_LINE_BUFFER_POWERGATING = 0,
-
-/**
-* @brief defines minor category for LogMajor_HWSS
-*
-* @note define sub functionality related to HWSS
-*/
- LOG_MINOR_HWSS_TAPS_VALIDATION = 0,
-
-/**
-* @brief defines minor category for LogMajor_Optimization
-*
-* @note define sub functionality related to Optimization
-*/
- LOG_MINOR_OPTMZ_GENERAL = 0,
- LOG_MINOR_OPTMZ_DO_NOT_TURN_OFF_VCC_DURING_SET_MODE,
-
-/**
-* @brief defines minor category for LogMajor_PerfMeasure
-*
-* @note define sub functionality related to Performance measurement dumps
-*/
- LOG_MINOR_PERF_MEASURE_GENERAL = 0,
- LOG_MINOR_PERF_MEASURE_HEAP_MEMORY,
-
-/**
-* @brief defines minor category for LogMajor_Sync
-*
-* @note define sub functionality related to HW and SW Synchronization
-*/
- LOG_MINOR_SYNC_HW_CLOCK_ADJUST = 0,
- LOG_MINOR_SYNC_TIMING,
-
-/**
-* @brief defines minor category for LogMajor_Backlight
-*
-* @note define sub functionality related to backlight (including VariBright)
-*/
- LOG_MINOR_BACKLIGHT_BRIGHTESS_CAPS = 0,
- LOG_MINOR_BACKLIGHT_DMCU_DELTALUT,
- LOG_MINOR_BACKLIGHT_DMCU_BUILD_DELTALUT,
- LOG_MINOR_BACKLIGHT_INTERFACE,
- LOG_MINOR_BACKLIGHT_LID,
-
-/**
-* @brief defines minor category for LOG_MAJOR_TM
-*
-* @note define sub functionality related to Topology Manager
-*/
- LOG_MINOR_TM_INFO = 0,
- LOG_MINOR_TM_IFACE_TRACE,
- LOG_MINOR_TM_RESOURCES,
- LOG_MINOR_TM_ENCODER_CTL,
- LOG_MINOR_TM_ENG_ASN,
- LOG_MINOR_TM_CONTROLLER_ASN,
- LOG_MINOR_TM_PWR_GATING,
- LOG_MINOR_TM_BUILD_DSP_PATH,
- LOG_MINOR_TM_DISPLAY_DETECT,
- LOG_MINOR_TM_LINK_SRV,
- LOG_MINOR_TM_NOT_IMPLEMENTED,
- LOG_MINOR_TM_COFUNC_PATH,
-
-/**
-* @brief defines minor category for LOG_MAJOR_DISPLAY_SERVICE
-*
-* @note define sub functionality related to Display Service
-*/
- LOG_MINOR_DS_MODE_SETTING = 0,
-
-/**
-* @brief defines minor category for LOG_MAJOR_FEATURE_OVERRIDE
-*
-* @note define sub functionality related to features in adapter service
-*/
- LOG_MINOR_FEATURE_OVERRIDE = 0,
-
-/**
-* @brief defines minor category for LOG_MAJOR_DETECTION
-*
-* @note define sub functionality related to detection
-*/
- LOG_MINOR_DETECTION_EDID_PARSER = 0,
- LOG_MINOR_DETECTION_DP_CAPS,
-
-/**
-* @brief defines minor category for LOG_MAJOR_CONNECTIVITY
-*
-* @note define sub functionality related to connectivity
-*/
- LOG_MINOR_CONNECTIVITY_MODE_SET = 0,
- LOG_MINOR_CONNECTIVITY_DETECTION,
- LOG_MINOR_CONNECTIVITY_LINK_TRAINING,
- LOG_MINOR_CONNECTIVITY_LINK_LOSS,
- LOG_MINOR_CONNECTIVITY_UNDERFLOW,
+struct dal_logger;
+enum dc_log_type {
+ LOG_ERROR = 0,
+ LOG_WARNING,
+ LOG_DC,
+ LOG_SURFACE,
+ LOG_HW_HOTPLUG,
+ LOG_HW_LINK_TRAINING,
+ LOG_HW_SET_MODE,
+ LOG_HW_RESUME_S3,
+ LOG_HW_AUDIO,
+ LOG_HW_HPD_IRQ,
+ LOG_MST,
+ LOG_SCALER,
+ LOG_BIOS,
+ LOG_BANDWIDTH_CALCS,
+ LOG_BANDWIDTH_VALIDATION,
+ LOG_I2C_AUX,
+ LOG_SYNC,
+ LOG_BACKLIGHT,
+ LOG_FEATURE_OVERRIDE,
+ LOG_DETECTION_EDID_PARSER,
+ LOG_DETECTION_DP_CAPS,
+ LOG_RESOURCE,
+ LOG_DML,
+ LOG_EVENT_MODE_SET,
+ LOG_EVENT_DETECTION,
+ LOG_EVENT_LINK_TRAINING,
+ LOG_EVENT_LINK_LOSS,
+ LOG_EVENT_UNDERFLOW,
+
+ LOG_SECTION_TOTAL_COUNT
};
union logger_flags {
@@ -337,10 +75,8 @@ union logger_flags {
};
struct log_entry {
-
struct dal_logger *logger;
- enum log_major major;
- enum log_minor minor;
+ enum dc_log_type type;
char *buf;
uint32_t buf_offset;
@@ -348,20 +84,11 @@ struct log_entry {
};
/**
-* Structure for enumerating LogMajors and LogMinors
+* Structure for enumerating log types
*/
-
-#define MAX_MAJOR_NAME_LEN 32
-#define MAX_MINOR_NAME_LEN 32
-
-struct log_major_info {
- enum log_major major;
- char major_name[MAX_MAJOR_NAME_LEN];
-};
-
-struct log_minor_info {
- enum log_minor minor;
- char minor_name[MAX_MINOR_NAME_LEN];
+struct dc_log_type_info {
+ enum dc_log_type type;
+ char name[MAX_NAME_LEN];
};
#endif /* __DAL_LOGGER_TYPES_H__ */
--
2.10.1
More information about the amd-gfx
mailing list