Skip to contentSkip to conversation

Make DC logging more configurable

PATCH In review Harry Wentland 2 participants 5 messages Sep 15, 2017 – Sep 18, 2017 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Make DC logging more configurable

We shouldn't be as chatty as we are, sitting in the kernel. This patchset reduces the default log levels greatly but still allows bug reporters and internal teams run with previous log levels, using a dc_log module parameter.

Going forward we'll look into converting the existing logs into DRM_DEBUG_KMS and/or the dynamic debug log system.

v2: Dont' use compile time option, only runtime param

Harry Wentland (3):
drm/amdgpu: Add dc_log module parameter
drm/amd/display: Pass log_mask from DM
drm/amd/display: Reduce DC chattiness

 drivers/gpu/drm/amd/amdgpu/amdgpu.h                |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |  4 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 75 ++++++++++++----------
 drivers/gpu/drm/amd/display/dc/basics/logger.c     | 41 ++----------
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  2 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  1 +
 .../gpu/drm/amd/display/include/logger_interface.h |  2 +-
 drivers/gpu/drm/amd/display/include/logger_types.h | 35 ++++++++++
 8 files changed, 88 insertions(+), 73 deletions(-)
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170915235151.5960-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH v2 1/3 drm/amdgpu: Add dc_log module parameter

We want to make DC less chatty but still allow bug reporters to provide more detailed logs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index a34c4cb0178d..fdfc95ad24bc 100644
@@ -103,6 +103,7 @@ extern int amdgpu_vm_fault_stop;
 extern int amdgpu_vm_debug;
 extern int amdgpu_vm_update_mode;
 extern int amdgpu_dc;
+extern int amdgpu_dc_log;
 extern int amdgpu_sched_jobs;
 extern int amdgpu_sched_hw_submission;
 extern int amdgpu_no_evict;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
index 5035305cf32c..916201660db9 100644
@@ -104,6 +104,7 @@ int amdgpu_vram_page_split = 512;
 int amdgpu_vm_update_mode = -1;
 int amdgpu_exp_hw_support = 0;
 int amdgpu_dc = -1;
+int amdgpu_dc_log = 0;
 int amdgpu_sched_jobs = 32;
 int amdgpu_sched_hw_submission = 2;
 int amdgpu_no_evict = 0;
@@ -211,6 +212,9 @@ module_param_named(exp_hw_support, amdgpu_exp_hw_support, int, 0444);
 MODULE_PARM_DESC(dc, "Display Core driver (1 = enable, 0 = disable, -1 = auto (default))");
 module_param_named(dc, amdgpu_dc, int, 0444);
 
+MODULE_PARM_DESC(dc, "Display Core Log Level (0 = minimal (default), 1 = chatty");
+module_param_named(dc_log, amdgpu_dc_log, int, 0444);
+
 MODULE_PARM_DESC(sched_jobs, "the max number of jobs supported in the sw queue (default 32)");
 module_param_named(sched_jobs, amdgpu_sched_jobs, int, 0444);
 
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH v2 2/3 drm/amd/display: Pass log_mask from DM

In reply to a message not in the archive

Linux and Windows often desire different log levels.

Change-Id Idd3c672e8b36f41de240e94d0c2d4b56ce60376e
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  3 +-
 drivers/gpu/drm/amd/display/dc/basics/logger.c     | 41 +++-------------------
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  2 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  1 +
 .../gpu/drm/amd/display/include/logger_interface.h |  2 +-
 drivers/gpu/drm/amd/display/include/logger_types.h | 32 +++++++++++++++++
 6 files changed, 42 insertions(+), 39 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index c9432c4c2646..abe89e3fed5b 100644
@@ -323,7 +323,6 @@ void amdgpu_dm_initialize_fbc(struct amdgpu_device *adev)
 }
 #endif
 
-
 /* Init display KMS
  *
  * Returns 0 on success
@@ -374,6 +373,8 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 
 	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
+	init_data.log_mask = DC_DEFAULT_LOG_MASK;
+
 #ifdef ENABLE_FBC
 	if (adev->family == FAMILY_CZ)
 		amdgpu_dm_initialize_fbc(adev);
drivers/gpu/drm/amd/display/dc/basics/logger.c +5 -36

66 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
index dd86b864efe6..7454a5a6a8fe 100644
@@ -495,7 +495,7 @@ static bool construct(struct dc *dc,
 	dc_ctx->asic_id = init_params->asic_id;
 
 	/* Create logger */
