Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1296423b authored by Bhawanpreet Lakha's avatar Bhawanpreet Lakha Committed by Alex Deucher
Browse files

drm/amd/display: define DC_LOGGER for logger



Created a DC_LOGGER define. This is used to
pass the logger into the macros.

Anywhere we need to use the logger we need to define
DC_LOGGER

Signed-off-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2f3fd67a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@

#define LAST_RECORD_TYPE 0xff

#define DC_LOGGER \
	bp->base.ctx->logger

/* GUID to validate external display connection info table (aka OPM module) */
static const uint8_t ext_display_connection_guid[NUMBER_OF_UCHAR_FOR_GUID] = {
	0x91, 0x6E, 0x57, 0x09,
@@ -3079,8 +3082,7 @@ static enum bp_result patch_bios_image_from_ext_display_connection_info(
					    opm_object,
					    &ext_display_connection_info_tbl) != BP_RESULT_OK) {

		DC_LOG_WARNING(bp->base.ctx->logger,
				"%s: Failed to read Connection Info Table", __func__);
		DC_LOG_WARNING("%s: Failed to read Connection Info Table", __func__);
		return BP_RESULT_UNSUPPORTED;
	}

+5 −6
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@
#include "command_table_helper2.h"
#include "bios_parser_helper.h"
#include "bios_parser_types_internal2.h"
#define DC_LOGGER \
	bp->base.ctx->logger

#define GET_INDEX_INTO_MASTER_TABLE(MasterOrData, FieldName)\
	(((char *)(&((\
@@ -239,8 +241,7 @@ static enum bp_result transmitter_control_v1_6(
	if (cntl->action == TRANSMITTER_CONTROL_ENABLE ||
		cntl->action == TRANSMITTER_CONTROL_ACTIAVATE ||
		cntl->action == TRANSMITTER_CONTROL_DEACTIVATE) {
		DC_LOG_BIOS(bp->base.ctx->logger, \
		"%s:ps.param.symclk_10khz = %d\n",\
		DC_LOG_BIOS("%s:ps.param.symclk_10khz = %d\n",\
		__func__, ps.param.symclk_10khz);
	}

@@ -331,8 +332,7 @@ static enum bp_result set_pixel_clock_v7(
			(uint8_t) bp->cmd_helper->
				transmitter_color_depth_to_atom(
					bp_params->color_depth);
		DC_LOG_BIOS(bp->base.ctx->logger, \
				"%s:program display clock = %d"\
		DC_LOG_BIOS("%s:program display clock = %d"\
				"colorDepth = %d\n", __func__,\
				bp_params->target_pixel_clock, bp_params->color_depth);

@@ -772,8 +772,7 @@ static enum bp_result set_dce_clock_v2_1(
		 */
		params.param.dceclk_10khz = cpu_to_le32(
				bp_params->target_clock_frequency / 10);
	DC_LOG_BIOS(bp->base.ctx->logger,
			"%s:target_clock_frequency = %d"\
	DC_LOG_BIOS("%s:target_clock_frequency = %d"\
			"clock_type = %d \n", __func__,\
			bp_params->target_clock_frequency,\
			bp_params->clock_type);
+5 −6
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
#include "dcn10/dcn10_resource.h"
#include "dcn_calc_math.h"

#define DC_LOGGER \
	dc->ctx->logger
/*
 * NOTE:
 *   This file is gcc-parseable HW gospel, coming straight from HW engineers.
@@ -1242,8 +1244,7 @@ unsigned int dcn_find_dcfclk_suits_all(
	else
		dcf_clk =  dc->dcn_soc->dcfclkv_min0p65*1000;

	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
		"\tdcf_clk for voltage = %d\n", dcf_clk);
	DC_LOG_BANDWIDTH_CALCS("\tdcf_clk for voltage = %d\n", dcf_clk);
	return dcf_clk;
}

@@ -1441,8 +1442,7 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc)
void dcn_bw_sync_calcs_and_dml(struct dc *dc)
{
	kernel_fpu_begin();
	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
			"sr_exit_time: %d ns\n"
	DC_LOG_BANDWIDTH_CALCS("sr_exit_time: %d ns\n"
			"sr_enter_plus_exit_time: %d ns\n"
			"urgent_latency: %d ns\n"
			"write_back_latency: %d ns\n"
@@ -1510,8 +1510,7 @@ void dcn_bw_sync_calcs_and_dml(struct dc *dc)
			dc->dcn_soc->vmm_page_size,
			dc->dcn_soc->dram_clock_change_latency * 1000,
			dc->dcn_soc->return_bus_width);
	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
			"rob_buffer_size_in_kbyte: %d\n"
	DC_LOG_BANDWIDTH_CALCS("rob_buffer_size_in_kbyte: %d\n"
			"det_buffer_size_in_kbyte: %d\n"
			"dpp_output_buffer_pixels: %d\n"
			"opp_output_buffer_lines: %d\n"
+6 −5
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@
#include "dm_helpers.h"
#include "mem_input.h"
#include "hubp.h"
#define DC_LOGGER \
	dc->ctx->logger


/*******************************************************************************
@@ -264,7 +266,7 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
	/* Only call if supported */
	if (tg->funcs->configure_crc)
		return tg->funcs->configure_crc(tg, &param);
	DC_LOG_WARNING(dc->ctx->logger,  "CRC capture not supported.");
	DC_LOG_WARNING("CRC capture not supported.");
	return false;
}

@@ -297,7 +299,7 @@ bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream,

	if (tg->funcs->get_crc)
		return tg->funcs->get_crc(tg, r_cr, g_y, b_cb);
	DC_LOG_WARNING(dc->ctx->logger,  "CRC capture not supported.");
	DC_LOG_WARNING("CRC capture not supported.");
	return false;
}

@@ -618,8 +620,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)

	dc->config = init_params->flags;

	DC_LOG_DC(dc->ctx->logger,
			"Display Core initialized\n");
	DC_LOG_DC("Display Core initialized\n");


	/* TODO: missing feature to be enabled */
@@ -888,7 +889,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
	if (false == context_changed(dc, context))
		return DC_OK;

	DC_LOG_DC(dc->ctx->logger,  "%s: %d streams\n",
	DC_LOG_DC("%s: %d streams\n",
				__func__, context->stream_count);

	for (i = 0; i < context->stream_count; i++) {
+22 −31
Original line number Diff line number Diff line
@@ -45,9 +45,11 @@
#include "dce/dce_11_0_d.h"
#include "dce/dce_11_0_enum.h"
#include "dce/dce_11_0_sh_mask.h"
#define DC_LOGGER \
	dc_ctx->logger

#define LINK_INFO(...) \
	DC_LOG_HW_HOTPLUG(dc_ctx->logger,  \
	DC_LOG_HW_HOTPLUG(  \
		__VA_ARGS__)

/*******************************************************************************
@@ -677,12 +679,10 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)

		switch (edid_status) {
		case EDID_BAD_CHECKSUM:
			DC_LOG_ERROR(link->ctx->logger,
				"EDID checksum invalid.\n");
			DC_LOG_ERROR("EDID checksum invalid.\n");
			break;
		case EDID_NO_RESPONSE:
			DC_LOG_ERROR(link->ctx->logger,
				"No EDID read.\n");
			DC_LOG_ERROR("No EDID read.\n");
		default:
			break;
		}
@@ -712,8 +712,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
					"%s: [Block %d] ", sink->edid_caps.display_name, i);
		}

		DC_LOG_DETECTION_EDID_PARSER(link->ctx->logger,
			"%s: "
		DC_LOG_DETECTION_EDID_PARSER("%s: "
			"manufacturer_id = %X, "
			"product_id = %X, "
			"serial_number = %X, "
@@ -733,8 +732,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
			sink->edid_caps.audio_mode_count);

		for (i = 0; i < sink->edid_caps.audio_mode_count; i++) {
			DC_LOG_DETECTION_EDID_PARSER(link->ctx->logger,
				"%s: mode number = %d, "
			DC_LOG_DETECTION_EDID_PARSER("%s: mode number = %d, "
				"format_code = %d, "
				"channel_count = %d, "
				"sample_rate = %d, "
@@ -984,8 +982,7 @@ static bool construct(
		}
		break;
	default:
		DC_LOG_WARNING(dc_ctx->logger,
			"Unsupported Connector type:%d!\n", link->link_id.id);
		DC_LOG_WARNING("Unsupported Connector type:%d!\n", link->link_id.id);
		goto create_fail;
	}

@@ -1138,7 +1135,7 @@ static void dpcd_configure_panel_mode(
{
	union dpcd_edp_config edp_config_set;
	bool panel_mode_edp = false;

	struct dc_context *dc_ctx = link->ctx;
	memset(&edp_config_set, '\0', sizeof(union dpcd_edp_config));

	if (DP_PANEL_MODE_DEFAULT != panel_mode) {
@@ -1175,8 +1172,7 @@ static void dpcd_configure_panel_mode(
			ASSERT(result == DDC_RESULT_SUCESSFULL);
		}
	}
	DC_LOG_DETECTION_DP_CAPS(link->ctx->logger,
			"Link: %d eDP panel mode supported: %d "
	DC_LOG_DETECTION_DP_CAPS("Link: %d eDP panel mode supported: %d "
			"eDP panel mode enabled: %d \n",
			link->link_index,
			link->dpcd_caps.panel_mode_edp,
@@ -1954,6 +1950,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
	struct dc  *core_dc = link->ctx->dc;
	struct abm *abm = core_dc->res_pool->abm;
	struct dmcu *dmcu = core_dc->res_pool->dmcu;
	struct dc_context *dc_ctx = link->ctx;
	unsigned int controller_id = 0;
	bool use_smooth_brightness = true;
	int i;
@@ -1965,8 +1962,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,

	use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);

	DC_LOG_BACKLIGHT(link->ctx->logger,
			"New Backlight level: %d (0x%X)\n", level, level);
	DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n", level, level);

	if (dc_is_embedded_signal(link->connector_signal)) {
		if (stream != NULL) {
@@ -2133,6 +2129,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
	struct fixed31_32 avg_time_slots_per_mtp;
	struct fixed31_32 pbn;
	struct fixed31_32 pbn_per_slot;
	struct dc_context *dc_ctx = link->ctx;
	uint8_t i;

	/* enable_link_dp_mst already check link->enabled_stream_count
@@ -2150,21 +2147,18 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
					link, pipe_ctx->stream_res.stream_enc, &proposed_table);
	}
	else
		DC_LOG_WARNING(link->ctx->logger,
				"Failed to update"
		DC_LOG_WARNING("Failed to update"
				"MST allocation table for"
				"pipe idx:%d\n",
				pipe_ctx->pipe_idx);

	DC_LOG_MST(link->ctx->logger,
			"%s  "
	DC_LOG_MST("%s  "
			"stream_count: %d: \n ",
			__func__,
			link->mst_stream_alloc_table.stream_count);

	for (i = 0; i < MAX_CONTROLLER_NUM; i++) {
		DC_LOG_MST(link->ctx->logger,
		"stream_enc[%d]: 0x%x      "
		DC_LOG_MST("stream_enc[%d]: 0x%x      "
		"stream[%d].vcp_id: %d      "
		"stream[%d].slot_count: %d\n",
		i,
@@ -2215,6 +2209,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
	struct fixed31_32 avg_time_slots_per_mtp = dal_fixed31_32_from_int(0);
	uint8_t i;
	bool mst_mode = (link->type == dc_connection_mst_branch);
	struct dc_context *dc_ctx = link->ctx;

	/* deallocate_mst_payload is called before disable link. When mode or
	 * disable/enable monitor, new stream is created which is not in link
@@ -2240,23 +2235,20 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
				link, pipe_ctx->stream_res.stream_enc, &proposed_table);
		}
		else {
				DC_LOG_WARNING(link->ctx->logger,
						"Failed to update"
				DC_LOG_WARNING("Failed to update"
						"MST allocation table for"
						"pipe idx:%d\n",
						pipe_ctx->pipe_idx);
		}
	}

	DC_LOG_MST(link->ctx->logger,
			"%s"
	DC_LOG_MST("%s"
			"stream_count: %d: ",
			__func__,
			link->mst_stream_alloc_table.stream_count);

	for (i = 0; i < MAX_CONTROLLER_NUM; i++) {
		DC_LOG_MST(link->ctx->logger,
		"stream_enc[%d]: 0x%x      "
		DC_LOG_MST("stream_enc[%d]: 0x%x      "
		"stream[%d].vcp_id: %d      "
		"stream[%d].slot_count: %d\n",
		i,
@@ -2290,7 +2282,7 @@ void core_link_enable_stream(
		struct pipe_ctx *pipe_ctx)
{
	struct dc  *core_dc = pipe_ctx->stream->ctx->dc;

	struct dc_context *dc_ctx = pipe_ctx->stream->ctx;
	enum dc_status status;

	/* eDP lit up by bios already, no need to enable again. */
@@ -2307,8 +2299,7 @@ void core_link_enable_stream(
	status = enable_link(state, pipe_ctx);

	if (status != DC_OK) {
			DC_LOG_WARNING(pipe_ctx->stream->ctx->logger,
			 "enabling link %u failed: %d\n",
			DC_LOG_WARNING("enabling link %u failed: %d\n",
			pipe_ctx->stream->sink->link->link_index,
			status);

Loading