Skip to contentSkip to conversation

DC Patches Feb 26, 2018

PATCH In review Harry Wentland 4 participants 46 messages Feb 26, 2018 – Mar 1, 2018 11 messages not in the archive

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

cover DC Patches Feb 26, 2018

* Fix HDMI 4k60 problems on some ASICs
* Fix NULL pointer when trying to wake up screen
* Fix HDMI infoframe problem (wrong colors)
* Increase LUT size to 4096
* Bunch of multi-plane fixes for Chrome
* Bunch of other DCN patches

Bhawanpreet Lakha (2):
drm/amd/display: Use MACROS instead of dm_logger drm/amd/display: define DC_LOGGER for logger

Dmytro Laktyushkin (4):
drm/amd/display: Update DCN OPTC registers drm/amd/display: add per pipe dppclk for drm/amd/display: add diags clock programming drm/amd/display: fix dcn1 dppclk when min dispclk patch applies

Eric Bernstein (1):
drm/amd/display: Fix DAL surface change test

Eric Yang (2):
drm/amd/display: fix missing az disable in reset backend drm/amd/display: update infoframe after dig fe is turned on

Harry Wentland (6):
drm/amd/display: Remove duplicate dm_pp_power_level enum drm/amd/display: Use crtc enable/disable_vblank hooks drm/amd/display: Return success when enabling interrupt drm/amd/display: Clean up formatting in irq_service_dce110.c drm/amd/display: Don't blow up if TG is NULL in dce110_vblank_set drm/amd/display: Default HDMI6G support to true. Log VBIOS table
error.

Hersen Wu (2):
drm/amd/display: move MST branch initialize to before link training drm/amd/display: Check DCN PState ASSERT failure

John Barberiz (1):
drm/amd/display: Add passive dongle support for HPD Rearch

Leo (Sunpeng) Li (2):
drm/amd/display: Use 4096 lut entries drm/amd/display: Add regamma lut write mask to SOC base

Roman Li (1):
drm/amd/display: Fix active dongle hotplug

Shirish S (4):
drm/amd/display: allocate fbc buffer in AMDGPU_GEM_DOMAIN_GTT drm/amd/display: defer modeset check in dm_update_planes_state drm/amd/display: validate plane in dce110 for scaling drm/amd/display: update plane params before validation

Tony Cheng (3):
drm/amd/display: dal 3.1.35
drm/amd/display: dal 3.1.36
drm/amd/display: dal 3.1.37

Vitaly Prosyak (1):
drm/amd/display: Handle HDR use cases.

Wenjing Liu (1):
drm/amd/display: Update Link Training Fallback logic

Xingyue Tao (1):
drm/amd/display: add psr_version to stream

Yongqiang Sun (1):
drm/amd/display: Clear dmps off for eDP when resume.

Yue Hin Lau (1):
drm/amd/display: update cur_clock correctly within set bandwidth

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  40 +++++-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |   4 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    |  77 ++++++++---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  |  14 ++
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |   6 +-
 .../gpu/drm/amd/display/dc/bios/command_table2.c   |  11 +-
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |  13 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  17 +--
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c     |  13 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |  67 ++++-----
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   | 151 ++++++++++++--------
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |   1 +
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |   9 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  15 +-
 drivers/gpu/drm/amd/display/dc/dc_link.h           |   2 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h         |   3 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c       |   5 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_audio.c     |  17 +--
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  32 +++--
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    |   8 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |  38 ++---
 .../drm/amd/display/dc/dce/dce_stream_encoder.c    |   9 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  11 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.h |   1 +
 .../drm/amd/display/dc/dce110/dce110_compressor.c  |  14 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  49 +++----
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  19 ++-
 .../display/dc/dce110/dce110_timing_generator_v.c  |  17 +--
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |   5 +-
 .../drm/amd/display/dc/dce112/dce112_compressor.c  |  27 ++--
 .../drm/amd/display/dc/dce112/dce112_resource.c    |   7 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 153 +++++++++++++++++++++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h |   5 +
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   |   6 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c    |  77 ++++-------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h    |   1 +
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  82 +++++++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h  |   6 +-
 drivers/gpu/drm/amd/display/dc/dm_helpers.h        |  10 ++
 drivers/gpu/drm/amd/display/dc/dm_services_types.h |  19 +--
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c |   6 +-
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.c        |   6 +-
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  26 ++--
 drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h        |   2 +
 .../amd/display/dc/irq/dce110/irq_service_dce110.c |  75 +++++-----
 drivers/gpu/drm/amd/display/dc/irq/irq_service.c   |  10 +-
 .../drm/amd/display/include/link_service_types.h   |   5 +-
 drivers/gpu/drm/amd/display/include/logger_types.h |  33 +++++
 .../drm/amd/display/modules/color/color_gamma.c    | 143 +++++++++----------
 49 files changed, 841 insertions(+), 526 deletions(-)
Signature · 6 lines
2.14.1

_______________________________________________
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): 20180226201603.28609-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/33 drm/amd/display: move MST branch initialize to before link training

From: Hersen Wu <[email protected]>

some MST capable scaler doesn't like recieving CLEAR_PAYLOAD_ID_TABLE after link training. move branch initialize to before link training

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 9 +++++++++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c             | 3 +++
 drivers/gpu/drm/amd/display/dc/dm_helpers.h               | 7 +++++++
 3 files changed, 19 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +9 -0
index 9bd142f65f9b..3e157e65d7cd 100644
@@ -258,6 +258,15 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
 	return true;
 }
 
+
+/*
+ * Clear payload allocation table before enable MST DP link.
+ */
+void dm_helpers_dp_mst_clear_payload_allocation_table(
+	struct dc_context *ctx,
+	const struct dc_link *link)
+{}
+
 /*
  * Polls for ACT (allocation change trigger) handled and sends
  * ALLOCATE_PAYLOAD message.
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -0
index 95955ade4012..f40c9c7aa733 100644
@@ -1311,6 +1311,9 @@ static enum dc_status enable_link_dp_mst(
 	if (link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN)
 		return DC_OK;
 
+	/* clear payload table */
+	dm_helpers_dp_mst_clear_payload_allocation_table(link->ctx, link);
+
 	/* set the sink to MST mode before enabling the link */
 	dp_enable_mst_on_sink(link, true);
 
drivers/gpu/drm/amd/display/dc/dm_helpers.h +7 -0
index ab88f07772a3..53d5566f89b8 100644
@@ -49,6 +49,13 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
 		struct dp_mst_stream_allocation_table *proposed_table,
 		bool enable);
 
+/*
+ * Clear payload allocation table before enable MST DP link.
+ */
+void dm_helpers_dp_mst_clear_payload_allocation_table(
+	struct dc_context *ctx,
+	const struct dc_link *link);
+
 /*
  * Polls for ACT (allocation change trigger) handled and
  */
Signature · 6 lines
2.14.1

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

PATCH 2/33 drm/amd/display: Fix active dongle hotplug

In reply to a message not in the archive

From: Roman Li <[email protected]>

Clean fake sink flag after detecting link on downstream port. Fixing display light-up after "hot-unplug&plug again" downstream of an active dongle.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
index 511cd58c16b9..bb9405daa087 100644
@@ -1058,6 +1058,10 @@ static void handle_hpd_rx_irq(void *param)
 			!is_mst_root_connector) {
 		/* Downstream Port status changed. */
 		if (dc_link_detect(dc_link, DETECT_REASON_HPDRX)) {
+
+			if (aconnector->fake_enable)
+				aconnector->fake_enable = false;
+
 			amdgpu_dm_update_connector_after_detect(aconnector);
 
 
Signature · 6 lines
2.14.1

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

PATCH 3/33 drm/amd/display: Add passive dongle support for HPD Rearch

In reply to a message not in the archive

From: John Barberiz <[email protected]>

Add HPD delay timer support to
1. Single/dual link DVI.
2. DP to HDMI passive dongle
3. DP to DVI passive dongle.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 7 +++++--
 drivers/gpu/drm/amd/display/dc/dc_link.h      | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +5 -2
index f40c9c7aa733..556b155ba5af 100644
@@ -2358,11 +2358,14 @@ void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
 	core_dc->hwss.set_avmute(pipe_ctx, enable);
 }
 
-void dc_link_disable_hpd_filter(struct dc_link *link)
+void dc_link_enable_hpd_filter(struct dc_link *link, bool enable)
 {
 	struct gpio *hpd;
 
-	if (!link->is_hpd_filter_disabled) {
+	if (enable) {
+		link->is_hpd_filter_disabled = false;
+		program_hpd_filter(link);
+	} else {
 		link->is_hpd_filter_disabled = true;
 		/* Obtain HPD handle */
 		hpd = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -1
index ac0f617b43c9..fb4d9eafdc6e 100644
@@ -197,7 +197,7 @@ bool dc_link_dp_set_test_pattern(
 	const unsigned char *p_custom_pattern,
 	unsigned int cust_pattern_size);
 
-void dc_link_disable_hpd_filter(struct dc_link *link);
+void dc_link_enable_hpd_filter(struct dc_link *link, bool enable);
 
 /*
  * DPCD access interfaces
Signature · 6 lines
2.14.1

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

PATCH 4/33 drm/amd/display: Use 4096 lut entries

In reply to a message not in the archive

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77 ++++++++++++++++------
 3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 	dm->adev->mode_info.crtcs[crtc_index] = acrtc;
 	drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
 				   true, MAX_COLOR_LUT_ENTRIES);
-	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
 
 	return 0;
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +3 -1
index 5b5fa80916cb..b4c48c5edc47 100644
@@ -269,7 +269,9 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc);
 #define amdgpu_dm_crtc_handle_crc_irq(x)
 #endif
 
-#define MAX_COLOR_LUT_ENTRIES 256
+#define MAX_COLOR_LUT_ENTRIES 4096
+/* Legacy gamm LUT users such as X doesn't like large LUT sizes */
+#define MAX_COLOR_LEGACY_LUT_ENTRIES 256
 
 void amdgpu_dm_init_color_mod(void);
 int amdgpu_dm_set_degamma_lut(struct drm_crtc_state *crtc_state,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +57 -20

134 lines not on this page · raw message

Signature · 6 lines
2.14.1

_______________________________________________
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): 20180226201603.28609-5-harry.wentland-5C7GfCeVMHo@public.gmane.org

#7 lore raw

Re: [PATCH 04/33] drm/amd/display: Use 4096 lut entries

Quoted 24 lines · Harry Wentland

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77 ++++++++++++++++------
 3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index bb9405daa087..f782518fc424 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · line 3231

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 	dm->adev->mode_info.crtcs[crtc_index] = acrtc;
 	drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
 				   true, MAX_COLOR_LUT_ENTRIES);
-	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);

This means userspace can't set gamma ramps with more than 256 entries, since drm_mode_gamma_set_ioctl returns an error if the sizes don't match. We should just fix userspace which tries to use the wrong size.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): abfeaf27-d732-5d7d-5baf-90d0f3d5f326-otUistvHUpPR7s880joybQ@public.gmane.org

#9 lore raw

Re: [PATCH 04/33] drm/amd/display: Use 4096 lut entries

Quoted 20 lines · Michel Dänzer
Quoted 19 lines · Harry Wentland

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +-
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +-
  .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77 ++++++++++++++++------
  3 files changed, 61 insertions(+), 22 deletions(-)
Quoted 14 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · line 3231

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
  	dm->adev->mode_info.crtcs[crtc_index] = acrtc;
  	drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
  				   true, MAX_COLOR_LUT_ENTRIES);
-	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);

This means userspace can't set gamma ramps with more than 256 entries, since drm_mode_gamma_set_ioctl returns an error if the sizes don't match. We should just fix userspace which tries to use the wrong size.

It seems X hard-codes 256 entries for the legacy lut, ignoring what the kernel requests:

xf86CrtcCreate in xserver/hw/xfree86/modes/xf86Crtc.c (~line 120):

/* Preallocate gamma at a sensible size. */
crtc->gamma_size = 256;

I confirmed this as well via a printk on the user LUT size in drm_mode_gamma_set_ioctl (after reverting to 4096 gamma size, of course).

I'm not sure if modifying that line in X will be straightforward. It's worth noting that drm_mode_crtc_set_gamma_size() only sets the legacy gamma size. Non-legacy gamma (de/regamma) sizes are reported via a mode property, and does not conflict with legacy size. Therefore, reporting a different size for legacy shouldn't be an issue, AFAIK; as long as we check the DRM lut size and update DC accordingly, which we're doing.

Leo

Quoted 2 lines

_______________________________________________
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): 7daa4947-2ce0-2079-e33e-8bea7d1435fe-5C7GfCeVMHo@public.gmane.org

#11 lore raw

Re: [PATCH 04/33] drm/amd/display: Use 4096 lut entries

Quoted 45 lines · Leo Li
Quoted 30 lines · Michel Dänzer
Quoted 29 lines · Harry Wentland

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77
++++++++++++++++------

  3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct
 amdgpu_display_manager *dm,
       dm->adev->mode_info.crtcs[crtc_index] = acrtc;
       drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
                      true, MAX_COLOR_LUT_ENTRIES);
-    drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+    drm_mode_crtc_set_gamma_size(&acrtc->base,
 MAX_COLOR_LEGACY_LUT_ENTRIES);

This means userspace can't set gamma ramps with more than 256 entries, since drm_mode_gamma_set_ioctl returns an error if the sizes don't match. We should just fix userspace which tries to use the wrong size.

It seems X hard-codes 256 entries for the legacy lut, ignoring what the kernel requests:

xf86CrtcCreate in xserver/hw/xfree86/modes/xf86Crtc.c (~line 120):

Quoted 8 lines

/* Preallocate gamma at a sensible size. */
crtc->gamma_size = 256;

I confirmed this as well via a printk on the user LUT size in drm_mode_gamma_set_ioctl (after reverting to 4096 gamma size, of course).

I'm not sure if modifying that line in X will be straightforward.

It could be overridden by the DDX driver. However, there is the issue of using an older DDX driver with a newer kernel.

Quoted 5 lines

It's worth noting that drm_mode_crtc_set_gamma_size() only sets the legacy gamma size. Non-legacy gamma (de/regamma) sizes are reported via a mode property, and does not conflict with legacy size. Therefore, reporting a different size for legacy shouldn't be an issue, AFAIK; as long as we check the DRM lut size and update DC accordingly, which we're doing.

Makes sense, but it means that gamma will not work for 30-bit colour in Xorg until the DDX driver uses the new gamma mechanism, which might require switching to the atomic KMS API as well. Is that okay?

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 4b8a798e-d3d1-23c3-f861-52b943c14fa7-otUistvHUpPR7s880joybQ@public.gmane.org

#13 lore raw

Re: [PATCH 04/33] drm/amd/display: Use 4096 lut entries

Quoted 65 lines · Michel Dänzer
Quoted 45 lines · Leo Li
Quoted 30 lines · Michel Dänzer
Quoted 29 lines · Harry Wentland

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77
++++++++++++++++------

  3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct
 amdgpu_display_manager *dm,
       dm->adev->mode_info.crtcs[crtc_index] = acrtc;
       drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_crtc_init(struct · line 3233

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
                      true, MAX_COLOR_LUT_ENTRIES);
-    drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+    drm_mode_crtc_set_gamma_size(&acrtc->base,
 MAX_COLOR_LEGACY_LUT_ENTRIES);

This means userspace can't set gamma ramps with more than 256 entries, since drm_mode_gamma_set_ioctl returns an error if the sizes don't match. We should just fix userspace which tries to use the wrong size.

It seems X hard-codes 256 entries for the legacy lut, ignoring what the kernel requests:

xf86CrtcCreate in xserver/hw/xfree86/modes/xf86Crtc.c (~line 120):

Quoted 8 lines

/* Preallocate gamma at a sensible size. */
crtc->gamma_size = 256;

I confirmed this as well via a printk on the user LUT size in drm_mode_gamma_set_ioctl (after reverting to 4096 gamma size, of course).

I'm not sure if modifying that line in X will be straightforward.

It could be overridden by the DDX driver. However, there is the issue of using an older DDX driver with a newer kernel.

Quoted 5 lines

It's worth noting that drm_mode_crtc_set_gamma_size() only sets the legacy gamma size. Non-legacy gamma (de/regamma) sizes are reported via a mode property, and does not conflict with legacy size. Therefore, reporting a different size for legacy shouldn't be an issue, AFAIK; as long as we check the DRM lut size and update DC accordingly, which we're doing.

Quoted 4 lines

Makes sense, but it means that gamma will not work for 30-bit colour in Xorg until the DDX driver uses the new gamma mechanism, which might require switching to the atomic KMS API as well. Is that okay?

That's still current behavior, so this patch is not changing anything there. We could increase it but how would we deal with old DDX/X that assumes 256? Would it make sense instead to teach X to set the new gamma_lut property?

Harry

Quoted 1 line

_______________________________________________
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): fed46746-fff2-d1cc-b7b9-1658d05bc339-5C7GfCeVMHo@public.gmane.org

#15 lore raw

Re: [PATCH 04/33] drm/amd/display: Use 4096 lut entries

Quoted 66 lines · Harry Wentland
Quoted 65 lines · Michel Dänzer
Quoted 45 lines · Leo Li
Quoted 30 lines · Michel Dänzer
Quoted 29 lines · Harry Wentland

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77
++++++++++++++++------

  3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct
 amdgpu_display_manager *dm,
       dm->adev->mode_info.crtcs[crtc_index] = acrtc;
       drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_crtc_init(struct · line 3233

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
                      true, MAX_COLOR_LUT_ENTRIES);
-    drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+    drm_mode_crtc_set_gamma_size(&acrtc->base,
 MAX_COLOR_LEGACY_LUT_ENTRIES);

This means userspace can't set gamma ramps with more than 256 entries, since drm_mode_gamma_set_ioctl returns an error if the sizes don't match. We should just fix userspace which tries to use the wrong size.

It seems X hard-codes 256 entries for the legacy lut, ignoring what the kernel requests:

xf86CrtcCreate in xserver/hw/xfree86/modes/xf86Crtc.c (~line 120):

Quoted 8 lines

/* Preallocate gamma at a sensible size. */
crtc->gamma_size = 256;

I confirmed this as well via a printk on the user LUT size in drm_mode_gamma_set_ioctl (after reverting to 4096 gamma size, of course).

I'm not sure if modifying that line in X will be straightforward.

It could be overridden by the DDX driver. However, there is the issue of using an older DDX driver with a newer kernel.

Quoted 5 lines

It's worth noting that drm_mode_crtc_set_gamma_size() only sets the legacy gamma size. Non-legacy gamma (de/regamma) sizes are reported via a mode property, and does not conflict with legacy size. Therefore, reporting a different size for legacy shouldn't be an issue, AFAIK; as long as we check the DRM lut size and update DC accordingly, which we're doing.

Quoted 6 lines
Quoted 4 lines

Makes sense, but it means that gamma will not work for 30-bit colour in Xorg until the DDX driver uses the new gamma mechanism, which might require switching to the atomic KMS API as well. Is that okay?

That's still current behavior, so this patch is not changing anything there. We could increase it but how would we deal with old DDX/X that assumes 256? Would it make sense instead to teach X to set the new gamma_lut property?

Maybe. Can it be used without using the atomic KMS UAPI in general?

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 37e31762-70e5-4f77-4bdc-2bb1338aacfa-otUistvHUpPR7s880joybQ@public.gmane.org

#17 lore raw

Re: [PATCH 04/33] drm/amd/display: Use 4096 lut entries

Quoted 67 lines · Michel Dänzer
Quoted 66 lines · Harry Wentland
Quoted 65 lines · Michel Dänzer
Quoted 45 lines · Leo Li
Quoted 30 lines · Michel Dänzer
Quoted 29 lines · Harry Wentland

From: "Leo (Sunpeng) Li" <[email protected]>

Non-legacy LUT size should reflect hw capability. Change size from 256 to 4096.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77
++++++++++++++++------

  3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct
 amdgpu_display_manager *dm,
       dm->adev->mode_info.crtcs[crtc_index] = acrtc;
       drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_crtc_init(struct · line 3233

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
                      true, MAX_COLOR_LUT_ENTRIES);
-    drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+    drm_mode_crtc_set_gamma_size(&acrtc->base,
 MAX_COLOR_LEGACY_LUT_ENTRIES);

This means userspace can't set gamma ramps with more than 256 entries, since drm_mode_gamma_set_ioctl returns an error if the sizes don't match. We should just fix userspace which tries to use the wrong size.

It seems X hard-codes 256 entries for the legacy lut, ignoring what the kernel requests:

xf86CrtcCreate in xserver/hw/xfree86/modes/xf86Crtc.c (~line 120):

Quoted 8 lines

/* Preallocate gamma at a sensible size. */
crtc->gamma_size = 256;

I confirmed this as well via a printk on the user LUT size in drm_mode_gamma_set_ioctl (after reverting to 4096 gamma size, of course).

I'm not sure if modifying that line in X will be straightforward.

It could be overridden by the DDX driver. However, there is the issue of using an older DDX driver with a newer kernel.

Quoted 5 lines

It's worth noting that drm_mode_crtc_set_gamma_size() only sets the legacy gamma size. Non-legacy gamma (de/regamma) sizes are reported via a mode property, and does not conflict with legacy size. Therefore, reporting a different size for legacy shouldn't be an issue, AFAIK; as long as we check the DRM lut size and update DC accordingly, which we're doing.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Makes sense, but it means that gamma will not work for 30-bit colour in Xorg until the DDX driver uses the new gamma mechanism, which might require switching to the atomic KMS API as well. Is that okay?

That's still current behavior, so this patch is not changing anything there. We could increase it but how would we deal with old DDX/X that assumes 256? Would it make sense instead to teach X to set the new gamma_lut property?

Maybe. Can it be used without using the atomic KMS UAPI in general?

Both legacy and atomic KMS can set non-legacy gamma(the new degamma_lut, ctm, and gamma_lut properties on CRTC). Legacy KMS can use DRM_IOCTL_MODE_SETPROPERTY to set these. IGT exercises both atomic and non-atomic KMS code paths to test these properties.

Only legacy KMS sets the legacy gamma property through the DRM_IOCTL_MODE_SETGAMMA IOCTL.

Harry

Quoted 1 line

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

#18 lore raw

PATCH v2 1/1 drm/amd/display: Use 4096 lut entries

In reply to a message not in the archive

From: "Leo (Sunpeng) Li" <[email protected]>

Points in the DRM LUT are spaced linearly. Points in hardware are spaced exponentially, with greater density towards 0. To maintain low-end accuracy in hardware when sampling the DRM LUT, more points are needed.

However, X doesn't seem to play with legacy LUTs of such size. Therefore, check for legacy lut when updating DC states, and update accordingly.

v2: Use a macro for the maximum drm LUT value.

v3: Update commit to reflect that this does not map 1-1 to HW

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  4 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c    | 77 ++++++++++++++++------
 3 files changed, 61 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index bb9405daa087..f782518fc424 100644
@@ -3228,7 +3228,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 	dm->adev->mode_info.crtcs[crtc_index] = acrtc;
 	drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
 				   true, MAX_COLOR_LUT_ENTRIES);
-	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LUT_ENTRIES);
+	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
 
 	return 0;
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +3 -1
index 5b5fa80916cb..b4c48c5edc47 100644
@@ -269,7 +269,9 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc);
 #define amdgpu_dm_crtc_handle_crc_irq(x)
 #endif
 