-	logger = dal_logger_create(dc_ctx);
+	logger = dal_logger_create(dc_ctx, init_params->log_mask);
 
 	if (!logger) {
 		/* can *not* call logger. call base driver 'print error' */
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index bf2d42561362..b5971f98dd23 100644
@@ -267,6 +267,7 @@ struct dc_init_data {
 	enum dce_environment dce_environment;
 
 	struct dc_config flags;
+	uint32_t log_mask;
 #ifdef ENABLE_FBC
 	uint64_t fbc_gpu_addr;
 #endif
drivers/gpu/drm/amd/display/include/logger_interface.h +1 -1
index 6641e8001e97..5aaf2dacfe38 100644
@@ -40,7 +40,7 @@ struct dc_state;
  *
  */
 
-struct dal_logger *dal_logger_create(struct dc_context *ctx);
+struct dal_logger *dal_logger_create(struct dc_context *ctx, uint32_t log_mask);
 
 uint32_t dal_logger_destroy(struct dal_logger **logger);
 
drivers/gpu/drm/amd/display/include/logger_types.h +32 -0
index 42ffb93e3172..044805ccac25 100644
@@ -70,6 +70,38 @@ enum dc_log_type {
 	LOG_SECTION_TOTAL_COUNT
 };
 
+#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_DETECTION_DP_CAPS) | \
+		(1 << LOG_BACKLIGHT)) | \
+		(1 << LOG_I2C_AUX) | \
+		(1 << LOG_IF_TRACE) | \
+		(1 << LOG_DTN) /* | \
+		(1 << LOG_DEBUG) | \
+		(1 << LOG_BIOS) | \
+		(1 << LOG_SURFACE) | \
+		(1 << LOG_SCALER) | \
+		(1 << LOG_DML) | \
+		(1 << LOG_HW_LINK_TRAINING) | \
+		(1 << LOG_HW_AUDIO)| \
+		(1 << LOG_BANDWIDTH_CALCS)*/
+
 union logger_flags {
 	struct {
 		uint32_t ENABLE_CONSOLE:1; /* Print to console */
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH v2 3/3 drm/amd/display: Reduce DC chattiness

In reply to a message not in the archive

Log DC init but default log level to 0 (default for amdgpu_dc_log) otherwise. Bug reporters can still make DC more chatty by using the dc_log module param.
amdgpu.dc_log = 1

v2: Only provide runtime option, no compile time config

Change-Id Icdfb849fa678225e2460519fbd8066540feb451a
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 74 ++++++++++++----------
 drivers/gpu/drm/amd/display/include/logger_types.h |  3 +
 2 files changed, 42 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +39 -35
index abe89e3fed5b..846cff8bff17 100644
@@ -333,7 +333,6 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 	adev->dm.ddev = adev->ddev;
 	adev->dm.adev = adev;
 
-	DRM_INFO("DAL is enabled\n");
 	/* Zero all the fields */
 	memset(&init_data, 0, sizeof(init_data));
 
@@ -373,7 +372,10 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 
 	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
-	init_data.log_mask = DC_DEFAULT_LOG_MASK;
+	if (amdgpu_dc_log)
+		init_data.log_mask = DC_DEFAULT_LOG_MASK;
+	else
+		init_data.log_mask = DC_MIN_LOG_MASK;
 
 #ifdef ENABLE_FBC
 	if (adev->family == FAMILY_CZ)
@@ -383,7 +385,9 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 	/* Display Core create. */
 	adev->dm.dc = dc_create(&init_data);
 
-	if (!adev->dm.dc)
+	if (adev->dm.dc)
+		DRM_INFO("Display Core initialized!\n");
+	else
 		DRM_INFO("Display Core failed to initialize!\n");
 
 	INIT_WORK(&adev->dm.mst_hotplug_work, hotplug_notify_work_func);
@@ -393,7 +397,7 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 		DRM_ERROR(
 		"amdgpu: failed to initialize freesync_module.\n");
 	} else
-		DRM_INFO("amdgpu: freesync_module init done %p.\n",
+		DRM_DEBUG_DRIVER("amdgpu: freesync_module init done %p.\n",
 				adev->dm.freesync_module);
 
 	if (amdgpu_dm_initialize_drm_device(adev)) {
@@ -417,7 +421,7 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 		goto error;
 	}
 
-	DRM_INFO("KMS initialized.\n");
+	DRM_DEBUG_DRIVER("KMS initialized.\n");
 
 	return 0;
 error:
@@ -475,7 +479,7 @@ static int detect_mst_link_for_all_connectors(struct drm_device *dev)
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		   aconnector = to_amdgpu_dm_connector(connector);
 		if (aconnector->dc_link->type == dc_connection_mst_branch) {
-			DRM_INFO("DM_MST: starting TM on aconnector: %p [id: %d]\n",
+			DRM_DEBUG_DRIVER("DM_MST: starting TM on aconnector: %p [id: %d]\n",
 					aconnector, aconnector->base.base.id);
 
 			ret = drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true);
@@ -819,12 +823,12 @@ void amdgpu_dm_update_connector_after_detect(
 	if (aconnector->dc_sink == sink) {
 		/* We got a DP short pulse (Link Loss, DP CTS, etc...).
 		 * Do nothing!! */
-		DRM_INFO("DCHPD: connector_id=%d: dc_sink didn't change.\n",
+		DRM_DEBUG_DRIVER("DCHPD: connector_id=%d: dc_sink didn't change.\n",
 				aconnector->connector_id);
 		return;
 	}
 
-	DRM_INFO("DCHPD: connector_id=%d: Old sink=%p New sink=%p\n",
+	DRM_DEBUG_DRIVER("DCHPD: connector_id=%d: Old sink=%p New sink=%p\n",
 		aconnector->connector_id, aconnector->dc_sink, sink);
 
 	mutex_lock(&dev->mode_config.mutex);
@@ -926,7 +930,7 @@ static void dm_handle_hpd_rx_irq(struct amdgpu_dm_connector *aconnector)
 
 		process_count++;
 
-		DRM_DEBUG_KMS("ESI %02x %02x %02x\n", esi[0], esi[1], esi[2]);
+		DRM_DEBUG_DRIVER("ESI %02x %02x %02x\n", esi[0], esi[1], esi[2]);
 		/* handle HPD short pulse irq */
 		if (aconnector->mst_mgr.mst_state)
 			drm_dp_mst_hpd_irq(
@@ -964,7 +968,7 @@ static void dm_handle_hpd_rx_irq(struct amdgpu_dm_connector *aconnector)
 	}
 
 	if (process_count == max_process_count)
-		DRM_DEBUG_KMS("Loop exceeded max iterations\n");
+		DRM_DEBUG_DRIVER("Loop exceeded max iterations\n");
 }
 
 static void handle_hpd_rx_irq(void *param)
@@ -1283,7 +1287,7 @@ void amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm)
 	if (NULL == dm->backlight_dev)
 		DRM_ERROR("DM: Backlight registration failed!\n");
 	else
-		DRM_INFO("DM: Registered Backlight device: %s\n", bl_name);
+		DRM_DEBUG_DRIVER("DM: Registered Backlight device: %s\n", bl_name);
 }
 
 #endif
@@ -2064,7 +2068,7 @@ static void update_stream_scaling_settings(
 	stream->src = src;
 	stream->dst = dst;
 
-	DRM_DEBUG_KMS("Destination Rectangle x:%d  y:%d  width:%d  height:%d\n",
+	DRM_DEBUG_DRIVER("Destination Rectangle x:%d  y:%d  width:%d  height:%d\n",
 			dst.x, dst.y, dst.width, dst.height);
 
 }
@@ -2374,7 +2378,7 @@ static struct dc_stream_state *create_stream_for_sink(
 		 * case, we call set mode ourselves to restore the previous mode
 		 * and the modelist may not be filled in in time.
 		 */
-		DRM_INFO("No preferred mode found\n");
+		DRM_DEBUG_DRIVER("No preferred mode found\n");
 	} else {
 		decide_crtc_timing_for_drm_display_mode(
 				&mode, preferred_mode,
@@ -2749,7 +2753,7 @@ static struct drm_encoder *best_encoder(struct drm_connector *connector)
 	struct drm_mode_object *obj;
 	struct drm_encoder *encoder;
 
-	DRM_DEBUG_KMS("Finding the best encoder\n");
+	DRM_DEBUG_DRIVER("Finding the best encoder\n");
 
 	/* pick the encoder ids */
 	if (enc_id) {
@@ -3019,7 +3023,7 @@ static int dm_plane_helper_prepare_fb(
 	dm_plane_state_new = to_dm_plane_state(new_state);
 
 	if (!new_state->fb) {
-		DRM_DEBUG_KMS("No FB bound\n");
+		DRM_DEBUG_DRIVER("No FB bound\n");
 		return 0;
 	}
 
@@ -3594,7 +3598,7 @@ int amdgpu_dm_connector_init(
 	struct amdgpu_i2c_adapter *i2c;
 	((struct dc_link *)link)->priv = aconnector;
 
-	DRM_DEBUG_KMS("%s()\n", __func__);
+	DRM_DEBUG_DRIVER("%s()\n", __func__);
 
 	i2c = create_i2c(link->ddc, link->link_index, &res);
 	aconnector->i2c = i2c;
@@ -3835,11 +3839,11 @@ static void handle_cursor_update(
 	if (!plane->state->fb && !old_plane_state->fb)
 		return;
 
-	DRM_DEBUG_KMS("%s: crtc_id=%d with size %d to %d\n",
-		      __func__,
-		      amdgpu_crtc->crtc_id,
-		      plane->state->crtc_w,
-		      plane->state->crtc_h);
+	DRM_DEBUG_DRIVER("%s: crtc_id=%d with size %d to %d\n",
+		         __func__,
+		         amdgpu_crtc->crtc_id,
+		         plane->state->crtc_w,
+		         plane->state->crtc_h);
 
 	ret = get_cursor_position(plane, crtc, &position);
 	if (ret)
@@ -4142,7 +4146,7 @@ void amdgpu_dm_atomic_commit_tail(
 		new_acrtc_state = to_dm_crtc_state(new_state);
 		old_acrtc_state = to_dm_crtc_state(old_crtc_state);
 
-		DRM_DEBUG_KMS(
+		DRM_DEBUG_DRIVER(
 			"amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, "
 			"planes_changed:%d, mode_changed:%d,active_changed:%d,"
 			"connectors_changed:%d\n",
@@ -4160,7 +4164,7 @@ void amdgpu_dm_atomic_commit_tail(
 
 		if (modeset_required(new_state, new_acrtc_state->stream, old_acrtc_state->stream)) {
 
-			DRM_INFO("Atomic commit: SET crtc id %d: [%p]\n", acrtc->crtc_id, acrtc);
+			DRM_DEBUG_DRIVER("Atomic commit: SET crtc id %d: [%p]\n", acrtc->crtc_id, acrtc);
 
 			if (!new_acrtc_state->stream) {
 				/*
@@ -4178,7 +4182,7 @@ void amdgpu_dm_atomic_commit_tail(
 				 * have a sink to keep the pipe running so that
 				 * hw state is consistent with the sw state
 				 */
-				DRM_DEBUG_KMS("%s: Failed to create new stream for crtc %d\n",
+				DRM_DEBUG_DRIVER("%s: Failed to create new stream for crtc %d\n",
 						__func__, acrtc->base.base.id);
 				continue;
 			}
@@ -4205,7 +4209,7 @@ void amdgpu_dm_atomic_commit_tail(
 			acrtc->hw_mode = crtc->state->mode;
 			crtc->hwmode = crtc->state->mode;
 		} else if (modereset_required(new_state)) {
-			DRM_INFO("Atomic commit: RESET. crtc id %d:[%p]\n", acrtc->crtc_id, acrtc);
+			DRM_DEBUG_DRIVER("Atomic commit: RESET. crtc id %d:[%p]\n", acrtc->crtc_id, acrtc);
 
 			/* i.e. reset mode */
 			if (old_acrtc_state->stream)
@@ -4230,7 +4234,7 @@ void amdgpu_dm_atomic_commit_tail(
 					&new_crtcs[i]->base,
 					false);
 			if (!aconnector) {
-				DRM_INFO("Atomic commit: Failed to find connector for acrtc id:%d "
+				DRM_DEBUG_DRIVER("Atomic commit: Failed to find connector for acrtc id:%d "
 					 "skipping freesync init\n",
 					 new_crtcs[i]->crtc_id);
 				continue;
@@ -4539,7 +4543,7 @@ static int dm_update_crtcs_state(
 			 */
 
 			if (!new_stream) {
-				DRM_DEBUG_KMS("%s: Failed to create new stream for crtc %d\n",
+				DRM_DEBUG_DRIVER("%s: Failed to create new stream for crtc %d\n",
 						__func__, acrtc->base.base.id);
 				break;
 			}
@@ -4550,7 +4554,7 @@ static int dm_update_crtcs_state(
 
 				crtc_state->mode_changed = false;
 
-				DRM_DEBUG_KMS("Mode change not required, setting mode_changed to %d",
+				DRM_DEBUG_DRIVER("Mode change not required, setting mode_changed to %d",
 					      crtc_state->mode_changed);
 		}
 
@@ -4558,7 +4562,7 @@ static int dm_update_crtcs_state(
 		if (!drm_atomic_crtc_needs_modeset(crtc_state))
 			goto next_crtc;
 
-		DRM_DEBUG_KMS(
+		DRM_DEBUG_DRIVER(
 			"amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, "
 			"planes_changed:%d, mode_changed:%d,active_changed:%d,"
 			"connectors_changed:%d\n",
@@ -4576,7 +4580,7 @@ static int dm_update_crtcs_state(
 			if (!old_acrtc_state->stream)
 				goto next_crtc;
 
-			DRM_DEBUG_KMS("Disabling DRM crtc: %d\n",
+			DRM_DEBUG_DRIVER("Disabling DRM crtc: %d\n",
 					crtc->base.id);
 
 			/* i.e. reset mode */
@@ -4606,7 +4610,7 @@ static int dm_update_crtcs_state(
 				new_acrtc_state->stream = new_stream;
 				dc_stream_retain(new_stream);
 
-				DRM_DEBUG_KMS("Enabling DRM crtc: %d\n",
+				DRM_DEBUG_DRIVER("Enabling DRM crtc: %d\n",
 							crtc->base.id);
 
 				if (!dc_add_stream_to_ctx(
@@ -4681,7 +4685,7 @@ static int dm_update_planes_state(
 			if (!old_acrtc_state->stream)
 				continue;
 
-			DRM_DEBUG_KMS("Disabling DRM plane: %d on DRM crtc %d\n",
+			DRM_DEBUG_DRIVER("Disabling DRM plane: %d on DRM crtc %d\n",
 					plane->base.id, old_plane_crtc->base.id);
 
 			if (!dc_remove_plane_from_context(
@@ -4719,7 +4723,7 @@ static int dm_update_planes_state(
 
 			new_dm_plane_state->dc_state = dc_create_plane_state(dc);
 
-			DRM_DEBUG_KMS("Enabling DRM plane: %d on DRM crtc %d\n",
+			DRM_DEBUG_DRIVER("Enabling DRM plane: %d on DRM crtc %d\n",
 					plane->base.id, new_plane_crtc->base.id);
 
 			if (!new_dm_plane_state->dc_state) {
@@ -4874,9 +4878,9 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 
 fail:
 	if (ret == -EDEADLK)
-		DRM_DEBUG_KMS("Atomic check stopped due to to deadlock.\n");
+		DRM_DEBUG_DRIVER("Atomic check stopped due to to deadlock.\n");
 	else if (ret == -EINTR || ret == -EAGAIN || ret == -ERESTARTSYS)
-		DRM_DEBUG_KMS("Atomic check stopped due to to signal.\n");
+		DRM_DEBUG_DRIVER("Atomic check stopped due to to signal.\n");
 	else
 		DRM_ERROR("Atomic check failed with err: %d \n", ret);
 
drivers/gpu/drm/amd/display/include/logger_types.h +3 -0
index 044805ccac25..1f22e84cedb9 100644
@@ -70,6 +70,9 @@ enum dc_log_type {
 	LOG_SECTION_TOTAL_COUNT
 };
 
+#define DC_MIN_LOG_MASK ((1 << LOG_ERROR) | \
+		(1 << LOG_DETECTION_EDID_PARSER))
+
 #define DC_DEFAULT_LOG_MASK ((1 << LOG_ERROR) | \
 		(1 << LOG_WARNING) | \
 		(1 << LOG_EVENT_MODE_SET) | \
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170915235151.5960-4-harry.wentland-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#6 lore raw

RE: [PATCH v2 3/3] drm/amd/display: Reduce DC chattiness

Quoted 14 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Harry Wentland
Sent: Friday, September 15, 2017 7:52 PM
To: [email protected]
Cc: Grodzovsky, Andrey; Wentland, Harry; Kuehling, Felix; Deucher, Alexander; Cheng, Tony; Koenig, Christian
Subject: [PATCH v2 3/3] drm/amd/display: Reduce DC chattiness

Log DC init but default log level to 0 (default for amdgpu_dc_log) otherwise. Bug reporters can still make DC more chatty by using the dc_log module param.
amdgpu.dc_log = 1

Quoted 4 lines

v2: Only provide runtime option, no compile time config

Change-Id Icdfb849fa678225e2460519fbd8066540feb451a

Series is:

Quoted 371 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 74
++++++++++++----------
 drivers/gpu/drm/amd/display/include/logger_types.h |  3 +
 2 files changed, 42 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -3
index abe89e3fed5b..846cff8bff17 100644
@@ -333,7 +333,6 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 	adev->dm.ddev = adev->ddev;
 	adev->dm.adev = adev;
 
-	DRM_INFO("DAL is enabled\n");
 	/* Zero all the fields */
 	memset(&init_data, 0, sizeof(init_data));
 
@@ -373,7 +372,10 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 
 	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
-	init_data.log_mask = DC_DEFAULT_LOG_MASK;
+	if (amdgpu_dc_log)
+		init_data.log_mask = DC_DEFAULT_LOG_MASK;
+	else
+		init_data.log_mask = DC_MIN_LOG_MASK;
 
 #ifdef ENABLE_FBC
 	if (adev->family == FAMILY_CZ)
@@ -383,7 +385,9 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 	/* Display Core create. */
 	adev->dm.dc = dc_create(&init_data);
 
-	if (!adev->dm.dc)
+	if (adev->dm.dc)
+		DRM_INFO("Display Core initialized!\n");
+	else
 		DRM_INFO("Display Core failed to initialize!\n");
 
 	INIT_WORK(&adev->dm.mst_hotplug_work,

hotplug_notify_work_func);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -393,7 +397,7 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 		DRM_ERROR(
 		"amdgpu: failed to initialize freesync_module.\n");
 	} else
-		DRM_INFO("amdgpu: freesync_module init done %p.\n",
+		DRM_DEBUG_DRIVER("amdgpu: freesync_module init done
 %p.\n",
 				adev->dm.freesync_module);
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
 	if (amdgpu_dm_initialize_drm_device(adev)) {
@@ -417,7 +421,7 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 		goto error;
 	}
 
-	DRM_INFO("KMS initialized.\n");
+	DRM_DEBUG_DRIVER("KMS initialized.\n");
 
 	return 0;
 error:
@@ -475,7 +479,7 @@ static int detect_mst_link_for_all_connectors(struct
 drm_device *dev)
 	list_for_each_entry(connector, &dev->mode_config.connector_list,
 head) {
 		   aconnector = to_amdgpu_dm_connector(connector);
 		if (aconnector->dc_link->type ==
 dc_connection_mst_branch) {
-			DRM_INFO("DM_MST: starting TM on aconnector:

%p [id: %d]\n",

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+			DRM_DEBUG_DRIVER("DM_MST: starting TM on

aconnector: %p [id: %d]\n",
aconnector, aconnector-

Quoted 1 line

base.base.id);

ret =
drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
@@ -819,12 +823,12 @@ void

amdgpu_dm_update_connector_after_detect(

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
 	if (aconnector->dc_sink == sink) {
 		/* We got a DP short pulse (Link Loss, DP CTS, etc...).
 		 * Do nothing!! */
-		DRM_INFO("DCHPD: connector_id=%d: dc_sink didn't

change.\n",

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+		DRM_DEBUG_DRIVER("DCHPD: connector_id=%d: dc_sink

didn't change.\n",

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
 				aconnector->connector_id);
 		return;
 	}
 
-	DRM_INFO("DCHPD: connector_id=%d: Old sink=%p New

sink=%p\n",

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+	DRM_DEBUG_DRIVER("DCHPD: connector_id=%d: Old sink=%p New

sink=%p\n",

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 		aconnector->connector_id, aconnector->dc_sink, sink);
 
 	mutex_lock(&dev->mode_config.mutex);
@@ -926,7 +930,7 @@ static void dm_handle_hpd_rx_irq(struct
 amdgpu_dm_connector *aconnector)
 
 		process_count++;
 
-		DRM_DEBUG_KMS("ESI %02x %02x %02x\n", esi[0], esi[1],
 esi[2]);
+		DRM_DEBUG_DRIVER("ESI %02x %02x %02x\n", esi[0],
 esi[1], esi[2]);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 		/* handle HPD short pulse irq */
 		if (aconnector->mst_mgr.mst_state)
 			drm_dp_mst_hpd_irq(
@@ -964,7 +968,7 @@ static void dm_handle_hpd_rx_irq(struct
 amdgpu_dm_connector *aconnector)
 	}
 
 	if (process_count == max_process_count)
-		DRM_DEBUG_KMS("Loop exceeded max iterations\n");
+		DRM_DEBUG_DRIVER("Loop exceeded max iterations\n");
 }
 

static void handle_hpd_rx_irq(void *param)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -1283,7 +1287,7 @@ void amdgpu_dm_register_backlight_device(struct
 amdgpu_display_manager *dm)
 	if (NULL == dm->backlight_dev)
 		DRM_ERROR("DM: Backlight registration failed!\n");
 	else
-		DRM_INFO("DM: Registered Backlight device: %s\n",
 bl_name);
+		DRM_DEBUG_DRIVER("DM: Registered Backlight device:
 %s\n", bl_name);

}

#endif

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -2064,7 +2068,7 @@ static void update_stream_scaling_settings(
 	stream->src = src;
 	stream->dst = dst;
 
-	DRM_DEBUG_KMS("Destination Rectangle x:%d  y:%d  width:%d
 height:%d\n",
+	DRM_DEBUG_DRIVER("Destination Rectangle x:%d  y:%d  width:%d
 height:%d\n",
 			dst.x, dst.y, dst.width, dst.height);

}

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
@@ -2374,7 +2378,7 @@ static struct dc_stream_state
 *create_stream_for_sink(
 		 * case, we call set mode ourselves to restore the previous

mode

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
 		 * and the modelist may not be filled in in time.
 		 */
-		DRM_INFO("No preferred mode found\n");
+		DRM_DEBUG_DRIVER("No preferred mode found\n");
 	} else {
 		decide_crtc_timing_for_drm_display_mode(
 				&mode, preferred_mode,
@@ -2749,7 +2753,7 @@ static struct drm_encoder *best_encoder(struct
 drm_connector *connector)
 	struct drm_mode_object *obj;
 	struct drm_encoder *encoder;
 
-	DRM_DEBUG_KMS("Finding the best encoder\n");
+	DRM_DEBUG_DRIVER("Finding the best encoder\n");
 
 	/* pick the encoder ids */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -8
 	if (enc_id) {
@@ -3019,7 +3023,7 @@ static int dm_plane_helper_prepare_fb(
 	dm_plane_state_new = to_dm_plane_state(new_state);
 
 	if (!new_state->fb) {
-		DRM_DEBUG_KMS("No FB bound\n");
+		DRM_DEBUG_DRIVER("No FB bound\n");
 		return 0;
 	}
 
@@ -3594,7 +3598,7 @@ int amdgpu_dm_connector_init(
 	struct amdgpu_i2c_adapter *i2c;
 	((struct dc_link *)link)->priv = aconnector;
 
-	DRM_DEBUG_KMS("%s()\n", __func__);
+	DRM_DEBUG_DRIVER("%s()\n", __func__);
 
 	i2c = create_i2c(link->ddc, link->link_index, &res);
 	aconnector->i2c = i2c;
@@ -3835,11 +3839,11 @@ static void handle_cursor_update(
 	if (!plane->state->fb && !old_plane_state->fb)
 		return;
 
-	DRM_DEBUG_KMS("%s: crtc_id=%d with size %d to %d\n",
-		      __func__,
-		      amdgpu_crtc->crtc_id,
-		      plane->state->crtc_w,
-		      plane->state->crtc_h);
+	DRM_DEBUG_DRIVER("%s: crtc_id=%d with size %d to %d\n",
+		         __func__,
+		         amdgpu_crtc->crtc_id,
+		         plane->state->crtc_w,
+		         plane->state->crtc_h);
 
 	ret = get_cursor_position(plane, crtc, &position);
 	if (ret)
@@ -4142,7 +4146,7 @@ void amdgpu_dm_atomic_commit_tail(
 		new_acrtc_state = to_dm_crtc_state(new_state);
 		old_acrtc_state = to_dm_crtc_state(old_crtc_state);
 
-		DRM_DEBUG_KMS(
+		DRM_DEBUG_DRIVER(
 			"amdgpu_crtc id:%d crtc_state_flags: enable:%d,

active:%d, "
"planes_changed:%d,
mode_changed:%d,active_changed:%d,"

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 			"connectors_changed:%d\n",
@@ -4160,7 +4164,7 @@ void amdgpu_dm_atomic_commit_tail(
 
 		if (modeset_required(new_state, new_acrtc_state->stream,
 old_acrtc_state->stream)) {
 
-			DRM_INFO("Atomic commit: SET crtc id %d: [%p]\n",
 acrtc->crtc_id, acrtc);
+			DRM_DEBUG_DRIVER("Atomic commit: SET crtc id
 %d: [%p]\n", acrtc->crtc_id, acrtc);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
 			if (!new_acrtc_state->stream) {
 				/*
@@ -4178,7 +4182,7 @@ void amdgpu_dm_atomic_commit_tail(
 				 * have a sink to keep the pipe running so

that

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
 				 * hw state is consistent with the sw state
 				 */
-				DRM_DEBUG_KMS("%s: Failed to create new

stream for crtc %d\n",

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+				DRM_DEBUG_DRIVER("%s: Failed to create

new stream for crtc %d\n",
__func__, acrtc-

Quoted 1 line

base.base.id);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 				continue;
 			}
@@ -4205,7 +4209,7 @@ void amdgpu_dm_atomic_commit_tail(
 			acrtc->hw_mode = crtc->state->mode;
 			crtc->hwmode = crtc->state->mode;
 		} else if (modereset_required(new_state)) {
-			DRM_INFO("Atomic commit: RESET. crtc id
 %d:[%p]\n", acrtc->crtc_id, acrtc);
+			DRM_DEBUG_DRIVER("Atomic commit: RESET. crtc id
 %d:[%p]\n", acrtc->crtc_id, acrtc);
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
 			/* i.e. reset mode */
 			if (old_acrtc_state->stream)
@@ -4230,7 +4234,7 @@ void amdgpu_dm_atomic_commit_tail(
 					&new_crtcs[i]->base,
 					false);
 			if (!aconnector) {
-				DRM_INFO("Atomic commit: Failed to find

connector for acrtc id:%d "

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+				DRM_DEBUG_DRIVER("Atomic commit:

Failed to find connector for acrtc id:%d "

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 					 "skipping freesync init\n",
 					 new_crtcs[i]->crtc_id);
 				continue;
@@ -4539,7 +4543,7 @@ static int dm_update_crtcs_state(
 			 */
 
 			if (!new_stream) {
-				DRM_DEBUG_KMS("%s: Failed to create new
 stream for crtc %d\n",
+				DRM_DEBUG_DRIVER("%s: Failed to create
 new stream for crtc %d\n",
 						__func__, acrtc-
Quoted 1 line

base.base.id);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 				break;
 			}
@@ -4550,7 +4554,7 @@ static int dm_update_crtcs_state(
 
 				crtc_state->mode_changed = false;
 
-				DRM_DEBUG_KMS("Mode change not
 required, setting mode_changed to %d",
+				DRM_DEBUG_DRIVER("Mode change not
 required, setting mode_changed to %d",
 					      crtc_state->mode_changed);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 		}
@@ -4558,7 +4562,7 @@ static int dm_update_crtcs_state(
 		if (!drm_atomic_crtc_needs_modeset(crtc_state))
 			goto next_crtc;
 
-		DRM_DEBUG_KMS(
+		DRM_DEBUG_DRIVER(
 			"amdgpu_crtc id:%d crtc_state_flags: enable:%d,

active:%d, "
"planes_changed:%d,
mode_changed:%d,active_changed:%d,"

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
 			"connectors_changed:%d\n",
@@ -4576,7 +4580,7 @@ static int dm_update_crtcs_state(
 			if (!old_acrtc_state->stream)
 				goto next_crtc;
 
-			DRM_DEBUG_KMS("Disabling DRM crtc: %d\n",
+			DRM_DEBUG_DRIVER("Disabling DRM crtc: %d\n",
 					crtc->base.id);
 
 			/* i.e. reset mode */
@@ -4606,7 +4610,7 @@ static int dm_update_crtcs_state(
 				new_acrtc_state->stream = new_stream;
 				dc_stream_retain(new_stream);
 
-				DRM_DEBUG_KMS("Enabling DRM crtc:
 %d\n",
+				DRM_DEBUG_DRIVER("Enabling DRM crtc:
 %d\n",
 							crtc->base.id);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 				if (!dc_add_stream_to_ctx(
@@ -4681,7 +4685,7 @@ static int dm_update_planes_state(
 			if (!old_acrtc_state->stream)
 				continue;
 
-			DRM_DEBUG_KMS("Disabling DRM plane: %d on
 DRM crtc %d\n",
+			DRM_DEBUG_DRIVER("Disabling DRM plane: %d on
 DRM crtc %d\n",
 					plane->base.id, old_plane_crtc-
Quoted 1 line

base.id);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
 			if (!dc_remove_plane_from_context(
@@ -4719,7 +4723,7 @@ static int dm_update_planes_state(
 
 			new_dm_plane_state->dc_state =
 dc_create_plane_state(dc);
 
-			DRM_DEBUG_KMS("Enabling DRM plane: %d on
 DRM crtc %d\n",
+			DRM_DEBUG_DRIVER("Enabling DRM plane: %d on
 DRM crtc %d\n",

plane->base.id, new_plane_crtc-

Quoted 1 line

base.id);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
 			if (!new_dm_plane_state->dc_state) {
@@ -4874,9 +4878,9 @@ int amdgpu_dm_atomic_check(struct drm_device
 *dev,
 
 fail:
 	if (ret == -EDEADLK)
-		DRM_DEBUG_KMS("Atomic check stopped due to to
 deadlock.\n");
+		DRM_DEBUG_DRIVER("Atomic check stopped due to to
 deadlock.\n");
 	else if (ret == -EINTR || ret == -EAGAIN || ret == -ERESTARTSYS)
-		DRM_DEBUG_KMS("Atomic check stopped due to to

signal.\n");

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+		DRM_DEBUG_DRIVER("Atomic check stopped due to to

signal.\n");

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
 	else
 		DRM_ERROR("Atomic check failed with err: %d \n", ret);
drivers/gpu/drm/amd/display/include/logger_types.h +3 -1
index 044805ccac25..1f22e84cedb9 100644
@@ -70,6 +70,9 @@ enum dc_log_type {
 	LOG_SECTION_TOTAL_COUNT
 };
 
+#define DC_MIN_LOG_MASK ((1 << LOG_ERROR) | \
+		(1 << LOG_DETECTION_EDID_PARSER))
+
 #define DC_DEFAULT_LOG_MASK ((1 << LOG_ERROR) | \
 		(1 << LOG_WARNING) | \
 		(1 << LOG_EVENT_MODE_SET) | \
--

2.11.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx