Skip to contentSkip to conversation

DC Patches July 25, 2024

PATCH In review Rodrigo Siqueira 2 participants 41 messages Jul 25, 2024 – Jul 26, 2024

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

cover DC Patches July 25, 2024

This DC patchset brings improvements in multiple areas. In summary, we have:

- SPL improvements.
- Address coverity issues.
- DML2 fixes.
- Code cleanup.
- DIO and DCCG refactor.
- Improve the PSR state.

Cc: Daniel Wheeler <[email protected]>
Thanks
Siqueira

Alex Hung (7):
drm/amd/display: Fix possible overflow in integer multiplication drm/amd/display: Check null pointers before using them drm/amd/display: Check stream_status before it is used drm/amd/display: Avoid overflow assignment in link_dp_cts drm/amd/display: Check null values from functions drm/amd/display: Initialize get_bytes_per_element's default to 1 drm/amd/display: Check UnboundedRequestEnabled's value

Alvin Lee (2):
drm/amd/display: Add option to disable unbounded req in DML21 drm/amd/display: For FAMS2 don't program P-State force from driver

Aric Cyr (1):
drm/amd/display: 3.2.294

Bhuvanachandra Pinninti (1):
drm/amd/display: Refactor for dio

Charlene Liu (2):
drm/amd/display: restore immediate_disable_crtc for w/a drm/amd/display: sync dmub output event type.

Chris Park (1):
drm/amd/display: Add two dmmuy I2C entry for GPIO port mapping issue

Cruise (2):
drm/amd/display: Add logs for debugging outbox drm/amd/display: Get link index for AUX reply notification

Daniel Sa (1):
drm/amd/display: Underflow Seen on DCN401 eGPU

Hansen Dsouza (2):
drm/amd/display: Add new enable and disable functions drm/amd/display: Add new enable and disable functions for DCN35

Ilya Bakoulin (1):
drm/amd/display: Use correct cm_helper function

Leo Li (2):
drm/amd/display: Let drm_crtc_vblank_on/off manage interrupts drm/amd/display: Run idle optimizations at end of vblank handler

Meenakshikumar Somasundaram (1):
drm/amd/display: Enable aux transfer path via dmub for dp tunneling

Nicholas Kazlauskas (3):
drm/amd/display: Request 0MHz dispclk for zero display case drm/amd/display: Add seamless boot support for more DIG operation
modes
drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces

Rodrigo Siqueira (9):
drm/amd/display: Re-order enum in a header file drm/amd/display: Setup two pixel per container drm/amd/display: Replace dm_execute_dmub_cmd with
dc_wake_and_execute_dmub_cmd
drm/amd/display: Add missing DET segments programming drm/amd/display: Remove duplicated code drm/amd/display: Add missing mcache registers drm/amd/display: Add dcc propagation value drm/amd/display: Add missing registers for dcn32 drm/amd/display: Remove unused code

Samson Tam (1):
drm/amd/display: roll back quality EASF and ISHARP and dc dependency
changes

Sung Lee (1):
drm/amd/display: Fix Cursor Offset in Scaled Scenarios

Tom Chung (2):
drm/amd/display: Add a missing PSR state
drm/amd/display: Reset VRR config during resume

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   46 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |   60 +-
 drivers/gpu/drm/amd/display/dc/Makefile       |    1 -
 .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c  |    4 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c      |   14 +-
 .../gpu/drm/amd/display/dc/core/dc_resource.c |    2 +
 drivers/gpu/drm/amd/display/dc/core/dc_stat.c |    1 +
 drivers/gpu/drm/amd/display/dc/dc.h           |    2 +-
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |    3 +
 drivers/gpu/drm/amd/display/dc/dc_dp_types.h  |    2 +-
 .../gpu/drm/amd/display/dc/dc_spl_translate.c |   50 +-
 .../gpu/drm/amd/display/dc/dc_spl_translate.h |    1 -
 drivers/gpu/drm/amd/display/dc/dc_types.h     |    1 +
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    |  266 ++-
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c  |   10 +-
 drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c |    2 +
 .../gpu/drm/amd/display/dc/dce/dmub_replay.c  |    3 +-
 .../gpu/drm/amd/display/dc/dcn301/Makefile    |    2 +-
 .../gpu/drm/amd/display/dc/dcn314/Makefile    |   10 -
 drivers/gpu/drm/amd/display/dc/dio/Makefile   |   18 +
 .../dcn301/dcn301_dio_link_encoder.c          |    0
 .../dcn301/dcn301_dio_link_encoder.h          |    0
 .../dcn314/dcn314_dio_stream_encoder.c        |    0
 .../dcn314/dcn314_dio_stream_encoder.h        |    0
 .../dc/dio/dcn321/dcn321_dio_link_encoder.c   |    1 -
 .../dc/dio/dcn35/dcn35_dio_stream_encoder.c   |   20 +-
 .../dc/dml/dcn20/display_rq_dlg_calc_20v2.c   |    2 +-
 .../dc/dml/dcn21/display_rq_dlg_calc_21.c     |    2 +-
 .../dc/dml2/dml21/dml21_translation_helper.c  |   13 +-
 .../src/dml2_core/dml2_core_dcn4_calcs.c      |    2 +-
 .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c  |    8 +
 .../display/dc/dml2/dml2_translation_helper.c |   20 +-
 .../drm/amd/display/dc/dml2/dml2_wrapper.c    |    2 +-
 .../display/dc/dpp/dcn401/dcn401_dpp_dscl.c   |  568 +++---
 .../dc/gpio/dcn401/hw_factory_dcn401.c        |   16 +-
 .../amd/display/dc/hubp/dcn401/dcn401_hubp.c  |    5 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |    2 +
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c |   30 +-
 .../amd/display/dc/hwss/dcn401/dcn401_init.c  |    1 -
 .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h   |    3 -
 .../amd/display/dc/inc/hw/stream_encoder.h    |    1 +
 .../gpu/drm/amd/display/dc/inc/hw/transform.h |   10 -
 .../display/dc/link/accessories/link_dp_cts.c |    3 +-
 .../amd/display/dc/optc/dcn31/dcn31_optc.c    |    8 +-
 .../dc/resource/dcn32/dcn32_resource.h        |    5 +
 .../resource/dcn32/dcn32_resource_helpers.c   |    4 +-
 .../dc/resource/dcn401/dcn401_resource.c      |    8 +-
 .../dc/resource/dcn401/dcn401_resource.h      |    4 +-
 drivers/gpu/drm/amd/display/dc/spl/Makefile   |    2 +-
 drivers/gpu/drm/amd/display/dc/spl/dc_spl.c   | 1310 +++++--------
 .../drm/amd/display/dc/spl/dc_spl_filters.c   |   15 -
 .../drm/amd/display/dc/spl/dc_spl_filters.h   |   15 -
 .../display/dc/spl/dc_spl_isharp_filters.c    |  427 +---
 .../display/dc/spl/dc_spl_isharp_filters.h    |   33 +-
 .../display/dc/spl/dc_spl_scl_easf_filters.c  | 1726 -----------------
 .../display/dc/spl/dc_spl_scl_easf_filters.h  |   38 -
 .../amd/display/dc/spl/dc_spl_scl_filters.c   |   92 +-
 .../amd/display/dc/spl/dc_spl_scl_filters.h   |   55 +-
 .../display/dc/spl/dc_spl_scl_filters_old.c   |   25 +
 .../gpu/drm/amd/display/dc/spl/dc_spl_types.h |   75 +-
 .../gpu/drm/amd/display/dc/spl/spl_debug.h    |   23 -
 .../drm/amd/display/dc/spl/spl_fixpt31_32.c   |  518 -----
 .../drm/amd/display/dc/spl/spl_fixpt31_32.h   |  546 ------
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |    3 +
 .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c |    4 +
 .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c |    4 +
 .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c |    4 +
 .../drm/amd/display/dmub/src/dmub_dcn401.c    |    4 +
 .../gpu/drm/amd/display/include/dpcd_defs.h   |    1 +
 69 files changed, 1510 insertions(+), 4646 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/dcn314/Makefile
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn301/dcn301_dio_link_encoder.c (100%)
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn301/dcn301_dio_link_encoder.h (100%)
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn314/dcn314_dio_stream_encoder.c (100%)
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn314/dcn314_dio_stream_encoder.h (100%)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_filters_old.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_debug.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.h
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/39 drm/amd/display: roll back quality EASF and ISHARP and dc dependency changes

From: Samson Tam <[email protected]>

[Why]
Seeing several regressions related to quality EASF and ISHARP changes and removing dc dependency changes.

[How]
Roll back SPL changes

---
 .../gpu/drm/amd/display/dc/core/dc_resource.c |    2 +
 .../gpu/drm/amd/display/dc/dc_spl_translate.c |   49 +-
 .../gpu/drm/amd/display/dc/dc_spl_translate.h |    1 -
 .../dc/dml2/dml21/dml21_translation_helper.c  |    8 -
 .../display/dc/dpp/dcn401/dcn401_dpp_dscl.c   |  568 +++---
 .../dc/resource/dcn401/dcn401_resource.c      |    7 -
 drivers/gpu/drm/amd/display/dc/spl/Makefile   |    2 +-
 drivers/gpu/drm/amd/display/dc/spl/dc_spl.c   | 1310 +++++--------
 .../drm/amd/display/dc/spl/dc_spl_filters.c   |   15 -
 .../drm/amd/display/dc/spl/dc_spl_filters.h   |   15 -
 .../display/dc/spl/dc_spl_isharp_filters.c    |  427 +---
 .../display/dc/spl/dc_spl_isharp_filters.h    |   33 +-
 .../display/dc/spl/dc_spl_scl_easf_filters.c  | 1726 -----------------
 .../display/dc/spl/dc_spl_scl_easf_filters.h  |   38 -
 .../amd/display/dc/spl/dc_spl_scl_filters.c   |   92 +-
 .../amd/display/dc/spl/dc_spl_scl_filters.h   |   55 +-
 .../display/dc/spl/dc_spl_scl_filters_old.c   |   25 +
 .../gpu/drm/amd/display/dc/spl/dc_spl_types.h |   43 +-
 .../gpu/drm/amd/display/dc/spl/spl_debug.h    |   23 -
 .../drm/amd/display/dc/spl/spl_fixpt31_32.c   |  518 -----
 .../drm/amd/display/dc/spl/spl_fixpt31_32.h   |  546 ------
 21 files changed, 989 insertions(+), 4514 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_filters_old.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_debug.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.h
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -0
index 5c9091f2a8b2..4f5b23520365 100644
@@ -1511,6 +1511,8 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 			pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
 
 		pipe_ctx->plane_res.scl_data.lb_params.alpha_en = plane_state->per_pixel_alpha;
+		spl_out->scl_data.h_active = pipe_ctx->plane_res.scl_data.h_active;
+		spl_out->scl_data.v_active = pipe_ctx->plane_res.scl_data.v_active;
 
 		// Convert pipe_ctx to respective input params for SPL
 		translate_SPL_in_params_from_pipe_ctx(pipe_ctx, spl_in);
drivers/gpu/drm/amd/display/dc/dc_spl_translate.c +20 -29

76 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dc_spl_translate.h +0 -1
index eaa5c5373b28..c73d640c3632 100644
@@ -6,7 +6,6 @@
 #define __DC_SPL_TRANSLATE_H__
 #include "dc.h"
 #include "resource.h"
-#include "dm_helpers.h"
 
 /* Map SPL input parameters to pipe context
  * @pipe_ctx: pipe context
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +0 -8
index 4164cda90b2a..0f34688e4058 100644
@@ -788,14 +788,6 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
 		 * certain cases. Hence do corrective active and disable scaling.
 		 */
 		plane->composition.scaler_info.enabled = false;
-	} else if ((plane_state->ctx->dc->config.use_spl == true) &&
-		(plane->composition.scaler_info.enabled == false)) {
-		/* To enable sharpener for 1:1, scaler must be enabled.  If use_spl is set, then
-		 *  allow case where ratio is 1 but taps > 1
-		 */
-		if ((scaler_data->taps.h_taps > 1) || (scaler_data->taps.v_taps > 1) ||
-			(scaler_data->taps.h_taps_c > 1) || (scaler_data->taps.v_taps_c > 1))
-			plane->composition.scaler_info.enabled = true;
 	}
 
 	/* always_scale is only used for debug purposes not used in production but has to be
drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_dscl.c +306 -262

704 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +0 -7
index 5ee20753572e..9fcdf06d6aa4 100644
@@ -76,9 +76,6 @@
 
 #include "dml2/dml2_wrapper.h"
 
-#include "spl/dc_spl_scl_easf_filters.h"
-#include "spl/dc_spl_isharp_filters.h"
-
 #define DC_LOGGER_INIT(logger)
 
 enum dcn401_clk_src_array_id {
@@ -2126,10 +2123,6 @@ static bool dcn401_resource_construct(
 	dc->dml2_options.max_segments_per_hubp = 20;
 	dc->dml2_options.det_segment_size = DCN4_01_CRB_SEGMENT_SIZE_KB;
 
-	/* SPL */
-	spl_init_easf_filter_coeffs();
-	spl_init_blur_scale_coeffs();
-
 	return true;
 
 create_fail:
drivers/gpu/drm/amd/display/dc/spl/Makefile +1 -1
index 05764d4d4604..f8df85ea4d32 100644
@@ -23,7 +23,7 @@
 # Makefile for the 'spl' sub-component of DAL.
 # It provides the scaling library interface.
 
-SPL = dc_spl.o dc_spl_scl_filters.o dc_spl_scl_easf_filters.o dc_spl_isharp_filters.o dc_spl_filters.o spl_fixpt31_32.o
+SPL = dc_spl.o dc_spl_scl_filters.o dc_spl_scl_filters_old.o dc_spl_isharp_filters.o
 
 AMD_DAL_SPL = $(addprefix $(AMDDALPATH)/dc/spl/,$(SPL))
 
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +538 -772

1,787 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.c deleted +0 -15
deleted file mode 100644
index 99238644e0a1..000000000000
@@ -1,15 +0,0 @@
-// SPDX-License-Identifier: MIT
-//
-// Copyright 2024 Advanced Micro Devices, Inc.
-
-#include "dc_spl_filters.h"
-
-void convert_filter_s1_10_to_s1_12(const uint16_t *s1_10_filter,
-	uint16_t *s1_12_filter, int num_taps)
-{
-	int num_entries = NUM_PHASES_COEFF * num_taps;
-	int i;
-
-	for (i = 0; i < num_entries; i++)
-		*(s1_12_filter + i) = *(s1_10_filter + i) * 4;
-}
drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.h deleted +0 -15
deleted file mode 100644
index 20439cdbdb10..000000000000
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-
-/* Copyright 2024 Advanced Micro Devices, Inc. */
-
-#ifndef __DC_SPL_FILTERS_H__
-#define __DC_SPL_FILTERS_H__
-
-#include "dc_spl_types.h"
-
-#define NUM_PHASES_COEFF 33
-
-void convert_filter_s1_10_to_s1_12(const uint16_t *s1_10_filter,
-	uint16_t *s1_12_filter, int num_taps);
-
-#endif /* __DC_SPL_FILTERS_H__ */
drivers/gpu/drm/amd/display/dc/spl/dc_spl_isharp_filters.c +3 -424

347 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/dc_spl_isharp_filters.h +1 -32
index 6cb000bf9d53..1aaf4c50c1bc 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.c deleted +0 -1726

1,726 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.h deleted +0 -38
deleted file mode 100644
index 8bb2b8108e38..000000000000

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_filters.c +32 -60

92 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_filters.h +46 -9

55 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_filters_old.c new file +25 -0
new file mode 100644
index 000000000000..bb0e1b80ec3c

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/amd/display/dc/spl/dc_spl_types.h +15 -28

43 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/spl_debug.h deleted +0 -23
deleted file mode 100644
index a36239ab8d1c..000000000000

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.c deleted +0 -518

518 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.h deleted +0 -546

546 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.43.0

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/39 drm/amd/display: Let drm_crtc_vblank_on/off manage interrupts

In reply to Rodrigo Siqueira

From: Leo Li <[email protected]>

[Why]
We manage interrupts for CRTCs in two places:
1. In manage_dm_interrupts(), when CRTC get enabled or disabled
2. When drm_vblank_get/put() starts or kills the vblank counter, calling into amdgpu_dm_crtc_set_vblank()

The interrupts managed by these twp places should be identical.

[How]
Since manage_dm_interrupts() already use drm_crtc_vblank_on/off(), just move all CRTC interrupt management into amdgpu_dm_crtc_set_vblank().

This has the added benefit of disabling all CRTC and HUBP interrupts when there are no vblank requestors.

Note that there is a TODO item - unchanged from when it was first introduced - to properly identify the HUBP instance from the OTG instance, rather than just assume direct mapping.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +-------------
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    | 48 +++++++++++++++++--
 2 files changed, 47 insertions(+), 37 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -34
index 1a8fc566e24d..4d36a66917c6 100644
@@ -8246,42 +8246,10 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
 				 struct amdgpu_crtc *acrtc,
 				 bool enable)
 {
-	/*
-	 * We have no guarantee that the frontend index maps to the same
-	 * backend index - some even map to more than one.
-	 *
-	 * TODO: Use a different interrupt or check DC itself for the mapping.
-	 */
-	int irq_type =
-		amdgpu_display_crtc_idx_to_irq_type(
-			adev,
-			acrtc->crtc_id);
-
-	if (enable) {
+	if (enable)
 		drm_crtc_vblank_on(&acrtc->base);
-		amdgpu_irq_get(
-			adev,
-			&adev->pageflip_irq,
-			irq_type);
-#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
-		amdgpu_irq_get(
-			adev,
-			&adev->vline0_irq,
-			irq_type);
-#endif
-	} else {
-#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
-		amdgpu_irq_put(
-			adev,
-			&adev->vline0_irq,
-			irq_type);
-#endif
-		amdgpu_irq_put(
-			adev,
-			&adev->pageflip_irq,
-			irq_type);
+	else
 		drm_crtc_vblank_off(&acrtc->base);
-	}
 }
 
 static void dm_update_pflip_irq_state(struct amdgpu_device *adev,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +45 -3

69 lines not on this page · raw message

Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/39 drm/amd/display: Run idle optimizations at end of vblank handler

In reply to Rodrigo Siqueira

From: Leo Li <[email protected]>

[Why & How]
1. After allowing idle optimizations, hw programming is disallowed.
2. Before hw programming, we need to disallow idle optimizations.

Otherwise, in scenario 1, we will immediately kick hw out of idle optimizations with register access.

Scenario 2 is less of a concern, since any register access will kick hw out of idle optimizations. But we'll do it early for correctness.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +9 -3
index 1fe038616d9f..a2cf2c066a76 100644
@@ -251,9 +251,10 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
 	else if (dm->active_vblank_irq_count)
 		dm->active_vblank_irq_count--;
 
-	dc_allow_idle_optimizations(dm->dc, dm->active_vblank_irq_count == 0);
-
-	DRM_DEBUG_KMS("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);
+	if (dm->active_vblank_irq_count > 0) {
+		DRM_DEBUG_KMS("Allow idle optimizations (MALL): false\n");
+		dc_allow_idle_optimizations(dm->dc, false);
+	}
 
 	/*
 	 * Control PSR based on vblank requirements from OS
@@ -272,6 +273,11 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
 			vblank_work->stream->link->replay_settings.replay_feature_enabled);
 	}
 
+	if (dm->active_vblank_irq_count == 0) {
+		DRM_DEBUG_KMS("Allow idle optimizations (MALL): true\n");
+		dc_allow_idle_optimizations(dm->dc, true);
+	}
+
 	mutex_unlock(&dm->dc_lock);
 
 	dc_stream_release(vblank_work->stream);
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/39 drm/amd/display: Add two dmmuy I2C entry for GPIO port mapping issue

In reply to Rodrigo Siqueira

From: Chris Park <[email protected]>

[Why]
When only 4 I2C is declared, two dummies are required to correctly map GPIO port.

[How]
Add one more I2C dummy entry to match GPIO port.

---
 .../display/dc/gpio/dcn401/hw_factory_dcn401.c   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/dcn401/hw_factory_dcn401.c +14 -2
index 46415cab23ab..928abca18a18 100644
@@ -86,7 +86,13 @@ static const struct ddc_registers ddc_data_regs_dcn[] = {
 	ddc_data_regs_dcn2(2),
 	ddc_data_regs_dcn2(3),
 	ddc_data_regs_dcn2(4),
-//	ddc_data_regs_dcn2(5),
+	{
+		// add a dummy entry for cases no such port
+		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
+		.ddc_setup = 0,
+		.phy_aux_cntl = 0,
+		.dc_gpio_aux_ctrl_5 = 0
+	},
 	{
 		// add a dummy entry for cases no such port
 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
@@ -107,7 +113,13 @@ static const struct ddc_registers ddc_clk_regs_dcn[] = {
 	ddc_clk_regs_dcn2(2),
 	ddc_clk_regs_dcn2(3),
 	ddc_clk_regs_dcn2(4),
-//	ddc_clk_regs_dcn2(5),
+	{
+		// add a dummy entry for cases no such port
+		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
+		.ddc_setup = 0,
+		.phy_aux_cntl = 0,
+		.dc_gpio_aux_ctrl_5 = 0
+	},
 	{
 		// add a dummy entry for cases no such port
 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
Signature · 1 line
2.43.0
#5 lore raw

PATCH 5/39 drm/amd/display: Request 0MHz dispclk for zero display case

In reply to Rodrigo Siqueira

From: Nicholas Kazlauskas <[email protected]>

[Why]
If we aren't entering RCG/IPS2 or CLKSTOP is not supported by PMFW then we should be requesting a dispclk value of 0MHz to PMFW.

Currenly we run at max clock since there's an assumption in APU clock table formulation where we can run at any DISPCLK at any state so the real clock value ends up as 1200Mhz - the maximum.

[How]
Set to 0 instead of the minimum value in the state array.

---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +1 -1
index d5dcc8b77281..866b0abcff1b 100644
@@ -575,7 +575,7 @@ static bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_s
 		unsigned int lowest_state_idx = 0;
 
 		out_clks.p_state_supported = true;
-		out_clks.dispclk_khz = (unsigned int)dml2->v20.dml_core_ctx.states.state_array[lowest_state_idx].dispclk_mhz * 1000;
+		out_clks.dispclk_khz = 0; /* No requirement, and lowest index will generally be maximum dispclk. */
 		out_clks.dcfclk_khz = (unsigned int)dml2->v20.dml_core_ctx.states.state_array[lowest_state_idx].dcfclk_mhz * 1000;
 		out_clks.fclk_khz = (unsigned int)dml2->v20.dml_core_ctx.states.state_array[lowest_state_idx].fabricclk_mhz * 1000;
 		out_clks.uclk_mts = (unsigned int)dml2->v20.dml_core_ctx.states.state_array[lowest_state_idx].dram_speed_mts;
Signature · 1 line
2.43.0
#6 lore raw

PATCH 6/39 drm/amd/display: Refactor for dio

In reply to Rodrigo Siqueira

From: Bhuvanachandra Pinninti <[email protected]>

Moved files to respective folders to improve DIO code.

---
 drivers/gpu/drm/amd/display/dc/Makefile        |  1 -
 drivers/gpu/drm/amd/display/dc/dcn301/Makefile |  2 +-
 drivers/gpu/drm/amd/display/dc/dcn314/Makefile | 10 ----------
 drivers/gpu/drm/amd/display/dc/dio/Makefile    | 18 ++++++++++++++++++
 .../{ => dio}/dcn301/dcn301_dio_link_encoder.c |  0
 .../{ => dio}/dcn301/dcn301_dio_link_encoder.h |  0
 .../dcn314/dcn314_dio_stream_encoder.c         |  0
 .../dcn314/dcn314_dio_stream_encoder.h         |  0
 .../dc/dio/dcn321/dcn321_dio_link_encoder.c    |  1 -
 .../dc/dio/dcn35/dcn35_dio_stream_encoder.c    |  1 -
 10 files changed, 19 insertions(+), 14 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/dcn314/Makefile
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn301/dcn301_dio_link_encoder.c (100%)
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn301/dcn301_dio_link_encoder.h (100%)
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn314/dcn314_dio_stream_encoder.c (100%)
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn314/dcn314_dio_stream_encoder.h (100%)
drivers/gpu/drm/amd/display/dc/Makefile +0 -1
index 80069651def3..8992e697759f 100644
@@ -35,7 +35,6 @@ DC_LIBS += dcn201
 DC_LIBS += dcn30
 DC_LIBS += dcn301
 DC_LIBS += dcn31
-DC_LIBS += dcn314
 DC_LIBS += dml
 DC_LIBS += dml2
 endif
drivers/gpu/drm/amd/display/dc/dcn301/Makefile +1 -1
index dc37dbf870df..fb4814ab3f05 100644
@@ -3,7 +3,7 @@
 #
 # Makefile for dcn30.
 
-DCN301 = dcn301_dio_link_encoder.o dcn301_panel_cntl.o
+DCN301 = dcn301_panel_cntl.o
 
 AMD_DAL_DCN301 = $(addprefix $(AMDDALPATH)/dc/dcn301/,$(DCN301))
 
drivers/gpu/drm/amd/display/dc/dcn314/Makefile deleted +0 -10
deleted file mode 100644
index 15fdcf7c6466..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: MIT
-# Copyright © 2024 Advanced Micro Devices, Inc. All rights reserved.
-#
-# Makefile for dcn314.
-
-DCN314 = dcn314_dio_stream_encoder.o
-
-AMD_DAL_DCN314 = $(addprefix $(AMDDALPATH)/dc/dcn314/,$(DCN314))
-
-AMD_DISPLAY_FILES += $(AMD_DAL_DCN314)
drivers/gpu/drm/amd/display/dc/dio/Makefile +18 -0
index 67840e474d7a..0dfd480976f7 100644
@@ -51,6 +51,15 @@ AMD_DAL_DIO_DCN30 = $(addprefix $(AMDDALPATH)/dc/dio/dcn30/,$(DIO_DCN30))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN30)
 
+###############################################################################
+# DCN301
+###############################################################################
+DIO_DCN301 = dcn301_dio_link_encoder.o
+
+AMD_DAL_DIO_DCN301 = $(addprefix $(AMDDALPATH)/dc/dio/dcn301/,$(DIO_DCN301))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN301)
+
 ###############################################################################
 # DCN31
 ###############################################################################
@@ -60,6 +69,15 @@ AMD_DAL_DIO_DCN31 = $(addprefix $(AMDDALPATH)/dc/dio/dcn31/,$(DIO_DCN31))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN31)
 
+###############################################################################
+# DCN314
+###############################################################################
+DIO_DCN314 = dcn314_dio_stream_encoder.o
+
+AMD_DAL_DIO_DCN314 = $(addprefix $(AMDDALPATH)/dc/dio/dcn314/,$(DIO_DCN314))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN314)
+
 ###############################################################################
 # DCN32
 ###############################################################################
drivers/gpu/drm/amd/display/dc/dio/dcn301/dcn301_dio_link_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dio_link_encoder.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dio_link_encoder.c
rename to drivers/gpu/drm/amd/display/dc/dio/dcn301/dcn301_dio_link_encoder.c
drivers/gpu/drm/amd/display/dc/dio/dcn301/dcn301_dio_link_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dio_link_encoder.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dio_link_encoder.h
rename to drivers/gpu/drm/amd/display/dc/dio/dcn301/dcn301_dio_link_encoder.h
drivers/gpu/drm/amd/display/dc/dio/dcn314/dcn314_dio_stream_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c
rename to drivers/gpu/drm/amd/display/dc/dio/dcn314/dcn314_dio_stream_encoder.c
drivers/gpu/drm/amd/display/dc/dio/dcn314/dcn314_dio_stream_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.h
rename to drivers/gpu/drm/amd/display/dc/dio/dcn314/dcn314_dio_stream_encoder.h
drivers/gpu/drm/amd/display/dc/dio/dcn321/dcn321_dio_link_encoder.c +0 -1
index 05783daa62ac..2ed382a8e79c 100644
@@ -23,7 +23,6 @@
  *
  */
 
-
 #include "reg_helper.h"
 
 #include "core_types.h"
drivers/gpu/drm/amd/display/dc/dio/dcn35/dcn35_dio_stream_encoder.c +0 -1
index fcc88ef83e6a..19e50fbf908d 100644
@@ -22,7 +22,6 @@
  *
  */
 
-
 #include "dc_bios_types.h"
 #include "dcn30/dcn30_dio_stream_encoder.h"
 #include "dcn314/dcn314_dio_stream_encoder.h"
Signature · 1 line
2.43.0
#7 lore raw

PATCH 7/39 drm/amd/display: Add option to disable unbounded req in DML21

In reply to Rodrigo Siqueira

From: Alvin Lee <[email protected]>

Use debug option for disabling unbounded req in DML21

---
 .../drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +5 -0
index 0f34688e4058..65776602648d 100644
@@ -959,6 +959,11 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
 	dml_dispcfg->minimize_det_reallocation = true;
 	dml_dispcfg->overrides.enable_subvp_implicit_pmo = true;
 
+	if (in_dc->debug.disable_unbounded_requesting) {
+		dml_dispcfg->overrides.hw.force_unbounded_requesting.enable = true;
+		dml_dispcfg->overrides.hw.force_unbounded_requesting.value = false;
+	}
+
 	for (stream_index = 0; stream_index < context->stream_count; stream_index++) {
 		disp_cfg_stream_location = map_stream_to_dml21_display_cfg(dml_ctx, context->streams[stream_index]);
 
Signature · 1 line
2.43.0
#8 lore raw

PATCH 8/39 drm/amd/display: Fix possible overflow in integer multiplication

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

[WHAT & HOW]
Integer multiplies integer may overflow in context that expects an expression of unsigned long long (64 bits). This can be fixed by casting integer to unsigned long long to force 64 bits results.

This fixes 2 OVERFLOW_BEFORE_WIDEN issues reported by Coverity.

---
 .../amd/display/dc/resource/dcn32/dcn32_resource_helpers.c    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource_helpers.c +2 -2
index 47c8a9fbe754..f5a4e97c40ce 100644
@@ -663,7 +663,7 @@ bool dcn32_subvp_drr_admissable(struct dc *dc, struct dc_state *context)
 
 				subvp_disallow |= disallow_subvp_in_active_plus_blank(pipe);
 				refresh_rate = (pipe->stream->timing.pix_clk_100hz * (uint64_t)100 +
-					pipe->stream->timing.v_total * pipe->stream->timing.h_total - (uint64_t)1);
+					pipe->stream->timing.v_total * (unsigned long long)pipe->stream->timing.h_total - (uint64_t)1);
 				refresh_rate = div_u64(refresh_rate, pipe->stream->timing.v_total);
 				refresh_rate = div_u64(refresh_rate, pipe->stream->timing.h_total);
 			}
@@ -724,7 +724,7 @@ bool dcn32_subvp_vblank_admissable(struct dc *dc, struct dc_state *context, int
 
 				subvp_disallow |= disallow_subvp_in_active_plus_blank(pipe);
 				refresh_rate = (pipe->stream->timing.pix_clk_100hz * (uint64_t)100 +
-					pipe->stream->timing.v_total * pipe->stream->timing.h_total - (uint64_t)1);
+					pipe->stream->timing.v_total * (unsigned long long)pipe->stream->timing.h_total - (uint64_t)1);
 				refresh_rate = div_u64(refresh_rate, pipe->stream->timing.v_total);
 				refresh_rate = div_u64(refresh_rate, pipe->stream->timing.h_total);
 			}
Signature · 1 line
2.43.0
#9 lore raw

PATCH 9/39 drm/amd/display: Check null pointers before using them

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

[WHAT & HOW]
dc_link is null checked previously in the same function, indicating it might be null as reported by Coverity.

This fixes 1 FORWARD_NULL issue reported by Coverity.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index 4d36a66917c6..54e665227e8b 100644
@@ -12083,7 +12083,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 		}
 	}
 
-	as_type = dm_get_adaptive_sync_support_type(amdgpu_dm_connector->dc_link);
+	if (amdgpu_dm_connector->dc_link)
+		as_type = dm_get_adaptive_sync_support_type(amdgpu_dm_connector->dc_link);
 
 	if (as_type == FREESYNC_TYPE_PCON_IN_WHITELIST) {
 		i = parse_hdmi_amd_vsdb(amdgpu_dm_connector, edid, &vsdb_info);
Signature · 1 line
2.43.0
#10 lore raw

PATCH 10/39 drm/amd/display: Check stream_status before it is used

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

[WHAT & HOW]
dc_state_get_stream_status can return null, and therefore null must be checked before stream_status is used.

This fixes 1 NULL_RETURNS issue reported by Coverity.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
index b8a6c062426d..ed811352506e 100644
@@ -3748,7 +3748,7 @@ static void commit_planes_for_stream_fast(struct dc *dc,
 				surface_count,
 				stream,
 				context);
-	} else {
+	} else if (stream_status) {
 		build_dmub_cmd_list(dc,
 				srf_updates,
 				surface_count,
Signature · 1 line
2.43.0
#11 lore raw

PATCH 11/39 drm/amd/display: restore immediate_disable_crtc for w/a

In reply to Rodrigo Siqueira

From: Charlene Liu <[email protected]>

[why]
immediate_disable_crtc does not reset ODM. if switching to disable_crtc which will disable ODM as well. i.e. need to restore ODM mem cfg at reenable it at end of w/a.

---
 .../gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c  | 4 ++--
 drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c    | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +2 -2
index 2d5bd5c7ab94..e075b2720f96 100644
@@ -149,8 +149,8 @@ static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *
 			!pipe->stream->link_enc) && !stream_changed_otg_dig_on) {
 			/* This w/a should not trigger when we have a dig active */
 			if (disable) {
-				if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->disable_crtc)
-					pipe->stream_res.tg->funcs->disable_crtc(pipe->stream_res.tg);
+				if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc)
+					pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);
 
 				reset_sync_context_for_pipe(dc, context, i);
 			} else {
drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c +6 -2
index 6bbbf313b2bb..4b6446ed4ce4 100644
@@ -149,7 +149,9 @@ static bool optc31_disable_crtc(struct timing_generator *optc)
 
 	return true;
 }
-
+/*
+ * Immediate_Disable_Crtc - this is to temp disable Timing generator without reset ODM.
+ */
 bool optc31_immediate_disable_crtc(struct timing_generator *optc)
 {
 	struct optc *optc1 = DCN10TG_FROM_TG(optc);
@@ -162,10 +164,12 @@ bool optc31_immediate_disable_crtc(struct timing_generator *optc)
 			VTG0_ENABLE, 0);
 
 	/* CRTC disabled, so disable  clock. */
-	REG_WAIT(OTG_CLOCK_CONTROL,
+	if (optc->ctx->dce_environment != DCE_ENV_DIAG)
+		REG_WAIT(OTG_CLOCK_CONTROL,
 			OTG_BUSY, 0,
 			1, 100000);
 
+
 	/* clear the false state */
 	optc1_clear_optc_underflow(optc);
 
Signature · 1 line
2.43.0
#12 lore raw

PATCH 12/39 drm/amd/display: sync dmub output event type.

In reply to Rodrigo Siqueira

From: Charlene Liu <[email protected]>

[why]
dmubfw added a new event type, update amdgpu to avoid "notify type 6 invalid"

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index 54e665227e8b..f2d5a180f293 100644
@@ -877,6 +877,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)
 		"HPD_IRQ",
 		"SET_CONFIGC_REPLY",
 		"DPIA_NOTIFICATION",
+		"HPD_SENSE_NOTIFY",
 	};
 
 	do {
Signature · 1 line
2.43.0
#13 lore raw

PATCH 13/39 drm/amd/display: Add a missing PSR state

In reply to Rodrigo Siqueira

From: Tom Chung <[email protected]>

[Why & How]
Add a missing PSR state to make the dmub_psr_get_state() return a correct PSR state.

---
 drivers/gpu/drm/amd/display/dc/dc_types.h     | 1 +
 drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
index c550e8997033..97279b080f3e 100644
@@ -590,6 +590,7 @@ enum dc_psr_state {
 	PSR_STATE5c,
 	PSR_STATE_HWLOCK_MGR,
 	PSR_STATE_POLLVUPDATE,
+	PSR_STATE_RELEASE_HWLOCK_MGR_FULL_FRAME,
 	PSR_STATE_INVALID = 0xFF
 };
 
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +2 -0
index 0f3d15126a1e..cae18f8c1c9a 100644
@@ -94,6 +94,8 @@ static enum dc_psr_state convert_psr_state(uint32_t raw_state)
 		state = PSR_STATE_HWLOCK_MGR;
 	else if (raw_state == 0x61)
 		state = PSR_STATE_POLLVUPDATE;
+	else if (raw_state == 0x62)
+		state = PSR_STATE_RELEASE_HWLOCK_MGR_FULL_FRAME;
 	else
 		state = PSR_STATE_INVALID;
 
Signature · 1 line
2.43.0
#14 lore raw

PATCH 14/39 drm/amd/display: Reset VRR config during resume

In reply to Rodrigo Siqueira

From: Tom Chung <[email protected]>

[Why]
After resume the system, the new_crtc_state->vrr_infopacket does not synchronize with the current state. It will affect the update_freesync_state_on_stream() does not update the state correctly.

The previous patch causes a PSR SU regression that cannot let panel go into self-refresh mode.

[How]
Reset the VRR config during resume to force update the VRR config later.

Fixes f8ebe6341a6a ("drm/amd/display: Reset freesync config before update new state")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
index f2d5a180f293..293f93d1976c 100644
@@ -176,6 +176,7 @@ MODULE_FIRMWARE(FIRMWARE_DCN_401_DMUB);
 static int amdgpu_dm_init(struct amdgpu_device *adev);
 static void amdgpu_dm_fini(struct amdgpu_device *adev);
 static bool is_freesync_video_mode(const struct drm_display_mode *mode, struct amdgpu_dm_connector *aconnector);
+static void reset_freesync_config_for_crtc(struct dm_crtc_state *new_crtc_state);
 
 static enum drm_mode_subconnector get_subconnector_type(struct dc_link *link)
 {
@@ -3213,8 +3214,11 @@ static int dm_resume(void *handle)
 	drm_connector_list_iter_end(&iter);
 
 	/* Force mode set in atomic commit */
-	for_each_new_crtc_in_state(dm->cached_state, crtc, new_crtc_state, i)
+	for_each_new_crtc_in_state(dm->cached_state, crtc, new_crtc_state, i) {
 		new_crtc_state->active_changed = true;
+		dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
+		reset_freesync_config_for_crtc(dm_new_crtc_state);
+	}
 
 	/*
 	 * atomic_check is expected to create the dc states. We need to release
Signature · 1 line
2.43.0
#15 lore raw

PATCH 15/39 drm/amd/display: Add seamless boot support for more DIG operation modes

In reply to Rodrigo Siqueira

From: Nicholas Kazlauskas <[email protected]>

[Why]
When pre-OS firmware enables display support for displays that operate the DIG in 2 pixels per cycle processing modes the inferred pixel rate from get_pixel_clk_frequency_100hz does not account for the true pixel rate since we're outputting 2 per cycle past the stream encoder.

This causes seamless boot validation to abort early.

[How]
Add a new stream encoder function for getting pixels per cycle from the stream encoder. If the pixels per cycle is greater than 1 and the driver policy is to enable 2 pixels per cycle for post-OS then allow seamless boot to continue.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 12 ++++++++++--
 .../dc/dio/dcn35/dcn35_dio_stream_encoder.c   | 19 +++++++++++++++++++
 .../amd/display/dc/inc/hw/stream_encoder.h    |  1 +
 3 files changed, 30 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +10 -2
index ed811352506e..143415d600ac 100644
@@ -1823,10 +1823,18 @@ bool dc_validate_boot_timing(const struct dc *dc,
 			tg->funcs->get_optc_source(tg,
 						&numOdmPipes, &id_src[0], &id_src[1]);
 
-		if (numOdmPipes == 2)
+		if (numOdmPipes == 2) {
 			pix_clk_100hz *= 2;
-		if (numOdmPipes == 4)
+		} else if (numOdmPipes == 4) {
 			pix_clk_100hz *= 4;
+		} else if (se && se->funcs->get_pixels_per_cycle) {
+			uint32_t pixels_per_cycle = se->funcs->get_pixels_per_cycle(se);
+
+			if (pixels_per_cycle != 1 && !dc->debug.enable_dp_dig_pixel_rate_div_policy)
+				return false;
+
+			pix_clk_100hz *= pixels_per_cycle;
+		}
 
 		// Note: In rare cases, HW pixclk may differ from crtc's pixclk
 		// slightly due to rounding issues in 10 kHz units.
drivers/gpu/drm/amd/display/dc/dio/dcn35/dcn35_dio_stream_encoder.c +19 -0
index 19e50fbf908d..6ab2a218b769 100644
@@ -422,6 +422,24 @@ void enc35_enable_fifo(struct stream_encoder *enc)
 	REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_ENABLE, 1);
 }
 
+static uint32_t enc35_get_pixels_per_cycle(struct stream_encoder *enc)
+{
+	struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
+	uint32_t value;
+
+	REG_GET(DIG_FIFO_CTRL0, DIG_FIFO_OUTPUT_PIXEL_MODE, &value);
+
+	switch (value) {
+	case 0:
+		return 1;
+	case 1:
+		return 2;
+	default:
+		ASSERT_CRITICAL(false);
+		return 1;
+	}
+}
+
 static const struct stream_encoder_funcs dcn35_str_enc_funcs = {
 	.dp_set_odm_combine =
 		enc314_dp_set_odm_combine,
@@ -474,6 +492,7 @@ static const struct stream_encoder_funcs dcn35_str_enc_funcs = {
 	.disable_fifo = enc35_disable_fifo,
 	.is_fifo_enabled = enc35_is_fifo_enabled,
 	.map_stream_to_link = enc35_stream_encoder_map_to_link,
+	.get_pixels_per_cycle = enc35_get_pixels_per_cycle,
 };
 
 void dcn35_dio_stream_encoder_construct(
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +1 -0
index 6fe42120738d..fe7f3137f228 100644
@@ -273,6 +273,7 @@ struct stream_encoder_funcs {
 	void (*disable_fifo)(struct stream_encoder *enc);
 	bool (*is_fifo_enabled)(struct stream_encoder *enc);
 	void (*map_stream_to_link)(struct stream_encoder *enc, uint32_t stream_enc_inst, uint32_t link_enc_inst);
+	uint32_t (*get_pixels_per_cycle)(struct stream_encoder *enc);
 };
 
 struct hpo_dp_stream_encoder_state {
Signature · 1 line
2.43.0
#16 lore raw

PATCH 16/39 drm/amd/display: Use correct cm_helper function

In reply to Rodrigo Siqueira

From: Ilya Bakoulin <[email protected]>

Need to use cm3_helper function with DCN401 to avoid cases where high RGB component values can get set to zero if using the TF curve generated by cm_helper.

---
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 22 +++++++++----------
 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +10 -12
index 0fa610590245..8e1ca709d304 100644
@@ -497,6 +497,7 @@ void dcn401_populate_mcm_luts(struct dc *dc,
 	enum MCM_LUT_XABLE lut3d_xable = MCM_LUT_DISABLE;
 	enum MCM_LUT_XABLE lut1d_xable = MCM_LUT_DISABLE;
 	bool is_17x17x17 = true;
+	bool rval;
 
 	dcn401_get_mcm_lut_xable_from_pipe_ctx(dc, pipe_ctx, &shaper_xable, &lut3d_xable, &lut1d_xable);
 
@@ -506,11 +507,10 @@ void dcn401_populate_mcm_luts(struct dc *dc,
 		if (mcm_luts.lut1d_func->type == TF_TYPE_HWPWL)
 			m_lut_params.pwl = &mcm_luts.lut1d_func->pwl;
 		else if (mcm_luts.lut1d_func->type == TF_TYPE_DISTRIBUTED_POINTS) {
-			cm_helper_translate_curve_to_hw_format(
-					dc->ctx,
+			rval = cm3_helper_translate_curve_to_hw_format(
 					mcm_luts.lut1d_func,
 					&dpp_base->regamma_params, false);
-			m_lut_params.pwl = &dpp_base->regamma_params;
+			m_lut_params.pwl = rval ? &dpp_base->regamma_params : NULL;
 		}
 		if (m_lut_params.pwl) {
 			if (mpc->funcs->populate_lut)
@@ -527,11 +527,10 @@ void dcn401_populate_mcm_luts(struct dc *dc,
 			m_lut_params.pwl = &mcm_luts.shaper->pwl;
 		else if (mcm_luts.shaper->type == TF_TYPE_DISTRIBUTED_POINTS) {
 			ASSERT(false);
-			cm_helper_translate_curve_to_hw_format(
-					dc->ctx,
+			rval = cm3_helper_translate_curve_to_hw_format(
 					mcm_luts.shaper,
 					&dpp_base->regamma_params, true);
-			m_lut_params.pwl = &dpp_base->regamma_params;
+			m_lut_params.pwl = rval ? &dpp_base->regamma_params : NULL;
 		}
 		if (m_lut_params.pwl) {
 			if (mpc->funcs->populate_lut)
@@ -669,6 +668,7 @@ bool dcn401_set_mcm_luts(struct pipe_ctx *pipe_ctx,
 	struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;
 	bool result = true;
 	const struct pwl_params *lut_params = NULL;
+	bool rval;
 
 	mpc->funcs->set_movable_cm_location(mpc, MPCC_MOVABLE_CM_LOCATION_BEFORE, mpcc_id);
 	pipe_ctx->plane_state->mcm_location = MPCC_MOVABLE_CM_LOCATION_BEFORE;
@@ -677,10 +677,9 @@ bool dcn401_set_mcm_luts(struct pipe_ctx *pipe_ctx,
 		if (plane_state->blend_tf.type == TF_TYPE_HWPWL)
 			lut_params = &plane_state->blend_tf.pwl;
 		else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) {
-			cm_helper_translate_curve_to_hw_format(plane_state->ctx,
-					&plane_state->blend_tf,
+			rval = cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf,
 					&dpp_base->regamma_params, false);
-			lut_params = &dpp_base->regamma_params;
+			lut_params = rval ? &dpp_base->regamma_params : NULL;
 		}
 		result = mpc->funcs->program_1dlut(mpc, lut_params, mpcc_id);
 		lut_params = NULL;
@@ -693,10 +692,9 @@ bool dcn401_set_mcm_luts(struct pipe_ctx *pipe_ctx,
 		else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) {
 			// TODO: dpp_base replace
 			ASSERT(false);
-			cm_helper_translate_curve_to_hw_format(plane_state->ctx,
-					&plane_state->in_shaper_func,
+			rval = cm3_helper_translate_curve_to_hw_format(&plane_state->in_shaper_func,
 					&dpp_base->shaper_params, true);
-			lut_params = &dpp_base->shaper_params;
+			lut_params = rval ? &dpp_base->shaper_params : NULL;
 		}
 
 		result = mpc->funcs->program_shaper(mpc, lut_params, mpcc_id);
Signature · 1 line
2.43.0
#17 lore raw

PATCH 17/39 drm/amd/display: Avoid overflow assignment in link_dp_cts

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

sampling_rate is an uint8_t but is assigned an unsigned int, and thus it can overflow. As a result, sampling_rate is changed to uint32_t.

Similarly, LINK_QUAL_PATTERN_SET has a size of 2 bits, and it should only be assigned to a value less or equal than 4.

This fixes 2 INTEGER_OVERFLOW issues reported by Coverity.

---
 drivers/gpu/drm/amd/display/dc/dc_dp_types.h                  | 2 +-
 drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c | 3 ++-
 drivers/gpu/drm/amd/display/include/dpcd_defs.h               | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +1 -1
index 519c3df78ee5..95c275bf649b 100644
@@ -727,7 +727,7 @@ struct dp_audio_test_data_flags {
 struct dp_audio_test_data {
 
 	struct dp_audio_test_data_flags flags;
-	uint8_t sampling_rate;
+	uint32_t sampling_rate;
 	uint8_t channel_count;
 	uint8_t pattern_type;
 	uint8_t pattern_period[8];
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c +2 -1
index df3781081da7..32d5a4b14333 100644
@@ -775,7 +775,8 @@ bool dp_set_test_pattern(
 			core_link_read_dpcd(link, DP_TRAINING_PATTERN_SET,
 					    &training_pattern.raw,
 					    sizeof(training_pattern));
-			training_pattern.v1_3.LINK_QUAL_PATTERN_SET = pattern;
+			if (pattern <= PHY_TEST_PATTERN_END_DP11)
+				training_pattern.v1_3.LINK_QUAL_PATTERN_SET = pattern;
 			core_link_write_dpcd(link, DP_TRAINING_PATTERN_SET,
 					     &training_pattern.raw,
 					     sizeof(training_pattern));
drivers/gpu/drm/amd/display/include/dpcd_defs.h +1 -0
index aee5170f5fb2..c246235e4afe 100644
@@ -76,6 +76,7 @@ enum dpcd_phy_test_patterns {
 	PHY_TEST_PATTERN_D10_2,
 	PHY_TEST_PATTERN_SYMBOL_ERROR,
 	PHY_TEST_PATTERN_PRBS7,
+	PHY_TEST_PATTERN_END_DP11 = PHY_TEST_PATTERN_PRBS7,
 	PHY_TEST_PATTERN_80BIT_CUSTOM,/* For DP1.2 only */
 	PHY_TEST_PATTERN_CP2520_1,
 	PHY_TEST_PATTERN_CP2520_2,
Signature · 1 line
2.43.0
#18 lore raw

PATCH 18/39 drm/amd/display: Add new enable and disable functions

In reply to Rodrigo Siqueira

From: Hansen Dsouza <[email protected]>

Add new enable and disable functions based on DCCG spec.

---
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    | 212 ++++++++++++++++++
 1 file changed, 212 insertions(+)
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c +212 -0
index b698b773338a..7d88b0ae241c 100644
@@ -732,6 +732,206 @@ static void dccg35_set_symclk_fe_src_new(struct dccg *dccg, enum physymclk_fe_so
 	}
 }
 
+static uint32_t dccg35_is_fe_rcg(struct dccg *dccg, int inst)
+{
+	uint32_t enable = 0;
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	switch (inst) {
+	case 0:
+		REG_GET(DCCG_GATE_DISABLE_CNTL5,
+				SYMCLKA_FE_ROOT_GATE_DISABLE, &enable);
+		break;
+	case 1:
+		REG_GET(DCCG_GATE_DISABLE_CNTL5,
+				SYMCLKB_FE_ROOT_GATE_DISABLE, &enable);
+		break;
+	case 2:
+		REG_GET(DCCG_GATE_DISABLE_CNTL5,
+				SYMCLKC_FE_ROOT_GATE_DISABLE, &enable);
+		break;
+	case 3:
+		REG_GET(DCCG_GATE_DISABLE_CNTL5,
+				SYMCLKD_FE_ROOT_GATE_DISABLE, &enable);
+		break;
+	case 4:
+		REG_GET(DCCG_GATE_DISABLE_CNTL5,
+				SYMCLKE_FE_ROOT_GATE_DISABLE, &enable);
+		break;
+	default:
+		BREAK_TO_DEBUGGER();
+		break;
+	}
+	return enable;
+}
+
+static uint32_t dccg35_is_symclk32_se_rcg(struct dccg *dccg, int inst)
+{
+	uint32_t disable_l1 = 0;
+	uint32_t disable_l2 = 0;
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	switch (inst) {
+	case 0:
+		REG_GET_2(DCCG_GATE_DISABLE_CNTL3,
+				  SYMCLK32_SE0_GATE_DISABLE, &disable_l1,
+				  SYMCLK32_ROOT_SE0_GATE_DISABLE, &disable_l2);
+		break;
+	case 1:
+		REG_GET_2(DCCG_GATE_DISABLE_CNTL3,
+				  SYMCLK32_SE1_GATE_DISABLE, &disable_l1,
+				  SYMCLK32_ROOT_SE1_GATE_DISABLE, &disable_l2);
+		break;
+	case 2:
+		REG_GET_2(DCCG_GATE_DISABLE_CNTL3,
+				  SYMCLK32_SE2_GATE_DISABLE, &disable_l1,
+				  SYMCLK32_ROOT_SE2_GATE_DISABLE, &disable_l2);
+		break;
+	case 3:
+		REG_GET_2(DCCG_GATE_DISABLE_CNTL3,
+				  SYMCLK32_SE3_GATE_DISABLE, &disable_l1,
+				  SYMCLK32_ROOT_SE3_GATE_DISABLE, &disable_l2);
+		break;
+	default:
+		BREAK_TO_DEBUGGER();
+		return 0;
+	}
+
+	/* return true if either block level or DCCG level gating is active */
+	return (disable_l1 | disable_l2);
+}
+
+static void dccg35_enable_symclk_fe_new(
+	struct dccg *dccg,
+	int inst,
+	enum physymclk_fe_source src)
+{
+	dccg35_set_physymclk_fe_rcg(dccg, inst, false);
+	dccg35_set_symclk_fe_src_new(dccg, src, inst);
+}
+
+static void dccg35_disable_symclk_fe_new(
+	struct dccg *dccg,
+	int inst)
+{
+	dccg35_set_symclk_fe_src_new(dccg, PHYSYMCLK_FE_REFCLK, inst);
+	dccg35_set_physymclk_fe_rcg(dccg, inst, true);
+}
+
+static void dccg35_enable_symclk_be_new(
+	struct dccg *dccg,
+	int inst,
+	enum physymclk_source src)
+{
+	dccg35_set_physymclk_rcg(dccg, inst, false);
+	dccg35_set_physymclk_src_new(dccg, inst, src);
+}
+
+static void dccg35_disable_symclk_be_new(
+	struct dccg *dccg,
+	int inst)
+{
+	int i;
+
+	/* Switch from functional clock to refclock */
+	dccg35_set_physymclk_src_new(dccg, inst, PHYSYMCLK_REFCLK);
+
+	/* Check if any other SE connected LE and disable them */
+	for (i = 0; i < 4; i++) {
+		/* Make sure FE is not already in RCG */
+		if (dccg35_is_fe_rcg(dccg, i) == 0) {
+			if (dccg35_is_symclk_fe_src_functional_be(dccg, i, inst))
+				dccg35_disable_symclk_fe_new(dccg, i);
+		}
+	}
+	/* Safe to RCG SYMCLK*/
+	dccg35_set_physymclk_rcg(dccg, inst, true);
+}
+
+static void dccg35_enable_symclk32_se_new(
+	struct dccg *dccg,
+	int inst,
+	enum symclk32_se_clk_source src)
+{
+	dccg35_set_symclk32_se_rcg(dccg, inst, false);
+	dccg35_set_symclk32_se_src_new(dccg, inst, src);
+}
+
+static void dccg35_disable_symclk32_se_new(
+	struct dccg *dccg,
+	int inst)
+{
+	dccg35_set_symclk32_se_src_new(dccg, SYMCLK32_SE_REFCLK, inst);
+	dccg35_set_symclk32_se_rcg(dccg, inst, true);
+}
+
+static void dccg35_enable_symclk32_le_new(
+	struct dccg *dccg,
+	int inst,
+	enum symclk32_le_clk_source src)
+{
+	dccg35_set_symclk32_le_rcg(dccg, inst, false);
+	dccg35_set_symclk32_le_src_new(dccg, inst, src);
+}
+
+static void dccg35_disable_symclk32_le_new(
+	struct dccg *dccg,
+	int inst)
+{
+	int i;
+
+	/* Switch from functional clock to refclock */
+	dccg35_set_symclk32_le_src_new(dccg, inst, SYMCLK32_LE_REFCLK);
+
+	/* Check if any SE are connected and disable SE as well */
+	for (i = 0; i < 4; i++) {
+		/* Make sure FE is not already in RCG */
+		if (dccg35_is_symclk32_se_rcg(dccg, i) == 0) {
+			/* Disable and SE connected to this LE before RCG */
+			if (dccg35_is_symclk32_se_src_functional_le_new(dccg, i, inst))
+				dccg35_disable_symclk32_se_new(dccg, i);
+		}
+	}
+	/* Safe to RCG SYM32_LE*/
+	dccg35_set_symclk32_le_rcg(dccg, inst, true);
+}
+
+static void dccg35_enable_dpp_new(
+	struct dccg *dccg,
+	int inst,
+	enum dppclk_clock_source src)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+	/* Sanitize inst before use in array de-ref */
+	if (inst < 0) {
+		BREAK_TO_DEBUGGER();
+		return;
+	}
+	dccg35_set_dppclk_rcg(dccg, inst, false);
+	dcn35_set_dppclk_src_new(dccg, inst, src);
+	/* Switch DPP clock to DTO */
+	REG_SET_2(DPPCLK_DTO_PARAM[inst], 0,
+			  DPPCLK0_DTO_PHASE, 0xFF,
+			  DPPCLK0_DTO_MODULO, 0xFF);
+}
+
+static void dccg35_disable_dpp_new(
+	struct dccg *dccg,
+	int inst)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+	/* Sanitize inst before use in array de-ref */
+	if (inst < 0) {
+		BREAK_TO_DEBUGGER();
+		return;
+	}
+	dcn35_set_dppclk_src_new(dccg, inst, DPP_REFCLK);
+	REG_SET_2(DPPCLK_DTO_PARAM[inst], 0,
+			  DPPCLK0_DTO_PHASE, 0,
+			  DPPCLK0_DTO_MODULO, 1);
+	dccg35_set_dppclk_rcg(dccg, inst, true);
+}
+
 static void dccg35_trigger_dio_fifo_resync(struct dccg *dccg)
 {
 	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
@@ -1753,6 +1953,18 @@ struct dccg *dccg35_create(
 	(void)&dccg35_set_physymclk_src_new;
 	(void)&dccg35_is_symclk_fe_src_functional_be;
 	(void)&dccg35_set_symclk_fe_src_new;
+	(void)&dccg35_is_fe_rcg;
+	(void)&dccg35_is_symclk32_se_rcg;
+	(void)&dccg35_enable_symclk_fe_new;
+	(void)&dccg35_disable_symclk_fe_new;
+	(void)&dccg35_enable_symclk_be_new;
+	(void)&dccg35_disable_symclk_be_new;
+	(void)&dccg35_enable_symclk32_se_new;
+	(void)&dccg35_disable_symclk32_se_new;
+	(void)&dccg35_enable_symclk32_le_new;
+	(void)&dccg35_disable_symclk32_le_new;
+	(void)&dccg35_enable_dpp_new;
+	(void)&dccg35_disable_dpp_new;
 
 	base = &dccg_dcn->base;
 	base->ctx = ctx;
Signature · 1 line
2.43.0
#19 lore raw

PATCH 19/39 drm/amd/display: Add logs for debugging outbox

In reply to Rodrigo Siqueira

From: Cruise <[email protected]>

The DP tunnel AUX reply is received through Outbox1. Print the Outbox1 status if an issue occurs.

---
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c       | 3 +++
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h        | 3 +++
 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c  | 4 ++++
 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c  | 4 ++++
 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c  | 4 ++++
 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c | 4 ++++
 6 files changed, 22 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +3 -0
index fb3391854eed..41270fade5f2 100644
@@ -979,6 +979,9 @@ void dc_dmub_srv_log_diagnostic_data(struct dc_dmub_srv *dc_dmub_srv)
 	DC_LOG_DEBUG("    inbox0_rptr        : %08x", diag_data.inbox0_rptr);
 	DC_LOG_DEBUG("    inbox0_wptr        : %08x", diag_data.inbox0_wptr);
 	DC_LOG_DEBUG("    inbox0_size        : %08x", diag_data.inbox0_size);
+	DC_LOG_DEBUG("    outbox1_rptr       : %08x", diag_data.outbox1_rptr);
+	DC_LOG_DEBUG("    outbox1_wptr       : %08x", diag_data.outbox1_wptr);
+	DC_LOG_DEBUG("    outbox1_size       : %08x", diag_data.outbox1_size);
 	DC_LOG_DEBUG("    is_enabled         : %d", diag_data.is_dmcub_enabled);
 	DC_LOG_DEBUG("    is_soft_reset      : %d", diag_data.is_dmcub_soft_reset);
 	DC_LOG_DEBUG("    is_secure_reset    : %d", diag_data.is_dmcub_secure_reset);
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +3 -0
index 6589bb9aea6b..cd70453aeae0 100644
@@ -330,6 +330,9 @@ struct dmub_diagnostic_data {
 	uint32_t inbox0_rptr;
 	uint32_t inbox0_wptr;
 	uint32_t inbox0_size;
+	uint32_t outbox1_rptr;
+	uint32_t outbox1_wptr;
+	uint32_t outbox1_size;
 	uint32_t gpint_datain0;
 	struct dmub_srv_debug timeout_info;
 	uint8_t is_dmcub_enabled : 1;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c +4 -0
index 662c34e9495c..d9f31b191c69 100644
@@ -449,6 +449,10 @@ void dmub_dcn31_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnosti
 	diag_data->inbox0_wptr = REG_READ(DMCUB_INBOX0_WPTR);
 	diag_data->inbox0_size = REG_READ(DMCUB_INBOX0_SIZE);
 
+	diag_data->outbox1_rptr = REG_READ(DMCUB_OUTBOX1_RPTR);
+	diag_data->outbox1_wptr = REG_READ(DMCUB_OUTBOX1_WPTR);
+	diag_data->outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
+
 	REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
 	diag_data->is_dmcub_enabled = is_dmub_enabled;
 
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +4 -0
index e1da270502cc..9600b7f858b0 100644
@@ -459,6 +459,10 @@ void dmub_dcn32_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnosti
 	diag_data->inbox0_wptr = REG_READ(DMCUB_INBOX0_WPTR);
 	diag_data->inbox0_size = REG_READ(DMCUB_INBOX0_SIZE);
 
+	diag_data->outbox1_rptr = REG_READ(DMCUB_OUTBOX1_RPTR);
+	diag_data->outbox1_wptr = REG_READ(DMCUB_OUTBOX1_WPTR);
+	diag_data->outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
+
 	REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
 	diag_data->is_dmcub_enabled = is_dmub_enabled;
 
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c +4 -0
index 916ed022e96b..746696b6f09a 100644
@@ -502,6 +502,10 @@ void dmub_dcn35_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnosti
 	diag_data->inbox0_wptr = REG_READ(DMCUB_INBOX0_WPTR);
 	diag_data->inbox0_size = REG_READ(DMCUB_INBOX0_SIZE);
 
+	diag_data->outbox1_rptr = REG_READ(DMCUB_OUTBOX1_RPTR);
+	diag_data->outbox1_wptr = REG_READ(DMCUB_OUTBOX1_WPTR);
+	diag_data->outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
+
 	REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
 	diag_data->is_dmcub_enabled = is_dmub_enabled;
 
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c +4 -0
index cf139e9cc20e..39a8cb6d7523 100644
@@ -444,6 +444,10 @@ void dmub_dcn401_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnost
 	diag_data->inbox0_wptr = REG_READ(DMCUB_INBOX0_WPTR);
 	diag_data->inbox0_size = REG_READ(DMCUB_INBOX0_SIZE);
 
+	diag_data->outbox1_rptr = REG_READ(DMCUB_OUTBOX1_RPTR);
+	diag_data->outbox1_wptr = REG_READ(DMCUB_OUTBOX1_WPTR);
+	diag_data->outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
+
 	REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
 	diag_data->is_dmcub_enabled = is_dmub_enabled;
 
Signature · 1 line
2.43.0
#20 lore raw

PATCH 20/39 drm/amd/display: Check null values from functions

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

Functions get_per_method_common_meta and get_expanded_strategy_list can return null and thus it is necessary to check their returned values before dereferencing.

This fixes 3 NULL_RETURNS issues reported by Coverity.

---
 .../dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c      | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c +8 -0
index dddb21818f8a..9331a8fe77c9 100644
@@ -1199,12 +1199,17 @@ static bool is_timing_group_schedulable(
 
 	/* init allow start and end lines for timing group */
 	stream_method_fams2_meta = get_per_method_common_meta(pmo, pstate_strategy->per_stream_pstate_method[base_stream_idx], base_stream_idx);
+	if (!stream_method_fams2_meta)
+		return false;
+
 	group_fams2_meta->allow_start_otg_vline = stream_method_fams2_meta->allow_start_otg_vline;
 	group_fams2_meta->allow_end_otg_vline = stream_method_fams2_meta->allow_end_otg_vline;
 	group_fams2_meta->period_us = stream_method_fams2_meta->period_us;
 	for (i = base_stream_idx + 1; i < display_cfg->display_config.num_streams; i++) {
 		if (is_bit_set_in_bitfield(pmo->scratch.pmo_dcn4.synchronized_timing_group_masks[timing_group_idx], i)) {
 			stream_method_fams2_meta = get_per_method_common_meta(pmo, pstate_strategy->per_stream_pstate_method[i], i);
+			if (!stream_method_fams2_meta)
+				return false;
 
 			if (group_fams2_meta->allow_start_otg_vline < stream_method_fams2_meta->allow_start_otg_vline) {
 				/* set group allow start to larger otg vline */
@@ -1768,6 +1773,9 @@ bool pmo_dcn4_fams2_init_for_pstate_support(struct dml2_pmo_init_for_pstate_supp
 	build_synchronized_timing_groups(pmo, display_config);
 
 	strategy_list = get_expanded_strategy_list(&pmo->init_data, display_config->display_config.num_streams);
+	if (!strategy_list)
+		return false;
+
 	strategy_list_size = get_num_expanded_strategies(&pmo->init_data, display_config->display_config.num_streams);
 
 	if (strategy_list_size == 0)
Signature · 1 line
2.43.0
#21 lore raw

PATCH 21/39 drm/amd/display: Initialize get_bytes_per_element's default to 1

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

Variables, used as denominators and maybe not assigned to other values, should not be 0. bytes_per_element_y & bytes_per_element_c are initialized by get_bytes_per_element() which should never return 0.

This fixes 10 DIVIDE_BY_ZERO issues reported by Coverity.

---
 .../gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c | 2 +-
 .../gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c +1 -1
index 3d95bfa5aca2..ae5251041728 100644
@@ -78,7 +78,7 @@ static void calculate_ttu_cursor(struct display_mode_lib *mode_lib,
 
 static unsigned int get_bytes_per_element(enum source_format_class source_format, bool is_chroma)
 {
-	unsigned int ret_val = 0;
+	unsigned int ret_val = 1;
 
 	if (source_format == dm_444_16) {
 		if (!is_chroma)
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c +1 -1
index 98502a4f0567..9e1c18b90805 100644
@@ -53,7 +53,7 @@ static void calculate_ttu_cursor(
 
 static unsigned int get_bytes_per_element(enum source_format_class source_format, bool is_chroma)
 {
-	unsigned int ret_val = 0;
+	unsigned int ret_val = 1;
 
 	if (source_format == dm_444_16) {
 		if (!is_chroma)
Signature · 1 line
2.43.0
#22 lore raw

PATCH 22/39 drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces

In reply to Rodrigo Siqueira

From: Nicholas Kazlauskas <[email protected]>

[Why]
It's currently hard coded to 256 when it should be using the SOC provided values. This can result in corruption with linear surfaces where we prefetch more PTE than the buffer can hold.

[How]
Update the min page size correctly for the plane.

---
 .../display/dc/dml2/dml2_translation_helper.c | 20 +++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +14 -6
index 25d4ef040173..7e39873832bf 100644
@@ -954,7 +954,9 @@ static void get_scaler_data_for_plane(const struct dc_plane_state *in, struct dc
 	memcpy(out, &temp_pipe->plane_res.scl_data, sizeof(*out));
 }
 
-static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_stream_state *in)
+static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned int location,
+					 const struct dc_stream_state *in,
+					 const struct soc_bounding_box_st *soc)
 {
 	dml_uint_t width, height;
 
@@ -971,7 +973,7 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned
 	out->CursorBPP[location] = dml_cur_32bit;
 	out->CursorWidth[location] = 256;
 
-	out->GPUVMMinPageSizeKBytes[location] = 256;
+	out->GPUVMMinPageSizeKBytes[location] = soc->gpuvm_min_page_size_kbytes;
 
 	out->ViewportWidth[location] = width;
 	out->ViewportHeight[location] = height;
@@ -1008,7 +1010,9 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned
 	out->ScalerEnabled[location] = false;
 }
 
-static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_plane_state *in, struct dc_state *context)
+static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out, unsigned int location,
+						    const struct dc_plane_state *in, struct dc_state *context,
+						    const struct soc_bounding_box_st *soc)
 {
 	struct scaler_data *scaler_data = kzalloc(sizeof(*scaler_data), GFP_KERNEL);
 	if (!scaler_data)
@@ -1019,7 +1023,7 @@ static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out
 	out->CursorBPP[location] = dml_cur_32bit;
 	out->CursorWidth[location] = 256;
 
-	out->GPUVMMinPageSizeKBytes[location] = 256;
+	out->GPUVMMinPageSizeKBytes[location] = soc->gpuvm_min_page_size_kbytes;
 
 	out->ViewportWidth[location] = scaler_data->viewport.width;
 	out->ViewportHeight[location] = scaler_data->viewport.height;
@@ -1332,7 +1336,8 @@ void map_dc_state_into_dml_display_cfg(struct dml2_context *dml2, struct dc_stat
 			disp_cfg_plane_location = dml_dispcfg->num_surfaces++;
 
 			populate_dummy_dml_surface_cfg(&dml_dispcfg->surface, disp_cfg_plane_location, context->streams[i]);
-			populate_dummy_dml_plane_cfg(&dml_dispcfg->plane, disp_cfg_plane_location, context->streams[i]);
+			populate_dummy_dml_plane_cfg(&dml_dispcfg->plane, disp_cfg_plane_location,
+						     context->streams[i], &dml2->v20.dml_core_ctx.soc);
 
 			dml_dispcfg->plane.BlendingAndTiming[disp_cfg_plane_location] = disp_cfg_stream_location;
 
@@ -1348,7 +1353,10 @@ void map_dc_state_into_dml_display_cfg(struct dml2_context *dml2, struct dc_stat
 				ASSERT(disp_cfg_plane_location >= 0 && disp_cfg_plane_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__);
 
 				populate_dml_surface_cfg_from_plane_state(dml2->v20.dml_core_ctx.project, &dml_dispcfg->surface, disp_cfg_plane_location, context->stream_status[i].plane_states[j]);
-				populate_dml_plane_cfg_from_plane_state(&dml_dispcfg->plane, disp_cfg_plane_location, context->stream_status[i].plane_states[j], context);
+				populate_dml_plane_cfg_from_plane_state(
+					&dml_dispcfg->plane, disp_cfg_plane_location,
+					context->stream_status[i].plane_states[j], context,
+					&dml2->v20.dml_core_ctx.soc);
 
 				if (stream_mall_type == SUBVP_MAIN) {
 					dml_dispcfg->plane.UseMALLForPStateChange[disp_cfg_plane_location] = dml_use_mall_pstate_change_sub_viewport;
Signature · 1 line
2.43.0
#23 lore raw

PATCH 23/39 drm/amd/display: Add new enable and disable functions for DCN35

In reply to Rodrigo Siqueira

From: Hansen Dsouza <[email protected]>

Add new enable and disable functions based on DCCG spec.

---
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    | 54 ++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c +53 -1
index 7d88b0ae241c..bd3757de51c9 100644
@@ -932,6 +932,53 @@ static void dccg35_disable_dpp_new(
 	dccg35_set_dppclk_rcg(dccg, inst, true);
 }
 
+static void dccg35_disable_dscclk_new(struct dccg *dccg,
+									  int inst)
+{
+	dccg35_set_dsc_clk_src_new(dccg, inst, DSC_CLK_REF_CLK);
+	dccg35_set_dsc_clk_rcg(dccg, inst, true);
+}
+
+static void dccg35_enable_dscclk_new(struct dccg *dccg,
+									 int inst,
+									 enum dsc_clk_source src)
+{
+	dccg35_set_dsc_clk_rcg(dccg, inst, false);
+	dccg35_set_dsc_clk_src_new(dccg, inst, src);
+}
+
+static void dccg35_enable_dtbclk_p_new(struct dccg *dccg,
+									   enum dtbclk_source src,
+									   int inst)
+{
+	dccg35_set_dtbclk_p_rcg(dccg, inst, false);
+	dccg35_set_dtbclk_p_src_new(dccg, src, inst);
+}
+
+static void dccg35_disable_dtbclk_p_new(struct dccg *dccg,
+										enum dtbclk_source src,
+										int inst)
+{
+	dccg35_set_dtbclk_p_src_new(dccg, DTBCLK_REFCLK, inst);
+	dccg35_set_dtbclk_p_rcg(dccg, inst, true);
+}
+
+static void dccg35_enable_dpstreamclk_new(struct dccg *dccg,
+										  enum dtbclk_source src,
+										  int inst)
+{
+	dccg35_set_dpstreamclk_src_new(dccg, DP_STREAM_REFCLK, inst);
+	dccg35_set_dpstreamclk_rcg(dccg, inst, true);
+}
+
+static void dccg35_disable_dpstreamclk_new(struct dccg *dccg,
+										   enum dtbclk_source src,
+										   int inst)
+{
+	dccg35_set_dpstreamclk_rcg(dccg, inst, false);
+	dccg35_set_dtbclk_p_src_new(dccg, src, inst);
+}
+
 static void dccg35_trigger_dio_fifo_resync(struct dccg *dccg)
 {
 	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
@@ -1965,7 +2012,12 @@ struct dccg *dccg35_create(
 	(void)&dccg35_disable_symclk32_le_new;
 	(void)&dccg35_enable_dpp_new;
 	(void)&dccg35_disable_dpp_new;
-
+	(void)&dccg35_disable_dscclk_new;
+	(void)&dccg35_enable_dscclk_new;
+	(void)&dccg35_enable_dtbclk_p_new;
+	(void)&dccg35_disable_dtbclk_p_new;
+	(void)&dccg35_enable_dpstreamclk_new;
+	(void)&dccg35_disable_dpstreamclk_new;
 	base = &dccg_dcn->base;
 	base->ctx = ctx;
 	base->funcs = &dccg35_funcs;
Signature · 1 line
2.43.0
#24 lore raw

PATCH 24/39 drm/amd/display: Enable aux transfer path via dmub for dp tunneling

In reply to Rodrigo Siqueira

From: Meenakshikumar Somasundaram <[email protected]>

[Why]
Aux transfer retries path does not support dp tunneling.

[How]
Based on ddc pin check, aux will be issued in legacy path or dmub.

---
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +9 -1
index b8996d285f00..bb4ac5042c80 100644
@@ -735,7 +735,15 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
 					(unsigned int) payload->mot);
 		if (payload->write)
 			dce_aux_log_payload("  write", payload->data, payload->length, 16);
-		ret = dce_aux_transfer_raw(ddc, payload, &operation_result);
+
+		/* Check whether aux to be processed via dmub or dcn directly */
+		if (ddc->ctx->dc->debug.enable_dmub_aux_for_legacy_ddc
+			|| ddc->ddc_pin == NULL) {
+			ret = dce_aux_transfer_dmub_raw(ddc, payload, &operation_result);
+		} else {
+			ret = dce_aux_transfer_raw(ddc, payload, &operation_result);
+		}
+
 		DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
 					LOG_FLAG_I2cAux_DceAux,
 					"dce_aux_transfer_with_retries: link_index=%u: END: retry %d of %d: address=0x%04x length=%u write=%d mot=%d: ret=%d operation_result=%d payload->reply=%u",
Signature · 1 line
2.43.0
#25 lore raw

PATCH 25/39 drm/amd/display: Underflow Seen on DCN401 eGPU

In reply to Rodrigo Siqueira

From: Daniel Sa <[email protected]>

[WHY]
In dcn401 we read clock values before FW is loaded. These incorrect values cause the driver to believe that we are running higher clocks than what we actually have. This then causes corruption/underflow for the eGPU.

[HOW]
When new values are read from HW, update internal structures to propagate the new/correct value. Fixes issue

---
 drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +6 -2
index 8e1ca709d304..ceaaa8df3641 100644
@@ -221,6 +221,7 @@ void dcn401_init_hw(struct dc *dc)
 	int edp_num;
 	uint32_t backlight = MAX_BACKLIGHT_LEVEL;
 	uint32_t user_level = MAX_BACKLIGHT_LEVEL;
+	int current_dchub_ref_freq = 0;
 
 	if (dc->clk_mgr && dc->clk_mgr->funcs && dc->clk_mgr->funcs->init_clocks) {
 		dc->clk_mgr->funcs->init_clocks(dc->clk_mgr);
@@ -264,6 +265,8 @@ void dcn401_init_hw(struct dc *dc)
 					dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency,
 					&res_pool->ref_clocks.dccg_ref_clock_inKhz);
 
+			current_dchub_ref_freq = res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000;
+
 			(res_pool->hubbub->funcs->get_dchub_ref_freq)(res_pool->hubbub,
 					res_pool->ref_clocks.dccg_ref_clock_inKhz,
 					&res_pool->ref_clocks.dchub_ref_clock_inKhz);
@@ -433,8 +436,9 @@ void dcn401_init_hw(struct dc *dc)
 		dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver > 0;
 		dc->caps.dmub_caps.fams_ver = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver;
 		dc->debug.fams2_config.bits.enable &= dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver == 2;
-		if (!dc->debug.fams2_config.bits.enable && dc->res_pool->funcs->update_bw_bounding_box) {
-			/* update bounding box if FAMS2 disabled */
+		if ((!dc->debug.fams2_config.bits.enable && dc->res_pool->funcs->update_bw_bounding_box)
+			|| res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000 != current_dchub_ref_freq) {
+			/* update bounding box if FAMS2 disabled, or if dchub clk has changed */
 			if (dc->clk_mgr)
 				dc->res_pool->funcs->update_bw_bounding_box(dc,
 									    dc->clk_mgr->bw_params);
Signature · 1 line
2.43.0
#26 lore raw

PATCH 26/39 drm/amd/display: Check UnboundedRequestEnabled's value

In reply to Rodrigo Siqueira

From: Alex Hung <[email protected]>

CalculateSwathAndDETConfiguration_params_st's UnboundedRequestEnabled is a pointer (i.e. dml_bool_t *UnboundedRequestEnabled), and thus p->UnboundedRequestEnabled checks its address, not bool value.

To check value, *p->UnboundedRequestEnabled is used instead.

This fixes 1 REVERSE_INULL issue reported by Coverity.

---
 .../display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +1 -1
index 5ba38d51382f..df0911aa251d 100644
@@ -3851,7 +3851,7 @@ static void CalculateSwathAndDETConfiguration(struct dml2_core_internal_scratch
 
 	*p->hw_debug5 = false;
 	for (unsigned int k = 0; k < p->NumberOfActiveSurfaces; ++k) {
-		if (!(p->mrq_present) && (!p->UnboundedRequestEnabled) && (TotalActiveDPP == 1)
+		if (!(p->mrq_present) && (!(*p->UnboundedRequestEnabled)) && (TotalActiveDPP == 1)
 			&& p->display_cfg->plane_descriptors[k].surface.dcc.enable
 			&& ((p->rob_buffer_size_kbytes * 1024 * (p->mrq_present ? MAXIMUMCOMPRESSION : 1)
 				+ *p->CompressedBufferSizeInkByte * MAXIMUMCOMPRESSION * 1024) > TTUFIFODEPTH * (RoundedUpSwathSizeBytesY[k] + RoundedUpSwathSizeBytesC[k])))
Signature · 1 line
2.43.0
#27 lore raw

PATCH 27/39 drm/amd/display: Get link index for AUX reply notification

In reply to Rodrigo Siqueira

From: Cruise <[email protected]>

The link index wasn't updated for the AUX reply notification. Get link index based on DPIA instance for AUX reply notification.

---
 drivers/gpu/drm/amd/display/dc/core/dc_stat.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc_stat.c +1 -0
index cd6570a1e20e..fe9f99f1bdf9 100644
@@ -61,6 +61,7 @@ void dc_stat_get_dmub_notification(const struct dc *dc, struct dmub_notification
 	/* For HPD/HPD RX, convert dpia port index into link index */
 	if (notify->type == DMUB_NOTIFICATION_HPD ||
 	    notify->type == DMUB_NOTIFICATION_HPD_IRQ ||
+	    notify->type == DMUB_NOTIFICATION_AUX_REPLY ||
 	    notify->type == DMUB_NOTIFICATION_DPIA_NOTIFICATION ||
 	    notify->type == DMUB_NOTIFICATION_SET_CONFIG_REPLY) {
 		notify->link_index =
Signature · 1 line
2.43.0
#28 lore raw

PATCH 28/39 drm/amd/display: Re-order enum in a header file

In reply to Rodrigo Siqueira

Move the lb_memory_config close to the pixel format enums to improve the code readability.

---
 .../gpu/drm/amd/display/dc/spl/dc_spl_types.h | 32 +++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/spl/dc_spl_types.h +16 -16
index caaa9ced2ec4..36d10b0f2eed 100644
@@ -10,22 +10,6 @@
 #ifndef __DC_SPL_TYPES_H__
 #define __DC_SPL_TYPES_H__
 
-enum lb_memory_config {
-	/* Enable all 3 pieces of memory */
-	LB_MEMORY_CONFIG_0 = 0,
-
-	/* Enable only the first piece of memory */
-	LB_MEMORY_CONFIG_1 = 1,
-
-	/* Enable only the second piece of memory */
-	LB_MEMORY_CONFIG_2 = 2,
-
-	/* Only applicable in 4:2:0 mode, enable all 3 pieces of memory and the
-	 * last piece of chroma memory used for the luma storage
-	 */
-	LB_MEMORY_CONFIG_3 = 3
-};
-
 struct spl_size {
 	uint32_t width;
 	uint32_t height;
@@ -87,6 +71,22 @@ enum spl_pixel_format {
 	SPL_PIXEL_FORMAT_UNKNOWN
 };
 
+enum lb_memory_config {
+	/* Enable all 3 pieces of memory */
+	LB_MEMORY_CONFIG_0 = 0,
+
+	/* Enable only the first piece of memory */
+	LB_MEMORY_CONFIG_1 = 1,
+
+	/* Enable only the second piece of memory */
+	LB_MEMORY_CONFIG_2 = 2,
+
+	/* Only applicable in 4:2:0 mode, enable all 3 pieces of memory and the
+	 * last piece of chroma memory used for the luma storage
+	 */
+	LB_MEMORY_CONFIG_3 = 3
+};
+
 /* Rotation angle */
 enum spl_rotation_angle {
 	SPL_ROTATION_ANGLE_0 = 0,
Signature · 1 line
2.43.0
#29 lore raw

PATCH 29/39 drm/amd/display: Setup two pixel per container

In reply to Rodrigo Siqueira

SPL has a control field for controlling the two pixels per container that is not in use yet. This commit adds a proper initialization for this feature.

---
 drivers/gpu/drm/amd/display/dc/dc_spl_translate.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc_spl_translate.c +1 -0
index bcc596724a4f..8f85a1db5eba 100644
@@ -128,6 +128,7 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl
 	spl_in->basic_out.always_scale = pipe_ctx->stream->ctx->dc->debug.always_scale;
 	// Make spl input basic output info alpha_en field point to plane res scl_data lb_params alpha_en
 	spl_in->basic_out.alpha_en = pipe_ctx->plane_res.scl_data.lb_params.alpha_en;
+	spl_in->basic_out.use_two_pixels_per_container = pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container(&stream->timing);
 	// Make spl input basic input info scaling quality field point to plane state scaling_quality
 	populate_spltaps_from_taps(&spl_in->scaling_quality, &plane_state->scaling_quality);
 	// Translate edge adaptive scaler preference
Signature · 1 line
2.43.0
#30 lore raw

PATCH 30/39 drm/amd/display: Replace dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd

In reply to Rodrigo Siqueira

In the commit c2cec7a872b6 ("drm/amd/display: Wake DMCUB before sending a command for replay feature"), replaced dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd in multiple areas, but due to merge issues the replacement of this function in the dmub_replay_copy_settings was missed. This commit replaces the old dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd.

Fixes c2cec7a872b6 ("drm/amd/display: Wake DMCUB before sending a command for replay feature")
---
 drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +1 -2
index 44df9e2351c2..14f935961672 100644
@@ -187,8 +187,7 @@ static bool dmub_replay_copy_settings(struct dmub_replay *dmub,
 	else
 		copy_settings_data->flags.bitfields.force_wakeup_by_tps3 = 0;
 
-
-	dm_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
+	dc_wake_and_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
 
 	return true;
 }
Signature · 1 line
2.43.0
#31 lore raw

PATCH 31/39 drm/amd/display: Fix Cursor Offset in Scaled Scenarios

In reply to Rodrigo Siqueira

From: Sung Lee <[email protected]>

[WHY]
Cursor position code had improper offsets in scaled modes.

[HOW]
Adjust cursor scaling to account for cursor offsets properly.

---
 drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +2 -2
index eb0da6c6b87c..846c183fe3a8 100644
@@ -725,8 +725,8 @@ void hubp401_cursor_set_position(
 		CURSOR_ENABLE, cur_en);
 
 	REG_SET_2(CURSOR_POSITION, 0,
-		CURSOR_X_POSITION, pos->x,
-		CURSOR_Y_POSITION, pos->y);
+		CURSOR_X_POSITION, x_pos,
+		CURSOR_Y_POSITION, y_pos);
 
 	REG_SET_2(CURSOR_HOT_SPOT, 0,
 		CURSOR_HOT_SPOT_X, pos->x_hotspot,
Signature · 1 line
2.43.0
#32 lore raw

PATCH 32/39 drm/amd/display: For FAMS2 don't program P-State force from driver

In reply to Rodrigo Siqueira

From: Alvin Lee <[email protected]>

P-State force programming is handled entirely by FW in FAMS2. Remove any programming from driver side to prevent incorrect programming from driver side (which may override FW programming)

---
 drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 1 -
 drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_init.c | 1 -
 2 files changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +0 -1
index 846c183fe3a8..b1ebf5053b4f 100644
@@ -990,7 +990,6 @@ static struct hubp_funcs dcn401_hubp_funcs = {
 	.hubp_soft_reset = hubp31_soft_reset,
 	.hubp_set_flip_int = hubp401_set_flip_int,
 	.hubp_in_blank = hubp401_in_blank,
-	.hubp_update_force_pstate_disallow = hubp32_update_force_pstate_disallow,
 	.phantom_hubp_post_enable = hubp32_phantom_hubp_post_enable,
 	.hubp_update_mall_sel = hubp401_update_mall_sel,
 	.hubp_prepare_subvp_buffering = hubp32_prepare_subvp_buffering,
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_init.c +0 -1
index 2533f16510ba..457f4167e848 100644
@@ -132,7 +132,6 @@ static const struct hwseq_private_funcs dcn401_private_funcs = {
 	.dccg_init = dcn20_dccg_init,
 	.set_mcm_luts = dcn401_set_mcm_luts,
 	.program_mall_pipe_config = dcn32_program_mall_pipe_config,
-	.update_force_pstate = dcn32_update_force_pstate,
 	.update_mall_sel = dcn32_update_mall_sel,
 	.calculate_dccg_k1_k2_values = NULL,
 	.apply_single_controller_ctx_to_hw = dce110_apply_single_controller_ctx_to_hw,
Signature · 1 line
2.43.0
#33 lore raw

PATCH 33/39 drm/amd/display: Add missing DET segments programming

In reply to Rodrigo Siqueira

The commit 54bd97eedd39 ("drm/amd/display: Modify DHCUB waterwark structures and functions") introduced a code refactor for DCHUB, but during the merge process into amd-staging-drm-next, the program det segments were removed. This commit adds the DET segment programming for DCN35.

Fixes 54bd97eedd39 ("drm/amd/display: Modify DHCUB waterwark structures and functions")
---
 drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2 -0
index a9dc7cf12dac..899e239352aa 100644
@@ -771,6 +771,8 @@ void dcn35_init_pipes(struct dc *dc, struct dc_state *context)
 		if (hubbub && hubp) {
 			if (hubbub->funcs->program_det_size)
 				hubbub->funcs->program_det_size(hubbub, hubp->inst, 0);
+			if (hubbub->funcs->program_det_segments)
+				hubbub->funcs->program_det_segments(hubbub, hubp->inst, 0);
 		}
 	}
 
Signature · 1 line
2.43.0
#34 lore raw

PATCH 34/39 drm/amd/display: Remove duplicated code

In reply to Rodrigo Siqueira

DCN_MINIMUM_DISPCLK_Khz and DCN_MINIMUM_DPPCLK_Khz is declared twice. This commit removes that duplication.

---
 drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +0 -3
index c55d7279fe51..2d06067ff36d 100644
@@ -29,9 +29,6 @@
 #include "dc.h"
 #include "dm_pp_smu.h"
 
-#define DCN_MINIMUM_DISPCLK_Khz 100000
-#define DCN_MINIMUM_DPPCLK_Khz 100000
-
 /* Constants */
 #define DDR4_DRAM_WIDTH   64
 #define WM_A 0
Signature · 1 line
2.43.0
#35 lore raw

PATCH 35/39 drm/amd/display: Add missing mcache registers

In reply to Rodrigo Siqueira

Add missing register programming for mcache in DCN401.

---
 .../gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h +3 -1
index 106008593464..514d1ce20df9 100644
@@ -138,7 +138,9 @@ void dcn401_prepare_mcache_programming(struct dc *dc, struct dc_state *context);
 	SRI_ARR(DCHUBP_MALL_CONFIG, HUBP, id),                                   \
 	SRI_ARR(DCHUBP_VMPG_CONFIG, HUBP, id),                                   \
 	SRI_ARR(UCLK_PSTATE_FORCE, HUBPREQ, id),                                 \
-	HUBP_3DLUT_FL_REG_LIST_DCN401(id)
+	HUBP_3DLUT_FL_REG_LIST_DCN401(id),                                       \
+	SRI_ARR(DCSURF_VIEWPORT_MCACHE_SPLIT_COORDINATE, HUBP, id),              \
+	SRI_ARR(DCHUBP_MCACHEID_CONFIG, HUBP, id)
 
 /* ABM */
 #define ABM_DCN401_REG_LIST_RI(id)                                            \
Signature · 1 line
2.43.0
#36 lore raw

PATCH 36/39 drm/amd/display: Add dcc propagation value

In reply to Rodrigo Siqueira

Initialize the field dcc_meta_propagation_delay_us with 10 ms.

---
 drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +1 -0
index 9fcdf06d6aa4..3e76732ac0dc 100644
@@ -723,6 +723,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.min_prefetch_in_strobe_ns = 60000, // 60us
 	.disable_unbounded_requesting = false,
 	.enable_legacy_fast_update = false,
+	.dcc_meta_propagation_delay_us = 10,
 	.fams2_config = {
 		.bits = {
 			.enable = true,
Signature · 1 line
2.43.0
#37 lore raw

PATCH 37/39 drm/amd/display: Add missing registers for dcn32

In reply to Rodrigo Siqueira

Add missing debug registers for DCN32.

---
 .../gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.h   | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.h +5 -0
index fee67fbab8e2..7901792afb7b 100644
@@ -505,6 +505,8 @@ unsigned int dcn32_calculate_mall_ways_from_bytes(const struct dc *dc, unsigned
       SRI_ARR(CM_POST_CSC_B_C11_C12, CM, id),                                  \
       SRI_ARR(CM_POST_CSC_B_C33_C34, CM, id),                                  \
       SRI_ARR(CM_MEM_PWR_CTRL, CM, id), SRI_ARR(CM_CONTROL, CM, id),           \
+      SRI_ARR(CM_TEST_DEBUG_INDEX, CM, id),                                    \
+      SRI_ARR(CM_TEST_DEBUG_DATA, CM, id),                                     \
       SRI_ARR(FORMAT_CONTROL, CNVC_CFG, id),                                   \
       SRI_ARR(CNVC_SURFACE_PIXEL_FORMAT, CNVC_CFG, id),                        \
       SRI_ARR(CURSOR0_CONTROL, CNVC_CUR, id),                                  \
@@ -761,6 +763,7 @@ unsigned int dcn32_calculate_mall_ways_from_bytes(const struct dc *dc, unsigned
       SRI_ARR(DSCC_RATE_CONTROL_BUFFER1_MAX_FULLNESS_LEVEL, DSCC, id),         \
       SRI_ARR(DSCC_RATE_CONTROL_BUFFER2_MAX_FULLNESS_LEVEL, DSCC, id),         \
       SRI_ARR(DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL, DSCC, id),         \
+      SRI_ARR(DSCC_TEST_DEBUG_BUS_ROTATE, DSCC, id),                           \
       SRI_ARR(DSCCIF_CONFIG0, DSCCIF, id),                                     \
       SRI_ARR(DSCCIF_CONFIG1, DSCCIF, id),                                     \
       SRI_ARR(DSCRM_DSC_FORWARD_CONFIG, DSCRM, id)
@@ -1185,6 +1188,8 @@ unsigned int dcn32_calculate_mall_ways_from_bytes(const struct dc *dc, unsigned
       SR(DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL),                                  \
       SR(DCHUBBUB_ARB_DRAM_STATE_CNTL), SR(DCHUBBUB_ARB_SAT_LEVEL),            \
       SR(DCHUBBUB_ARB_DF_REQ_OUTSTAND), SR(DCHUBBUB_GLOBAL_TIMER_CNTL),        \
+      SR(DCHUBBUB_TEST_DEBUG_INDEX),                                           \
+      SR(DCHUBBUB_TEST_DEBUG_DATA),                                            \
       SR(DCHUBBUB_SOFT_RESET), SR(DCHUBBUB_CRC_CTRL),                          \
       SR(DCN_VM_FB_LOCATION_BASE), SR(DCN_VM_FB_LOCATION_TOP),                 \
       SR(DCN_VM_FB_OFFSET), SR(DCN_VM_AGP_BOT), SR(DCN_VM_AGP_TOP),            \
Signature · 1 line
2.43.0
#38 lore raw

PATCH 38/39 drm/amd/display: Remove unused code

In reply to Rodrigo Siqueira

Remove function pointers that were never used.

---
 drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +0 -10
index 28da1dddf0a0..45262cba675e 100644
@@ -245,16 +245,6 @@ struct transform_funcs {
 	void (*set_cursor_attributes)(
 			struct transform *xfm_base,
 			const struct dc_cursor_attributes *attr);
-
-	bool (*transform_program_blnd_lut)(
-			struct transform *xfm,
-			const struct pwl_params *params);
-	bool (*transform_program_shaper_lut)(
-			struct transform *xfm,
-			const struct pwl_params *params);
-	bool (*transform_program_3dlut)(
-			struct transform *xfm,
-			struct tetrahedral_params *params);
 };
 
 const uint16_t *get_filter_2tap_16p(void);
Signature · 1 line
2.43.0
#39 lore raw

PATCH 39/39 drm/amd/display: 3.2.294

In reply to Rodrigo Siqueira

From: Aric Cyr <[email protected]>

This version brings along the following:

- SPL improvements.
- Address coverity issues.
- DML2 fixes.
- Code cleanup.
- DIO and DCCG refactor.
- Improve the PSR state.

---
 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 4077c1ddb9c1..250d5d48c2d3 100644
@@ -55,7 +55,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.293"
+#define DC_VER "3.2.294"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
Signature · 1 line
2.43.0
Tested-by on the v1 series
#40 lore raw
In reply to Rodrigo Siqueira

[Public]

Hi all,

This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX

These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])

The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
* Changing display configurations and settings
* Benchmark testing
* Feature testing (Freesync, etc.)

Automated testing includes (but is not limited to):
* Script testing (scripts to automate some of the manual checks)
* IGT testing

The patchset consists of the amd-staging-drm-next branch (Head commit - 087de3e81122 drm/amd/display: 3.2.293) with new patches added on top of it.

Tested on Ubuntu 24.04.1, on Wayland and X11, using KDE Plasma and Gnome.

Thank you,

Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com

-----Original Message-----
From: Siqueira, Rodrigo <[email protected]>
Sent: Thursday, July 25, 2024 2:01 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/39] DC Patches July 25, 2024

This DC patchset brings improvements in multiple areas. In summary, we have:

- SPL improvements.
- Address coverity issues.
- DML2 fixes.
- Code cleanup.
- DIO and DCCG refactor.
- Improve the PSR state.

Cc Daniel Wheeler <[email protected]> Thanks Siqueira

Alex Hung (7):
drm/amd/display: Fix possible overflow in integer multiplication drm/amd/display: Check null pointers before using them drm/amd/display: Check stream_status before it is used drm/amd/display: Avoid overflow assignment in link_dp_cts drm/amd/display: Check null values from functions drm/amd/display: Initialize get_bytes_per_element's default to 1 drm/amd/display: Check UnboundedRequestEnabled's value

Alvin Lee (2):
drm/amd/display: Add option to disable unbounded req in DML21 drm/amd/display: For FAMS2 don't program P-State force from driver

Aric Cyr (1):
drm/amd/display: 3.2.294

Bhuvanachandra Pinninti (1):
drm/amd/display: Refactor for dio

Charlene Liu (2):
drm/amd/display: restore immediate_disable_crtc for w/a drm/amd/display: sync dmub output event type.

Chris Park (1):
drm/amd/display: Add two dmmuy I2C entry for GPIO port mapping issue

Cruise (2):
drm/amd/display: Add logs for debugging outbox drm/amd/display: Get link index for AUX reply notification

Daniel Sa (1):
drm/amd/display: Underflow Seen on DCN401 eGPU

Hansen Dsouza (2):
drm/amd/display: Add new enable and disable functions drm/amd/display: Add new enable and disable functions for DCN35

Ilya Bakoulin (1):
drm/amd/display: Use correct cm_helper function

Leo Li (2):
drm/amd/display: Let drm_crtc_vblank_on/off manage interrupts drm/amd/display: Run idle optimizations at end of vblank handler

Meenakshikumar Somasundaram (1):
drm/amd/display: Enable aux transfer path via dmub for dp tunneling

Nicholas Kazlauskas (3):
drm/amd/display: Request 0MHz dispclk for zero display case drm/amd/display: Add seamless boot support for more DIG operation
modes
drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces

Rodrigo Siqueira (9):
drm/amd/display: Re-order enum in a header file drm/amd/display: Setup two pixel per container drm/amd/display: Replace dm_execute_dmub_cmd with
dc_wake_and_execute_dmub_cmd
drm/amd/display: Add missing DET segments programming drm/amd/display: Remove duplicated code drm/amd/display: Add missing mcache registers drm/amd/display: Add dcc propagation value drm/amd/display: Add missing registers for dcn32 drm/amd/display: Remove unused code

Samson Tam (1):
drm/amd/display: roll back quality EASF and ISHARP and dc dependency
changes

Sung Lee (1):
drm/amd/display: Fix Cursor Offset in Scaled Scenarios

Tom Chung (2):
drm/amd/display: Add a missing PSR state
drm/amd/display: Reset VRR config during resume

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   46 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |   60 +-
 drivers/gpu/drm/amd/display/dc/Makefile       |    1 -
 .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c  |    4 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c      |   14 +-
 .../gpu/drm/amd/display/dc/core/dc_resource.c |    2 +
 drivers/gpu/drm/amd/display/dc/core/dc_stat.c |    1 +
 drivers/gpu/drm/amd/display/dc/dc.h           |    2 +-
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |    3 +
 drivers/gpu/drm/amd/display/dc/dc_dp_types.h  |    2 +-
 .../gpu/drm/amd/display/dc/dc_spl_translate.c |   50 +-
 .../gpu/drm/amd/display/dc/dc_spl_translate.h |    1 -
 drivers/gpu/drm/amd/display/dc/dc_types.h     |    1 +
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    |  266 ++-
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c  |   10 +-
 drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c |    2 +
 .../gpu/drm/amd/display/dc/dce/dmub_replay.c  |    3 +-
 .../gpu/drm/amd/display/dc/dcn301/Makefile    |    2 +-
 .../gpu/drm/amd/display/dc/dcn314/Makefile    |   10 -
 drivers/gpu/drm/amd/display/dc/dio/Makefile   |   18 +
 .../dcn301/dcn301_dio_link_encoder.c          |    0
 .../dcn301/dcn301_dio_link_encoder.h          |    0
 .../dcn314/dcn314_dio_stream_encoder.c        |    0
 .../dcn314/dcn314_dio_stream_encoder.h        |    0
 .../dc/dio/dcn321/dcn321_dio_link_encoder.c   |    1 -
 .../dc/dio/dcn35/dcn35_dio_stream_encoder.c   |   20 +-
 .../dc/dml/dcn20/display_rq_dlg_calc_20v2.c   |    2 +-
 .../dc/dml/dcn21/display_rq_dlg_calc_21.c     |    2 +-
 .../dc/dml2/dml21/dml21_translation_helper.c  |   13 +-
 .../src/dml2_core/dml2_core_dcn4_calcs.c      |    2 +-
 .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c  |    8 +
 .../display/dc/dml2/dml2_translation_helper.c |   20 +-
 .../drm/amd/display/dc/dml2/dml2_wrapper.c    |    2 +-
 .../display/dc/dpp/dcn401/dcn401_dpp_dscl.c   |  568 +++---
 .../dc/gpio/dcn401/hw_factory_dcn401.c        |   16 +-
 .../amd/display/dc/hubp/dcn401/dcn401_hubp.c  |    5 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |    2 +
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c |   30 +-
 .../amd/display/dc/hwss/dcn401/dcn401_init.c  |    1 -
 .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h   |    3 -
 .../amd/display/dc/inc/hw/stream_encoder.h    |    1 +
 .../gpu/drm/amd/display/dc/inc/hw/transform.h |   10 -
 .../display/dc/link/accessories/link_dp_cts.c |    3 +-
 .../amd/display/dc/optc/dcn31/dcn31_optc.c    |    8 +-
 .../dc/resource/dcn32/dcn32_resource.h        |    5 +
 .../resource/dcn32/dcn32_resource_helpers.c   |    4 +-
 .../dc/resource/dcn401/dcn401_resource.c      |    8 +-
 .../dc/resource/dcn401/dcn401_resource.h      |    4 +-
 drivers/gpu/drm/amd/display/dc/spl/Makefile   |    2 +-
 drivers/gpu/drm/amd/display/dc/spl/dc_spl.c   | 1310 +++++--------
 .../drm/amd/display/dc/spl/dc_spl_filters.c   |   15 -
 .../drm/amd/display/dc/spl/dc_spl_filters.h   |   15 -
 .../display/dc/spl/dc_spl_isharp_filters.c    |  427 +---
 .../display/dc/spl/dc_spl_isharp_filters.h    |   33 +-
 .../display/dc/spl/dc_spl_scl_easf_filters.c  | 1726 -----------------
 .../display/dc/spl/dc_spl_scl_easf_filters.h  |   38 -
 .../amd/display/dc/spl/dc_spl_scl_filters.c   |   92 +-
 .../amd/display/dc/spl/dc_spl_scl_filters.h   |   55 +-
 .../display/dc/spl/dc_spl_scl_filters_old.c   |   25 +
 .../gpu/drm/amd/display/dc/spl/dc_spl_types.h |   75 +-
 .../gpu/drm/amd/display/dc/spl/spl_debug.h    |   23 -
 .../drm/amd/display/dc/spl/spl_fixpt31_32.c   |  518 -----
 .../drm/amd/display/dc/spl/spl_fixpt31_32.h   |  546 ------
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |    3 +
 .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c |    4 +
 .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c |    4 +
 .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c |    4 +
 .../drm/amd/display/dmub/src/dmub_dcn401.c    |    4 +
 .../gpu/drm/amd/display/include/dpcd_defs.h   |    1 +
 69 files changed, 1510 insertions(+), 4646 deletions(-)  delete mode 100644 drivers/gpu/drm/amd/display/dc/dcn314/Makefile
 rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn301/dcn301_dio_link_encoder.c (100%)  rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn301/dcn301_dio_link_encoder.h (100%)  rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn314/dcn314_dio_stream_encoder.c (100%)  rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn314/dcn314_dio_stream_encoder.h (100%)  delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_filters.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_easf_filters.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/spl/dc_spl_scl_filters_old.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_debug.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/spl/spl_fixpt31_32.h

--
2.43.0