-#define MAX_COLOR_LUT_ENTRIES 256
+#define MAX_COLOR_LUT_ENTRIES 4096
+/* Legacy gamm LUT users such as X doesn't like large LUT sizes */
+#define MAX_COLOR_LEGACY_LUT_ENTRIES 256
 
 void amdgpu_dm_init_color_mod(void);
 int amdgpu_dm_set_degamma_lut(struct drm_crtc_state *crtc_state,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +57 -20

134 lines not on this page · raw message

Signature · 6 lines
2.14.1

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

PATCH 5/33 drm/amd/display: update cur_clock correctly within set bandwidth

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -7
index 29dc37fbdb26..0384aefd79b6 100644
@@ -2054,22 +2054,24 @@ static void dcn10_set_bandwidth(
 		dc->res_pool->display_clock->funcs->set_clock(
 				dc->res_pool->display_clock,
 				context->bw.dcn.calc_clk.dispclk_khz);
-		dc->current_state->bw.dcn.cur_clk.dispclk_khz =
+		context->bw.dcn.cur_clk.dispclk_khz =
 				context->bw.dcn.calc_clk.dispclk_khz;
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.dcfclk_khz
 			> dc->current_state->bw.dcn.cur_clk.dcfclk_khz) {
+		context->bw.dcn.cur_clk.dcfclk_khz =
+				context->bw.dcn.calc_clk.dcfclk_khz;
 		smu_req.hard_min_dcefclk_khz =
 				context->bw.dcn.calc_clk.dcfclk_khz;
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.fclk_khz
 			> dc->current_state->bw.dcn.cur_clk.fclk_khz) {
+		context->bw.dcn.cur_clk.fclk_khz =
+				context->bw.dcn.calc_clk.fclk_khz;
 		smu_req.hard_min_fclk_khz = context->bw.dcn.calc_clk.fclk_khz;
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz
 			> dc->current_state->bw.dcn.cur_clk.dcfclk_deep_sleep_khz) {
-		dc->current_state->bw.dcn.calc_clk.dcfclk_deep_sleep_khz =
-				context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz;
 		context->bw.dcn.cur_clk.dcfclk_deep_sleep_khz =
 				context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz;
 	}
@@ -2084,15 +2086,11 @@ static void dcn10_set_bandwidth(
 	/* Decrease in freq is increase in period so opposite comparison for dram_ccm */
 	if (decrease_allowed || context->bw.dcn.calc_clk.dram_ccm_us
 			< dc->current_state->bw.dcn.cur_clk.dram_ccm_us) {
-		dc->current_state->bw.dcn.calc_clk.dram_ccm_us =
-				context->bw.dcn.calc_clk.dram_ccm_us;
 		context->bw.dcn.cur_clk.dram_ccm_us =
 				context->bw.dcn.calc_clk.dram_ccm_us;
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.min_active_dram_ccm_us
 			< dc->current_state->bw.dcn.cur_clk.min_active_dram_ccm_us) {
-		dc->current_state->bw.dcn.calc_clk.min_active_dram_ccm_us =
-				context->bw.dcn.calc_clk.min_active_dram_ccm_us;
 		context->bw.dcn.cur_clk.min_active_dram_ccm_us =
 				context->bw.dcn.calc_clk.min_active_dram_ccm_us;
 	}
Signature · 6 lines
2.14.1

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

PATCH 6/33 drm/amd/display: Check DCN PState ASSERT failure

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

[Description] ASIC change debug register definition

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 9 ++++++---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +6 -3
index eb8317187f30..f984583b9caa 100644
@@ -100,7 +100,6 @@ bool hubbub1_verify_allow_pstate_change_high(
 	static unsigned int max_sampled_pstate_wait_us; /* data collection */
 	static bool forced_pstate_allow; /* help with revert wa */
 
-	unsigned int debug_index = 0x7;
 	unsigned int debug_data;
 	unsigned int i;
 
@@ -115,7 +114,9 @@ bool hubbub1_verify_allow_pstate_change_high(
 		forced_pstate_allow = false;
 	}
 
-	/* description "3-0:   Pipe0 cursor0 QOS
+	/* RV1:
+	 * dchubbubdebugind, at: 0x7
+	 * description "3-0:   Pipe0 cursor0 QOS
 	 * 7-4:   Pipe1 cursor0 QOS
 	 * 11-8:  Pipe2 cursor0 QOS
 	 * 15-12: Pipe3 cursor0 QOS
@@ -137,7 +138,8 @@ bool hubbub1_verify_allow_pstate_change_high(
 	 * 31:    SOC pstate change request
 	 */
 
-	REG_WRITE(DCHUBBUB_TEST_DEBUG_INDEX, debug_index);
+
+	REG_WRITE(DCHUBBUB_TEST_DEBUG_INDEX, hubbub->debug_test_index_pstate);
 
 	for (i = 0; i < pstate_wait_timeout_us; i++) {
 		debug_data = REG_READ(DCHUBBUB_TEST_DEBUG_DATA);
@@ -512,5 +514,6 @@ void hubbub1_construct(struct hubbub *hubbub,
 	hubbub->shifts = hubbub_shift;
 	hubbub->masks = hubbub_mask;
 
+	hubbub->debug_test_index_pstate = 0x7;
 }
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h +1 -0
index d5c97844312f..a16e908821a0 100644
@@ -185,6 +185,7 @@ struct hubbub {
 	const struct dcn_hubbub_registers *regs;
 	const struct dcn_hubbub_shift *shifts;
 	const struct dcn_hubbub_mask *masks;
+	unsigned int debug_test_index_pstate;
 };
 
 void hubbub1_update_dchub(
Signature · 6 lines
2.14.1

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

PATCH 7/33 drm/amd/display: dal 3.1.35

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 5bb0e5defaf4..a6402c651251 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.34"
+#define DC_VER "3.1.35"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.14.1

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

PATCH 8/33 drm/amd/display: fix missing az disable in reset backend

In reply to a message not in the archive

From: Eric Yang <[email protected]>

Optimization in reset backend skips disable stream if it is already done in dc_stream_set_dpms. However that path does not disable az in order to prevent audio from toggling between internal and external displays. This still need to be done.

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +16 -0
index 0384aefd79b6..4adb2d311d4e 100644
@@ -536,6 +536,22 @@ static void reset_back_end_for_pipe(
 		/* DPMS may already disable */
 		if (!pipe_ctx->stream->dpms_off)
 			core_link_disable_stream(pipe_ctx, FREE_ACQUIRED_RESOURCE);
+		else if (pipe_ctx->stream_res.audio) {
+			/*
+			 * if stream is already disabled outside of commit streams path,
+			 * audio disable was skipped. Need to do it here
+			 */
+			pipe_ctx->stream_res.audio->funcs->az_disable(pipe_ctx->stream_res.audio);
+
+			if (dc->caps.dynamic_audio == true) {
+				/*we have to dynamic arbitrate the audio endpoints*/
+				pipe_ctx->stream_res.audio = NULL;
+				/*we free the resource, need reset is_audio_acquired*/
+				update_audio_usage(&dc->current_state->res_ctx, dc->res_pool, pipe_ctx->stream_res.audio, false);
+			}
+
+		}
+
 	}
 
 	/* by upper caller loop, parent pipe: pipe0, will be reset last.
Signature · 6 lines
2.14.1

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

PATCH 9/33 drm/amd/display: Clear dmps off for eDP when resume.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

This patch fixed secondary screen only S4 resume, eDP is unintentionally light up due to incorrect dpms off flag.

When entering S4, dpms off flags are set to true via
set power state. During resume, eDP is light up by vbios, so the flags should be changed to false to match the real state.
By change the flag properly, eDP is able to be turned off properly as per OS request.

This change may affect S3/S4 Shut down resume IOIC, need to verify those cases.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c               | 4 ++++
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++----
 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -0
index 556b155ba5af..b7540152005b 100644
@@ -2297,9 +2297,13 @@ void core_link_enable_stream(
 	if (pipe_ctx->stream->signal == SIGNAL_TYPE_EDP &&
 		core_dc->apply_edp_fast_boot_optimization) {
 		core_dc->apply_edp_fast_boot_optimization = false;
+		pipe_ctx->stream->dpms_off = false;
 		return;
 	}
 
+	if (pipe_ctx->stream->dpms_off)
+		return;
+
 	status = enable_link(state, pipe_ctx);
 
 	if (status != DC_OK) {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -4
index 0422c72a7579..73e0bcd5ba8f 100644
@@ -1320,10 +1320,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 
 	resource_build_info_frame(pipe_ctx);
 	dce110_update_info_frame(pipe_ctx);
-	if (!pipe_ctx_old->stream) {
-		if (!pipe_ctx->stream->dpms_off)
-			core_link_enable_stream(context, pipe_ctx);
-	}
+	if (!pipe_ctx_old->stream)
+		core_link_enable_stream(context, pipe_ctx);
 
 	pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
 
Signature · 6 lines
2.14.1

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

PATCH 10/33 drm/amd/display: add psr_version to stream

In reply to a message not in the archive

From: Xingyue Tao <[email protected]>

Brightness could not be changed for some panels whose DPCD_version is below 1.2 Now psr_version is added into stream, and it copies from the displayTarget's psr_version. It checks if the stream's psr_versio is non-zero and sets the vsc info packet revision now.

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h        | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index ce0e9e76eb35..48709d4b5627 100644
@@ -2436,7 +2436,7 @@ static void set_vsc_info_packet(
 	unsigned int i;
 
 	/*VSC packet set to 2 when DP revision >= 1.2*/
-	if (stream->sink->link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_12) {
+	if (stream->psr_version != 0) {
 		vscPacketRevision = 2;
 	}
 
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -1
index 78a2bbe0b272..f44cd4d87b79 100644
@@ -70,7 +70,8 @@ struct dc_stream_state {
 	bool ignore_msa_timing_param;
 	/* TODO: custom INFO packets */
 	/* TODO: ABM info (DMCU) */
-	/* TODO: PSR info */
+	/* PSR info */
+	unsigned char psr_version;
 	/* TODO: CEA VIC */
 
 	/* from core_stream struct */
Signature · 6 lines
2.14.1

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

PATCH 11/33 drm/amd/display: Update Link Training Fallback logic

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

[Description]
When CR fails to minimum link rate,
we should reduce lane count to the number lowest cr_done lanes.

[Code Review]
Jun Lei

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   | 98 ++++++++++++++++------
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |  1 +
 .../drm/amd/display/include/link_service_types.h   |  5 +-
 3 files changed, 79 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +74 -24
index 604fb0171ee3..4c21da54a9d5 100644
@@ -709,6 +709,22 @@ static enum hw_dp_training_pattern get_supported_tp(struct dc_link *link)
 	return HW_DP_TRAINING_PATTERN_2;
 }
 
+static enum link_training_result get_cr_failure(enum dc_lane_count ln_count,
+					union lane_status *dpcd_lane_status)
+{
+	enum link_training_result result = LINK_TRAINING_SUCCESS;
+
+	if (ln_count >= LANE_COUNT_ONE && !dpcd_lane_status[0].bits.CR_DONE_0)
+		result = LINK_TRAINING_CR_FAIL_LANE0;
+	else if (ln_count >= LANE_COUNT_TWO && !dpcd_lane_status[1].bits.CR_DONE_0)
+		result = LINK_TRAINING_CR_FAIL_LANE1;
+	else if (ln_count >= LANE_COUNT_FOUR && !dpcd_lane_status[2].bits.CR_DONE_0)
+		result = LINK_TRAINING_CR_FAIL_LANE23;
+	else if (ln_count >= LANE_COUNT_FOUR && !dpcd_lane_status[3].bits.CR_DONE_0)
+		result = LINK_TRAINING_CR_FAIL_LANE23;
+	return result;
+}
+
 static enum link_training_result perform_channel_equalization_sequence(
 	struct dc_link *link,
 	struct link_training_settings *lt_settings)
@@ -771,7 +787,7 @@ static enum link_training_result perform_channel_equalization_sequence(
 
 }
 
-static bool perform_clock_recovery_sequence(
+static enum link_training_result perform_clock_recovery_sequence(
 	struct dc_link *link,
 	struct link_training_settings *lt_settings)
 {
@@ -846,11 +862,11 @@ static bool perform_clock_recovery_sequence(
 
 		/* 5. check CR done*/
 		if (is_cr_done(lane_count, dpcd_lane_status))
-			return true;
+			return LINK_TRAINING_SUCCESS;
 
 		/* 6. max VS reached*/
 		if (is_max_vs_reached(lt_settings))
-			return false;
+			break;
 
 		/* 7. same voltage*/
 		/* Note: VS same for all lanes,
@@ -876,13 +892,13 @@ static bool perform_clock_recovery_sequence(
 
 	}
 
-	return false;
+	return get_cr_failure(lane_count, dpcd_lane_status);
 }
 
-static inline bool perform_link_training_int(
+static inline enum link_training_result perform_link_training_int(
 	struct dc_link *link,
 	struct link_training_settings *lt_settings,
-	bool status)
+	enum link_training_result status)
 {
 	union lane_count_set lane_count_set = { {0} };
 	union dpcd_training_pattern dpcd_pattern = { {0} };
@@ -903,9 +919,9 @@ static inline bool perform_link_training_int(
 			get_supported_tp(link) == HW_DP_TRAINING_PATTERN_4)
 		return status;
 
-	if (status &&
+	if (status == LINK_TRAINING_SUCCESS &&
 		perform_post_lt_adj_req_sequence(link, lt_settings) == false)
-		status = false;
+		status = LINK_TRAINING_LQA_FAIL;
 
 	lane_count_set.bits.LANE_COUNT_SET = lt_settings->link_settings.lane_count;
 	lane_count_set.bits.ENHANCED_FRAMING = 1;
@@ -928,6 +944,8 @@ enum link_training_result dc_link_dp_perform_link_training(
 	enum link_training_result status = LINK_TRAINING_SUCCESS;
 
 	char *link_rate = "Unknown";
+	char *lt_result = "Unknown";
+
 	struct link_training_settings lt_settings;
 
 	memset(&lt_settings, '\0', sizeof(lt_settings));
@@ -951,22 +969,16 @@ enum link_training_result dc_link_dp_perform_link_training(
 
 	/* 2. perform link training (set link training done
 	 *  to false is done as well)*/
-	if (!perform_clock_recovery_sequence(link, &lt_settings)) {
-		status = LINK_TRAINING_CR_FAIL;
-	} else {
+	status = perform_clock_recovery_sequence(link, &lt_settings);
+	if (status == LINK_TRAINING_SUCCESS) {
 		status = perform_channel_equalization_sequence(link,
 				&lt_settings);
 	}
 
 	if ((status == LINK_TRAINING_SUCCESS) || !skip_video_pattern) {
-		if (!perform_link_training_int(link,
+		status = perform_link_training_int(link,
 				&lt_settings,
-				status == LINK_TRAINING_SUCCESS)) {
-			/* the next link training setting in this case
-			 * would be the same as CR failure case.
-			 */
-			status = LINK_TRAINING_CR_FAIL;
-		}
+				status);
 	}
 
 	/* 6. print status message*/
@@ -991,13 +1003,37 @@ enum link_training_result dc_link_dp_perform_link_training(
 		break;
 	}
 
+	switch (status) {
+	case LINK_TRAINING_SUCCESS:
+		lt_result = "pass";
+		break;
+	case LINK_TRAINING_CR_FAIL_LANE0:
+		lt_result = "CR failed lane0";
+		break;
+	case LINK_TRAINING_CR_FAIL_LANE1:
+		lt_result = "CR failed lane1";
+		break;
+	case LINK_TRAINING_CR_FAIL_LANE23:
+		lt_result = "CR failed lane23";
+		break;
+	case LINK_TRAINING_EQ_FAIL_CR:
+		lt_result = "CR failed in EQ";
+		break;
+	case LINK_TRAINING_EQ_FAIL_EQ:
+		lt_result = "EQ failed";
+		break;
+	case LINK_TRAINING_LQA_FAIL:
+		lt_result = "LQA failed";
+		break;
+	default:
+		break;
+	}
+
 	/* Connectivity log: link training */
 	CONN_MSG_LT(link, "%sx%d %s VS=%d, PE=%d",
 			link_rate,
 			lt_settings.link_settings.lane_count,
-			(status ==  LINK_TRAINING_SUCCESS) ? "pass" :
-			((status == LINK_TRAINING_CR_FAIL) ? "CR failed" :
-			"EQ failed"),
+			lt_result,
 			lt_settings.lane_settings[0].VOLTAGE_SWING,
 			lt_settings.lane_settings[0].PRE_EMPHASIS);
 
@@ -1115,6 +1151,7 @@ bool dp_hbr_verify_link_cap(
 				dp_cs_id,
 				cur);
 
+
 		if (skip_link_training)
 			success = true;
 		else {
@@ -1279,7 +1316,10 @@ static bool decide_fallback_link_setting(
 		return false;
 
 	switch (training_result) {
-	case LINK_TRAINING_CR_FAIL:
+	case LINK_TRAINING_CR_FAIL_LANE0:
+	case LINK_TRAINING_CR_FAIL_LANE1:
+	case LINK_TRAINING_CR_FAIL_LANE23:
+	case LINK_TRAINING_LQA_FAIL:
 	{
 		if (!reached_minimum_link_rate
 				(current_link_setting->link_rate)) {
@@ -1290,8 +1330,18 @@ static bool decide_fallback_link_setting(
 				(current_link_setting->lane_count)) {
 			current_link_setting->link_rate =
 				initial_link_settings.link_rate;
-			current_link_setting->lane_count =
-				reduce_lane_count(
+			if (training_result == LINK_TRAINING_CR_FAIL_LANE0)
+				return false;
+			else if (training_result == LINK_TRAINING_CR_FAIL_LANE1)
+				current_link_setting->lane_count =
+						LANE_COUNT_ONE;
+			else if (training_result ==
+					LINK_TRAINING_CR_FAIL_LANE23)
+				current_link_setting->lane_count =
+						LANE_COUNT_TWO;
+			else
+				current_link_setting->lane_count =
+					reduce_lane_count(
 					current_link_setting->lane_count);
 		} else {
 			return false;
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +1 -0
index bae9b0587e12..7c866a7d5e77 100644
@@ -279,6 +279,7 @@ void dp_retrain_link_dp_test(struct dc_link *link,
 
 	for (i = 0; i < MAX_PIPES; i++) {
 		if (pipes[i].stream != NULL &&
+			!pipes[i].top_pipe &&
 			pipes[i].stream->sink != NULL &&
 			pipes[i].stream->sink->link != NULL &&
 			pipes[i].stream_res.stream_enc != NULL &&
drivers/gpu/drm/amd/display/include/link_service_types.h +4 -1
index adea1a59f620..80f0d93cfd94 100644
@@ -58,11 +58,14 @@ enum {
 
 enum link_training_result {
 	LINK_TRAINING_SUCCESS,
-	LINK_TRAINING_CR_FAIL,
+	LINK_TRAINING_CR_FAIL_LANE0,
+	LINK_TRAINING_CR_FAIL_LANE1,
+	LINK_TRAINING_CR_FAIL_LANE23,
 	/* CR DONE bit is cleared during EQ step */
 	LINK_TRAINING_EQ_FAIL_CR,
 	/* other failure during EQ step */
 	LINK_TRAINING_EQ_FAIL_EQ,
+	LINK_TRAINING_LQA_FAIL,
 };
 
 struct link_training_settings {
Signature · 6 lines
2.14.1

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

PATCH 12/33 drm/amd/display: Add regamma lut write mask to SOC base

In reply to a message not in the archive

From: "Leo (Sunpeng) Li" <[email protected]>

Mask and shift values for DCP0_REGAMMA_LUT_WRITE_EN_MASK were missing from XFM_COMMON_MASK_SH_LIST_SOC_BASE. Add it.

---
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dce/dce_transform.h +1 -0
index bfc94b4927b9..948281d8b6af 100644
@@ -248,6 +248,7 @@
 	XFM_SF(DCP0_REGAMMA_CNTLA_REGION_0_1, REGAMMA_CNTLA_EXP_REGION1_LUT_OFFSET, mask_sh),\
 	XFM_SF(DCP0_REGAMMA_CNTLA_REGION_0_1, REGAMMA_CNTLA_EXP_REGION1_NUM_SEGMENTS, mask_sh),\
 	XFM_SF(DCP0_REGAMMA_CONTROL, GRPH_REGAMMA_MODE, mask_sh),\
+	XFM_SF(DCP0_REGAMMA_LUT_WRITE_EN_MASK, REGAMMA_LUT_WRITE_EN_MASK, mask_sh),\
 	XFM_SF(SCL0_SCL_MODE, SCL_MODE, mask_sh), \
 	XFM_SF(SCL0_SCL_TAP_CONTROL, SCL_H_NUM_OF_TAPS, mask_sh), \
 	XFM_SF(SCL0_SCL_TAP_CONTROL, SCL_V_NUM_OF_TAPS, mask_sh), \
Signature · 6 lines
2.14.1

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

PATCH 13/33 drm/amd/display: allocate fbc buffer in AMDGPU_GEM_DOMAIN_GTT

In reply to a message not in the archive

From: Shirish S <[email protected]>

Currently the FBC buffer is allocated in VRAM, since VRAM usage is dedicatedly for scanouts, by allocating FBC back buffer in GTT shall help in conserving VRAM for other purposes.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index f782518fc424..64a3abed2466 100644
@@ -374,7 +374,7 @@ static void amdgpu_dm_fbc_init(struct drm_connector *connector)
 
 	if (max_size) {
 		int r = amdgpu_bo_create_kernel(adev, max_size * 4, PAGE_SIZE,
-			    AMDGPU_GEM_DOMAIN_VRAM, &compressor->bo_ptr,
+			    AMDGPU_GEM_DOMAIN_GTT, &compressor->bo_ptr,
 			    &compressor->gpu_addr, &compressor->cpu_addr);
 
 		if (r)
Signature · 6 lines
2.14.1

_______________________________________________
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): 20180226201603.28609-14-harry.wentland-5C7GfCeVMHo@public.gmane.org

#29 lore raw

Re: [PATCH 13/33] drm/amd/display: allocate fbc buffer in AMDGPU_GEM_DOMAIN_GTT

Quoted 5 lines · Harry Wentland

From: Shirish S <[email protected]>

Currently the FBC buffer is allocated in VRAM, since VRAM usage is dedicatedly for scanouts, by allocating FBC back buffer in GTT shall help in conserving VRAM for other purposes.

Are there any dGPUs that support FBC? If so, will this be an issue there?

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index f782518fc424..64a3abed2466 100644
@@ -374,7 +374,7 @@ static void amdgpu_dm_fbc_init(struct drm_connector *connector)
 
        if (max_size) {
                int r = amdgpu_bo_create_kernel(adev, max_size * 4, PAGE_SIZE,
-                           AMDGPU_GEM_DOMAIN_VRAM, &compressor->bo_ptr,
+                           AMDGPU_GEM_DOMAIN_GTT, &compressor->bo_ptr,
                            &compressor->gpu_addr, &compressor->cpu_addr);
 
                if (r)
--

2.14.1

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

A message that is not in the archive (sent off-list or not yet received): CADnq5_M+gR3XE0sM3UTW_z1D=X4R4h+ikA8T+iWmSoczbZA_bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#31 lore raw

Re: [PATCH 13/33] drm/amd/display: allocate fbc buffer in AMDGPU_GEM_DOMAIN_GTT

Quoted 9 lines · Alex Deucher
Quoted 5 lines · Harry Wentland

From: Shirish S <[email protected]>

Currently the FBC buffer is allocated in VRAM, since VRAM usage is dedicatedly for scanouts, by allocating FBC back buffer in GTT shall help in conserving VRAM for other purposes.

Are there any dGPUs that support FBC? If so, will this be an issue there?

We only create dc->fbc_compressor for DCE11 (CZ/ST) so amdgpu_dm_fbc_init will early return.

See dce110_resource.c's construct()

Harry

Quoted 22 lines

Alex

Quoted 20 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index f782518fc424..64a3abed2466 100644
@@ -374,7 +374,7 @@ static void amdgpu_dm_fbc_init(struct drm_connector *connector)
 
        if (max_size) {
                int r = amdgpu_bo_create_kernel(adev, max_size * 4, PAGE_SIZE,
-                           AMDGPU_GEM_DOMAIN_VRAM, &compressor->bo_ptr,
+                           AMDGPU_GEM_DOMAIN_GTT, &compressor->bo_ptr,
                            &compressor->gpu_addr, &compressor->cpu_addr);
 
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
                if (r)
--

2.14.1

_______________________________________________
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

#32 lore raw

PATCH 14/33 drm/amd/display: Update DCN OPTC registers

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 +++-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h         | 6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -1
index 4adb2d311d4e..7a1b2deaf3d7 100644
@@ -1584,6 +1584,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state)
 		dpp->funcs->dpp_program_bias_and_scale(dpp, &bns_params);
 }
 
+
 static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
 	struct hubp *hubp = pipe_ctx->plane_res.hubp;
@@ -1819,8 +1820,9 @@ static void program_all_pipe_in_tree(
 			dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
 	}
 
-	if (pipe_ctx->bottom_pipe != NULL && pipe_ctx->bottom_pipe != pipe_ctx)
+	if (pipe_ctx->bottom_pipe != NULL && pipe_ctx->bottom_pipe != pipe_ctx) {
 		program_all_pipe_in_tree(dc, pipe_ctx->bottom_pipe, context);
+	}
 }
 
 static void dcn10_pplib_apply_display_requirements(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +4 -2
index 014543235df8..d25e7bf0d0d7 100644
@@ -83,6 +83,8 @@
 
 
 struct dcn_optc_registers {
+	uint32_t OTG_GLOBAL_CONTROL1;
+	uint32_t OTG_GLOBAL_CONTROL2;
 	uint32_t OTG_VERT_SYNC_CONTROL;
 	uint32_t OTG_MASTER_UPDATE_MODE;
 	uint32_t OTG_GSL_CONTROL;
@@ -126,6 +128,7 @@ struct dcn_optc_registers {
 	uint32_t OTG_VERTICAL_INTERRUPT2_POSITION;
 	uint32_t OPTC_INPUT_CLOCK_CONTROL;
 	uint32_t OPTC_DATA_SOURCE_SELECT;
+	uint32_t OPTC_MEMORY_CONFIG;
 	uint32_t OPTC_INPUT_GLOBAL_CONTROL;
 	uint32_t CONTROL;
 	uint32_t OTG_GSL_WINDOW_X;
@@ -325,10 +328,9 @@ struct dcn_optc_registers {
 	type OPTC_INPUT_CLK_EN;\
 	type OPTC_INPUT_CLK_ON;\
 	type OPTC_INPUT_CLK_GATE_DIS;\
-	type OPTC_SRC_SEL;\
-	type OPTC_SEG0_SRC_SEL;\
 	type OPTC_UNDERFLOW_OCCURRED_STATUS;\
 	type OPTC_UNDERFLOW_CLEAR;\
+	type OPTC_SRC_SEL;\
 	type VTG0_ENABLE;\
 	type VTG0_FP2;\
 	type VTG0_VCOUNT_INIT;\
Signature · 6 lines
2.14.1

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

PATCH 15/33 drm/amd/display: add per pipe dppclk for

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c          |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c            | 13 +++++++------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c          |  6 ++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |  9 +++++----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h           | 15 +++++++++++++--
 5 files changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -1
index c9aa686d16b9..e4d8a8dbc5ef 100644
@@ -996,7 +996,7 @@ bool dcn_validate_bandwidth(
 					dc->debug.min_disp_clk_khz;
 		}
 
-		context->bw.dcn.calc_clk.dppclk_div = (int)(v->dispclk_dppclk_ratio) == 2;
+		context->bw.dcn.calc_clk.max_dppclk_khz = (int)(v->dppclk * 1000);
 
 		for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
 			struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +7 -6
index 1babac07bcc9..c15565092ca8 100644
@@ -361,21 +361,22 @@ void context_clock_trace(
 	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 
-	CLOCK_TRACE("Current: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+	CLOCK_TRACE("Current: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
 			"dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
 			context->bw.dcn.calc_clk.dispclk_khz,
-			context->bw.dcn.calc_clk.dppclk_div,
+			context->bw.dcn.calc_clk.max_dppclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
 			context->bw.dcn.calc_clk.fclk_khz,
+			context->bw.dcn.calc_clk.socclk_khz,
 			context->bw.dcn.calc_clk.dram_ccm_us,
 			context->bw.dcn.calc_clk.min_active_dram_ccm_us);
-	CLOCK_TRACE("Calculated: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+	CLOCK_TRACE("Calculated: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
 			"dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
 			context->bw.dcn.calc_clk.dispclk_khz,
-			context->bw.dcn.calc_clk.dppclk_div,
+			context->bw.dcn.calc_clk.max_dppclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
 			context->bw.dcn.calc_clk.fclk_khz,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +2 -4
index 8725cab9ec00..f0b798930b51 100644
@@ -432,14 +432,12 @@ void dpp1_dppclk_control(
 	struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
 
 	if (enable) {
-		if (dpp->tf_mask->DPPCLK_RATE_CONTROL) {
+		if (dpp->tf_mask->DPPCLK_RATE_CONTROL)
 			REG_UPDATE_2(DPP_CONTROL,
 				DPPCLK_RATE_CONTROL, dppclk_div,
 				DPP_CLOCK_ENABLE, 1);
-		} else {
-			ASSERT(dppclk_div == false);
+		else
 			REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 1);
-		}
 	} else
 		REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 0);
 }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -4
index 7a1b2deaf3d7..759e925439ce 100644
@@ -1684,12 +1684,13 @@ static void update_dchubp_dpp(
 	if (plane_state->update_flags.bits.full_update) {
 		dpp->funcs->dpp_dppclk_control(
 				dpp,
-				context->bw.dcn.calc_clk.dppclk_div,
+				context->bw.dcn.calc_clk.max_dppclk_khz <
+						context->bw.dcn.calc_clk.dispclk_khz,
 				true);
 
-		dc->current_state->bw.dcn.cur_clk.dppclk_div =
-				context->bw.dcn.calc_clk.dppclk_div;
-		context->bw.dcn.cur_clk.dppclk_div = context->bw.dcn.calc_clk.dppclk_div;
+		dc->current_state->bw.dcn.cur_clk.max_dppclk_khz =
+				context->bw.dcn.calc_clk.max_dppclk_khz;
+		context->bw.dcn.cur_clk.max_dppclk_khz = context->bw.dcn.calc_clk.max_dppclk_khz;
 	}
 
 	/* TODO: Need input parameter to tell current DCHUB pipe tie to which OTG
drivers/gpu/drm/amd/display/dc/inc/core_types.h +13 -2
index 5509e13e7edf..a9b21a4a0c17 100644
@@ -177,6 +177,15 @@ struct resource_pool {
 	const struct resource_caps *res_cap;
 };
 
+struct dcn_fe_clocks {
+	int dppclk_khz;
+};
+
+struct dcn_fe_bandwidth {
+	struct dcn_fe_clocks calc;
+	struct dcn_fe_clocks cur;
+};
+
 struct stream_resource {
 	struct output_pixel_processor *opp;
 	struct timing_generator *tg;
@@ -195,6 +204,8 @@ struct plane_resource {
 	struct transform *xfm;
 	struct dpp *dpp;
 	uint8_t mpcc_inst;
+
+	struct dcn_fe_bandwidth bw;
 };
 
 struct pipe_ctx {
@@ -247,9 +258,9 @@ struct dce_bw_output {
 
 struct dcn_bw_clocks {
 	int dispclk_khz;
-	int dppclk_khz;
-	bool dppclk_div;
+	int max_dppclk_khz;
 	int dcfclk_khz;
+	int socclk_khz;
 	int dcfclk_deep_sleep_khz;
 	int fclk_khz;
 	int dram_ccm_us;
Signature · 6 lines
2.14.1

_______________________________________________
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): 20180226201603.28609-16-harry.wentland-5C7GfCeVMHo@public.gmane.org

#35 lore raw

Re: [PATCH 15/33] drm/amd/display: add per pipe dppclk for

Quoted 5 lines · Harry Wentland

From: Dmytro Laktyushkin <[email protected]>

Did the patch title get cut off? add per pipe dppclk for...what?

Alex

Quoted 141 lines
---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c          |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c            | 13 +++++++------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c          |  6 ++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |  9 +++++----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h           | 15 +++++++++++++--
 5 files changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -1
index c9aa686d16b9..e4d8a8dbc5ef 100644
@@ -996,7 +996,7 @@ bool dcn_validate_bandwidth(
                                        dc->debug.min_disp_clk_khz;
                }
 
-               context->bw.dcn.calc_clk.dppclk_div = (int)(v->dispclk_dppclk_ratio) == 2;
+               context->bw.dcn.calc_clk.max_dppclk_khz = (int)(v->dppclk * 1000);
 
                for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
                        struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +7 -6
index 1babac07bcc9..c15565092ca8 100644
@@ -361,21 +361,22 @@ void context_clock_trace(
        struct dc  *core_dc = dc;
        struct dal_logger *logger =  core_dc->ctx->logger;
 
-       CLOCK_TRACE("Current: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+       CLOCK_TRACE("Current: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
                        "dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
                        context->bw.dcn.calc_clk.dispclk_khz,
-                       context->bw.dcn.calc_clk.dppclk_div,
+                       context->bw.dcn.calc_clk.max_dppclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
                        context->bw.dcn.calc_clk.fclk_khz,
+                       context->bw.dcn.calc_clk.socclk_khz,
                        context->bw.dcn.calc_clk.dram_ccm_us,
                        context->bw.dcn.calc_clk.min_active_dram_ccm_us);
-       CLOCK_TRACE("Calculated: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+       CLOCK_TRACE("Calculated: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
                        "dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
                        context->bw.dcn.calc_clk.dispclk_khz,
-                       context->bw.dcn.calc_clk.dppclk_div,
+                       context->bw.dcn.calc_clk.max_dppclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
                        context->bw.dcn.calc_clk.fclk_khz,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +2 -4
index 8725cab9ec00..f0b798930b51 100644
@@ -432,14 +432,12 @@ void dpp1_dppclk_control(
        struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
 
        if (enable) {
-               if (dpp->tf_mask->DPPCLK_RATE_CONTROL) {
+               if (dpp->tf_mask->DPPCLK_RATE_CONTROL)
                        REG_UPDATE_2(DPP_CONTROL,
                                DPPCLK_RATE_CONTROL, dppclk_div,
                                DPP_CLOCK_ENABLE, 1);
-               } else {
-                       ASSERT(dppclk_div == false);
+               else
                        REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 1);
-               }
        } else
                REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 0);
 }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -4
index 7a1b2deaf3d7..759e925439ce 100644
@@ -1684,12 +1684,13 @@ static void update_dchubp_dpp(
        if (plane_state->update_flags.bits.full_update) {
                dpp->funcs->dpp_dppclk_control(
                                dpp,
-                               context->bw.dcn.calc_clk.dppclk_div,
+                               context->bw.dcn.calc_clk.max_dppclk_khz <
+                                               context->bw.dcn.calc_clk.dispclk_khz,
                                true);
 
-               dc->current_state->bw.dcn.cur_clk.dppclk_div =
-                               context->bw.dcn.calc_clk.dppclk_div;
-               context->bw.dcn.cur_clk.dppclk_div = context->bw.dcn.calc_clk.dppclk_div;
+               dc->current_state->bw.dcn.cur_clk.max_dppclk_khz =
+                               context->bw.dcn.calc_clk.max_dppclk_khz;
+               context->bw.dcn.cur_clk.max_dppclk_khz = context->bw.dcn.calc_clk.max_dppclk_khz;
        }
 
        /* TODO: Need input parameter to tell current DCHUB pipe tie to which OTG
drivers/gpu/drm/amd/display/dc/inc/core_types.h +13 -3
index 5509e13e7edf..a9b21a4a0c17 100644
@@ -177,6 +177,15 @@ struct resource_pool {
        const struct resource_caps *res_cap;
 };
 
+struct dcn_fe_clocks {
+       int dppclk_khz;
+};
+
+struct dcn_fe_bandwidth {
+       struct dcn_fe_clocks calc;
+       struct dcn_fe_clocks cur;
+};
+
 struct stream_resource {
        struct output_pixel_processor *opp;
        struct timing_generator *tg;
@@ -195,6 +204,8 @@ struct plane_resource {
        struct transform *xfm;
        struct dpp *dpp;
        uint8_t mpcc_inst;
+
+       struct dcn_fe_bandwidth bw;
 };
 
 struct pipe_ctx {
@@ -247,9 +258,9 @@ struct dce_bw_output {
 
 struct dcn_bw_clocks {
        int dispclk_khz;
-       int dppclk_khz;
-       bool dppclk_div;
+       int max_dppclk_khz;
        int dcfclk_khz;
+       int socclk_khz;
        int dcfclk_deep_sleep_khz;
        int fclk_khz;
        int dram_ccm_us;
--

2.14.1

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

#36 lore raw

PATCH v2 1/1 drm/amd/display: add per pipe dppclk

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

v2: Fix commit title

---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c          |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c            | 13 +++++++------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c          |  6 ++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |  9 +++++----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h           | 15 +++++++++++++--
 5 files changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -1
index c9aa686d16b9..e4d8a8dbc5ef 100644
@@ -996,7 +996,7 @@ bool dcn_validate_bandwidth(
 					dc->debug.min_disp_clk_khz;
 		}
 
-		context->bw.dcn.calc_clk.dppclk_div = (int)(v->dispclk_dppclk_ratio) == 2;
+		context->bw.dcn.calc_clk.max_dppclk_khz = (int)(v->dppclk * 1000);
 
 		for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
 			struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +7 -6
index 1babac07bcc9..c15565092ca8 100644
@@ -361,21 +361,22 @@ void context_clock_trace(
 	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 
-	CLOCK_TRACE("Current: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+	CLOCK_TRACE("Current: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
 			"dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
 			context->bw.dcn.calc_clk.dispclk_khz,
-			context->bw.dcn.calc_clk.dppclk_div,
+			context->bw.dcn.calc_clk.max_dppclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
 			context->bw.dcn.calc_clk.fclk_khz,
+			context->bw.dcn.calc_clk.socclk_khz,
 			context->bw.dcn.calc_clk.dram_ccm_us,
 			context->bw.dcn.calc_clk.min_active_dram_ccm_us);
-	CLOCK_TRACE("Calculated: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+	CLOCK_TRACE("Calculated: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+			"dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
 			"dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
 			context->bw.dcn.calc_clk.dispclk_khz,
-			context->bw.dcn.calc_clk.dppclk_div,
+			context->bw.dcn.calc_clk.max_dppclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_khz,
 			context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
 			context->bw.dcn.calc_clk.fclk_khz,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +2 -4
index 8725cab9ec00..f0b798930b51 100644
@@ -432,14 +432,12 @@ void dpp1_dppclk_control(
 	struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
 
 	if (enable) {
-		if (dpp->tf_mask->DPPCLK_RATE_CONTROL) {
+		if (dpp->tf_mask->DPPCLK_RATE_CONTROL)
 			REG_UPDATE_2(DPP_CONTROL,
 				DPPCLK_RATE_CONTROL, dppclk_div,
 				DPP_CLOCK_ENABLE, 1);
-		} else {
-			ASSERT(dppclk_div == false);
+		else
 			REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 1);
-		}
 	} else
 		REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 0);
 }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -4
index 7a1b2deaf3d7..759e925439ce 100644
@@ -1684,12 +1684,13 @@ static void update_dchubp_dpp(
 	if (plane_state->update_flags.bits.full_update) {
 		dpp->funcs->dpp_dppclk_control(
 				dpp,
-				context->bw.dcn.calc_clk.dppclk_div,
+				context->bw.dcn.calc_clk.max_dppclk_khz <
+						context->bw.dcn.calc_clk.dispclk_khz,
 				true);
 
-		dc->current_state->bw.dcn.cur_clk.dppclk_div =
-				context->bw.dcn.calc_clk.dppclk_div;
-		context->bw.dcn.cur_clk.dppclk_div = context->bw.dcn.calc_clk.dppclk_div;
+		dc->current_state->bw.dcn.cur_clk.max_dppclk_khz =
+				context->bw.dcn.calc_clk.max_dppclk_khz;
+		context->bw.dcn.cur_clk.max_dppclk_khz = context->bw.dcn.calc_clk.max_dppclk_khz;
 	}
 
 	/* TODO: Need input parameter to tell current DCHUB pipe tie to which OTG
drivers/gpu/drm/amd/display/dc/inc/core_types.h +13 -2
index 5509e13e7edf..a9b21a4a0c17 100644
@@ -177,6 +177,15 @@ struct resource_pool {
 	const struct resource_caps *res_cap;
 };
 
+struct dcn_fe_clocks {
+	int dppclk_khz;
+};
+
+struct dcn_fe_bandwidth {
+	struct dcn_fe_clocks calc;
+	struct dcn_fe_clocks cur;
+};
+
 struct stream_resource {
 	struct output_pixel_processor *opp;
 	struct timing_generator *tg;
@@ -195,6 +204,8 @@ struct plane_resource {
 	struct transform *xfm;
 	struct dpp *dpp;
 	uint8_t mpcc_inst;
+
+	struct dcn_fe_bandwidth bw;
 };
 
 struct pipe_ctx {
@@ -247,9 +258,9 @@ struct dce_bw_output {
 
 struct dcn_bw_clocks {
 	int dispclk_khz;
-	int dppclk_khz;
-	bool dppclk_div;
+	int max_dppclk_khz;
 	int dcfclk_khz;
+	int socclk_khz;
 	int dcfclk_deep_sleep_khz;
 	int fclk_khz;
 	int dram_ccm_us;
Signature · 6 lines
2.14.1

_______________________________________________
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): 20180301200430.14772-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

Acked-by
#38 lore raw

Re: [PATCH v2] drm/amd/display: add per pipe dppclk

Quoted 7 lines · Harry Wentland

From: Dmytro Laktyushkin <[email protected]>

v2: Fix commit title

Quoted 141 lines
---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c          |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c            | 13 +++++++------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c          |  6 ++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |  9 +++++----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h           | 15 +++++++++++++--
 5 files changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -1
index c9aa686d16b9..e4d8a8dbc5ef 100644
@@ -996,7 +996,7 @@ bool dcn_validate_bandwidth(
                                        dc->debug.min_disp_clk_khz;
                }
 
-               context->bw.dcn.calc_clk.dppclk_div = (int)(v->dispclk_dppclk_ratio) == 2;
+               context->bw.dcn.calc_clk.max_dppclk_khz = (int)(v->dppclk * 1000);
 
                for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
                        struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +7 -6
index 1babac07bcc9..c15565092ca8 100644
@@ -361,21 +361,22 @@ void context_clock_trace(
        struct dc  *core_dc = dc;
        struct dal_logger *logger =  core_dc->ctx->logger;
 
-       CLOCK_TRACE("Current: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+       CLOCK_TRACE("Current: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
                        "dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
                        context->bw.dcn.calc_clk.dispclk_khz,
-                       context->bw.dcn.calc_clk.dppclk_div,
+                       context->bw.dcn.calc_clk.max_dppclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
                        context->bw.dcn.calc_clk.fclk_khz,
+                       context->bw.dcn.calc_clk.socclk_khz,
                        context->bw.dcn.calc_clk.dram_ccm_us,
                        context->bw.dcn.calc_clk.min_active_dram_ccm_us);
-       CLOCK_TRACE("Calculated: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
-                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d\n"
+       CLOCK_TRACE("Calculated: dispclk_khz:%d  max_dppclk_khz:%d  dcfclk_khz:%d\n"
+                       "dcfclk_deep_sleep_khz:%d  fclk_khz:%d  socclk_khz:%d\n"
                        "dram_ccm_us:%d  min_active_dram_ccm_us:%d\n",
                        context->bw.dcn.calc_clk.dispclk_khz,
-                       context->bw.dcn.calc_clk.dppclk_div,
+                       context->bw.dcn.calc_clk.max_dppclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_khz,
                        context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz,
                        context->bw.dcn.calc_clk.fclk_khz,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +2 -4
index 8725cab9ec00..f0b798930b51 100644
@@ -432,14 +432,12 @@ void dpp1_dppclk_control(
        struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
 
        if (enable) {
-               if (dpp->tf_mask->DPPCLK_RATE_CONTROL) {
+               if (dpp->tf_mask->DPPCLK_RATE_CONTROL)
                        REG_UPDATE_2(DPP_CONTROL,
                                DPPCLK_RATE_CONTROL, dppclk_div,
                                DPP_CLOCK_ENABLE, 1);
-               } else {
-                       ASSERT(dppclk_div == false);
+               else
                        REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 1);
-               }
        } else
                REG_UPDATE(DPP_CONTROL, DPP_CLOCK_ENABLE, 0);
 }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -4
index 7a1b2deaf3d7..759e925439ce 100644
@@ -1684,12 +1684,13 @@ static void update_dchubp_dpp(
        if (plane_state->update_flags.bits.full_update) {
                dpp->funcs->dpp_dppclk_control(
                                dpp,
-                               context->bw.dcn.calc_clk.dppclk_div,
+                               context->bw.dcn.calc_clk.max_dppclk_khz <
+                                               context->bw.dcn.calc_clk.dispclk_khz,
                                true);
 
-               dc->current_state->bw.dcn.cur_clk.dppclk_div =
-                               context->bw.dcn.calc_clk.dppclk_div;
-               context->bw.dcn.cur_clk.dppclk_div = context->bw.dcn.calc_clk.dppclk_div;
+               dc->current_state->bw.dcn.cur_clk.max_dppclk_khz =
+                               context->bw.dcn.calc_clk.max_dppclk_khz;
+               context->bw.dcn.cur_clk.max_dppclk_khz = context->bw.dcn.calc_clk.max_dppclk_khz;
        }
 
        /* TODO: Need input parameter to tell current DCHUB pipe tie to which OTG
drivers/gpu/drm/amd/display/dc/inc/core_types.h +13 -3
index 5509e13e7edf..a9b21a4a0c17 100644
@@ -177,6 +177,15 @@ struct resource_pool {
        const struct resource_caps *res_cap;
 };
 
+struct dcn_fe_clocks {
+       int dppclk_khz;
+};
+
+struct dcn_fe_bandwidth {
+       struct dcn_fe_clocks calc;
+       struct dcn_fe_clocks cur;
+};
+
 struct stream_resource {
        struct output_pixel_processor *opp;
        struct timing_generator *tg;
@@ -195,6 +204,8 @@ struct plane_resource {
        struct transform *xfm;
        struct dpp *dpp;
        uint8_t mpcc_inst;
+
+       struct dcn_fe_bandwidth bw;
 };
 
 struct pipe_ctx {
@@ -247,9 +258,9 @@ struct dce_bw_output {
 
 struct dcn_bw_clocks {
        int dispclk_khz;
-       int dppclk_khz;
-       bool dppclk_div;
+       int max_dppclk_khz;
        int dcfclk_khz;
+       int socclk_khz;
        int dcfclk_deep_sleep_khz;
        int fclk_khz;
        int dram_ccm_us;
--

2.14.1

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

#39 lore raw

PATCH 16/33 drm/amd/display: add diags clock programming

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  5 +++++
 drivers/gpu/drm/amd/display/dc/dc.h                       | 11 +++++++++++
 drivers/gpu/drm/amd/display/dc/dm_helpers.h               |  3 +++
 drivers/gpu/drm/amd/display/dc/inc/core_types.h           | 15 ++-------------
 4 files changed, 21 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +5 -0
index 3e157e65d7cd..9ab69b22b989 100644
@@ -505,3 +505,8 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 	return edid_status;
 }
+
+void dm_set_dcn_clocks(struct dc_context *ctx, struct dc_clocks *clks)
+{
+	/* TODO: something */
+}
drivers/gpu/drm/amd/display/dc/dc.h +11 -0
index a6402c651251..14cc4beb12c1 100644
@@ -184,6 +184,17 @@ enum wm_report_mode {
 	WM_REPORT_OVERRIDE = 1,
 };
 
+struct dc_clocks {
+	int dispclk_khz;
+	int max_dppclk_khz;
+	int dcfclk_khz;
+	int socclk_khz;
+	int dcfclk_deep_sleep_khz;
+	int fclk_khz;
+	int dram_ccm_us;
+	int min_active_dram_ccm_us;
+};
+
 struct dc_debug {
 	bool surface_visual_confirm;
 	bool sanity_checks;
drivers/gpu/drm/amd/display/dc/dm_helpers.h +3 -0
index 53d5566f89b8..034369fbb9e2 100644
@@ -108,5 +108,8 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_link *link,
 		struct dc_sink *sink);
 
+void dm_set_dcn_clocks(
+		struct dc_context *ctx,
+		struct dc_clocks *clks);
 
 #endif /* __DM_HELPERS__ */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -13
index a9b21a4a0c17..b8f05384a897 100644
@@ -256,20 +256,9 @@ struct dce_bw_output {
 	int blackout_recovery_time_us;
 };
 
-struct dcn_bw_clocks {
-	int dispclk_khz;
-	int max_dppclk_khz;
-	int dcfclk_khz;
-	int socclk_khz;
-	int dcfclk_deep_sleep_khz;
-	int fclk_khz;
-	int dram_ccm_us;
-	int min_active_dram_ccm_us;
-};
-
 struct dcn_bw_output {
-	struct dcn_bw_clocks cur_clk;
-	struct dcn_bw_clocks calc_clk;
+	struct dc_clocks cur_clk;
+	struct dc_clocks calc_clk;
 	struct dcn_watermark_set watermarks;
 };
 
Signature · 6 lines
2.14.1

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

PATCH 17/33 drm/amd/display: dal 3.1.36

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 14cc4beb12c1..e954705f7f0f 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.35"
+#define DC_VER "3.1.36"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.14.1

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

PATCH 18/33 drm/amd/display: Fix DAL surface change test

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
index 759e925439ce..b4a6b6729e62 100644
@@ -1943,7 +1943,7 @@ static void dcn10_apply_ctx_for_surface(
 			if (old_pipe_ctx->stream_res.tg == tg &&
 				old_pipe_ctx->plane_res.hubp &&
 				old_pipe_ctx->plane_res.hubp->opp_id != 0xf) {
-				dcn10_disable_plane(dc, pipe_ctx);
+				dcn10_disable_plane(dc, old_pipe_ctx);
 				/*
 				 * power down fe will unlock when calling reset, need
 				 * to lock it back here. Messy, need rework.
Signature · 6 lines
2.14.1

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

PATCH 19/33 drm/amd/display: Handle HDR use cases.

In reply to a message not in the archive

From: Vitaly Prosyak <[email protected]>

Implementation of de-gamma, blnd-gamma, shaper and 3d lut's.
Removed memory allocations in transfer functions. Refactor color module.

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 153 +++++++++++++++++++++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h |   5 +
 drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h        |   2 +
 .../drm/amd/display/modules/color/color_gamma.c    | 143 +++++++++----------
 4 files changed, 227 insertions(+), 76 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c +153 -0
index b3db6397d353..881a1bff94d2 100644
@@ -416,3 +416,156 @@ bool cm_helper_translate_curve_to_hw_format(
 
 	return true;
 }
+
+#define NUM_DEGAMMA_REGIONS    12
+
+
+bool cm_helper_translate_curve_to_degamma_hw_format(
+				const struct dc_transfer_func *output_tf,
+				struct pwl_params *lut_params)
+{
+	struct curve_points *arr_points;
+	struct pwl_result_data *rgb_resulted;
+	struct pwl_result_data *rgb;
+	struct pwl_result_data *rgb_plus_1;
+	struct fixed31_32 y_r;
+	struct fixed31_32 y_g;
+	struct fixed31_32 y_b;
+	struct fixed31_32 y1_min;
+	struct fixed31_32 y3_max;
+
+	int32_t region_start, region_end;
+	int32_t i;
+	uint32_t j, k, seg_distr[MAX_REGIONS_NUMBER], increment, start_index, hw_points;
+
+	if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
+		return false;
+
+	PERF_TRACE();
+
+	arr_points = lut_params->arr_points;
+	rgb_resulted = lut_params->rgb_resulted;
+	hw_points = 0;
+
+	memset(lut_params, 0, sizeof(struct pwl_params));
+	memset(seg_distr, 0, sizeof(seg_distr));
+
+	region_start = -NUM_DEGAMMA_REGIONS;
+	region_end   = 0;
+
+
+	for (i = region_end - region_start; i < MAX_REGIONS_NUMBER ; i++)
+		seg_distr[i] = -1;
+	/* 12 segments
+	 * segments are from 2^-12 to 0
+	 */
+	for (i = 0; i < NUM_DEGAMMA_REGIONS ; i++)
+		seg_distr[i] = 4;
+
+	for (k = 0; k < MAX_REGIONS_NUMBER; k++) {
+		if (seg_distr[k] != -1)
+			hw_points += (1 << seg_distr[k]);
+	}
+
+	j = 0;
+	for (k = 0; k < (region_end - region_start); k++) {
+		increment = NUMBER_SW_SEGMENTS / (1 << seg_distr[k]);
+		start_index = (region_start + k + MAX_LOW_POINT) *
+				NUMBER_SW_SEGMENTS;
+		for (i = start_index; i < start_index + NUMBER_SW_SEGMENTS;
+				i += increment) {
+			if (j == hw_points - 1)
+				break;
+			rgb_resulted[j].red = output_tf->tf_pts.red[i];
+			rgb_resulted[j].green = output_tf->tf_pts.green[i];
+			rgb_resulted[j].blue = output_tf->tf_pts.blue[i];
+			j++;
+		}
+	}
+
+	/* last point */
+	start_index = (region_end + MAX_LOW_POINT) * NUMBER_SW_SEGMENTS;
+	rgb_resulted[hw_points - 1].red = output_tf->tf_pts.red[start_index];
+	rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index];
+	rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index];
+
+	arr_points[0].x = dal_fixed31_32_pow(dal_fixed31_32_from_int(2),
+					     dal_fixed31_32_from_int(region_start));
+	arr_points[1].x = dal_fixed31_32_pow(dal_fixed31_32_from_int(2),
+					     dal_fixed31_32_from_int(region_end));
+
+	y_r = rgb_resulted[0].red;
+	y_g = rgb_resulted[0].green;
+	y_b = rgb_resulted[0].blue;
+
+	y1_min = dal_fixed31_32_min(y_r, dal_fixed31_32_min(y_g, y_b));
+
+	arr_points[0].y = y1_min;
+	arr_points[0].slope = dal_fixed31_32_div(arr_points[0].y, arr_points[0].x);
+	y_r = rgb_resulted[hw_points - 1].red;
+	y_g = rgb_resulted[hw_points - 1].green;
+	y_b = rgb_resulted[hw_points - 1].blue;
+
+	/* see comment above, m_arrPoints[1].y should be the Y value for the
+	 * region end (m_numOfHwPoints), not last HW point(m_numOfHwPoints - 1)
+	 */
+	y3_max = dal_fixed31_32_max(y_r, dal_fixed31_32_max(y_g, y_b));
+
+	arr_points[1].y = y3_max;
+
+	arr_points[1].slope = dal_fixed31_32_zero;
+
+	if (output_tf->tf == TRANSFER_FUNCTION_PQ) {
+		/* for PQ, we want to have a straight line from last HW X point,
+		 * and the slope to be such that we hit 1.0 at 10000 nits.
+		 */
+		const struct fixed31_32 end_value =
+				dal_fixed31_32_from_int(125);
+
+		arr_points[1].slope = dal_fixed31_32_div(
+			dal_fixed31_32_sub(dal_fixed31_32_one, arr_points[1].y),
+			dal_fixed31_32_sub(end_value, arr_points[1].x));
+	}
+
+	lut_params->hw_points_num = hw_points;
+
+	i = 1;
+	for (k = 0; k < MAX_REGIONS_NUMBER && i < MAX_REGIONS_NUMBER; k++) {
+		if (seg_distr[k] != -1) {
+			lut_params->arr_curve_points[k].segments_num =
+					seg_distr[k];
+			lut_params->arr_curve_points[i].offset =
+					lut_params->arr_curve_points[k].offset + (1 << seg_distr[k]);
+		}
+		i++;
+	}
+
+	if (seg_distr[k] != -1)
+		lut_params->arr_curve_points[k].segments_num = seg_distr[k];
+
+	rgb = rgb_resulted;
+	rgb_plus_1 = rgb_resulted + 1;
+
+	i = 1;
+	while (i != hw_points + 1) {
+		if (dal_fixed31_32_lt(rgb_plus_1->red, rgb->red))
+			rgb_plus_1->red = rgb->red;
+		if (dal_fixed31_32_lt(rgb_plus_1->green, rgb->green))
+			rgb_plus_1->green = rgb->green;
+		if (dal_fixed31_32_lt(rgb_plus_1->blue, rgb->blue))
+			rgb_plus_1->blue = rgb->blue;
+
+		rgb->delta_red   = dal_fixed31_32_sub(rgb_plus_1->red,   rgb->red);
+		rgb->delta_green = dal_fixed31_32_sub(rgb_plus_1->green, rgb->green);
+		rgb->delta_blue  = dal_fixed31_32_sub(rgb_plus_1->blue,  rgb->blue);
+
+		++rgb_plus_1;
+		++rgb;
+		++i;
+	}
+	cm_helper_convert_to_custom_float(rgb_resulted,
+						lut_params->arr_points,
+						hw_points, false);
+
+	return true;
+}
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h +5 -0
index 64e476b83bcb..7a531b02871f 100644
@@ -106,4 +106,9 @@ bool cm_helper_translate_curve_to_hw_format(
 		const struct dc_transfer_func *output_tf,
 		struct pwl_params *lut_params, bool fixpoint);
 
+bool cm_helper_translate_curve_to_degamma_hw_format(
+				const struct dc_transfer_func *output_tf,
+				struct pwl_params *lut_params);
+
+
 #endif
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +2 -0
index 78abc16ec4dc..c5aae2daf442 100644
@@ -35,6 +35,8 @@ struct dpp {
 	int inst;
 	struct dpp_caps *caps;
 	struct pwl_params regamma_params;
+	struct pwl_params degamma_params;
+
 };
 
 struct dpp_grph_csc_adjustment {
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +67 -76

271 lines not on this page · raw message

Signature · 6 lines
2.14.1

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

PATCH 20/33 drm/amd/display: Use MACROS instead of dm_logger

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

Created MACROS for all log levels. Also Replaced usage of dm_logger_write to the defined MACROS

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |  2 +-
 .../gpu/drm/amd/display/dc/bios/command_table2.c   |  6 +--
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |  6 +--
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  8 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 32 ++++++++--------
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   | 34 ++++++++---------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c       |  2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_audio.c     | 10 ++---
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  | 24 ++++++------
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    |  4 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  | 10 ++---
 .../drm/amd/display/dc/dce/dce_stream_encoder.c    |  6 +--
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  6 +--
 .../drm/amd/display/dc/dce110/dce110_compressor.c  | 12 +++---
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 16 ++++----
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  6 +--
 .../display/dc/dce110/dce110_timing_generator_v.c  | 10 ++---
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |  2 +-
 .../drm/amd/display/dc/dce112/dce112_compressor.c  | 32 ++++++++--------
 .../drm/amd/display/dc/dce112/dce112_resource.c    |  6 +--
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c    | 44 +++++++++++-----------
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 28 +++++++-------
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c |  4 +-
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.c        |  4 +-
 .../amd/display/dc/irq/dce110/irq_service_dce110.c |  8 ++--
 drivers/gpu/drm/amd/display/dc/irq/irq_service.c   |  8 ++--
 drivers/gpu/drm/amd/display/include/logger_types.h | 33 ++++++++++++++++
 28 files changed, 199 insertions(+), 166 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +1 -1
index 69c59e050a96..52f524a55b57 100644
@@ -3079,7 +3079,7 @@ static enum bp_result patch_bios_image_from_ext_display_connection_info(
 					    opm_object,
 					    &ext_display_connection_info_tbl) != BP_RESULT_OK) {
 
-		dm_logger_write(bp->base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(bp->base.ctx->logger,
 				"%s: Failed to read Connection Info Table", __func__);
 		return BP_RESULT_UNSUPPORTED;
 	}
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +3 -3
index fea5e83736fd..03df7b7a2d80 100644
@@ -239,7 +239,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) {
-		dm_logger_write(bp->base.ctx->logger, LOG_BIOS,\
+		DC_LOG_BIOS(bp->base.ctx->logger, \
 		"%s:ps.param.symclk_10khz = %d\n",\
 		__func__, ps.param.symclk_10khz);
 	}
@@ -331,7 +331,7 @@ static enum bp_result set_pixel_clock_v7(
 			(uint8_t) bp->cmd_helper->
 				transmitter_color_depth_to_atom(
 					bp_params->color_depth);
-		dm_logger_write(bp->base.ctx->logger, LOG_BIOS,\
+		DC_LOG_BIOS(bp->base.ctx->logger, \
 				"%s:program display clock = %d"\
 				"colorDepth = %d\n", __func__,\
 				bp_params->target_pixel_clock, bp_params->color_depth);
@@ -772,7 +772,7 @@ static enum bp_result set_dce_clock_v2_1(
 		 */
 		params.param.dceclk_10khz = cpu_to_le32(
 				bp_params->target_clock_frequency / 10);
-	dm_logger_write(bp->base.ctx->logger, LOG_BIOS,
+	DC_LOG_BIOS(bp->base.ctx->logger,
 			"%s:target_clock_frequency = %d"\
 			"clock_type = %d \n", __func__,\
 			bp_params->target_clock_frequency,\
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +3 -3
index e4d8a8dbc5ef..7728c85bcb0e 100644
@@ -1242,7 +1242,7 @@ unsigned int dcn_find_dcfclk_suits_all(
 	else
 		dcf_clk =  dc->dcn_soc->dcfclkv_min0p65*1000;
 
-	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
 		"\tdcf_clk for voltage = %d\n", dcf_clk);
 	return dcf_clk;
 }
@@ -1441,7 +1441,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();
-	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
 			"sr_exit_time: %d ns\n"
 			"sr_enter_plus_exit_time: %d ns\n"
 			"urgent_latency: %d ns\n"
@@ -1510,7 +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);
-	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
 			"rob_buffer_size_in_kbyte: %d\n"
 			"det_buffer_size_in_kbyte: %d\n"
 			"dpp_output_buffer_pixels: %d\n"
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -4
index 77a1bf233c3c..73bb416cb7dc 100644
@@ -264,7 +264,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);
-	dm_logger_write(dc->ctx->logger, LOG_WARNING, "CRC capture not supported.");
+	DC_LOG_WARNING(dc->ctx->logger,  "CRC capture not supported.");
 	return false;
 }
 
@@ -297,7 +297,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);
-	dm_logger_write(dc->ctx->logger, LOG_WARNING, "CRC capture not supported.");
+	DC_LOG_WARNING(dc->ctx->logger,  "CRC capture not supported.");
 	return false;
 }
 
@@ -618,7 +618,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)
 
 	dc->config = init_params->flags;
 
-	dm_logger_write(dc->ctx->logger, LOG_DC,
+	DC_LOG_DC(dc->ctx->logger,
 			"Display Core initialized\n");
 
 
@@ -888,7 +888,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
 	if (false == context_changed(dc, context))
 		return DC_OK;
 
-	dm_logger_write(dc->ctx->logger, LOG_DC, "%s: %d streams\n",
+	DC_LOG_DC(dc->ctx->logger,  "%s: %d streams\n",
 				__func__, context->stream_count);
 
 	for (i = 0; i < context->stream_count; i++) {
drivers/gpu/drm/amd/display/dc/core/dc_link.c +16 -16
index b7540152005b..059ceada2095 100644
@@ -47,7 +47,7 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #define LINK_INFO(...) \
-	dm_logger_write(dc_ctx->logger, LOG_HW_HOTPLUG, \
+	DC_LOG_HW_HOTPLUG(dc_ctx->logger,  \
 		__VA_ARGS__)
 
 /*******************************************************************************
@@ -677,11 +677,11 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 
 		switch (edid_status) {
 		case EDID_BAD_CHECKSUM:
-			dm_logger_write(link->ctx->logger, LOG_ERROR,
+			DC_LOG_ERROR(link->ctx->logger,
 				"EDID checksum invalid.\n");
 			break;
 		case EDID_NO_RESPONSE:
-			dm_logger_write(link->ctx->logger, LOG_ERROR,
+			DC_LOG_ERROR(link->ctx->logger,
 				"No EDID read.\n");
 		default:
 			break;
@@ -712,7 +712,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 					"%s: [Block %d] ", sink->edid_caps.display_name, i);
 		}
 
-		dm_logger_write(link->ctx->logger, LOG_DETECTION_EDID_PARSER,
+		DC_LOG_DETECTION_EDID_PARSER(link->ctx->logger,
 			"%s: "
 			"manufacturer_id = %X, "
 			"product_id = %X, "
@@ -733,7 +733,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++) {
-			dm_logger_write(link->ctx->logger, LOG_DETECTION_EDID_PARSER,
+			DC_LOG_DETECTION_EDID_PARSER(link->ctx->logger,
 				"%s: mode number = %d, "
 				"format_code = %d, "
 				"channel_count = %d, "
@@ -984,7 +984,7 @@ static bool construct(
 		}
 		break;
 	default:
-		dm_logger_write(dc_ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(dc_ctx->logger,
 			"Unsupported Connector type:%d!\n", link->link_id.id);
 		goto create_fail;
 	}
@@ -1175,7 +1175,7 @@ static void dpcd_configure_panel_mode(
 			ASSERT(result == DDC_RESULT_SUCESSFULL);
 		}
 	}
-	dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
+	DC_LOG_DETECTION_DP_CAPS(link->ctx->logger,
 			"Link: %d eDP panel mode supported: %d "
 			"eDP panel mode enabled: %d \n",
 			link->link_index,
@@ -1965,7 +1965,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
 
 	use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);
 
-	dm_logger_write(link->ctx->logger, LOG_BACKLIGHT,
+	DC_LOG_BACKLIGHT(link->ctx->logger,
 			"New Backlight level: %d (0x%X)\n", level, level);
 
 	if (dc_is_embedded_signal(link->connector_signal)) {
@@ -2150,20 +2150,20 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
 					link, pipe_ctx->stream_res.stream_enc, &proposed_table);
 	}
 	else
-		dm_logger_write(link->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(link->ctx->logger,
 				"Failed to update"
 				"MST allocation table for"
 				"pipe idx:%d\n",
 				pipe_ctx->pipe_idx);
 
-	dm_logger_write(link->ctx->logger, LOG_MST,
+	DC_LOG_MST(link->ctx->logger,
 			"%s  "
 			"stream_count: %d: \n ",
 			__func__,
 			link->mst_stream_alloc_table.stream_count);
 
 	for (i = 0; i < MAX_CONTROLLER_NUM; i++) {
-		dm_logger_write(link->ctx->logger, LOG_MST,
+		DC_LOG_MST(link->ctx->logger,
 		"stream_enc[%d]: 0x%x      "
 		"stream[%d].vcp_id: %d      "
 		"stream[%d].slot_count: %d\n",
@@ -2240,7 +2240,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 				link, pipe_ctx->stream_res.stream_enc, &proposed_table);
 		}
 		else {
-				dm_logger_write(link->ctx->logger, LOG_WARNING,
+				DC_LOG_WARNING(link->ctx->logger,
 						"Failed to update"
 						"MST allocation table for"
 						"pipe idx:%d\n",
@@ -2248,14 +2248,14 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 		}
 	}
 
-	dm_logger_write(link->ctx->logger, LOG_MST,
+	DC_LOG_MST(link->ctx->logger,
 			"%s"
 			"stream_count: %d: ",
 			__func__,
 			link->mst_stream_alloc_table.stream_count);
 
 	for (i = 0; i < MAX_CONTROLLER_NUM; i++) {
-		dm_logger_write(link->ctx->logger, LOG_MST,
+		DC_LOG_MST(link->ctx->logger,
 		"stream_enc[%d]: 0x%x      "
 		"stream[%d].vcp_id: %d      "
 		"stream[%d].slot_count: %d\n",
@@ -2307,8 +2307,8 @@ void core_link_enable_stream(
 	status = enable_link(state, pipe_ctx);
 
 	if (status != DC_OK) {
-			dm_logger_write(pipe_ctx->stream->ctx->logger,
-			LOG_WARNING, "enabling link %u failed: %d\n",
+			DC_LOG_WARNING(pipe_ctx->stream->ctx->logger,
+			 "enabling link %u failed: %d\n",
 			pipe_ctx->stream->sink->link->link_index,
 			status);
 
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +17 -17
index 4c21da54a9d5..9a041641a539 100644
@@ -63,7 +63,7 @@ static void wait_for_training_aux_rd_interval(
 
 	udelay(default_wait_in_micro_secs);
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s:\n wait = %d\n",
 		__func__,
 		default_wait_in_micro_secs);
@@ -79,7 +79,7 @@ static void dpcd_set_training_pattern(
 		&dpcd_pattern.raw,
 		1);
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s\n %x pattern = %x\n",
 		__func__,
 		DP_TRAINING_PATTERN_SET,
@@ -116,7 +116,7 @@ static void dpcd_set_link_settings(
 	core_link_write_dpcd(link, DP_DOWNSPREAD_CTRL,
 	&downspread.raw, sizeof(downspread));
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s\n %x rate = %x\n %x lane = %x\n %x spread = %x\n",
 		__func__,
 		DP_LINK_BW_SET,
@@ -151,7 +151,7 @@ static enum dpcd_training_patterns
 		break;
 	default:
 		ASSERT(0);
-		dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+		DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 			"%s: Invalid HW Training pattern: %d\n",
 			__func__, pattern);
 		break;
@@ -184,7 +184,7 @@ static void dpcd_set_lt_pattern_and_lane_settings(
 	dpcd_lt_buffer[DP_TRAINING_PATTERN_SET - dpcd_base_lt_offset]
 		= dpcd_pattern.raw;
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s\n %x pattern = %x\n",
 		__func__,
 		DP_TRAINING_PATTERN_SET,
@@ -219,7 +219,7 @@ static void dpcd_set_lt_pattern_and_lane_settings(
 		dpcd_lane,
 		size_in_bytes);
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s:\n %x VS set = %x  PE set = %x max VS Reached = %x  max PE Reached = %x\n",
 		__func__,
 		DP_TRAINING_LANE0_SET,
@@ -456,13 +456,13 @@ static void get_lane_status_and_drive_settings(
 
 	ln_status_updated->raw = dpcd_buf[2];
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s:\n%x Lane01Status = %x\n %x Lane23Status = %x\n ",
 		__func__,
 		DP_LANE0_1_STATUS, dpcd_buf[0],
 		DP_LANE2_3_STATUS, dpcd_buf[1]);
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s:\n %x Lane01AdjustRequest = %x\n %x Lane23AdjustRequest = %x\n",
 		__func__,
 		DP_ADJUST_REQUEST_LANE0_1,
@@ -556,7 +556,7 @@ static void dpcd_set_lane_settings(
 	}
 	*/
 
-	dm_logger_write(link->ctx->logger, LOG_HW_LINK_TRAINING,
+	DC_LOG_HW_LINK_TRAINING(link->ctx->logger,
 		"%s\n %x VS set = %x  PE set = %x max VS Reached = %x  max PE Reached = %x\n",
 		__func__,
 		DP_TRAINING_LANE0_SET,
@@ -669,7 +669,7 @@ static bool perform_post_lt_adj_req_sequence(
 		}
 
 		if (!req_drv_setting_changed) {
-			dm_logger_write(link->ctx->logger, LOG_WARNING,
+			DC_LOG_WARNING(link->ctx->logger,
 				"%s: Post Link Training Adjust Request Timed out\n",
 				__func__);
 
@@ -677,7 +677,7 @@ static bool perform_post_lt_adj_req_sequence(
 			return true;
 		}
 	}
-	dm_logger_write(link->ctx->logger, LOG_WARNING,
+	DC_LOG_WARNING(link->ctx->logger,
 		"%s: Post Link Training Adjust Request limit reached\n",
 		__func__);
 
@@ -885,7 +885,7 @@ static enum link_training_result perform_clock_recovery_sequence(
 
 	if (retry_count >= LINK_TRAINING_MAX_CR_RETRY) {
 		ASSERT(0);
-		dm_logger_write(link->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(link->ctx->logger,
 			"%s: Link Training Error, could not get CR after %d tries. Possibly voltage swing issue",
 			__func__,
 			LINK_TRAINING_MAX_CR_RETRY);
@@ -1606,7 +1606,7 @@ static bool hpd_rx_irq_check_link_loss_status(
 	if (sink_status_changed ||
 		!hpd_irq_dpcd_data->bytes.lane_status_updated.bits.INTERLANE_ALIGN_DONE) {
 
-		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
+		DC_LOG_HW_HPD_IRQ(link->ctx->logger,
 			"%s: Link Status changed.\n", __func__);
 
 		return_code = true;
@@ -1620,7 +1620,7 @@ static bool hpd_rx_irq_check_link_loss_status(
 			sizeof(irq_reg_rx_power_state));
 
 		if (dpcd_result != DC_OK) {
-			dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
+			DC_LOG_HW_HPD_IRQ(link->ctx->logger,
 				"%s: DPCD read failed to obtain power state.\n",
 				__func__);
 		} else {
@@ -1982,7 +1982,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 	 * PSR and device auto test, refer to function handle_sst_hpd_irq
 	 * in DAL2.1*/
 
-	dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
+	DC_LOG_HW_HPD_IRQ(link->ctx->logger,
 		"%s: Got short pulse HPD on link %d\n",
 		__func__, link->link_index);
 
@@ -1997,7 +1997,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 		*out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
 
 	if (result != DC_OK) {
-		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
+		DC_LOG_HW_HPD_IRQ(link->ctx->logger,
 			"%s: DPCD read failed to obtain irq data\n",
 			__func__);
 		return false;
@@ -2016,7 +2016,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 	}
 
 	if (!allow_hpd_rx_irq(link)) {
-		dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
+		DC_LOG_HW_HPD_IRQ(link->ctx->logger,
 			"%s: skipping HPD handling on %d\n",
 			__func__, link->link_index);
 		return false;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index 48709d4b5627..52b0a4ae2f9a 100644
@@ -893,7 +893,7 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 		/* May need to re-check lb size after this in some obscure scenario */
 		calculate_inits_and_adj_vp(pipe_ctx, &recout_skip);
 
-	dm_logger_write(pipe_ctx->stream->ctx->logger, LOG_SCALER,
+	DC_LOG_SCALER(pipe_ctx->stream->ctx->logger,
 				"%s: Viewport:\nheight:%d width:%d x:%d "
 				"y:%d\n dst_rect:\nheight:%d width:%d x:%d "
 				"y:%d\n",
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +1 -1
index b231bd53613e..5efd0c460bee 100644
@@ -403,7 +403,7 @@ static bool dce_abm_set_backlight_level(
 {
 	struct dce_abm *abm_dce = TO_DCE_ABM(abm);
 
-	dm_logger_write(abm->ctx->logger, LOG_BACKLIGHT,
+	DC_LOG_BACKLIGHT(abm->ctx->logger,
 			"New Backlight level: %d (0x%X)\n",
 			backlight_level, backlight_level);
 
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +5 -5
index e366bfd7cf6f..2e86d8cb4ef3 100644
@@ -63,7 +63,7 @@ static void write_indirect_azalia_reg(struct audio *audio,
 	REG_SET(AZALIA_F0_CODEC_ENDPOINT_DATA, 0,
 			AZALIA_ENDPOINT_REG_DATA, reg_data);
 
-	dm_logger_write(CTX->logger, LOG_HW_AUDIO,
+	DC_LOG_HW_AUDIO(CTX->logger,
 		"AUDIO:write_indirect_azalia_reg: index: %u  data: %u\n",
 		reg_index, reg_data);
 }
@@ -81,7 +81,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);
 
-	dm_logger_write(CTX->logger, LOG_HW_AUDIO,
+	DC_LOG_HW_AUDIO(CTX->logger,
 		"AUDIO:read_indirect_azalia_reg: index: %u  data: %u\n",
 		reg_index, value);
 
@@ -364,7 +364,7 @@ void dce_aud_az_enable(struct audio *audio)
 			CLOCK_GATING_DISABLE);
 	AZ_REG_WRITE(AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL, value);
 
-	dm_logger_write(CTX->logger, LOG_HW_AUDIO,
+	DC_LOG_HW_AUDIO(CTX->logger,
 			"\n\t========= AUDIO:dce_aud_az_enable: index: %u  data: 0x%x\n",
 			audio->inst, value);
 }
@@ -390,7 +390,7 @@ void dce_aud_az_disable(struct audio *audio)
 			CLOCK_GATING_DISABLE);
 	AZ_REG_WRITE(AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL, value);
 	value = AZ_REG_READ(AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL);
-	dm_logger_write(CTX->logger, LOG_HW_AUDIO,
+	DC_LOG_HW_AUDIO(CTX->logger,
 			"\n\t========= AUDIO:dce_aud_az_disable: index: %u  data: 0x%x\n",
 			audio->inst, value);
 }
@@ -795,7 +795,7 @@ void dce_aud_wall_dto_setup(
 			crtc_info->calculated_pixel_clock,
 			&clock_info);
 
-		dm_logger_write(audio->ctx->logger, LOG_HW_AUDIO,\
+		DC_LOG_HW_AUDIO(audio->ctx->logger, \
 				"\n%s:Input::requested_pixel_clock = %d"\
 				"calculated_pixel_clock =%d\n"\
 				"audio_dto_module = %d audio_dto_phase =%d \n\n", __func__,\
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +12 -12
index 5036b674f68b..2860d0a39be4 100644
@@ -288,7 +288,7 @@ static uint32_t calculate_pixel_clock_pll_dividers(
 	uint32_t max_ref_divider;
 
 	if (pll_settings->adjusted_pix_clk == 0) {
-		dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
 			"%s Bad requested pixel clock", __func__);
 		return MAX_PLL_CALC_ERROR;
 	}
@@ -349,13 +349,13 @@ static uint32_t calculate_pixel_clock_pll_dividers(
  *  ## SVS Wed 15 Jul 2009 */
 
 	if (min_post_divider > max_post_divider) {
-		dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
 			"%s Post divider range is invalid", __func__);
 		return MAX_PLL_CALC_ERROR;
 	}
 
 	if (min_ref_divider > max_ref_divider) {
-		dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
 			"%s Reference divider range is invalid", __func__);
 		return MAX_PLL_CALC_ERROR;
 	}
@@ -493,7 +493,7 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
 	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. */
-		dm_logger_write(clk_src->base.ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(clk_src->base.ctx->logger,
 			"%s: Failed to adjust pixel clock!!", __func__);
 		pll_settings->actual_pix_clk =
 				pix_clk_params->requested_pix_clk;
@@ -560,7 +560,7 @@ static uint32_t dce110_get_pix_clk_dividers(
 
 	if (pix_clk_params == NULL || pll_settings == NULL
 			|| pix_clk_params->requested_pix_clk == 0) {
-		dm_logger_write(clk_src->base.ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(clk_src->base.ctx->logger,
 			"%s: Invalid parameters!!\n", __func__);
 		return pll_calc_error;
 	}
@@ -1054,12 +1054,12 @@ static void get_ss_info_from_atombios(
 	uint32_t i;
 
 	if (ss_entries_num == NULL) {
-		dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
+		DC_LOG_SYNC(clk_src->base.ctx->logger,
 			"Invalid entry !!!\n");
 		return;
 	}
 	if (spread_spectrum_data == NULL) {
-		dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
+		DC_LOG_SYNC(clk_src->base.ctx->logger,
 			"Invalid array pointer!!!\n");
 		return;
 	}
@@ -1104,7 +1104,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) {
-			dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
+			DC_LOG_SYNC(clk_src->base.ctx->logger,
 				"Invalid ATOMBIOS SS Table!!!\n");
 			goto out_free_data;
 		}
@@ -1114,9 +1114,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 */
-			dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
+			DC_LOG_SYNC(clk_src->base.ctx->logger,
 				"Invalid SS percentage ");
-			dm_logger_write(clk_src->base.ctx->logger, LOG_SYNC,
+			DC_LOG_SYNC(clk_src->base.ctx->logger,
 				"for HDMI in ATOMBIOS info Table!!!\n");
 			continue;
 		}
@@ -1228,12 +1228,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) {
-		dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
 			"The dec point num or precision is incorrect!");
 		return false;
 	}
 	if (init_data->num_fract_fb_divider_decimal_point_precision == 0) {
-		dm_logger_write(calc_pll_cs->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
 			"Incorrect fract feedback divider precision num!");
 		return false;
 	}
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +2 -2
index 046658c8498a..654dcc6df97d 100644
@@ -292,7 +292,7 @@ static enum dm_pp_clocks_state dce_get_required_clocks_state(
 
 	low_req_clk = i + 1;
 	if (low_req_clk > clk->max_clks_state) {
-		dm_logger_write(clk->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(clk->ctx->logger,
 				"%s: clocks unsupported disp_clk %d pix_clk %d",
 				__func__,
 				req_clocks->display_clk_khz,
@@ -312,7 +312,7 @@ static bool dce_clock_set_min_clocks_state(
 
 	if (clocks_state > clk->max_clks_state) {
 		/*Requested state exceeds max supported state.*/
-		dm_logger_write(clk->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(clk->ctx->logger,
 				"Requested state exceeds max supported state");
 		return false;
 	} else if (clocks_state == clk->cur_min_clks_state) {
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +5 -5
index 11f50588b3f4..e063a50a5771 100644
@@ -827,7 +827,7 @@ void dce110_link_encoder_hw_init(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		dm_logger_write(ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(ctx->logger,
 			"%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
@@ -928,7 +928,7 @@ void dce110_link_encoder_enable_tmds_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		dm_logger_write(ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(ctx->logger,
 			"%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
@@ -969,7 +969,7 @@ void dce110_link_encoder_enable_dp_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		dm_logger_write(ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(ctx->logger,
 			"%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
@@ -1010,7 +1010,7 @@ void dce110_link_encoder_enable_dp_mst_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		dm_logger_write(ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(ctx->logger,
 			"%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
@@ -1053,7 +1053,7 @@ void dce110_link_encoder_disable_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		dm_logger_write(ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(ctx->logger,
 			"%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +3 -3
index 8146b9079d51..f4d95126de2e 100644
@@ -277,8 +277,8 @@ static void dce110_update_hdmi_info_packet(
 #endif
 	default:
 		/* invalid HW packet index */
-		dm_logger_write(
-			ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			ctx->logger,
 			"Invalid HW packet index: %s()\n",
 			__func__);
 		return;
@@ -1386,7 +1386,7 @@ static void dce110_se_setup_hdmi_audio(
 			     crtc_info->requested_pixel_clock,
 			     crtc_info->calculated_pixel_clock,
 			     &audio_clock_info);
-	dm_logger_write(enc->ctx->logger, LOG_HW_AUDIO,
+	DC_LOG_HW_AUDIO(enc->ctx->logger,
 			"\n%s:Input::requested_pixel_clock = %d"	\
 			"calculated_pixel_clock = %d \n", __func__,	\
 			crtc_info->requested_pixel_clock,		\
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +3 -3
index ad411dac5639..5268197678f5 100644
@@ -693,7 +693,7 @@ static int dce_transform_get_max_num_of_supported_lines(
 		break;
 
 	default:
-		dm_logger_write(xfm_dce->base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(xfm_dce->base.ctx->logger,
 			"%s: Invalid LB pixel depth",
 			__func__);
 		BREAK_TO_DEBUGGER();
@@ -791,7 +791,7 @@ static void dce_transform_set_pixel_storage_depth(
 	if (!(xfm_dce->lb_pixel_depth_supported & depth)) {
 		/*we should use unsupported capabilities
 		 *  unless it is required by w/a*/
-		dm_logger_write(xfm->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(xfm->ctx->logger,
 			"%s: Capability not supported",
 			__func__);
 	}
@@ -1172,7 +1172,7 @@ static void program_pwl(struct dce_transform *xfm_dce,
 	}
 
 	if (counter == max_tries) {
-		dm_logger_write(xfm_dce->base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(xfm_dce->base.ctx->logger,
 				"%s: regamma lut was not powered on "
 				"in a timely manner,"
 				" programming still proceeds\n",
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +6 -6
index 6923662413cd..af854f21e9f5 100644
@@ -120,13 +120,13 @@ static void wait_for_fbc_state_changed(
 	}
 
 	if (counter == 10) {
-		dm_logger_write(
-			cp110->base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			cp110->base.ctx->logger,
 			"%s: wait counter exceeded, changes to HW not applied",
 			__func__);
 	} else {
-		dm_logger_write(
-			cp110->base.ctx->logger, LOG_SYNC,
+		DC_LOG_SYNC(
+			cp110->base.ctx->logger,
 			"FBC status changed to %d", enabled);
 	}
 
@@ -310,8 +310,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
-		dm_logger_write(
-			compressor->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			compressor->ctx->logger,
 			"%s: Unexpected DCE11 compression ratio",
 			__func__);
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +8 -8
index 73e0bcd5ba8f..9e31f06ab4c8 100644
@@ -816,7 +816,7 @@ void hwss_edp_wait_for_hpd_ready(
 	dal_gpio_destroy_irq(&hpd);
 
 	if (false == edp_hpd_high) {
-		dm_logger_write(ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(ctx->logger,
 				"%s: wait timed out!\n", __func__);
 	}
 }
@@ -840,7 +840,7 @@ void hwss_edp_power_control(
 	if (power_up != is_panel_powered_on(hwseq)) {
 		/* Send VBIOS command to prompt eDP panel power */
 
-		dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
+		DC_LOG_HW_RESUME_S3(ctx->logger,
 				"%s: Panel Power action: %s\n",
 				__func__, (power_up ? "On":"Off"));
 
@@ -856,11 +856,11 @@ void hwss_edp_power_control(
 		bp_result = link_transmitter_control(ctx->dc_bios, &cntl);
 
 		if (bp_result != BP_RESULT_OK)
-			dm_logger_write(ctx->logger, LOG_ERROR,
+			DC_LOG_ERROR(ctx->logger,
 					"%s: Panel Power bp_result: %d\n",
 					__func__, bp_result);
 	} else {
-		dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
+		DC_LOG_HW_RESUME_S3(ctx->logger,
 				"%s: Skipping Panel Power action: %s\n",
 				__func__, (power_up ? "On":"Off"));
 	}
@@ -886,7 +886,7 @@ void hwss_edp_backlight_control(
 	}
 
 	if (enable && is_panel_backlight_on(hws)) {
-		dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
+		DC_LOG_HW_RESUME_S3(ctx->logger,
 				"%s: panel already powered up. Do nothing.\n",
 				__func__);
 		return;
@@ -894,7 +894,7 @@ void hwss_edp_backlight_control(
 
 	/* Send VBIOS command to control eDP panel backlight */
 
-	dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
+	DC_LOG_HW_RESUME_S3(ctx->logger,
 			"%s: backlight action: %s\n",
 			__func__, (enable ? "On":"Off"));
 
@@ -2762,7 +2762,7 @@ static void dce110_program_front_end_for_pipe(
 	if (pipe_ctx->plane_state->update_flags.bits.full_update)
 		dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
 
-	dm_logger_write(dc->ctx->logger, LOG_SURFACE,
+	DC_LOG_SURFACE(dc->ctx->logger,
 			"Pipe:%d 0x%x: addr hi:0x%x, "
 			"addr low:0x%x, "
 			"src: %d, %d, %d,"
@@ -2785,7 +2785,7 @@ static void dce110_program_front_end_for_pipe(
 			pipe_ctx->plane_state->clip_rect.width,
 			pipe_ctx->plane_state->clip_rect.height);
 
-	dm_logger_write(dc->ctx->logger, LOG_SURFACE,
+	DC_LOG_SURFACE(dc->ctx->logger,
 			"Pipe %d: width, height, x, y\n"
 			"viewport:%d, %d, %d, %d\n"
 			"recout:  %d, %d, %d, %d\n",
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +3 -3
index c4e877ac95d3..d938047fc17f 100644
@@ -771,8 +771,8 @@ static bool dce110_validate_bandwidth(
 {
 	bool result = false;
 
-	dm_logger_write(
-		dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(
+		dc->ctx->logger,
 		"%s: start",
 		__func__);
 
@@ -786,7 +786,7 @@ static bool dce110_validate_bandwidth(
 		result =  true;
 
 	if (!result)
-		dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_VALIDATION,
+		DC_LOG_BANDWIDTH_VALIDATION(dc->ctx->logger,
 			"%s: %dx%d@%d Bandwidth validation failed!\n",
 			__func__,
 			context->streams[0]->timing.h_addressable,
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c +5 -5
index 59b4cd329715..a8e93072ab5c 100644
@@ -606,7 +606,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)
 {
-	dm_logger_write(tg->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(tg->ctx->logger,
 					"Timing Sync not supported on underlay pipe\n");
 	return false;
 }
@@ -615,7 +615,7 @@ static void dce110_timing_generator_v_setup_global_swap_lock(
 	struct timing_generator *tg,
 	const struct dcp_gsl_params *gsl_params)
 {
-	dm_logger_write(tg->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(tg->ctx->logger,
 					"Timing Sync not supported on underlay pipe\n");
 	return;
 }
@@ -624,7 +624,7 @@ static void dce110_timing_generator_v_enable_reset_trigger(
 	struct timing_generator *tg,
 	int source_tg_inst)
 {
-	dm_logger_write(tg->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(tg->ctx->logger,
 					"Timing Sync not supported on underlay pipe\n");
 	return;
 }
@@ -632,7 +632,7 @@ static void dce110_timing_generator_v_enable_reset_trigger(
 static void dce110_timing_generator_v_disable_reset_trigger(
 	struct timing_generator *tg)
 {
-	dm_logger_write(tg->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(tg->ctx->logger,
 						"Timing Sync not supported on underlay pipe\n");
 	return;
 }
@@ -640,7 +640,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)
 {
-	dm_logger_write(tg->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(tg->ctx->logger,
 						"Timing Sync not supported on underlay pipe\n");
 	return;
 }
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +1 -1
index 47390dc58306..809db96a8ba5 100644
@@ -670,7 +670,7 @@ static void dce110_xfmv_set_pixel_storage_depth(
 	if (!(xfm_dce->lb_pixel_depth_supported & depth)) {
 		/*we should use unsupported capabilities
 		 *  unless it is required by w/a*/
-		dm_logger_write(xfm->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(xfm->ctx->logger,
 			"%s: Capability not supported",
 			__func__);
 	}
drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c +16 -16
index 69649928768c..196ddd01615c 100644
@@ -129,8 +129,8 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 				LOW_POWER_TILING_NUM_PIPES);
 			break;
 		default:
-			dm_logger_write(
-				cp110->base.ctx->logger, LOG_WARNING,
+			DC_LOG_WARNING(
+				cp110->base.ctx->logger,
 				"%s: Invalid LPT NUM_PIPES!!!",
 				__func__);
 			break;
@@ -175,8 +175,8 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 				LOW_POWER_TILING_NUM_BANKS);
 			break;
 		default:
-			dm_logger_write(
-				cp110->base.ctx->logger, LOG_WARNING,
+			DC_LOG_WARNING(
+				cp110->base.ctx->logger,
 				"%s: Invalid LPT NUM_BANKS!!!",
 				__func__);
 			break;
@@ -209,8 +209,8 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 				LOW_POWER_TILING_PIPE_INTERLEAVE_SIZE);
 			break;
 		default:
-			dm_logger_write(
-				cp110->base.ctx->logger, LOG_WARNING,
+			DC_LOG_WARNING(
+				cp110->base.ctx->logger,
 				"%s: Invalid LPT INTERLEAVE_SIZE!!!",
 				__func__);
 			break;
@@ -253,15 +253,15 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 				LOW_POWER_TILING_ROW_SIZE);
 			break;
 		default:
-			dm_logger_write(
-				cp110->base.ctx->logger, LOG_WARNING,
+			DC_LOG_WARNING(
+				cp110->base.ctx->logger,
 				"%s: Invalid LPT ROW_SIZE!!!",
 				__func__);
 			break;
 		}
 	} else {
-		dm_logger_write(
-			cp110->base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			cp110->base.ctx->logger,
 			"%s: LPT MC Configuration is not provided",
 			__func__);
 	}
@@ -311,8 +311,8 @@ static void wait_for_fbc_state_changed(
 	}
 
 	if (counter == 10) {
-		dm_logger_write(
-			cp110->base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			cp110->base.ctx->logger,
 			"%s: wait counter exceeded, changes to HW not applied",
 			__func__);
 	}
@@ -525,8 +525,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
-		dm_logger_write(
-			compressor->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			compressor->ctx->logger,
 			"%s: Unexpected DCE11 compression ratio",
 			__func__);
 
@@ -690,8 +690,8 @@ void dce112_compressor_program_lpt_control(
 			LOW_POWER_TILING_MODE);
 		break;
 	default:
-		dm_logger_write(
-			compressor->ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+			compressor->ctx->logger,
 			"%s: Invalid selected DRAM channels for LPT!!!",
 			__func__);
 		break;
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +3 -3
index c0757dd6c03c..bf885d7e699b 100644
@@ -722,8 +722,8 @@ bool dce112_validate_bandwidth(
 {
 	bool result = false;
 
-	dm_logger_write(
-		dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(
+		dc->ctx->logger,
 		"%s: start",
 		__func__);
 
@@ -737,7 +737,7 @@ bool dce112_validate_bandwidth(
 		result = true;
 
 	if (!result)
-		dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_VALIDATION,
+		DC_LOG_BANDWIDTH_VALIDATION(dc->ctx->logger,
 			"%s: Bandwidth validation failed!",
 			__func__);
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +22 -22

176 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +14 -14
index b4a6b6729e62..aa5516539c95 100644
@@ -335,7 +335,7 @@ static void power_on_plane(
 		hubp_pg_control(hws, plane_id, true);
 		REG_SET(DC_IP_REQUEST_CNTL, 0,
 				IP_REQUEST_EN, 0);
-		dm_logger_write(hws->ctx->logger, LOG_DEBUG,
+		DC_LOG_DEBUG(hws->ctx->logger,
 				"Un-gated front end for pipe %d\n", plane_id);
 	}
 }
@@ -572,7 +572,7 @@ static void reset_back_end_for_pipe(
 		return;
 
 	pipe_ctx->stream = NULL;
-	dm_logger_write(dc->ctx->logger, LOG_DEBUG,
+	DC_LOG_DEBUG(dc->ctx->logger,
 					"Reset back end for pipe %d, tg:%d\n",
 					pipe_ctx->pipe_idx, pipe_ctx->stream_res.tg->inst);
 }
@@ -632,7 +632,7 @@ static void plane_atomic_power_down(struct dc *dc, struct pipe_ctx *pipe_ctx)
 		dpp->funcs->dpp_reset(dpp);
 		REG_SET(DC_IP_REQUEST_CNTL, 0,
 				IP_REQUEST_EN, 0);
-		dm_logger_write(dc->ctx->logger, LOG_DEBUG,
+		DC_LOG_DEBUG(dc->ctx->logger,
 				"Power gated front end %d\n", pipe_ctx->pipe_idx);
 	}
 }
@@ -679,7 +679,7 @@ static void dcn10_disable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx)
 
 	apply_DEGVIDCN10_253_wa(dc);
 
-	dm_logger_write(dc->ctx->logger, LOG_DC,
+	DC_LOG_DC(dc->ctx->logger,
 					"Power down front end %d\n",
 					pipe_ctx->pipe_idx);
 }
@@ -1102,7 +1102,7 @@ static void dcn10_enable_per_frame_crtc_position_reset(
 		struct dc *core_dc,
 		struct pipe_ctx *pipe_ctx)
 {
-	dm_logger_write(core_dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(core_dc->ctx->logger,
 			"\n============== DML TTU Output parameters [%d] ==============\n"
 			"qos_level_low_wm: %d, \n"
 			"qos_level_high_wm: %d, \n"
@@ -1132,7 +1132,7 @@ static void dcn10_enable_per_frame_crtc_position_reset(
 			pipe_ctx->ttu_regs.refcyc_per_req_delivery_pre_c
 			);
 
-	dm_logger_write(core_dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(core_dc->ctx->logger,
 			"\n============== DML DLG Output parameters [%d] ==============\n"
 			"refcyc_h_blank_end: %d, \n"
 			"dlg_vblank_end: %d, \n"
@@ -1167,7 +1167,7 @@ static void dcn10_enable_per_frame_crtc_position_reset(
 			pipe_ctx->dlg_regs.refcyc_per_pte_group_nom_l
 			);
 
-	dm_logger_write(core_dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(core_dc->ctx->logger,
 			"\ndst_y_per_meta_row_nom_l: %d, \n"
 			"refcyc_per_meta_chunk_nom_l: %d, \n"
 			"refcyc_per_line_delivery_pre_l: %d, \n"
@@ -1197,7 +1197,7 @@ static void dcn10_enable_per_frame_crtc_position_reset(
 			pipe_ctx->dlg_regs.refcyc_per_line_delivery_c
 			);
 
-	dm_logger_write(core_dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(core_dc->ctx->logger,
 			"\n============== DML RQ Output parameters [%d] ==============\n"
 			"chunk_size: %d \n"
 			"min_chunk_size: %d \n"
@@ -1330,7 +1330,7 @@ static void dcn10_enable_plane(
 
 /* TODO: enable/disable in dm as per update type.
 	if (plane_state) {
-		dm_logger_write(dc->ctx->logger, LOG_DC,
+		DC_LOG_DC(dc->ctx->logger,
 				"Pipe:%d 0x%x: addr hi:0x%x, "
 				"addr low:0x%x, "
 				"src: %d, %d, %d,"
@@ -1348,7 +1348,7 @@ static void dcn10_enable_plane(
 				plane_state->dst_rect.width,
 				plane_state->dst_rect.height);
 
-		dm_logger_write(dc->ctx->logger, LOG_DC,
+		DC_LOG_DC(dc->ctx->logger,
 				"Pipe %d: width, height, x, y         format:%d\n"
 				"viewport:%d, %d, %d, %d\n"
 				"recout:  %d, %d, %d, %d\n",
@@ -1959,7 +1959,7 @@ static void dcn10_apply_ctx_for_surface(
 			plane_atomic_disconnect(dc, old_pipe_ctx);
 			removed_pipe[i] = true;
 
-			dm_logger_write(dc->ctx->logger, LOG_DC,
+			DC_LOG_DC(dc->ctx->logger,
 					"Reset mpcc for pipe %d\n",
 					old_pipe_ctx->pipe_idx);
 		}
@@ -2002,7 +2002,7 @@ static void dcn10_apply_ctx_for_surface(
 			dcn10_verify_allow_pstate_change_high(dc);
 		}
 	}
-/*	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+/*	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
 			"\n============== Watermark parameters ==============\n"
 			"a.urgent_ns: %d \n"
 			"a.cstate_enter_plus_exit: %d \n"
@@ -2025,7 +2025,7 @@ static void dcn10_apply_ctx_for_surface(
 			context->bw.dcn.watermarks.b.cstate_pstate.pstate_change_ns,
 			context->bw.dcn.watermarks.b.pte_meta_urgent_ns
 			);
-	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
+	DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger,
 			"\nc.urgent_ns: %d \n"
 			"c.cstate_enter_plus_exit: %d \n"
 			"c.cstate_exit: %d \n"
@@ -2268,7 +2268,7 @@ static void dcn10_wait_for_mpcc_disconnect(
 			res_pool->mpc->funcs->wait_for_idle(res_pool->mpc, mpcc_inst);
 			pipe_ctx->stream_res.opp->mpcc_disconnect_pending[mpcc_inst] = false;
 			hubp->funcs->set_blank(hubp, true);
-			/*dm_logger_write(dc->ctx->logger, LOG_ERROR,
+			/*DC_LOG_ERROR(dc->ctx->logger,
 					"[debug_mpo: wait_for_mpcc finished waiting on mpcc %d]\n",
 					i);*/
 		}
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c +2 -2
index 0b1db48fef36..4c2417dd2be6 100644
@@ -286,7 +286,7 @@ static bool read_command(
 
 	if (request->payload.address_space ==
 		I2CAUX_TRANSACTION_ADDRESS_SPACE_DPCD) {
-		dm_logger_write(engine->base.ctx->logger, LOG_I2C_AUX, "READ: addr:0x%x  value:0x%x Result:%d",
+		DC_LOG_I2C_AUX(engine->base.ctx->logger,  "READ: addr:0x%x  value:0x%x Result:%d",
 				request->payload.address,
 				request->payload.data[0],
 				ctx.operation_succeeded);
@@ -494,7 +494,7 @@ static bool write_command(
 
 	if (request->payload.address_space ==
 		I2CAUX_TRANSACTION_ADDRESS_SPACE_DPCD) {
-		dm_logger_write(engine->base.ctx->logger, LOG_I2C_AUX, "WRITE: addr:0x%x  value:0x%x Result:%d",
+		DC_LOG_I2C_AUX(engine->base.ctx->logger,  "WRITE: addr:0x%x  value:0x%x Result:%d",
 				request->payload.address,
 				request->payload.data[0],
 				ctx.operation_succeeded);
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.c +2 -2
index 56e25b3d65fd..ad685b1c9b81 100644
@@ -525,8 +525,8 @@ static void construct(
 	REG_GET(MICROSECOND_TIME_BASE_DIV, XTAL_REF_DIV, &xtal_ref_div);
 
 	if (xtal_ref_div == 0) {
-		dm_logger_write(
-				hw_engine->base.base.base.ctx->logger, LOG_WARNING,
+		DC_LOG_WARNING(
+				hw_engine->base.base.base.ctx->logger,
 				"Invalid base timer divider\n",
 				__func__);
 		xtal_ref_div = 2;
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +4 -4
index f7e40b292dfb..e3de56b7ac5f 100644
@@ -181,8 +181,8 @@ bool dal_irq_service_dummy_set(
 	const struct irq_source_info *info,
 	bool enable)
 {
-	dm_logger_write(
-		irq_service->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(
+		irq_service->ctx->logger,
 		"%s: called for non-implemented irq source\n",
 		__func__);
 	return false;
@@ -192,8 +192,8 @@ bool dal_irq_service_dummy_ack(
 	struct irq_service *irq_service,
 	const struct irq_source_info *info)
 {
-	dm_logger_write(
-		irq_service->ctx->logger, LOG_ERROR,
+	DC_LOG_ERROR(
+		irq_service->ctx->logger,
 		"%s: called for non-implemented irq source\n",
 		__func__);
 	return false;
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +4 -4
index b106513fc2dc..441724776441 100644
@@ -104,8 +104,8 @@ bool dal_irq_service_set(
 		find_irq_source_info(irq_service, source);
 
 	if (!info) {
-		dm_logger_write(
-			irq_service->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(
+			irq_service->ctx->logger,
 			"%s: cannot find irq info table entry for %d\n",
 			__func__,
 			source);
@@ -142,8 +142,8 @@ bool dal_irq_service_ack(
 		find_irq_source_info(irq_service, source);
 
 	if (!info) {
-		dm_logger_write(
-			irq_service->ctx->logger, LOG_ERROR,
+		DC_LOG_ERROR(
+			irq_service->ctx->logger,
 			"%s: cannot find irq info table entry for %d\n",
 			__func__,
 			source);
drivers/gpu/drm/amd/display/include/logger_types.h +33 -0
index e2ff8cd423d6..65b6bf892839 100644
@@ -29,6 +29,39 @@
 #include "os_types.h"
 
 #define MAX_NAME_LEN 32
+#define DC_LOG_ERROR(a, b, ...) dm_logger_write(a, LOG_ERROR, b, ## __VA_ARGS__)
+#define DC_LOG_WARNING(a, b, ...) dm_logger_write(a, LOG_WARNING, b, ## __VA_ARGS__)
+#define DC_LOG_DEBUG(a, b, ...) dm_logger_write(a, LOG_DEBUG, b, ## __VA_ARGS__)
+#define DC_LOG_DC(a, b, ...) dm_logger_write(a, LOG_DC, b, ## __VA_ARGS__)
+#define DC_LOG_DTN(a, b, ...) dm_logger_write(a, LOG_DTN, b, ## __VA_ARGS__)
+#define DC_LOG_SURFACE(a, b, ...) dm_logger_write(a, LOG_SURFACE, b, ## __VA_ARGS__)
+#define DC_LOG_HW_HOTPLUG(a, b, ...) dm_logger_write(a, LOG_HW_HOTPLUG, b, ## __VA_ARGS__)
+#define DC_LOG_HW_LINK_TRAINING(a, b, ...) dm_logger_write(a, LOG_HW_LINK_TRAINING, b, ## __VA_ARGS__)
+#define DC_LOG_HW_SET_MODE(a, b, ...) dm_logger_write(a, LOG_HW_SET_MODE, b, ## __VA_ARGS__)
+#define DC_LOG_HW_RESUME_S3(a, b, ...) dm_logger_write(a, LOG_HW_RESUME_S3, b, ## __VA_ARGS__)
+#define DC_LOG_HW_AUDIO(a, b, ...) dm_logger_write(a, LOG_HW_AUDIO, b, ## __VA_ARGS__)
+#define DC_LOG_HW_HPD_IRQ(a, b, ...) dm_logger_write(a, LOG_HW_HPD_IRQ, b, ## __VA_ARGS__)
+#define DC_LOG_MST(a, b, ...) dm_logger_write(a, LOG_MST, b, ## __VA_ARGS__)
+#define DC_LOG_SCALER(a, b, ...) dm_logger_write(a, LOG_SCALER, b, ## __VA_ARGS__)
+#define DC_LOG_BIOS(a, b, ...) dm_logger_write(a, LOG_BIOS, b, ## __VA_ARGS__)
+#define DC_LOG_BANDWIDTH_CALCS(a, b, ...) dm_logger_write(a, LOG_BANDWIDTH_CALCS, b, ## __VA_ARGS__)
+#define DC_LOG_BANDWIDTH_VALIDATION(a, b, ...) dm_logger_write(a, LOG_BANDWIDTH_VALIDATION, b, ## __VA_ARGS__)
+#define DC_LOG_I2C_AUX(a, b, ...) dm_logger_write(a, LOG_I2C_AUX, b, ## __VA_ARGS__)
+#define DC_LOG_SYNC(a, b, ...) dm_logger_write(a, LOG_SYNC, b, ## __VA_ARGS__)
+#define DC_LOG_BACKLIGHT(a, b, ...) dm_logger_write(a, LOG_BACKLIGHT, b, ## __VA_ARGS__)
+#define DC_LOG_FEATURE_OVERRIDE(a, b, ...) dm_logger_write(a, LOG_FEATURE_OVERRIDE, b, ## __VA_ARGS__)
+#define DC_LOG_DETECTION_EDID_PARSER(a, b, ...) dm_logger_write(a, LOG_DETECTION_EDID_PARSER, b, ## __VA_ARGS__)
+#define DC_LOG_DETECTION_DP_CAPS(a, b, ...) dm_logger_write(a, LOG_DETECTION_DP_CAPS, b, ## __VA_ARGS__)
+#define DC_LOG_RESOURCE(a, b, ...) dm_logger_write(a, LOG_RESOURCE, b, ## __VA_ARGS__)
+#define DC_LOG_DML(a, b, ...) dm_logger_write(a, LOG_DML, b, ## __VA_ARGS__)
+#define DC_LOG_EVENT_MODE_SET(a, b, ...) dm_logger_write(a, LOG_EVENT_MODE_SET, b, ## __VA_ARGS__)
+#define DC_LOG_EVENT_DETECTION(a, b, ...) dm_logger_write(a, LOG_EVENT_DETECTION, b, ## __VA_ARGS__)
+#define DC_LOG_EVENT_LINK_TRAINING(a, b, ...) dm_logger_write(a, LOG_EVENT_LINK_TRAINING, b, ## __VA_ARGS__)
+#define DC_LOG_EVENT_LINK_LOSS(a, b, ...) dm_logger_write(a, LOG_EVENT_LINK_LOSS, b, ## __VA_ARGS__)
+#define DC_LOG_EVENT_UNDERFLOW(a, b, ...) dm_logger_write(a, LOG_EVENT_UNDERFLOW, b, ## __VA_ARGS__)
+#define DC_LOG_IF_TRACE(a, b, ...) dm_logger_write(a, LOG_IF_TRACE, b, ## __VA_ARGS__)
+#define DC_LOG_PERF_TRACE(a, b, ...) dm_logger_write(a, LOG_PERF_TRACE, b, ## __VA_ARGS__)
+
 
 struct dal_logger;
 
Signature · 6 lines
2.14.1

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

PATCH 21/33 drm/amd/display: define DC_LOGGER for logger

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

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

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |  6 +-
 .../gpu/drm/amd/display/dc/bios/command_table2.c   | 11 ++--
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   | 11 ++--
 drivers/gpu/drm/amd/display/dc/core/dc.c           | 11 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 53 +++++++----------
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   | 53 ++++++-----------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  7 ++-
 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c       |  5 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_audio.c     | 17 +++---
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  | 32 +++++-----
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    |  8 +--
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  | 22 +++----
 .../drm/amd/display/dc/dce/dce_stream_encoder.c    |  7 +--
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 11 ++--
 .../drm/amd/display/dc/dce110/dce110_compressor.c  | 14 ++---
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 20 ++++---
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  6 +-
 .../display/dc/dce110/dce110_timing_generator_v.c  | 17 +++---
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |  5 +-
 .../drm/amd/display/dc/dce112/dce112_compressor.c  | 11 +---
 .../drm/amd/display/dc/dce112/dce112_resource.c    |  5 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c    | 68 ++++++++--------------
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 21 ++++---
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c |  6 +-
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.c        |  6 +-
 .../amd/display/dc/irq/dce110/irq_service_dce110.c | 11 ++--
 drivers/gpu/drm/amd/display/dc/irq/irq_service.c   | 10 ++--
 drivers/gpu/drm/amd/display/include/logger_types.h | 64 ++++++++++----------
 28 files changed, 230 insertions(+), 288 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +4 -2
index 52f524a55b57..c7f0b27e457e 100644
@@ -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;
 	}
 
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +5 -6
index 03df7b7a2d80..e362658aa3ce 100644
@@ -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);
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +5 -6
index 7728c85bcb0e..f1d8db56f406 100644
@@ -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"
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -5
index 73bb416cb7dc..2bc15a46882a 100644
@@ -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++) {
drivers/gpu/drm/amd/display/dc/core/dc_link.c +22 -31

167 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +19 -34

159 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 -3
index 52b0a4ae2f9a..b9fc6d842931 100644
@@ -45,7 +45,8 @@
 #include "dcn10/dcn10_resource.h"
 #endif
 #include "dce120/dce120_resource.h"
-
+#define DC_LOGGER \
+	ctx->logger
 enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
 {
 	enum dce_version dc_version = DCE_VERSION_UNKNOWN;
@@ -834,7 +835,7 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 	struct dc_crtc_timing *timing = &pipe_ctx->stream->timing;
 	struct view recout_skip = { 0 };
 	bool res = false;
-
+	struct dc_context *ctx = pipe_ctx->stream->ctx;
 	/* Important: scaling ratio calculation requires pixel format,
 	 * lb depth calculation requires recout and taps require scaling ratios.
 	 * Inits require viewport, taps, ratios and recout of split pipe
@@ -893,7 +894,7 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 		/* May need to re-check lb size after this in some obscure scenario */
 		calculate_inits_and_adj_vp(pipe_ctx, &recout_skip);
 
-	DC_LOG_SCALER(pipe_ctx->stream->ctx->logger,
+	DC_LOG_SCALER(
 				"%s: Viewport:\nheight:%d width:%d x:%d "
 				"y:%d\n dst_rect:\nheight:%d width:%d x:%d "
 				"y:%d\n",
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +3 -2
index 5efd0c460bee..fe92a1222803 100644
@@ -42,6 +42,8 @@
 #define FN(reg_name, field_name) \
 	abm_dce->abm_shift->field_name, abm_dce->abm_mask->field_name
 
+#define DC_LOGGER \
+	abm->ctx->logger
 #define CTX \
 	abm_dce->base.ctx
 
@@ -403,8 +405,7 @@ static bool dce_abm_set_backlight_level(
 {
 	struct dce_abm *abm_dce = TO_DCE_ABM(abm);
 
-	DC_LOG_BACKLIGHT(abm->ctx->logger,
-			"New Backlight level: %d (0x%X)\n",
+	DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",
 			backlight_level, backlight_level);
 
 	/* If DMCU is in reset state, DMCU is uninitialized */
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +7 -10
index 2e86d8cb4ef3..6d5cdcdc8ec9 100644
@@ -33,6 +33,8 @@
 
 #define CTX \
 	aud->base.ctx
+#define DC_LOGGER \
+	aud->base.ctx->logger
 #define REG(reg)\
 	(aud->regs->reg)
 
@@ -63,8 +65,7 @@ static void write_indirect_azalia_reg(struct audio *audio,
 	REG_SET(AZALIA_F0_CODEC_ENDPOINT_DATA, 0,
 			AZALIA_ENDPOINT_REG_DATA, reg_data);
 
-	DC_LOG_HW_AUDIO(CTX->logger,
-		"AUDIO:write_indirect_azalia_reg: index: %u  data: %u\n",
+	DC_LOG_HW_AUDIO("AUDIO:write_indirect_azalia_reg: index: %u  data: %u\n",
 		reg_index, reg_data);
 }
 
@@ -81,8 +82,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);
 
-	DC_LOG_HW_AUDIO(CTX->logger,
-		"AUDIO:read_indirect_azalia_reg: index: %u  data: %u\n",
+	DC_LOG_HW_AUDIO("AUDIO:read_indirect_azalia_reg: index: %u  data: %u\n",
 		reg_index, value);
 
 	return value;
@@ -364,8 +364,7 @@ void dce_aud_az_enable(struct audio *audio)
 			CLOCK_GATING_DISABLE);
 	AZ_REG_WRITE(AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL, value);
 
-	DC_LOG_HW_AUDIO(CTX->logger,
-			"\n\t========= AUDIO:dce_aud_az_enable: index: %u  data: 0x%x\n",
+	DC_LOG_HW_AUDIO("\n\t========= AUDIO:dce_aud_az_enable: index: %u  data: 0x%x\n",
 			audio->inst, value);
 }
 
@@ -390,8 +389,7 @@ void dce_aud_az_disable(struct audio *audio)
 			CLOCK_GATING_DISABLE);
 	AZ_REG_WRITE(AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL, value);
 	value = AZ_REG_READ(AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL);
-	DC_LOG_HW_AUDIO(CTX->logger,
-			"\n\t========= AUDIO:dce_aud_az_disable: index: %u  data: 0x%x\n",
+	DC_LOG_HW_AUDIO("\n\t========= AUDIO:dce_aud_az_disable: index: %u  data: 0x%x\n",
 			audio->inst, value);
 }
 
@@ -795,8 +793,7 @@ void dce_aud_wall_dto_setup(
 			crtc_info->calculated_pixel_clock,
 			&clock_info);
 
-		DC_LOG_HW_AUDIO(audio->ctx->logger, \
-				"\n%s:Input::requested_pixel_clock = %d"\
+		DC_LOG_HW_AUDIO("\n%s:Input::requested_pixel_clock = %d"\
 				"calculated_pixel_clock =%d\n"\
 				"audio_dto_module = %d audio_dto_phase =%d \n\n", __func__,\
 				crtc_info->requested_pixel_clock,\
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +17 -15
index 2860d0a39be4..0aa2cda60890 100644
@@ -41,7 +41,8 @@
 
 #define CTX \
 	clk_src->base.ctx
-
+#define DC_LOGGER \
+	calc_pll_cs->ctx->logger
 #undef FN
 #define FN(reg_name, field_name) \
 	clk_src->cs_shift->field_name, clk_src->cs_mask->field_name
@@ -288,7 +289,7 @@ static uint32_t calculate_pixel_clock_pll_dividers(
 	uint32_t max_ref_divider;
 
 	if (pll_settings->adjusted_pix_clk == 0) {
-		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
+		DC_LOG_ERROR(
 			"%s Bad requested pixel clock", __func__);
 		return MAX_PLL_CALC_ERROR;
 	}
@@ -349,13 +350,13 @@ static uint32_t calculate_pixel_clock_pll_dividers(
  *  ## SVS Wed 15 Jul 2009 */
 
 	if (min_post_divider > max_post_divider) {
-		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
+		DC_LOG_ERROR(
 			"%s Post divider range is invalid", __func__);
 		return MAX_PLL_CALC_ERROR;
 	}
 
 	if (min_ref_divider > max_ref_divider) {
-		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
+		DC_LOG_ERROR(
 			"%s Reference divider range is invalid", __func__);
 		return MAX_PLL_CALC_ERROR;
 	}
@@ -466,7 +467,7 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
 {
 	uint32_t field = 0;
 	uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
-
+	struct calc_pll_clock_source *calc_pll_cs = &clk_src->calc_pll;
 	/* Check if reference clock is external (not pcie/xtalin)
 	* HW Dce80 spec:
 	* 00 - PCIE_REFCLK, 01 - XTALIN,    02 - GENERICA,    03 - GENERICB
@@ -493,7 +494,7 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
 	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. */
-		DC_LOG_ERROR(clk_src->base.ctx->logger,
+		DC_LOG_ERROR(
 			"%s: Failed to adjust pixel clock!!", __func__);
 		pll_settings->actual_pix_clk =
 				pix_clk_params->requested_pix_clk;
@@ -556,11 +557,12 @@ static uint32_t dce110_get_pix_clk_dividers(
 		struct pll_settings *pll_settings)
 {
 	struct dce110_clk_src *clk_src = TO_DCE110_CLK_SRC(cs);
+	struct calc_pll_clock_source *calc_pll_cs = &clk_src->calc_pll;
 	uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
 
 	if (pix_clk_params == NULL || pll_settings == NULL
 			|| pix_clk_params->requested_pix_clk == 0) {
-		DC_LOG_ERROR(clk_src->base.ctx->logger,
+		DC_LOG_ERROR(
 			"%s: Invalid parameters!!\n", __func__);
 		return pll_calc_error;
 	}
@@ -1052,14 +1054,14 @@ static void get_ss_info_from_atombios(
 	struct spread_spectrum_info *ss_info_cur;
 	struct spread_spectrum_data *ss_data_cur;
 	uint32_t i;
-
+	struct calc_pll_clock_source *calc_pll_cs = &clk_src->calc_pll;
 	if (ss_entries_num == NULL) {
-		DC_LOG_SYNC(clk_src->base.ctx->logger,
+		DC_LOG_SYNC(
 			"Invalid entry !!!\n");
 		return;
 	}
 	if (spread_spectrum_data == NULL) {
-		DC_LOG_SYNC(clk_src->base.ctx->logger,
+		DC_LOG_SYNC(
 			"Invalid array pointer!!!\n");
 		return;
 	}
@@ -1104,7 +1106,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) {
-			DC_LOG_SYNC(clk_src->base.ctx->logger,
+			DC_LOG_SYNC(
 				"Invalid ATOMBIOS SS Table!!!\n");
 			goto out_free_data;
 		}
@@ -1114,9 +1116,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 */
-			DC_LOG_SYNC(clk_src->base.ctx->logger,
+			DC_LOG_SYNC(
 				"Invalid SS percentage ");
-			DC_LOG_SYNC(clk_src->base.ctx->logger,
+			DC_LOG_SYNC(
 				"for HDMI in ATOMBIOS info Table!!!\n");
 			continue;
 		}
@@ -1228,12 +1230,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) {
-		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
+		DC_LOG_ERROR(
 			"The dec point num or precision is incorrect!");
 		return false;
 	}
 	if (init_data->num_fract_fb_divider_decimal_point_precision == 0) {
-		DC_LOG_ERROR(calc_pll_cs->ctx->logger,
+		DC_LOG_ERROR(
 			"Incorrect fract feedback divider precision num!");
 		return false;
 	}
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +4 -4
index 654dcc6df97d..78e6beb6cf26 100644
@@ -49,6 +49,8 @@
 
 #define CTX \
 	clk_dce->base.ctx
+#define DC_LOGGER \
+	clk->ctx->logger
 
 /* Max clock values for each state indexed by "enum clocks_state": */
 static const struct state_dependent_clocks dce80_max_clks_by_state[] = {
@@ -292,8 +294,7 @@ static enum dm_pp_clocks_state dce_get_required_clocks_state(
 
 	low_req_clk = i + 1;
 	if (low_req_clk > clk->max_clks_state) {
-		DC_LOG_WARNING(clk->ctx->logger,
-				"%s: clocks unsupported disp_clk %d pix_clk %d",
+		DC_LOG_WARNING("%s: clocks unsupported disp_clk %d pix_clk %d",
 				__func__,
 				req_clocks->display_clk_khz,
 				req_clocks->pixel_clk_khz);
@@ -312,8 +313,7 @@ static bool dce_clock_set_min_clocks_state(
 
 	if (clocks_state > clk->max_clks_state) {
 		/*Requested state exceeds max supported state.*/
-		DC_LOG_WARNING(clk->ctx->logger,
-				"Requested state exceeds max supported state");
+		DC_LOG_WARNING("Requested state exceeds max supported state");
 		return false;
 	} else if (clocks_state == clk->cur_min_clks_state) {
 		/*if we're trying to set the same state, we can just return
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +7 -15
index e063a50a5771..f0d63ac7724a 100644
@@ -56,6 +56,8 @@
 
 #define CTX \
 	enc110->base.ctx
+#define DC_LOGGER \
+	enc110->base.ctx->logger
 
 #define REG(reg)\
 	(enc110->link_regs->reg)
@@ -809,7 +811,6 @@ void dce110_link_encoder_hw_init(
 	struct link_encoder *enc)
 {
 	struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
-	struct dc_context *ctx = enc110->base.ctx;
 	struct bp_transmitter_control cntl = { 0 };
 	enum bp_result result;
 
@@ -827,8 +828,7 @@ void dce110_link_encoder_hw_init(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		DC_LOG_ERROR(ctx->logger,
-			"%s: Failed to execute VBIOS command table!\n",
+		DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
 		return;
@@ -904,7 +904,6 @@ void dce110_link_encoder_enable_tmds_output(
 	uint32_t pixel_clock)
 {
 	struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
-	struct dc_context *ctx = enc110->base.ctx;
 	struct bp_transmitter_control cntl = { 0 };
 	enum bp_result result;
 
@@ -928,8 +927,7 @@ void dce110_link_encoder_enable_tmds_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		DC_LOG_ERROR(ctx->logger,
-			"%s: Failed to execute VBIOS command table!\n",
+		DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
 	}
@@ -942,7 +940,6 @@ void dce110_link_encoder_enable_dp_output(
 	enum clock_source_id clock_source)
 {
 	struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
-	struct dc_context *ctx = enc110->base.ctx;
 	struct bp_transmitter_control cntl = { 0 };
 	enum bp_result result;
 
@@ -969,8 +966,7 @@ void dce110_link_encoder_enable_dp_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		DC_LOG_ERROR(ctx->logger,
-			"%s: Failed to execute VBIOS command table!\n",
+		DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
 	}
@@ -983,7 +979,6 @@ void dce110_link_encoder_enable_dp_mst_output(
 	enum clock_source_id clock_source)
 {
 	struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
-	struct dc_context *ctx = enc110->base.ctx;
 	struct bp_transmitter_control cntl = { 0 };
 	enum bp_result result;
 
@@ -1010,8 +1005,7 @@ void dce110_link_encoder_enable_dp_mst_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		DC_LOG_ERROR(ctx->logger,
-			"%s: Failed to execute VBIOS command table!\n",
+		DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
 	}
@@ -1025,7 +1019,6 @@ void dce110_link_encoder_disable_output(
 	enum signal_type signal)
 {
 	struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
-	struct dc_context *ctx = enc110->base.ctx;
 	struct bp_transmitter_control cntl = { 0 };
 	enum bp_result result;
 
@@ -1053,8 +1046,7 @@ void dce110_link_encoder_disable_output(
 	result = link_transmitter_control(enc110, &cntl);
 
 	if (result != BP_RESULT_OK) {
-		DC_LOG_ERROR(ctx->logger,
-			"%s: Failed to execute VBIOS command table!\n",
+		DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
 			__func__);
 		BREAK_TO_DEBUGGER();
 		return;
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +3 -4
index f4d95126de2e..444558ca6533 100644
@@ -26,7 +26,8 @@
 #include "dc_bios_types.h"
 #include "dce_stream_encoder.h"
 #include "reg_helper.h"
-
+#define DC_LOGGER \
+		enc110->base.ctx->logger
 enum DP_PIXEL_ENCODING {
 DP_PIXEL_ENCODING_RGB444                 = 0x00000000,
 DP_PIXEL_ENCODING_YCBCR422               = 0x00000001,
@@ -197,7 +198,6 @@ static void dce110_update_hdmi_info_packet(
 	uint32_t packet_index,
 	const struct encoder_info_packet *info_packet)
 {
-	struct dc_context *ctx = enc110->base.ctx;
 	uint32_t cont, send, line;
 
 	if (info_packet->valid) {
@@ -278,7 +278,6 @@ static void dce110_update_hdmi_info_packet(
 	default:
 		/* invalid HW packet index */
 		DC_LOG_WARNING(
-			ctx->logger,
 			"Invalid HW packet index: %s()\n",
 			__func__);
 		return;
@@ -1386,7 +1385,7 @@ static void dce110_se_setup_hdmi_audio(
 			     crtc_info->requested_pixel_clock,
 			     crtc_info->calculated_pixel_clock,
 			     &audio_clock_info);
-	DC_LOG_HW_AUDIO(enc->ctx->logger,
+	DC_LOG_HW_AUDIO(
 			"\n%s:Input::requested_pixel_clock = %d"	\
 			"calculated_pixel_clock = %d \n", __func__,	\
 			crtc_info->requested_pixel_clock,		\
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +5 -6
index 5268197678f5..832c5daada35 100644
@@ -38,6 +38,8 @@
 
 #define CTX \
 	xfm_dce->base.ctx
+#define DC_LOGGER \
+	xfm_dce->base.ctx->logger
 
 #define IDENTITY_RATIO(ratio) (dal_fixed31_32_u2d19(ratio) == (1 << 19))
 #define GAMUT_MATRIX_SIZE 12
@@ -693,8 +695,7 @@ static int dce_transform_get_max_num_of_supported_lines(
 		break;
 
 	default:
-		DC_LOG_WARNING(xfm_dce->base.ctx->logger,
-			"%s: Invalid LB pixel depth",
+		DC_LOG_WARNING("%s: Invalid LB pixel depth",
 			__func__);
 		BREAK_TO_DEBUGGER();
 		break;
@@ -791,8 +792,7 @@ static void dce_transform_set_pixel_storage_depth(
 	if (!(xfm_dce->lb_pixel_depth_supported & depth)) {
 		/*we should use unsupported capabilities
 		 *  unless it is required by w/a*/
-		DC_LOG_WARNING(xfm->ctx->logger,
-			"%s: Capability not supported",
+		DC_LOG_WARNING("%s: Capability not supported",
 			__func__);
 	}
 }
@@ -1172,8 +1172,7 @@ static void program_pwl(struct dce_transform *xfm_dce,
 	}
 
 	if (counter == max_tries) {
-		DC_LOG_WARNING(xfm_dce->base.ctx->logger,
-				"%s: regamma lut was not powered on "
+		DC_LOG_WARNING("%s: regamma lut was not powered on "
 				"in a timely manner,"
 				" programming still proceeds\n",
 				__func__);
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +5 -9
index af854f21e9f5..775d3bf0bd39 100644
@@ -34,6 +34,8 @@
 
 #include "dce110_compressor.h"
 
+#define DC_LOGGER \
+		cp110->base.ctx->logger
 #define DCP_REG(reg)\
 	(reg + cp110->offsets.dcp_offset)
 #define DMIF_REG(reg)\
@@ -120,14 +122,10 @@ static void wait_for_fbc_state_changed(
 	}
 
 	if (counter == 10) {
-		DC_LOG_WARNING(
-			cp110->base.ctx->logger,
-			"%s: wait counter exceeded, changes to HW not applied",
+		DC_LOG_WARNING("%s: wait counter exceeded, changes to HW not applied",
 			__func__);
 	} else {
-		DC_LOG_SYNC(
-			cp110->base.ctx->logger,
-			"FBC status changed to %d", enabled);
+		DC_LOG_SYNC("FBC status changed to %d", enabled);
 	}
 
 
@@ -310,9 +308,7 @@ void dce110_compressor_program_compressed_surface_address_and_pitch(
 	if (compressor->min_compress_ratio == FBC_COMPRESS_RATIO_1TO1)
 		fbc_pitch = fbc_pitch / 8;
 	else
-		DC_LOG_WARNING(
-			compressor->ctx->logger,
-			"%s: Unexpected DCE11 compression ratio",
+		DC_LOG_WARNING("%s: Unexpected DCE11 compression ratio",
 			__func__);
 
 	/* Clear content first. */
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +11 -9
index 9e31f06ab4c8..f21aa04e93da 100644
@@ -70,6 +70,8 @@
 
 #define CTX \
 	hws->ctx
+#define DC_LOGGER \
+	ctx->logger
 #define REG(reg)\
 	hws->regs->reg
 
@@ -816,7 +818,7 @@ void hwss_edp_wait_for_hpd_ready(
 	dal_gpio_destroy_irq(&hpd);
 
 	if (false == edp_hpd_high) {
-		DC_LOG_ERROR(ctx->logger,
+		DC_LOG_ERROR(
 				"%s: wait timed out!\n", __func__);
 	}
 }
@@ -840,7 +842,7 @@ void hwss_edp_power_control(
 	if (power_up != is_panel_powered_on(hwseq)) {
 		/* Send VBIOS command to prompt eDP panel power */
 
-		DC_LOG_HW_RESUME_S3(ctx->logger,
+		DC_LOG_HW_RESUME_S3(
 				"%s: Panel Power action: %s\n",
 				__func__, (power_up ? "On":"Off"));
 
@@ -856,11 +858,11 @@ void hwss_edp_power_control(
 		bp_result = link_transmitter_control(ctx->dc_bios, &cntl);
 
 		if (bp_result != BP_RESULT_OK)
-			DC_LOG_ERROR(ctx->logger,
+			DC_LOG_ERROR(
 					"%s: Panel Power bp_result: %d\n",
 					__func__, bp_result);
 	} else {
-		DC_LOG_HW_RESUME_S3(ctx->logger,
+		DC_LOG_HW_RESUME_S3(
 				"%s: Skipping Panel Power action: %s\n",
 				__func__, (power_up ? "On":"Off"));
 	}
@@ -886,7 +888,7 @@ void hwss_edp_backlight_control(
 	}
 
 	if (enable && is_panel_backlight_on(hws)) {
-		DC_LOG_HW_RESUME_S3(ctx->logger,
+		DC_LOG_HW_RESUME_S3(
 				"%s: panel already powered up. Do nothing.\n",
 				__func__);
 		return;
@@ -894,7 +896,7 @@ void hwss_edp_backlight_control(
 
 	/* Send VBIOS command to control eDP panel backlight */
 
-	DC_LOG_HW_RESUME_S3(ctx->logger,
+	DC_LOG_HW_RESUME_S3(
 			"%s: backlight action: %s\n",
 			__func__, (enable ? "On":"Off"));
 
@@ -2687,7 +2689,7 @@ static void dce110_program_front_end_for_pipe(
 	struct xfm_grph_csc_adjustment adjust;
 	struct out_csc_color_matrix tbl_entry;
 	unsigned int i;
-
+	struct dc_context *ctx = dc->ctx;
 	memset(&tbl_entry, 0, sizeof(tbl_entry));
 
 	if (dc->current_state)
@@ -2762,7 +2764,7 @@ static void dce110_program_front_end_for_pipe(
 	if (pipe_ctx->plane_state->update_flags.bits.full_update)
 		dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
 
-	DC_LOG_SURFACE(dc->ctx->logger,
+	DC_LOG_SURFACE(
 			"Pipe:%d 0x%x: addr hi:0x%x, "
 			"addr low:0x%x, "
 			"src: %d, %d, %d,"
@@ -2785,7 +2787,7 @@ static void dce110_program_front_end_for_pipe(
 			pipe_ctx->plane_state->clip_rect.width,
 			pipe_ctx->plane_state->clip_rect.height);
 
-	DC_LOG_SURFACE(dc->ctx->logger,
+	DC_LOG_SURFACE(
 			"Pipe %d: width, height, x, y\n"
 			"viewport:%d, %d, %d, %d\n"
 			"recout:  %d, %d, %d, %d\n",
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +3 -3
index d938047fc17f..9b34c400c041 100644
@@ -52,6 +52,8 @@
 #include "dce/dce_abm.h"
 #include "dce/dce_dmcu.h"
 
+#define DC_LOGGER \
+		dc->ctx->logger
 #if defined(CONFIG_DRM_AMD_DC_FBC)
 #include "dce110/dce110_compressor.h"
 #endif
@@ -772,7 +774,6 @@ static bool dce110_validate_bandwidth(
 	bool result = false;
 
 	DC_LOG_BANDWIDTH_CALCS(
-		dc->ctx->logger,
 		"%s: start",
 		__func__);
 
@@ -786,8 +787,7 @@ static bool dce110_validate_bandwidth(
 		result =  true;
 
 	if (!result)
-		DC_LOG_BANDWIDTH_VALIDATION(dc->ctx->logger,
-			"%s: %dx%d@%d Bandwidth validation failed!\n",
+		DC_LOG_BANDWIDTH_VALIDATION("%s: %dx%d@%d Bandwidth validation failed!\n",
 			__func__,
 			context->streams[0]->timing.h_addressable,
 			context->streams[0]->timing.v_addressable,
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c +7 -10
index a8e93072ab5c..8ad04816e7d3 100644
@@ -38,6 +38,8 @@
 
 #include "timing_generator.h"
 
+#define DC_LOGGER \
+	tg->ctx->logger
 /** ********************************************************************************
  *
  * DCE11 Timing Generator Implementation
@@ -606,8 +608,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)
 {
-	DC_LOG_ERROR(tg->ctx->logger,
-					"Timing Sync not supported on underlay pipe\n");
+	DC_LOG_ERROR("Timing Sync not supported on underlay pipe\n");
 	return false;
 }
 
@@ -615,8 +616,7 @@ static void dce110_timing_generator_v_setup_global_swap_lock(
 	struct timing_generator *tg,
 	const struct dcp_gsl_params *gsl_params)
 {
-	DC_LOG_ERROR(tg->ctx->logger,
-					"Timing Sync not supported on underlay pipe\n");
+	DC_LOG_ERROR("Timing Sync not supported on underlay pipe\n");
 	return;
 }
 
@@ -624,24 +624,21 @@ static void dce110_timing_generator_v_enable_reset_trigger(
 	struct timing_generator *tg,
 	int source_tg_inst)
 {
-	DC_LOG_ERROR(tg->ctx->logger,
-					"Timing Sync not supported on underlay pipe\n");
+	DC_LOG_ERROR("Timing Sync not supported on underlay pipe\n");
 	return;
 }
 
 static void dce110_timing_generator_v_disable_reset_trigger(
 	struct timing_generator *tg)
 {
-	DC_LOG_ERROR(tg->ctx->logger,
-						"Timing Sync not supported on underlay pipe\n");
+	DC_LOG_ERROR("Timing Sync not supported on underlay pipe\n");
 	return;
 }
 
 static void dce110_timing_generator_v_tear_down_global_swap_lock(
 	struct timing_generator *tg)
 {
-	DC_LOG_ERROR(tg->ctx->logger,
-						"Timing Sync not supported on underlay pipe\n");
+	DC_LOG_ERROR("Timing Sync not supported on underlay pipe\n");
 	return;
 }
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +3 -2
index 809db96a8ba5..8ba3c12fc608 100644
@@ -30,6 +30,8 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #define SCLV_PHASES 64
+#define DC_LOGGER \
+	xfm->ctx->logger
 
 struct sclv_ratios_inits {
 	uint32_t h_int_scale_ratio_luma;
@@ -670,8 +672,7 @@ static void dce110_xfmv_set_pixel_storage_depth(
 	if (!(xfm_dce->lb_pixel_depth_supported & depth)) {
 		/*we should use unsupported capabilities
 		 *  unless it is required by w/a*/
-		DC_LOG_WARNING(xfm->ctx->logger,
-			"%s: Capability not supported",
+		DC_LOG_WARNING("%s: Capability not supported",
 			__func__);
 	}
 }
drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c +2 -9
index 196ddd01615c..faae12cf7968 100644
@@ -33,7 +33,8 @@
 #include "include/logger_interface.h"
 
 #include "dce112_compressor.h"
-
+#define DC_LOGGER \
+		cp110->base.ctx->logger
 #define DCP_REG(reg)\
 	(reg + cp110->offsets.dcp_offset)
 #define DMIF_REG(reg)\
@@ -130,7 +131,6 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 			break;
 		default:
 			DC_LOG_WARNING(
-				cp110->base.ctx->logger,
 				"%s: Invalid LPT NUM_PIPES!!!",
 				__func__);
 			break;
@@ -176,7 +176,6 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 			break;
 		default:
 			DC_LOG_WARNING(
-				cp110->base.ctx->logger,
 				"%s: Invalid LPT NUM_BANKS!!!",
 				__func__);
 			break;
@@ -210,7 +209,6 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 			break;
 		default:
 			DC_LOG_WARNING(
-				cp110->base.ctx->logger,
 				"%s: Invalid LPT INTERLEAVE_SIZE!!!",
 				__func__);
 			break;
@@ -254,14 +252,12 @@ static uint32_t lpt_memory_control_config(struct dce112_compressor *cp110,
 			break;
 		default:
 			DC_LOG_WARNING(
-				cp110->base.ctx->logger,
 				"%s: Invalid LPT ROW_SIZE!!!",
 				__func__);
 			break;
 		}
 	} else {
 		DC_LOG_WARNING(
-			cp110->base.ctx->logger,
 			"%s: LPT MC Configuration is not provided",
 			__func__);
 	}
@@ -312,7 +308,6 @@ static void wait_for_fbc_state_changed(
 
 	if (counter == 10) {
 		DC_LOG_WARNING(
-			cp110->base.ctx->logger,
 			"%s: wait counter exceeded, changes to HW not applied",
 			__func__);
 	}
@@ -526,7 +521,6 @@ void dce112_compressor_program_compressed_surface_address_and_pitch(
 		fbc_pitch = fbc_pitch / 8;
 	else
 		DC_LOG_WARNING(
-			compressor->ctx->logger,
 			"%s: Unexpected DCE11 compression ratio",
 			__func__);
 
@@ -691,7 +685,6 @@ void dce112_compressor_program_lpt_control(
 		break;
 	default:
 		DC_LOG_WARNING(
-			compressor->ctx->logger,
 			"%s: Invalid selected DRAM channels for LPT!!!",
 			__func__);
 		break;
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +3 -2
index bf885d7e699b..cd1e3f72c44e 100644
@@ -56,6 +56,8 @@
 #include "dce/dce_11_2_sh_mask.h"
 
 #include "dce100/dce100_resource.h"
+#define DC_LOGGER \
+		dc->ctx->logger
 
 #ifndef mmDP_DPHY_INTERNAL_CTRL
 	#define mmDP_DPHY_INTERNAL_CTRL 0x4aa7
@@ -723,7 +725,6 @@ bool dce112_validate_bandwidth(
 	bool result = false;
 
 	DC_LOG_BANDWIDTH_CALCS(
-		dc->ctx->logger,
 		"%s: start",
 		__func__);
 
@@ -737,7 +738,7 @@ bool dce112_validate_bandwidth(
 		result = true;
 
 	if (!result)
-		DC_LOG_BANDWIDTH_VALIDATION(dc->ctx->logger,
+		DC_LOG_BANDWIDTH_VALIDATION(
 			"%s: Bandwidth validation failed!",
 			__func__);
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +24 -44

206 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +13 -8
index aa5516539c95..1907ade1574a 100644
@@ -45,6 +45,8 @@
 #include "dcn10_hubbub.h"
 #include "dcn10_cm_common.h"
 
+#define DC_LOGGER \
+	ctx->logger
 #define CTX \
 	hws->ctx
 #define REG(reg)\
@@ -328,6 +330,7 @@ static void power_on_plane(
 	struct dce_hwseq *hws,
 	int plane_id)
 {
+	struct dc_context *ctx = hws->ctx;
 	if (REG(DC_IP_REQUEST_CNTL)) {
 		REG_SET(DC_IP_REQUEST_CNTL, 0,
 				IP_REQUEST_EN, 1);
@@ -335,7 +338,7 @@ static void power_on_plane(
 		hubp_pg_control(hws, plane_id, true);
 		REG_SET(DC_IP_REQUEST_CNTL, 0,
 				IP_REQUEST_EN, 0);
-		DC_LOG_DEBUG(hws->ctx->logger,
+		DC_LOG_DEBUG(
 				"Un-gated front end for pipe %d\n", plane_id);
 	}
 }
@@ -526,7 +529,7 @@ static void reset_back_end_for_pipe(
 		struct dc_state *context)
 {
 	int i;
-
+	struct dc_context *ctx = dc->ctx;
 	if (pipe_ctx->stream_res.stream_enc == NULL) {
 		pipe_ctx->stream = NULL;
 		return;
@@ -572,8 +575,7 @@ static void reset_back_end_for_pipe(
 		return;
 
 	pipe_ctx->stream = NULL;
-	DC_LOG_DEBUG(dc->ctx->logger,
-					"Reset back end for pipe %d, tg:%d\n",
+	DC_LOG_DEBUG("Reset back end for pipe %d, tg:%d\n",
 					pipe_ctx->pipe_idx, pipe_ctx->stream_res.tg->inst);
 }
 
@@ -623,6 +625,7 @@ static void plane_atomic_power_down(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
 	struct dce_hwseq *hws = dc->hwseq;
 	struct dpp *dpp = pipe_ctx->plane_res.dpp;
+	struct dc_context *ctx = dc->ctx;
 
 	if (REG(DC_IP_REQUEST_CNTL)) {
 		REG_SET(DC_IP_REQUEST_CNTL, 0,
@@ -632,7 +635,7 @@ static void plane_atomic_power_down(struct dc *dc, struct pipe_ctx *pipe_ctx)
 		dpp->funcs->dpp_reset(dpp);
 		REG_SET(DC_IP_REQUEST_CNTL, 0,
 				IP_REQUEST_EN, 0);
-		DC_LOG_DEBUG(dc->ctx->logger,
+		DC_LOG_DEBUG(
 				"Power gated front end %d\n", pipe_ctx->pipe_idx);
 	}
 }
@@ -672,6 +675,8 @@ static void plane_atomic_disable(struct dc *dc, struct pipe_ctx *pipe_ctx)
 
 static void dcn10_disable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
+	struct dc_context *ctx = dc->ctx;
+
 	if (!pipe_ctx->plane_res.hubp || pipe_ctx->plane_res.hubp->power_gated)
 		return;
 
@@ -679,8 +684,7 @@ static void dcn10_disable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx)
 
 	apply_DEGVIDCN10_253_wa(dc);
 
-	DC_LOG_DC(dc->ctx->logger,
-					"Power down front end %d\n",
+	DC_LOG_DC("Power down front end %d\n",
 					pipe_ctx->pipe_idx);
 }
 
@@ -1908,6 +1912,7 @@ static void dcn10_apply_ctx_for_surface(
 	bool removed_pipe[4] = { false };
 	unsigned int ref_clk_mhz = dc->res_pool->ref_clock_inKhz/1000;
 	bool program_water_mark = false;
+	struct dc_context *ctx = dc->ctx;
 
 	struct pipe_ctx *top_pipe_to_program =
 			find_top_pipe_for_stream(dc, context, stream);
@@ -1959,7 +1964,7 @@ static void dcn10_apply_ctx_for_surface(
 			plane_atomic_disconnect(dc, old_pipe_ctx);
 			removed_pipe[i] = true;
 
-			DC_LOG_DC(dc->ctx->logger,
+			DC_LOG_DC(
 					"Reset mpcc for pipe %d\n",
 					old_pipe_ctx->pipe_idx);
 		}
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c +4 -2
index 4c2417dd2be6..3977a1f35aad 100644
@@ -55,6 +55,8 @@ enum {
 
 #define FROM_ENGINE(ptr) \
 	container_of((ptr), struct aux_engine, base)
+#define DC_LOGGER \
+	engine->base.ctx->logger
 
 enum i2caux_engine_type dal_aux_engine_get_engine_type(
 	const struct engine *engine)
@@ -286,7 +288,7 @@ static bool read_command(
 
 	if (request->payload.address_space ==
 		I2CAUX_TRANSACTION_ADDRESS_SPACE_DPCD) {
-		DC_LOG_I2C_AUX(engine->base.ctx->logger,  "READ: addr:0x%x  value:0x%x Result:%d",
+		DC_LOG_I2C_AUX("READ: addr:0x%x  value:0x%x Result:%d",
 				request->payload.address,
 				request->payload.data[0],
 				ctx.operation_succeeded);
@@ -494,7 +496,7 @@ static bool write_command(
 
 	if (request->payload.address_space ==
 		I2CAUX_TRANSACTION_ADDRESS_SPACE_DPCD) {
-		DC_LOG_I2C_AUX(engine->base.ctx->logger,  "WRITE: addr:0x%x  value:0x%x Result:%d",
+		DC_LOG_I2C_AUX("WRITE: addr:0x%x  value:0x%x Result:%d",
 				request->payload.address,
 				request->payload.data[0],
 				ctx.operation_succeeded);
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.c +3 -3
index ad685b1c9b81..abd0095ced30 100644
@@ -48,6 +48,8 @@
 /*
  * This unit
  */
+#define DC_LOGGER \
+		hw_engine->base.base.base.ctx->logger
 
 enum dc_i2c_status {
 	DC_I2C_STATUS__DC_I2C_STATUS_IDLE,
@@ -525,9 +527,7 @@ static void construct(
 	REG_GET(MICROSECOND_TIME_BASE_DIV, XTAL_REF_DIV, &xtal_ref_div);
 
 	if (xtal_ref_div == 0) {
-		DC_LOG_WARNING(
-				hw_engine->base.base.base.ctx->logger,
-				"Invalid base timer divider\n",
+		DC_LOG_WARNING("Invalid base timer divider\n",
 				__func__);
 		xtal_ref_div = 2;
 	}
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +5 -6
index e3de56b7ac5f..aa260f9562a2 100644
@@ -36,6 +36,9 @@
 
 #include "dc.h"
 #include "core_types.h"
+#define DC_LOGGER \
+	irq_service->ctx->logger
+
 static bool hpd_ack(
 	struct irq_service *irq_service,
 	const struct irq_source_info *info)
@@ -181,9 +184,7 @@ bool dal_irq_service_dummy_set(
 	const struct irq_source_info *info,
 	bool enable)
 {
-	DC_LOG_ERROR(
-		irq_service->ctx->logger,
-		"%s: called for non-implemented irq source\n",
+	DC_LOG_ERROR("%s: called for non-implemented irq source\n",
 		__func__);
 	return false;
 }
@@ -192,9 +193,7 @@ bool dal_irq_service_dummy_ack(
 	struct irq_service *irq_service,
 	const struct irq_source_info *info)
 {
-	DC_LOG_ERROR(
-		irq_service->ctx->logger,
-		"%s: called for non-implemented irq source\n",
+	DC_LOG_ERROR("%s: called for non-implemented irq source\n",
 		__func__);
 	return false;
 }
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +4 -6
index 441724776441..dcdfa0f01551 100644
@@ -47,6 +47,8 @@
 
 #define CTX \
 		irq_service->ctx
+#define DC_LOGGER \
+	irq_service->ctx->logger
 
 void dal_irq_service_construct(
 	struct irq_service *irq_service,
@@ -104,9 +106,7 @@ bool dal_irq_service_set(
 		find_irq_source_info(irq_service, source);
 
 	if (!info) {
-		DC_LOG_ERROR(
-			irq_service->ctx->logger,
-			"%s: cannot find irq info table entry for %d\n",
+		DC_LOG_ERROR("%s: cannot find irq info table entry for %d\n",
 			__func__,
 			source);
 		return false;
@@ -142,9 +142,7 @@ bool dal_irq_service_ack(
 		find_irq_source_info(irq_service, source);
 
 	if (!info) {
-		DC_LOG_ERROR(
-			irq_service->ctx->logger,
-			"%s: cannot find irq info table entry for %d\n",
+		DC_LOG_ERROR("%s: cannot find irq info table entry for %d\n",
 			__func__,
 			source);
 		return false;
drivers/gpu/drm/amd/display/include/logger_types.h +32 -32

70 lines not on this page · raw message

Signature · 6 lines
2.14.1

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

PATCH 22/33 drm/amd/display: fix dcn1 dppclk when min dispclk patch applies

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Applying min dispclk patch would result in incorrect dppclk divider without this change

---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -1
index f1d8db56f406..8020bc7742c1 100644
@@ -998,7 +998,7 @@ bool dcn_validate_bandwidth(
 					dc->debug.min_disp_clk_khz;
 		}
 
-		context->bw.dcn.calc_clk.max_dppclk_khz = (int)(v->dppclk * 1000);
+		context->bw.dcn.calc_clk.max_dppclk_khz = context->bw.dcn.calc_clk.dispclk_khz / v->dispclk_dppclk_ratio;
 
 		for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
 			struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
Signature · 6 lines
2.14.1

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

PATCH 23/33 drm/amd/display: update infoframe after dig fe is turned on

In reply to a message not in the archive

From: Eric Yang <[email protected]>

Before dig fe is enabled, infoframe can't be programmed. So in suspend resume case our infoframe programmming was not going through.

This change changes the sequence so that infoframe is programmed after.

---
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +13 -10
index f21aa04e93da..c2041a63cccd 100644
@@ -684,15 +684,22 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
 	struct dc_crtc_timing *timing = &pipe_ctx->stream->timing;
 	struct dc_link *link = pipe_ctx->stream->sink->link;
 
-	/* 1. update AVI info frame (HDMI, DP)
-	 * we always need to update info frame
-	*/
+
 	uint32_t active_total_with_borders;
 	uint32_t early_control = 0;
 	struct timing_generator *tg = pipe_ctx->stream_res.tg;
 
-	/* TODOFPGA may change to hwss.update_info_frame */
+	/* For MST, there are multiply stream go to only one link.
+	 * connect DIG back_end to front_end while enable_stream and
+	 * disconnect them during disable_stream
+	 * BY this, it is logic clean to separate stream and link */
+	link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
+						    pipe_ctx->stream_res.stream_enc->id, true);
+
+	/* update AVI info frame (HDMI, DP)*/
+	/* TODO: FPGA may change to hwss.update_info_frame */
 	dce110_update_info_frame(pipe_ctx);
+
 	/* enable early control to avoid corruption on DP monitor*/
 	active_total_with_borders =
 			timing->h_addressable
@@ -713,12 +720,8 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
 			pipe_ctx->stream_res.stream_enc->funcs->dp_audio_enable(pipe_ctx->stream_res.stream_enc);
 	}
 
-	/* For MST, there are multiply stream go to only one link.
-	 * connect DIG back_end to front_end while enable_stream and
-	 * disconnect them during disable_stream
-	 * BY this, it is logic clean to separate stream and link */
-	link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
-						    pipe_ctx->stream_res.stream_enc->id, true);
+
+
 
 }
 
Signature · 6 lines
2.14.1

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

PATCH 24/33 drm/amd/display: Remove duplicate dm_pp_power_level enum

In reply to a message not in the archive

This is really just a copy of dm_pp_clocks_state, so just use that one.

Thanks to Matthias Kaehlke for spotting this.

---
 drivers/gpu/drm/amd/display/dc/dm_services_types.h | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/dm_services_types.h +1 -18
index fa26cf488b3c..25ece5315353 100644
@@ -239,25 +239,8 @@ enum dm_acpi_display_type {
 	AcpiDisplayType_DFP6 = 12
 };
 
-enum dm_pp_power_level {
-	DM_PP_POWER_LEVEL_INVALID,
-	DM_PP_POWER_LEVEL_ULTRA_LOW,
-	DM_PP_POWER_LEVEL_LOW,
-	DM_PP_POWER_LEVEL_NOMINAL,
-	DM_PP_POWER_LEVEL_PERFORMANCE,
-
-	DM_PP_POWER_LEVEL_0 = DM_PP_POWER_LEVEL_ULTRA_LOW,
-	DM_PP_POWER_LEVEL_1 = DM_PP_POWER_LEVEL_LOW,
-	DM_PP_POWER_LEVEL_2 = DM_PP_POWER_LEVEL_NOMINAL,
-	DM_PP_POWER_LEVEL_3 = DM_PP_POWER_LEVEL_PERFORMANCE,
-	DM_PP_POWER_LEVEL_4 = DM_PP_CLOCKS_DPM_STATE_LEVEL_3 + 1,
-	DM_PP_POWER_LEVEL_5 = DM_PP_CLOCKS_DPM_STATE_LEVEL_4 + 1,
-	DM_PP_POWER_LEVEL_6 = DM_PP_CLOCKS_DPM_STATE_LEVEL_5 + 1,
-	DM_PP_POWER_LEVEL_7 = DM_PP_CLOCKS_DPM_STATE_LEVEL_6 + 1,
-};
-
 struct dm_pp_power_level_change_request {
-	enum dm_pp_power_level power_level;
+	enum dm_pp_clocks_state power_level;
 };
 
 struct dm_pp_clock_for_voltage_req {
Signature · 6 lines
2.14.1

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

PATCH 25/33 drm/amd/display: dal 3.1.37

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index e954705f7f0f..7f0dbf6a866a 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.36"
+#define DC_VER "3.1.37"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.14.1

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

PATCH 26/33 drm/amd/display: Use crtc enable/disable_vblank hooks

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +24 -0
index 64a3abed2466..39934f2fdc9d 100644
@@ -2495,6 +2495,28 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc)
 	return &state->base;
 }
 
+
+static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
+{
+	enum dc_irq_source irq_source;
+	struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
+	struct amdgpu_device *adev = crtc->dev->dev_private;
+
+	irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst;
+	dc_interrupt_set(adev->dm.dc, irq_source, enable);
+	return 0;
+}
+
+static int dm_enable_vblank(struct drm_crtc *crtc)
+{
+	return dm_set_vblank(crtc, true);
+}
+
+static void dm_disable_vblank(struct drm_crtc *crtc)
+{
+	dm_set_vblank(crtc, false);
+}
+
 /* Implemented only the options currently availible for the driver */
 static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {
 	.reset = dm_crtc_reset_state,
@@ -2505,6 +2527,8 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {
 	.atomic_duplicate_state = dm_crtc_duplicate_state,
 	.atomic_destroy_state = dm_crtc_destroy_state,
 	.set_crc_source = amdgpu_dm_crtc_set_crc_source,
+	.enable_vblank = dm_enable_vblank,
+	.disable_vblank = dm_disable_vblank,
 };
 
 static enum drm_connector_status
Signature · 6 lines
2.14.1

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

PATCH 27/33 drm/amd/display: Return success when enabling interrupt

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 6 +++---
 drivers/gpu/drm/amd/display/dc/dc.h               | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index 39934f2fdc9d..2e1fd37e47df 100644
@@ -2503,8 +2503,7 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
 	struct amdgpu_device *adev = crtc->dev->dev_private;
 
 	irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst;
-	dc_interrupt_set(adev->dm.dc, irq_source, enable);
-	return 0;
+	return dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY;
 }
 
 static int dm_enable_vblank(struct drm_crtc *crtc)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -3
index 2bc15a46882a..8394d69b963f 100644
@@ -1516,13 +1516,13 @@ enum dc_irq_source dc_interrupt_to_irq_source(
 	return dal_irq_service_to_irq_source(dc->res_pool->irqs, src_id, ext_id);
 }
 
-void dc_interrupt_set(struct dc *dc, enum dc_irq_source src, bool enable)
+bool dc_interrupt_set(struct dc *dc, enum dc_irq_source src, bool enable)
 {
 
 	if (dc == NULL)
-		return;
+		return false;
 
-	dal_irq_service_set(dc->res_pool->irqs, src, enable);
+	return dal_irq_service_set(dc->res_pool->irqs, src, enable);
 }
 
 void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 7f0dbf6a866a..2cd97342bf0f 100644
@@ -705,7 +705,7 @@ enum dc_irq_source dc_interrupt_to_irq_source(
 		struct dc *dc,
 		uint32_t src_id,
 		uint32_t ext_id);
-void dc_interrupt_set(struct dc *dc, enum dc_irq_source src, bool enable);
+bool dc_interrupt_set(struct dc *dc, enum dc_irq_source src, bool enable);
 void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src);
 enum dc_irq_source dc_get_hpd_irq_source_at_index(
 		struct dc *dc, uint32_t link_index);
Signature · 6 lines
2.14.1

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

PATCH 28/33 drm/amd/display: Clean up formatting in irq_service_dce110.c

In reply to a message not in the archive
---
 .../amd/display/dc/irq/dce110/irq_service_dce110.c | 62 +++++++++-------------
 1 file changed, 26 insertions(+), 36 deletions(-)
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +26 -36
index aa260f9562a2..9bc1c1d90bad 100644
@@ -39,27 +39,22 @@
 #define DC_LOGGER \
 	irq_service->ctx->logger
 
-static bool hpd_ack(
-	struct irq_service *irq_service,
-	const struct irq_source_info *info)
+static bool hpd_ack(struct irq_service *irq_service,
+		    const struct irq_source_info *info)
 {
 	uint32_t addr = info->status_reg;
 	uint32_t value = dm_read_reg(irq_service->ctx, addr);
-	uint32_t current_status =
-		get_reg_field_value(
-			value,
-			DC_HPD_INT_STATUS,
-			DC_HPD_SENSE_DELAYED);
+	uint32_t current_status = get_reg_field_value(value,
+						      DC_HPD_INT_STATUS,
+						      DC_HPD_SENSE_DELAYED);
 
 	dal_irq_service_ack_generic(irq_service, info);
 
 	value = dm_read_reg(irq_service->ctx, info->enable_reg);
 
-	set_reg_field_value(
-		value,
-		current_status ? 0 : 1,
-		DC_HPD_INT_CONTROL,
-		DC_HPD_INT_POLARITY);
+	set_reg_field_value(value, current_status ? 0 : 1,
+			    DC_HPD_INT_CONTROL,
+			    DC_HPD_INT_POLARITY);
 
 	dm_write_reg(irq_service->ctx, info->enable_reg, value);
 
@@ -179,37 +174,34 @@ static const struct irq_source_info_funcs vblank_irq_info_funcs = {
 #define dc_underflow_int_entry(reg_num) \
 	[DC_IRQ_SOURCE_DC ## reg_num ## UNDERFLOW] = dummy_irq_entry()
 
-bool dal_irq_service_dummy_set(
-	struct irq_service *irq_service,
-	const struct irq_source_info *info,
-	bool enable)
+bool dal_irq_service_dummy_set(struct irq_service *irq_service,
+			       const struct irq_source_info *info,
+			       bool enable)
 {
 	DC_LOG_ERROR("%s: called for non-implemented irq source\n",
-		__func__);
+		     __func__);
 	return false;
 }
 
-bool dal_irq_service_dummy_ack(
-	struct irq_service *irq_service,
-	const struct irq_source_info *info)
+bool dal_irq_service_dummy_ack(struct irq_service *irq_service,
+			       const struct irq_source_info *info)
 {
 	DC_LOG_ERROR("%s: called for non-implemented irq source\n",
-		__func__);
+		     __func__);
 	return false;
 }
 
 
-bool dce110_vblank_set(
-		struct irq_service *irq_service,
-		const struct irq_source_info *info,
-		bool enable)
+bool dce110_vblank_set(struct irq_service *irq_service,
+		       const struct irq_source_info *info,
+		       bool enable)
 {
 	struct dc_context *dc_ctx = irq_service->ctx;
 	struct dc *core_dc = irq_service->ctx->dc;
-	enum dc_irq_source dal_irq_src = dc_interrupt_to_irq_source(
-										irq_service->ctx->dc,
-										info->src_id,
-										info->ext_id);
+	enum dc_irq_source dal_irq_src =
+			dc_interrupt_to_irq_source(irq_service->ctx->dc,
+						   info->src_id,
+						   info->ext_id);
 	uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
 
 	struct timing_generator *tg =
@@ -224,7 +216,6 @@ bool dce110_vblank_set(
 
 	dal_irq_service_set_generic(irq_service, info, enable);
 	return true;
-
 }
 
 static const struct irq_source_info_funcs dummy_irq_info_funcs = {
@@ -405,9 +396,8 @@ static const struct irq_service_funcs irq_service_funcs_dce110 = {
 		.to_dal_irq_source = to_dal_irq_source_dce110
 };
 
-static void construct(
-	struct irq_service *irq_service,
-	struct irq_service_init_data *init_data)
+static void construct(struct irq_service *irq_service,
+		      struct irq_service_init_data *init_data)
 {
 	dal_irq_service_construct(irq_service, init_data);
 
@@ -415,8 +405,8 @@ static void construct(
 	irq_service->funcs = &irq_service_funcs_dce110;
 }
 
-struct irq_service *dal_irq_service_dce110_create(
-	struct irq_service_init_data *init_data)
+struct irq_service *
+dal_irq_service_dce110_create(struct irq_service_init_data *init_data)
 {
 	struct irq_service *irq_service = kzalloc(sizeof(*irq_service),
 						  GFP_KERNEL);
Signature · 6 lines
2.14.1

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

PATCH 29/33 drm/amd/display: defer modeset check in dm_update_planes_state

In reply to a message not in the archive

From: Shirish S <[email protected]>

amdgpu_dm_atomic_check() is used to validate the entire configuration of planes and crtc's that the user space wants to commit.

However amdgpu_dm_atomic_check() depends upon DRM_MODE_ATOMIC_ALLOW_MODESET flag else its mostly dummy.
Its not mandatory for the user space to set DRM_MODE_ATOMIC_ALLOW_MODESET, and in general its not set either along with DRM_MODE_ATOMIC_TEST_ONLY.

Considering its importantance, this patch defers the allow_modeset check in dm_update_planes_state(), so that there shall be scope to validate the configuration sent from user space, without impacting the population of dc/dm related data structures.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -2
index 2e1fd37e47df..19f727d4df42 100644
@@ -4726,8 +4726,6 @@ static int dm_update_planes_state(struct dc *dc,
 	bool pflip_needed  = !state->allow_modeset;
 	int ret = 0;
 
-	if (pflip_needed)
-		return ret;
 
 	/* Add new planes */
 	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
@@ -4742,6 +4740,8 @@ static int dm_update_planes_state(struct dc *dc,
 
 		/* Remove any changed/removed planes */
 		if (!enable) {
+			if (pflip_needed)
+				continue;
 
 			if (!old_plane_crtc)
 				continue;
@@ -4786,6 +4786,8 @@ static int dm_update_planes_state(struct dc *dc,
 			if (!dm_new_crtc_state->stream)
 				continue;
 
+			if (pflip_needed)
+				continue;
 
 			WARN_ON(dm_new_plane_state->dc_state);
 
Signature · 6 lines
2.14.1

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

PATCH 30/33 drm/amd/display: validate plane in dce110 for scaling

In reply to a message not in the archive

From: Shirish S <[email protected]>

CZ & ST support uptil a limit 2:1 downscaling, this patch adds validate_plane hook, that shall be used to validate the plane attributes sent by the user space based on dce110 capabilities.

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +11 -0
index 9b34c400c041..830cbbc4adeb 100644
@@ -846,6 +846,16 @@ static bool dce110_validate_bandwidth(
 	return result;
 }
 
+enum dc_status dce110_validate_plane(const struct dc_plane_state *plane_state,
+				     struct dc_caps *caps)
+{
+	if (((plane_state->dst_rect.width * 2) < plane_state->src_rect.width) ||
+	    ((plane_state->dst_rect.height * 2) < plane_state->src_rect.height))
+		return DC_FAIL_SURFACE_VALIDATE;
+
+	return DC_OK;
+}
+
 static bool dce110_validate_surface_sets(
 		struct dc_state *context)
 {
@@ -1021,6 +1031,7 @@ static const struct resource_funcs dce110_res_pool_funcs = {
 	.link_enc_create = dce110_link_encoder_create,
 	.validate_guaranteed = dce110_validate_guaranteed,
 	.validate_bandwidth = dce110_validate_bandwidth,
+	.validate_plane = dce110_validate_plane,
 	.acquire_idle_pipe_for_layer = dce110_acquire_underlay,
 	.add_stream_to_ctx = dce110_add_stream_to_ctx,
 	.validate_global = dce110_validate_global
Signature · 6 lines
2.14.1

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

PATCH 31/33 drm/amd/display: Don't blow up if TG is NULL in dce110_vblank_set

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +1 -1
index 9bc1c1d90bad..afe0876fe6f8 100644
@@ -208,7 +208,7 @@ bool dce110_vblank_set(struct irq_service *irq_service,
 			core_dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
 
 	if (enable) {
-		if (!tg->funcs->arm_vert_intr(tg, 2)) {
+		if (!tg || !tg->funcs->arm_vert_intr(tg, 2)) {
 			DC_ERROR("Failed to get VBLANK!\n");
 			return false;
 		}
Signature · 6 lines
2.14.1

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

PATCH 32/33 drm/amd/display: update plane params before validation

In reply to a message not in the archive

From: Shirish S <[email protected]>

This patch updates the dc's plane state with the parameters set by the user side.
This is needed to validate the plane capabilities with the parameters user space wants to set.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index 19f727d4df42..eb613fa89fc8 100644
@@ -3117,6 +3117,9 @@ static int dm_plane_atomic_check(struct drm_plane *plane,
 	if (!dm_plane_state->dc_state)
 		return 0;
 
+	if (!fill_rects_from_plane_state(state, dm_plane_state->dc_state))
+		return -EINVAL;
+
 	if (dc_validate_plane(dc, dm_plane_state->dc_state) == DC_OK)
 		return 0;
 
Signature · 6 lines
2.14.1

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

PATCH 33/33 drm/amd/display: Default HDMI6G support to true. Log VBIOS table error.

In reply to a message not in the archive

There have been many reports of Ellesmere and Baffin systems not being able to drive HDMI 4k60 due to the fact that we check the HDMI_6GB_EN bit from VBIOS table. Windows seems to not have this issue.

On some systems we fail to the encoder cap info from VBIOS. In that case we should default to enabling HDMI6G support.

This was tested by dwagner on
https://bugs.freedesktop.org/show_bug.cgi?id=102820

---
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +13 -3
index f0d63ac7724a..81776e4797ed 100644
@@ -678,6 +678,7 @@ void dce110_link_encoder_construct(
 {
 	struct bp_encoder_cap_info bp_cap_info = {0};
 	const struct dc_vbios_funcs *bp_funcs = init_data->ctx->dc_bios->funcs;
+	enum bp_result result = BP_RESULT_OK;
 
 	enc110->base.funcs = &dce110_lnk_enc_funcs;
 	enc110->base.ctx = init_data->ctx;
@@ -752,15 +753,24 @@ void dce110_link_encoder_construct(
 		enc110->base.preferred_engine = ENGINE_ID_UNKNOWN;
 	}
 
+	/* default to one to mirror Windows behavior */
+	enc110->base.features.flags.bits.HDMI_6GB_EN = 1;
+
+	result = bp_funcs->get_encoder_cap_info(enc110->base.ctx->dc_bios,
+						enc110->base.id, &bp_cap_info);
+
 	/* Override features with DCE-specific values */
-	if (BP_RESULT_OK == bp_funcs->get_encoder_cap_info(
-			enc110->base.ctx->dc_bios, enc110->base.id,
-			&bp_cap_info)) {
+	if (BP_RESULT_OK == result) {
 		enc110->base.features.flags.bits.IS_HBR2_CAPABLE =
 				bp_cap_info.DP_HBR2_EN;
 		enc110->base.features.flags.bits.IS_HBR3_CAPABLE =
 				bp_cap_info.DP_HBR3_EN;
 		enc110->base.features.flags.bits.HDMI_6GB_EN = bp_cap_info.HDMI_6GB_EN;
+	} else {
+		dm_logger_write(enc110->base.ctx->logger, LOG_WARNING,
+				"%s: Failed to get encoder_cap_info from VBIOS with error code %d!\n",
+				__func__,
+				result);
 	}
 }
 
Signature · 6 lines
2.14.1

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