Skip to contentSkip to conversation

Linux Patches Aug 31, 2017

PATCH In review Harry Wentland 4 participants 82 messages Aug 31, 2017 – Sep 28, 2017 5 messages not in the archive Page 1 of 2

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

cover Linux Patches Aug 31, 2017

A long list of changes all at once again, this time, since we've had a couple regressions to iron out.

* Build state per streams and planes to follow model of other atomic drivers
* Rename context to state to avoid confusion
* Flatten core_dc object
* Remove bunch of unneeded code
* Rework HW object code to fit HW layout better
* Bunch of Raven fixes and ongoing work
* Fix some races with DC object refcounts by using atomic_t
* Fix some MST regressions

Andrey Grodzovsky (5):
drm/amd/display: Per stream validate_context build v2. drm/amd/display: Per plane validation context build. drm/amd/display: Refactor atomic check. drm/amd/display: Use DRM provided page flip flag. drm/amd/display: Move dis_clk into dc_state.

Bhawanpreet Lakha (8):
drm/amd/display: change bw_dceip and bw_vbios into pointers drm/amd/display: change dcn_ip and dcn_soc into pointers drm/amd/display: Flattening core_dc to dc drm/amd/display: Disable stutter for Raven drm/amd/display: Change log level for DCN powergatting drm/amd/display: Remove unneeded code drm/amd/display: Clean up flattening core_dc to dc drm/amd/display: Rename dc resource_validate_ctx methods

Charlene Liu (9):
drm/amd/display: fix eDP bootup/S4 backlight on drm/amd/display: eDP power sequence T9 fail drm/amd/display: fix not enter/exit PSR with latest driver/SBIOS drm/amd/display: write dpcd 0x600 to 2 for DP/eDP when powerdown drm/amd/display: Block 6Ghz timing if SBIOS set HDMI_6G_en to 0 drm/amd/display: add aux arbitration logic drm/amd/display: only polling VSync Phase within VSync peroroid drm/amd/display: not override the FMT setting set by VBIOS for eDP drm/amd/display: add backlight control in blankstream.

Corbin McElhanney (2):
drm/amd/display: Add comment explaining context free drm/amd/display: Log OTG registers with dcn10 hw state

Dmytro Laktyushkin (4):
drm/amd/display: Use function pointer for update_plane_addr drm/amd/display: Use MAX_PIPES for DTO reg arrays drm/amd/display: fix hubp mpcc and opp tracking drm/amd/display: Fixed mpc add, enable always scaler for video
surface.

Duke Du (1):
drm/amd/display: add display write back(DWB)

Eric Bernstein (1):
drm/amd/display: Update DSCL

Eric Yang (1):
drm/amd/display: Fix time out on boot

Harry Wentland (8):
drm/amd/display: Leave DCN config guard around fpu header drm/amd/display: Remove unnecessary assignemnt drm/amd/display: dc: Remove unneeded includes in DCN drm/amd/display: Remove old, misleading comment drm/amd/display: Stop including atomfimrwareid.h directly drm/amd/display: Set add_stream_ctx for CZ, Hawaii and others drm/amd/display: Restore missing DCE8 xfm regs drm/amd/display: Don't spam log with failed validation

Hersen Wu (1):
drm/amd/display: DF C-state entry blocked when DPMS

Jerry Zuo (4):
drm/amd/display: Use atomic types for ref_count drm/amd/display: Fix two MST not light up regressions drm/amd/display: Fix MST downstream display not light up regression drm/amd/display: Rename dc validate_context and current_context

Mikita Lipski (1):
drm/amd/display: Add a clock source to a sharing pipe

Roman Li (5):
drm/amd/display: fix gamma distortion on Vega drm/amd/display: Fix FBC compilation
drm/amd/display: increase polling interval for fbc status update drm/amd/display: Fix FBC disable for stereo drm/amd/display: program fbc for scatter/gather

Tony Cheng (6):
drm/amd/display: remove fake address reporting when blank drm/amd/display: refactor pplib/smu communication drm/amd/display: memory leak dwb
drm/amd/display: version 3.1.01
drm/amd/display: retire dm_pp_apply_clock_for_voltage_request drm/amd/display: delete dead code

Wenjing Liu (6):
drm/amd/display: Cache edp config in dc link drm/amd/display: re-enable audio after LT test drm/amd/display: retry LT on failing LT in automated request drm/amd/display: Fix return value from rx irq handler on up request drm/amd/display: Safe stream encoder id in stream_status drm/amd/display: do not reset lane count in EQ fallback

Yongqiang Sun (6):
drm/amd/display: blank otg before power gate front end. drm/amd/display: Enable double buffer when unblank crtc. drm/amd/display: work around for 8k sleep crash drm/amd/display: Remove mpc from bios left over, keep double buffer
disabled.
drm/amd/display: Program reg for vertical interrupt. drm/amd/display: Disable OTG double buffer.

Yue Hin Lau (8):
drm/amd/display: move vm registers to hwsequencer drm/amd/display: separate scl functions out from dcn10_dpp drm/amd/display: separate cm functions out from dcn10_dpp drm/amd/display: cleanup naming of DCN DPP functions drm/amd/display: move cm registers from ipp to dpp_cm drm/amd/display: clean up header file includes drm/amd/display: clean up functions in dcn10_dpp_cm drm/amd/display: clean up cm register programming functions

Zeyu Fan (1):
drm/amd/display: Implement HDMI retimer settings for RV AM4 support.

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  545 +++----
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |    2 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c |   13 +-
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |    1 +
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c |   70 +-
 .../gpu/drm/amd/display/dc/bios/command_table2.c   |    1 -
 .../amd/display/dc/bios/command_table_helper2.c    |    1 -
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |  733 +++++-----
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  791 ++++------
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c     |   22 +-
 .../gpu/drm/amd/display/dc/core/dc_hw_sequencer.c  |    3 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |  507 ++++++-
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   27 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |   48 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  798 ++++++----
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c      |   12 +-
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |   68 +-
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c   |   50 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  211 +--
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h       |    2 +-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   87 +-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.h  |   14 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    |   35 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c      |   32 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c     |    4 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h     |   54 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |    8 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c |    2 +
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.h |   13 +
 .../amd/display/dc/dce100/dce100_hw_sequencer.c    |   17 +-
 .../amd/display/dc/dce100/dce100_hw_sequencer.h    |   10 +-
 .../drm/amd/display/dc/dce100/dce100_resource.c    |  123 +-
 .../drm/amd/display/dc/dce100/dce100_resource.h    |    9 +-
 .../drm/amd/display/dc/dce110/dce110_compressor.c  |   26 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  248 ++--
 .../amd/display/dc/dce110/dce110_hw_sequencer.h    |   25 +-
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  185 +--
 .../drm/amd/display/dc/dce110/dce110_resource.h    |    4 +-
 .../amd/display/dc/dce112/dce112_hw_sequencer.c    |    5 +-
 .../amd/display/dc/dce112/dce112_hw_sequencer.h    |    4 +-
 .../drm/amd/display/dc/dce112/dce112_resource.c    |  237 ++-
 .../drm/amd/display/dc/dce112/dce112_resource.h    |   23 +-
 .../amd/display/dc/dce120/dce120_hw_sequencer.c    |    6 +-
 .../amd/display/dc/dce120/dce120_hw_sequencer.h    |    4 +-
 .../drm/amd/display/dc/dce120/dce120_resource.c    |   46 +-
 .../drm/amd/display/dc/dce120/dce120_resource.h    |    4 +-
 .../drm/amd/display/dc/dce80/dce80_hw_sequencer.c  |    5 +-
 .../drm/amd/display/dc/dce80/dce80_hw_sequencer.h  |    4 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |  152 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.h  |    8 +-
 drivers/gpu/drm/amd/display/dc/dcn10/Makefile      |    3 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 1521 +++-----------------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h   |  787 +++++-----
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    |  864 +++++++++++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  |  710 +++++++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c   |  651 +++++++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.h   |   32 +
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  433 ++++--
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h  |    6 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c   |  717 +--------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.h   |  416 ------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c |  118 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h |   41 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c   |   16 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |  189 +--
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.h  |    4 +-
 .../amd/display/dc/dcn10/dcn10_timing_generator.c  |   49 +
 .../amd/display/dc/dcn10/dcn10_timing_generator.h  |   29 +
 drivers/gpu/drm/amd/display/dc/dm_helpers.h        |    5 -
 drivers/gpu/drm/amd/display/dc/dm_pp_smu.h         |  131 ++
 drivers/gpu/drm/amd/display/dc/dm_services.h       |    7 +-
 drivers/gpu/drm/amd/display/dc/dm_services_types.h |    2 +
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c |    6 +
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h |    2 +
 .../display/dc/i2caux/dce110/aux_engine_dce110.c   |   30 +-
 drivers/gpu/drm/amd/display/dc/inc/clock_source.h  |    4 +
 drivers/gpu/drm/amd/display/dc/inc/core_dc.h       |   55 -
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   57 +-
 drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h     |    4 +-
 drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h     |   16 +-
 .../gpu/drm/amd/display/dc/inc/hw/display_clock.h  |    2 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h       |    2 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h        |  193 +++
 drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h  |   18 +
 drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h        |   17 +-
 .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h   |    1 +
 drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h  |   24 +
 drivers/gpu/drm/amd/display/dc/inc/hw/transform.h  |   20 +
 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h  |   61 +-
 drivers/gpu/drm/amd/display/dc/inc/resource.h      |   44 +-
 .../amd/display/dc/irq/dce110/irq_service_dce110.c |    8 +-
 .../amd/display/dc/irq/dce80/irq_service_dce80.c   |    1 -
 .../amd/display/include/grph_object_ctrl_defs.h    |   38 +
 .../gpu/drm/amd/display/include/logger_interface.h |   14 +-
 .../drm/amd/display/modules/freesync/freesync.c    |   20 +-
 95 files changed, 6912 insertions(+), 5755 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/dm_pp_smu.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/inc/core_dc.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h
Signature · 6 lines
2.11.0

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

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

#2 lore raw

PATCH 1/77 drm/amd/display: fix gamma distortion on Vega

From: Roman Li <[email protected]>

Added missing reg shift/masks to soc base

---
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_transform.h +3 -0
index f9622ff54560..d87225d15cd9 100644
@@ -237,6 +237,7 @@
 	XFM_SF(DCP0_REGAMMA_CNTLA_REGION_0_1, REGAMMA_CNTLA_EXP_REGION0_NUM_SEGMENTS, mask_sh),\
 	XFM_SF(DCP0_REGAMMA_CNTLA_REGION_0_1, REGAMMA_CNTLA_EXP_REGION1_LUT_OFFSET, mask_sh),\
 	XFM_SF(DCP0_REGAMMA_CNTLA_REGION_0_1, REGAMMA_CNTLA_EXP_REGION1_NUM_SEGMENTS, mask_sh),\
+	XFM_SF(DCP0_REGAMMA_CONTROL, GRPH_REGAMMA_MODE, mask_sh),\
 	XFM_SF(SCL0_SCL_MODE, SCL_MODE, mask_sh), \
 	XFM_SF(SCL0_SCL_TAP_CONTROL, SCL_H_NUM_OF_TAPS, mask_sh), \
 	XFM_SF(SCL0_SCL_TAP_CONTROL, SCL_V_NUM_OF_TAPS, mask_sh), \
@@ -270,6 +271,8 @@
 	XFM_SF(SCL0_SCL_UPDATE, SCL_COEF_UPDATE_COMPLETE, mask_sh), \
 	XFM_SF(LB0_LB_DATA_FORMAT, ALPHA_EN, mask_sh), \
 	XFM_SF(DCFE0_DCFE_MEM_PWR_CTRL, SCL_COEFF_MEM_PWR_DIS, mask_sh), \
+	XFM_SF(DCFE0_DCFE_MEM_PWR_CTRL, DCP_REGAMMA_MEM_PWR_DIS, mask_sh),\
+	XFM_SF(DCFE0_DCFE_MEM_PWR_CTRL, DCP_LUT_MEM_PWR_DIS, mask_sh),\
 	XFM_SF(DCFE0_DCFE_MEM_PWR_STATUS, SCL_COEFF_MEM_PWR_STATE, mask_sh), \
 	XFM_SF(SCL0_SCL_MODE, SCL_PSCL_EN, mask_sh)
 
Signature · 6 lines
2.11.0

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

PATCH 2/77 drm/amd/display: Use atomic types for ref_count

In reply to a message not in the archive

From: Jerry Zuo <[email protected]>

Current ref_count inc/dec is not guarded by locks which leads to a raced condition where two threads try to access the variable at the same time. In this case, both might act on the same cached value and inc/dec from the same value, rather than inc/dec by 2.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 24 +++++++--------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c     | 12 ++++----
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c   | 14 ++++-----
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c  | 36 +++++++++++------------
 drivers/gpu/drm/amd/display/dc/dc.h               |  8 ++---
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h      |  2 +-
 drivers/gpu/drm/amd/display/dc/inc/core_types.h   |  2 +-
 8 files changed, 49 insertions(+), 51 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +12 -12
index b69a726717d9..8efdd05841e1 100644
@@ -454,7 +454,7 @@ static bool construct(struct core_dc *dc,
 		goto val_ctx_fail;
 	}
 
-	dc->current_context->ref_count++;
+	atomic_inc(&dc->current_context->ref_count);
 
 	dc_ctx->cgs_device = init_params->cgs_device;
 	dc_ctx->driver_context = init_params->driver;
@@ -704,7 +704,7 @@ struct validate_context *dc_get_validate_context(
 	if (context == NULL)
 		goto context_alloc_fail;
 
-	++context->ref_count;
+	atomic_inc(&context->ref_count);
 
 	if (!is_validation_required(core_dc, set, set_count)) {
 		dc_resource_validate_ctx_copy_construct(core_dc->current_context, context);
@@ -748,7 +748,7 @@ bool dc_validate_resources(
 	if (context == NULL)
 		goto context_alloc_fail;
 
-	++context->ref_count;
+	atomic_inc(&context->ref_count);
 
 	result = core_dc->res_pool->funcs->validate_with_context(
 				core_dc, set, set_count, context, NULL);
@@ -782,7 +782,7 @@ bool dc_validate_guaranteed(
 	if (context == NULL)
 		goto context_alloc_fail;
 
-	++context->ref_count;
+	atomic_inc(&context->ref_count);
 
 	result = core_dc->res_pool->funcs->validate_guaranteed(
 					core_dc, stream, context);
@@ -1090,7 +1090,7 @@ bool dc_commit_streams(
 	if (context == NULL)
 		goto context_alloc_fail;
 
-	++context->ref_count;
+	atomic_inc(&context->ref_count);
 
 	result = core_dc->res_pool->funcs->validate_with_context(
 			core_dc, set, stream_count, context, core_dc->current_context);
@@ -1203,16 +1203,16 @@ bool dc_commit_planes_to_stream(
 
 void dc_retain_validate_context(struct validate_context *context)
 {
-	ASSERT(context->ref_count > 0);
-	++context->ref_count;
+	ASSERT(atomic_read(&context->ref_count) > 0);
+	atomic_inc(&context->ref_count);
 }
 
 void dc_release_validate_context(struct validate_context *context)
 {
-	ASSERT(context->ref_count > 0);
-	--context->ref_count;
+	ASSERT(atomic_read(&context->ref_count) > 0);
+	atomic_dec(&context->ref_count);
 
-	if (context->ref_count == 0) {
+	if (atomic_read(&context->ref_count) == 0) {
 		dc_resource_validate_ctx_destruct(context);
 		dm_free(context);
 	}
@@ -1485,7 +1485,7 @@ void dc_update_planes_and_stream(struct dc *dc,
 		if (context == NULL)
 				goto context_alloc_fail;
 
-		++context->ref_count;
+		atomic_inc(&context->ref_count);
 
 		dc_resource_validate_ctx_copy_construct(
 				core_dc->current_context, context);
@@ -1800,7 +1800,7 @@ void dc_set_power_state(
 	enum dc_acpi_cm_power_state power_state)
 {
 	struct core_dc *core_dc = DC_TO_CORE(dc);
-	int ref_count;
+	atomic_t ref_count;
 
 	switch (power_state) {
 	case DC_ACPI_CM_POWER_STATE_D0:
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index f0100396d870..6687baa3d8b8 100644
@@ -2238,7 +2238,7 @@ void dc_resource_validate_ctx_copy_construct(
 		struct validate_context *dst_ctx)
 {
 	int i, j;
-	int ref_count = dst_ctx->ref_count;
+	atomic_t ref_count = dst_ctx->ref_count;
 
 	*dst_ctx = *src_ctx;
 
drivers/gpu/drm/amd/display/dc/core/dc_sink.c +6 -6
index a83f1243a9d1..7717350297a5 100644
@@ -63,16 +63,16 @@ static bool construct(struct dc_sink *sink, const struct dc_sink_init_data *init
 
 void dc_sink_retain(struct dc_sink *sink)
 {
-	ASSERT(sink->ref_count > 0);
-	++sink->ref_count;
+	ASSERT(atomic_read(&sink->ref_count) > 0);
+	atomic_inc(&sink->ref_count);
 }
 
 void dc_sink_release(struct dc_sink *sink)
 {
-	ASSERT(sink->ref_count > 0);
-	--sink->ref_count;
+	ASSERT(atomic_read(&sink->ref_count) > 0);
+	atomic_dec(&sink->ref_count);
 
-	if (sink->ref_count == 0) {
+	if (atomic_read(&sink->ref_count) == 0) {
 		destruct(sink);
 		dm_free(sink);
 	}
@@ -88,7 +88,7 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params)
 	if (false == construct(sink, init_params))
 		goto construct_fail;
 
-	++sink->ref_count;
+	atomic_inc(&sink->ref_count);
 
 	return sink;
 
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +6 -8
index 2de37fed12a5..47e407dab4a3 100644
@@ -96,19 +96,17 @@ static void destruct(struct dc_stream_state *stream)
 
 void dc_stream_retain(struct dc_stream_state *stream)
 {
-
-	ASSERT(stream->ref_count > 0);
-	stream->ref_count++;
+	ASSERT(atomic_read(&stream->ref_count) > 0);
+	atomic_inc(&stream->ref_count);
 }
 
 void dc_stream_release(struct dc_stream_state *stream)
 {
-
 	if (stream != NULL) {
-		ASSERT(stream->ref_count > 0);
-		stream->ref_count--;
+		ASSERT(atomic_read(&stream->ref_count) > 0);
+		atomic_dec(&stream->ref_count);
 
-		if (stream->ref_count == 0) {
+		if (atomic_read(&stream->ref_count) == 0) {
 			destruct(stream);
 			dm_free(stream);
 		}
@@ -131,7 +129,7 @@ struct dc_stream_state *dc_create_stream_for_sink(
 	if (false == construct(stream, sink))
 			goto construct_fail;
 
-	stream->ref_count++;
+	atomic_inc(&stream->ref_count);
 
 	return stream;
 
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +18 -18
index 3bcca2d1872b..da19c7fa5151 100644
@@ -76,7 +76,7 @@ struct dc_plane_state *dc_create_plane_state(const struct dc *dc)
 	if (false == construct(core_dc->ctx, plane_state))
 		goto construct_fail;
 
-	++plane_state->ref_count;
+	atomic_inc(&plane_state->ref_count);
 
 	return plane_state;
 
@@ -122,16 +122,16 @@ const struct dc_plane_status *dc_plane_get_status(
 
 void dc_plane_state_retain(struct dc_plane_state *plane_state)
 {
-	ASSERT(plane_state->ref_count > 0);
-	++plane_state->ref_count;
+	ASSERT(atomic_read(&plane_state->ref_count) > 0);
+	atomic_inc(&plane_state->ref_count);
 }
 
 void dc_plane_state_release(struct dc_plane_state *plane_state)
 {
-	ASSERT(plane_state->ref_count > 0);
-	--plane_state->ref_count;
+	ASSERT(atomic_read(&plane_state->ref_count) > 0);
+	atomic_dec(&plane_state->ref_count);
 
-	if (plane_state->ref_count == 0) {
+	if (atomic_read(&plane_state->ref_count) == 0) {
 		destruct(plane_state);
 		dm_free(plane_state);
 	}
@@ -139,16 +139,16 @@ void dc_plane_state_release(struct dc_plane_state *plane_state)
 
 void dc_gamma_retain(struct dc_gamma *gamma)
 {
-	ASSERT(gamma->ref_count > 0);
-	++gamma->ref_count;
+	ASSERT(atomic_read(&gamma->ref_count) > 0);
+	atomic_inc(&gamma->ref_count);
 }
 
 void dc_gamma_release(struct dc_gamma **gamma)
 {
-	ASSERT((*gamma)->ref_count > 0);
-	--(*gamma)->ref_count;
+	ASSERT(atomic_read(&(*gamma)->ref_count) > 0);
+	atomic_dec(&(*gamma)->ref_count);
 
-	if ((*gamma)->ref_count == 0)
+	if (atomic_read(&(*gamma)->ref_count) == 0)
 		dm_free((*gamma));
 
 	*gamma = NULL;
@@ -161,7 +161,7 @@ struct dc_gamma *dc_create_gamma()
 	if (gamma == NULL)
 		goto alloc_fail;
 
-	++gamma->ref_count;
+	atomic_inc(&gamma->ref_count);
 
 	return gamma;
 
@@ -171,16 +171,16 @@ struct dc_gamma *dc_create_gamma()
 
 void dc_transfer_func_retain(struct dc_transfer_func *tf)
 {
-	ASSERT(tf->ref_count > 0);
-	++tf->ref_count;
+	ASSERT(atomic_read(&tf->ref_count) > 0);
+	atomic_inc(&tf->ref_count);
 }
 
 void dc_transfer_func_release(struct dc_transfer_func *tf)
 {
-	ASSERT(tf->ref_count > 0);
-	--tf->ref_count;
+	ASSERT(atomic_read(&tf->ref_count) > 0);
+	atomic_dec(&tf->ref_count);
 
-	if (tf->ref_count == 0)
+	if (atomic_read(&tf->ref_count) == 0)
 		dm_free(tf);
 }
 
@@ -191,7 +191,7 @@ struct dc_transfer_func *dc_create_transfer_func()
 	if (tf == NULL)
 		goto alloc_fail;
 
-	++tf->ref_count;
+	atomic_inc(&tf->ref_count);
 
 	return tf;
 
drivers/gpu/drm/amd/display/dc/dc.h +4 -4
index cac92bf91e4a..4e60adb981e1 100644
@@ -295,7 +295,7 @@ struct dc_transfer_func {
 	enum dc_transfer_func_type type;
 	enum dc_transfer_func_predefined tf;
 	struct dc_context *ctx;
-	int ref_count;
+	atomic_t ref_count;
 };
 
 /*
@@ -342,7 +342,7 @@ struct dc_plane_state {
 
 	/* private to dc_surface.c */
 	enum dc_irq_source irq_source;
-	int ref_count;
+	atomic_t ref_count;
 };
 
 struct dc_plane_info {
@@ -518,7 +518,7 @@ struct dc_stream_state {
 	struct dc_stream_status status;
 
 	/* from stream struct */
-	int ref_count;
+	atomic_t ref_count;
 };
 
 struct dc_stream_update {
@@ -902,7 +902,7 @@ struct dc_sink {
 	struct dc_context *ctx;
 
 	/* private to dc_sink.c */
-	int ref_count;
+	atomic_t ref_count;
 };
 
 void dc_sink_retain(struct dc_sink *sink);
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -1
index 8d1504668ec7..94f83cd9ab32 100644
@@ -433,7 +433,7 @@ struct dc_gamma {
 	struct dc_context *ctx;
 
 	/* private to dc_surface.c */
-	int ref_count;
+	atomic_t ref_count;
 };
 
 /* Used by both ipp amd opp functions*/
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
index b3005629ab21..5190901ea379 100644
@@ -260,7 +260,7 @@ struct validate_context {
 	struct dcn_bw_internal_vars dcn_bw_vars;
 #endif
 
-	int ref_count;
+	atomic_t ref_count;
 };
 
 #endif /* _CORE_TYPES_H_ */
Signature · 6 lines
2.11.0

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

PATCH 3/77 drm/amd/display: add display write back(DWB)

In reply to a message not in the archive

From: Duke Du <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  10 +
 drivers/gpu/drm/amd/display/dc/dc.h                |   2 +
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  87 ++-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.h  |   8 +
 drivers/gpu/drm/amd/display/dc/dcn10/Makefile      |   2 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c   | 652 +++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.h   |  32 +
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |   9 +
 drivers/gpu/drm/amd/display/dc/inc/clock_source.h  |   4 +
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   6 +
 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h        | 193 ++++++
 11 files changed, 1003 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h
drivers/gpu/drm/amd/display/dc/core/dc.c +10 -0
index 8efdd05841e1..aeed95a5d097 100644
@@ -1749,6 +1749,16 @@ struct dc_link *dc_get_link_at_index(const struct dc *dc, uint32_t link_index)
 	return core_dc->links[link_index];
 }
 
+struct dwbc *dc_get_dwb_at_pipe(const struct dc *dc, uint32_t pipe)
+{
+	struct core_dc *core_dc = DC_TO_CORE(dc);
+	if ((pipe >= dwb_pipe0) && (pipe < dwb_pipe_max_num)) {
+		return core_dc->res_pool->dwbc[(int)pipe];
+	} else {
+		return NULL;
+	}
+}
+
 const struct graphics_object_id dc_get_link_id_at_index(
 	struct dc *dc, uint32_t link_index)
 {
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
index 4e60adb981e1..e62d15d90fdb 100644
@@ -797,6 +797,8 @@ const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link);
  */
 struct dc_link *dc_get_link_at_index(const struct dc *dc, uint32_t link_index);
 
+struct dwbc *dc_get_dwb_at_pipe(const struct dc *dc, uint32_t pipe);
+
 /* Return id of physical connector represented by a dc_link at link_index.*/
 const struct graphics_object_id dc_get_link_id_at_index(
 		struct dc *dc, uint32_t link_index);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +86 -1

105 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.h +8 -0
index fc923886e3d4..238c03f14959 100644
@@ -55,6 +55,8 @@
 	CS_SF(PHYPLLA_PIXCLK_RESYNC_CNTL, PHYPLLA_DCCG_DEEP_COLOR_CNTL, mask_sh),\
 	CS_SF(PHYPLLA_PIXCLK_RESYNC_CNTL, PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE, mask_sh)
 
+#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
+
 #define CS_COMMON_REG_LIST_DCN1_0(index, pllid) \
 		SRI(PIXCLK_RESYNC_CNTL, PHYPLL, pllid),\
 		SRII(PHASE, DP_DTO, 0),\
@@ -71,9 +73,13 @@
 		SRII(PIXEL_RATE_CNTL, OTG, 3)
 
 #define CS_COMMON_MASK_SH_LIST_DCN1_0(mask_sh)\
+	CS_SF(DP_DTO0_PHASE, DP_DTO0_PHASE, mask_sh),\
+	CS_SF(DP_DTO0_MODULO, DP_DTO0_MODULO, mask_sh),\
 	CS_SF(PHYPLLA_PIXCLK_RESYNC_CNTL, PHYPLLA_DCCG_DEEP_COLOR_CNTL, mask_sh),\
 	CS_SF(OTG0_PIXEL_RATE_CNTL, DP_DTO0_ENABLE, mask_sh)
 
+#endif
+
 #define CS_REG_FIELD_LIST(type) \
 	type PLL_REF_DIV_SRC; \
 	type DCCG_DEEP_COLOR_CNTL1; \
@@ -81,6 +87,8 @@
 	type PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE; \
 	type PLL_POST_DIV_PIXCLK; \
 	type PLL_REF_DIV; \
+	type DP_DTO0_PHASE; \
+	type DP_DTO0_MODULO; \
 	type DP_DTO0_ENABLE;
 
 struct dce110_clk_src_shift {
drivers/gpu/drm/amd/display/dc/dcn10/Makefile +1 -1
index 9ba1bfc30146..8af201a51a2a 100644
@@ -3,7 +3,7 @@
 
 DCN10 = dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \
 		dcn10_dpp.o dcn10_opp.o dcn10_timing_generator.o \
-		dcn10_mem_input.o dcn10_mpc.o
+		dcn10_mem_input.o dcn10_mpc.o dcn10_dwb.o
 
 AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c new file +652 -0

652 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.h new file +32 -0
new file mode 100644
index 000000000000..cf530aed4e1c
@@ -0,0 +1,32 @@
+/* Copyright 2012-17 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+#ifndef __DC_DWBC_DCN10_H__
+#define __DC_DWBC_DCN10_H__
+
+#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
+
+bool dcn10_dwbc_create(struct dc_context *ctx, struct resource_pool *pool);
+#endif
+
+#endif
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +9 -0
index 6006fb4799c3..fa990a51ac83 100644
@@ -32,6 +32,7 @@
 
 #include "dcn10/dcn10_ipp.h"
 #include "dcn10/dcn10_mpc.h"
+#include "dcn10/dcn10_dwb.h"
 #include "irq/dcn10/irq_service_dcn10.h"
 #include "dcn10/dcn10_dpp.h"
 #include "dcn10/dcn10_timing_generator.h"
@@ -410,6 +411,7 @@ static const struct resource_caps res_cap = {
 		.num_audio = 4,
 		.num_stream_encoder = 4,
 		.num_pll = 4,
+		.num_dwb = 2,
 };
 
 static const struct dc_debug debug_defaults_drv = {
@@ -1410,6 +1412,12 @@ static bool construct(
 		goto mpc_create_fail;
 	}
 
+#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
+	if (!dcn10_dwbc_create(ctx, &pool->base)) {
+		goto dwbc_create_fail;
+	}
+#endif
+
 	if (!resource_construct(num_virtual_links, dc, &pool->base,
 			(!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment) ?
 			&res_create_funcs : &res_create_maximus_funcs)))
@@ -1432,6 +1440,7 @@ static bool construct(
 irqs_create_fail:
 res_create_fail:
 clock_source_create_fail:
+dwbc_create_fail:
 
 	destruct(pool);
 
drivers/gpu/drm/amd/display/dc/inc/clock_source.h +4 -0
index 47ef90495376..ebcf67b5fc57 100644
@@ -166,6 +166,10 @@ struct clock_source_funcs {
 			struct clock_source *,
 			struct pixel_clk_params *,
 			struct pll_settings *);
+	uint32_t (*get_pix_rate_in_hz)(
+			struct clock_source *,
+			struct pixel_clk_params *,
+			struct pll_settings *);
 };
 
 struct clock_source {
drivers/gpu/drm/amd/display/dc/inc/core_types.h +6 -0
index 5190901ea379..28454028434c 100644
@@ -32,7 +32,10 @@
 #include "ddc_service_types.h"
 #include "dc_bios_types.h"
 #include "mem_input.h"
+#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 #include "mpc.h"
+#endif
+#include "dwb.h"
 
 #define MAX_CLOCK_SOURCES 7
 
@@ -125,6 +128,8 @@ struct resource_pool {
 	struct mpc *mpc;
 #endif
 
+	struct dwbc *dwbc[MAX_DWB_PIPES];
+
 	unsigned int pipe_count;
 	unsigned int underlay_pipe_index;
 	unsigned int stream_enc_count;
@@ -193,6 +198,7 @@ struct pipe_ctx {
 	struct _vcs_dpi_display_rq_regs_st rq_regs;
 	struct _vcs_dpi_display_pipe_dest_params_st pipe_dlg_param;
 #endif
+	struct dwbc *dwbc;
 };
 
 struct resource_context {
drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h new file +193 -0

193 lines not on this page · raw message

Signature · 6 lines
2.11.0

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

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

#6 lore raw

Re: [PATCH 03/77] drm/amd/display: add display write back(DWB)

Quoted 1 line · Harry Wentland

From: Duke Du <[email protected]>

I happened to look at dwb stuff in passing today.

there is a bunch of dwb API that look to be never called, and a bunch of over engineered interfaces.

Comments inline:

Quoted 17 lines
drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h new file +17 -0
+struct dwbc_funcs {
+       bool (*get_caps)(struct dwbc *dwbc, struct dwb_caps *caps);
+
+       bool (*enable)(struct dwbc *dwbc);
+
+       bool (*disable)(struct dwbc *dwbc);
+
+       bool (*get_status)(struct dwbc *dwbc, struct dwb_status *status);
+
+       bool (*dump_frame)(struct dwbc *dwbc, struct dwb_frame_info *frame_info,
+               unsigned char *luma_buffer, unsigned char *chroma_buffer,
+               unsigned char *dest_luma_buffer, unsigned char *dest_chroma_buffer);
+
+       bool (*set_basic_settings)(struct dwbc *dwbc,
+               const struct dwb_basic_settings *basic_settings);
+
+       bool (*get_basic_settings)(struct dwbc *dwbc,

drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h line 191

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h new file +10 -0
+               struct dwb_basic_settings *basic_settings);
+
+       bool (*set_advanced_settings)(struct dwbc *dwbc,
+               const struct dwb_advanced_settings *advanced_settings);
+
+       bool (*get_advanced_settings)(struct dwbc *dwbc,
+               struct dwb_advanced_settings *advanced_settings);
+
+       bool (*reset_advanced_settings)(struct dwbc *dwbc);
+};

So a fair few of these return bool for no reason, and accept NULL as a parameter,
returning true or false. this is all pointless, apart from the fact that no code currently
calls these, calling APIs and passing NULL should be caught with code inspection,
not adding error paths that nobody will ever test.

If your API expects something assert on it being there, don't add true/false return values.

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

#7 lore raw

PATCH 4/77 drm/amd/display: change bw_dceip and bw_vbios into pointers

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

-Change bw_calcs_dceip into pointer
-Change bw_calcs_vbios into pointer

This is needed for flattening of core_dc into dc, as without this the diags build fails

---
 drivers/gpu/drm/amd/display/dc/core/dc.c           | 26 +++++++++++
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  2 +-
 .../drm/amd/display/dc/dce110/dce110_resource.c    | 34 +++++++--------
 .../drm/amd/display/dc/dce112/dce112_resource.c    | 50 +++++++++++-----------
 .../drm/amd/display/dc/dce120/dce120_resource.c    | 24 +++++------
 drivers/gpu/drm/amd/display/dc/inc/core_dc.h       |  4 +-
 6 files changed, 83 insertions(+), 57 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +26 -0
index aeed95a5d097..477024c467e6 100644
@@ -433,6 +433,13 @@ static void destruct(struct core_dc *dc)
 
 	dm_free(dc->ctx);
 	dc->ctx = NULL;
+
+	dm_free(dc->bw_vbios);
+	dc->bw_vbios = NULL;
+
+	dm_free(dc->bw_dceip);
+	dc->bw_dceip = NULL;
+
 }
 
 static bool construct(struct core_dc *dc,
@@ -440,8 +447,25 @@ static bool construct(struct core_dc *dc,
 {
 	struct dal_logger *logger;
 	struct dc_context *dc_ctx = dm_alloc(sizeof(*dc_ctx));
+	struct bw_calcs_dceip *dc_dceip = dm_alloc(sizeof(*dc_dceip));
+	struct bw_calcs_vbios *dc_vbios = dm_alloc(sizeof(*dc_vbios));
+
 	enum dce_version dc_version = DCE_VERSION_UNKNOWN;
 
+	if (!dc_dceip) {
+		dm_error("%s: failed to create dceip\n", __func__);
+		goto dceip_fail;
+	}
+
+	dc->bw_dceip = dc_dceip;
+
+	if (!dc_vbios) {
+		dm_error("%s: failed to create vbios\n", __func__);
+		goto vbios_fail;
+	}
+
+	dc->bw_vbios = dc_vbios;
+
 	if (!dc_ctx) {
 		dm_error("%s: failed to create ctx\n", __func__);
 		goto ctx_fail;
@@ -544,6 +568,8 @@ static bool construct(struct core_dc *dc,
 logger_fail:
 val_ctx_fail:
 ctx_fail:
+dceip_fail:
+vbios_fail:
 	destruct(dc);
 	return false;
 }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
index 5b46e776b9b7..ccde7c80d658 100644
@@ -1264,7 +1264,7 @@ void dce110_set_displaymarks(
 			continue;
 
 		total_dest_line_time_ns = compute_pstate_blackout_duration(
-			dc->bw_vbios.blackout_duration, pipe_ctx->stream);
+			dc->bw_vbios->blackout_duration, pipe_ctx->stream);
 		pipe_ctx->plane_res.mi->funcs->mem_input_program_display_marks(
 			pipe_ctx->plane_res.mi,
 			context->bw.dce.nbp_state_change_wm_ns[num_pipes],
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +17 -17
index a7f30dcc906c..56be84ce5a0d 100644
@@ -826,8 +826,8 @@ static bool dce110_validate_bandwidth(
 
 	if (bw_calcs(
 			dc->ctx,
-			&dc->bw_dceip,
-			&dc->bw_vbios,
+			dc->bw_dceip,
+			dc->bw_vbios,
 			context->res_ctx.pipe_ctx,
 			dc->res_pool->pipe_count,
 			&context->bw.dce))
@@ -1127,21 +1127,21 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 			DM_PP_CLOCK_TYPE_ENGINE_CLK,
 			&clks);
 	/* convert all the clock fro kHz to fix point mHz */
-	dc->bw_vbios.high_sclk = bw_frc_to_fixed(
+	dc->bw_vbios->high_sclk = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels-1], 1000);
-	dc->bw_vbios.mid1_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid1_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels/8], 1000);
-	dc->bw_vbios.mid2_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid2_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels*2/8], 1000);
-	dc->bw_vbios.mid3_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid3_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels*3/8], 1000);
-	dc->bw_vbios.mid4_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid4_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels*4/8], 1000);
-	dc->bw_vbios.mid5_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid5_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels*5/8], 1000);
-	dc->bw_vbios.mid6_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid6_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels*6/8], 1000);
-	dc->bw_vbios.low_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->low_sclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[0], 1000);
 	dc->sclk_lvls = clks;
 
@@ -1150,11 +1150,11 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 			dc->ctx,
 			DM_PP_CLOCK_TYPE_DISPLAY_CLK,
 			&clks);
-	dc->bw_vbios.high_voltage_max_dispclk = bw_frc_to_fixed(
+	dc->bw_vbios->high_voltage_max_dispclk = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels-1], 1000);
-	dc->bw_vbios.mid_voltage_max_dispclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid_voltage_max_dispclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[clks.num_levels>>1], 1000);
-	dc->bw_vbios.low_voltage_max_dispclk  = bw_frc_to_fixed(
+	dc->bw_vbios->low_voltage_max_dispclk  = bw_frc_to_fixed(
 			clks.clocks_in_khz[0], 1000);
 
 	/*do memory clock*/
@@ -1163,12 +1163,12 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 			DM_PP_CLOCK_TYPE_MEMORY_CLK,
 			&clks);
 
-	dc->bw_vbios.low_yclk = bw_frc_to_fixed(
+	dc->bw_vbios->low_yclk = bw_frc_to_fixed(
 		clks.clocks_in_khz[0] * MEMORY_TYPE_MULTIPLIER, 1000);
-	dc->bw_vbios.mid_yclk = bw_frc_to_fixed(
+	dc->bw_vbios->mid_yclk = bw_frc_to_fixed(
 		clks.clocks_in_khz[clks.num_levels>>1] * MEMORY_TYPE_MULTIPLIER,
 		1000);
-	dc->bw_vbios.high_yclk = bw_frc_to_fixed(
+	dc->bw_vbios->high_yclk = bw_frc_to_fixed(
 		clks.clocks_in_khz[clks.num_levels-1] * MEMORY_TYPE_MULTIPLIER,
 		1000);
 }
@@ -1353,7 +1353,7 @@ static bool construct(
 
 	dc->public.caps.max_planes =  pool->base.pipe_count;
 
-	bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios, dc->ctx->asic_id);
+	bw_calcs_init(dc->bw_dceip, dc->bw_vbios, dc->ctx->asic_id);
 
 	bw_calcs_data_update_from_pplib(dc);
 
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +25 -25

106 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +12 -12
index d4e962756fbb..562ae2205a90 100644
@@ -729,21 +729,21 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 	}
 
 	/* convert all the clock fro kHz to fix point mHz  TODO: wloop data */
-	dc->bw_vbios.high_sclk = bw_frc_to_fixed(
+	dc->bw_vbios->high_sclk = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels-1].clocks_in_khz, 1000);
-	dc->bw_vbios.mid1_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid1_sclk  = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels/8].clocks_in_khz, 1000);
-	dc->bw_vbios.mid2_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid2_sclk  = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels*2/8].clocks_in_khz, 1000);
-	dc->bw_vbios.mid3_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid3_sclk  = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels*3/8].clocks_in_khz, 1000);
-	dc->bw_vbios.mid4_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid4_sclk  = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels*4/8].clocks_in_khz, 1000);
-	dc->bw_vbios.mid5_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid5_sclk  = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels*5/8].clocks_in_khz, 1000);
-	dc->bw_vbios.mid6_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->mid6_sclk  = bw_frc_to_fixed(
 		eng_clks.data[eng_clks.num_levels*6/8].clocks_in_khz, 1000);
-	dc->bw_vbios.low_sclk  = bw_frc_to_fixed(
+	dc->bw_vbios->low_sclk  = bw_frc_to_fixed(
 			eng_clks.data[0].clocks_in_khz, 1000);
 
 	/*do memory clock*/
@@ -770,12 +770,12 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 	 * ALSO always convert UMA clock (from PPLIB)  to YCLK (HW formula):
 	 * YCLK = UMACLK*m_memoryTypeMultiplier
 	 */
-	dc->bw_vbios.low_yclk = bw_frc_to_fixed(
+	dc->bw_vbios->low_yclk = bw_frc_to_fixed(
 		mem_clks.data[0].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, 1000);
-	dc->bw_vbios.mid_yclk = bw_frc_to_fixed(
+	dc->bw_vbios->mid_yclk = bw_frc_to_fixed(
 		mem_clks.data[mem_clks.num_levels>>1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER,
 		1000);
-	dc->bw_vbios.high_yclk = bw_frc_to_fixed(
+	dc->bw_vbios->high_yclk = bw_frc_to_fixed(
 		mem_clks.data[mem_clks.num_levels-1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER,
 		1000);
 
@@ -984,7 +984,7 @@ static bool construct(
 
 	dc->public.caps.max_planes =  pool->base.pipe_count;
 
-	bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios, dc->ctx->asic_id);
+	bw_calcs_init(dc->bw_dceip, dc->bw_vbios, dc->ctx->asic_id);
 
 	bw_calcs_data_update_from_pplib(dc);
 
drivers/gpu/drm/amd/display/dc/inc/core_dc.h +2 -2
index 1ecb54603e17..982f7170f5d2 100644
@@ -29,8 +29,8 @@ struct core_dc {
 	struct dm_pp_clock_levels sclk_lvls;
 
 	/* Inputs into BW and WM calculations. */
-	struct bw_calcs_dceip bw_dceip;
-	struct bw_calcs_vbios bw_vbios;
+	struct bw_calcs_dceip *bw_dceip;
+	struct bw_calcs_vbios *bw_vbios;
 #ifdef CONFIG_DRM_AMD_DC_DCN1_0
 	struct dcn_soc_bounding_box dcn_soc;
 	struct dcn_ip_params dcn_ip;
Signature · 6 lines
2.11.0

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

PATCH 5/77 drm/amd/display: Add comment explaining context free

In reply to a message not in the archive

From: Corbin McElhanney <[email protected]>

This comment explains a previous change that adds some complexity to the context free in dc:

commit 9ad58779a895 ("drm/amd/display: Fix accessing freed memory")

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +9 -0
index 477024c467e6..33c3d88b1c86 100644
@@ -1740,6 +1740,15 @@ void dc_update_planes_and_stream(struct dc *dc,
 	}
 
 	if (core_dc->current_context != context) {
+
+		/* Since memory free requires elevated IRQL, an interrupt
+		 * request is generated by mem free. If this happens
+		 * between freeing and reassigning the context, our vsync
+		 * interrupt will call into dc and cause a memory
+		 * corruption BSOD. Hence, we first reassign the context,
+		 * then free the old context.
+		 */
+
 		struct validate_context *old = core_dc->current_context;
 
 		core_dc->current_context = context;
Signature · 6 lines
2.11.0

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

PATCH 6/77 drm/amd/display: change dcn_ip and dcn_soc into pointers

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

-Change dcn_ip into pointer
-Change dcn_soc into pointer

This is needed for flattening of core_dc into dc, as without this the diags build fails

---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   | 553 +++++++++++----------
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  59 ++-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |  28 +-
 drivers/gpu/drm/amd/display/dc/inc/core_dc.h       |   4 +-
 4 files changed, 331 insertions(+), 313 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +277 -276
index 67da973c898b..6fb1b9a91993 100644
@@ -457,7 +457,7 @@ static void dcn_bw_calc_rq_dlg_ttu(
 	}
 
 	/*todo: soc->sr_enter_plus_exit_time??*/
-	dlg_sys_param.t_srx_delay_us = dc->dcn_ip.dcfclk_cstate_latency / v->dcf_clk_deep_sleep;
+	dlg_sys_param.t_srx_delay_us = dc->dcn_ip->dcfclk_cstate_latency / v->dcf_clk_deep_sleep;
 
 	dml_rq_dlg_get_rq_params(dml, &rq_param, input.pipe.src);
 	extract_rq_regs(dml, rq_regs, rq_param);
@@ -679,39 +679,39 @@ static bool dcn_bw_apply_registry_override(struct core_dc *dc)
 	bool updated = false;
 
 	kernel_fpu_begin();
-	if ((int)(dc->dcn_soc.sr_exit_time * 1000) != dc->public.debug.sr_exit_time_ns
+	if ((int)(dc->dcn_soc->sr_exit_time * 1000) != dc->public.debug.sr_exit_time_ns
 			&& dc->public.debug.sr_exit_time_ns) {
 		updated = true;
-		dc->dcn_soc.sr_exit_time = dc->public.debug.sr_exit_time_ns / 1000.0;
+		dc->dcn_soc->sr_exit_time = dc->public.debug.sr_exit_time_ns / 1000.0;
 	}
 
-	if ((int)(dc->dcn_soc.sr_enter_plus_exit_time * 1000)
+	if ((int)(dc->dcn_soc->sr_enter_plus_exit_time * 1000)
 				!= dc->public.debug.sr_enter_plus_exit_time_ns
 			&& dc->public.debug.sr_enter_plus_exit_time_ns) {
 		updated = true;
-		dc->dcn_soc.sr_enter_plus_exit_time =
+		dc->dcn_soc->sr_enter_plus_exit_time =
 				dc->public.debug.sr_enter_plus_exit_time_ns / 1000.0;
 	}
 
-	if ((int)(dc->dcn_soc.urgent_latency * 1000) != dc->public.debug.urgent_latency_ns
+	if ((int)(dc->dcn_soc->urgent_latency * 1000) != dc->public.debug.urgent_latency_ns
 			&& dc->public.debug.urgent_latency_ns) {
 		updated = true;
-		dc->dcn_soc.urgent_latency = dc->public.debug.urgent_latency_ns / 1000.0;
+		dc->dcn_soc->urgent_latency = dc->public.debug.urgent_latency_ns / 1000.0;
 	}
 
-	if ((int)(dc->dcn_soc.percent_of_ideal_drambw_received_after_urg_latency * 1000)
+	if ((int)(dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency * 1000)
 				!= dc->public.debug.percent_of_ideal_drambw
 			&& dc->public.debug.percent_of_ideal_drambw) {
 		updated = true;
-		dc->dcn_soc.percent_of_ideal_drambw_received_after_urg_latency =
+		dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency =
 				dc->public.debug.percent_of_ideal_drambw;
 	}
 
-	if ((int)(dc->dcn_soc.dram_clock_change_latency * 1000)
+	if ((int)(dc->dcn_soc->dram_clock_change_latency * 1000)
 				!= dc->public.debug.dram_clock_change_latency_ns
 			&& dc->public.debug.dram_clock_change_latency_ns) {
 		updated = true;
-		dc->dcn_soc.dram_clock_change_latency =
+		dc->dcn_soc->dram_clock_change_latency =
 				dc->public.debug.dram_clock_change_latency_ns / 1000.0;
 	}
 	kernel_fpu_end();
@@ -735,83 +735,83 @@ bool dcn_validate_bandwidth(
 
 	memset(v, 0, sizeof(*v));
 	kernel_fpu_begin();
-	v->sr_exit_time = dc->dcn_soc.sr_exit_time;
-	v->sr_enter_plus_exit_time = dc->dcn_soc.sr_enter_plus_exit_time;
-	v->urgent_latency = dc->dcn_soc.urgent_latency;
-	v->write_back_latency = dc->dcn_soc.write_back_latency;
+	v->sr_exit_time = dc->dcn_soc->sr_exit_time;
+	v->sr_enter_plus_exit_time = dc->dcn_soc->sr_enter_plus_exit_time;
+	v->urgent_latency = dc->dcn_soc->urgent_latency;
+	v->write_back_latency = dc->dcn_soc->write_back_latency;
 	v->percent_of_ideal_drambw_received_after_urg_latency =
-			dc->dcn_soc.percent_of_ideal_drambw_received_after_urg_latency;
-
-	v->dcfclkv_min0p65 = dc->dcn_soc.dcfclkv_min0p65;
-	v->dcfclkv_mid0p72 = dc->dcn_soc.dcfclkv_mid0p72;
-	v->dcfclkv_nom0p8 = dc->dcn_soc.dcfclkv_nom0p8;
-	v->dcfclkv_max0p9 = dc->dcn_soc.dcfclkv_max0p9;
-
-	v->max_dispclk_vmin0p65 = dc->dcn_soc.max_dispclk_vmin0p65;
-	v->max_dispclk_vmid0p72 = dc->dcn_soc.max_dispclk_vmid0p72;
-	v->max_dispclk_vnom0p8 = dc->dcn_soc.max_dispclk_vnom0p8;
-	v->max_dispclk_vmax0p9 = dc->dcn_soc.max_dispclk_vmax0p9;
-
-	v->max_dppclk_vmin0p65 = dc->dcn_soc.max_dppclk_vmin0p65;
-	v->max_dppclk_vmid0p72 = dc->dcn_soc.max_dppclk_vmid0p72;
-	v->max_dppclk_vnom0p8 = dc->dcn_soc.max_dppclk_vnom0p8;
-	v->max_dppclk_vmax0p9 = dc->dcn_soc.max_dppclk_vmax0p9;
-
-	v->socclk = dc->dcn_soc.socclk;
-
-	v->fabric_and_dram_bandwidth_vmin0p65 = dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65;
-	v->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72;
-	v->fabric_and_dram_bandwidth_vnom0p8 = dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8;
-	v->fabric_and_dram_bandwidth_vmax0p9 = dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9;
-
-	v->phyclkv_min0p65 = dc->dcn_soc.phyclkv_min0p65;
-	v->phyclkv_mid0p72 = dc->dcn_soc.phyclkv_mid0p72;
-	v->phyclkv_nom0p8 = dc->dcn_soc.phyclkv_nom0p8;
-	v->phyclkv_max0p9 = dc->dcn_soc.phyclkv_max0p9;
-
-	v->downspreading = dc->dcn_soc.downspreading;
-	v->round_trip_ping_latency_cycles = dc->dcn_soc.round_trip_ping_latency_cycles;
-	v->urgent_out_of_order_return_per_channel = dc->dcn_soc.urgent_out_of_order_return_per_channel;
-	v->number_of_channels = dc->dcn_soc.number_of_channels;
-	v->vmm_page_size = dc->dcn_soc.vmm_page_size;
-	v->dram_clock_change_latency = dc->dcn_soc.dram_clock_change_latency;
-	v->return_bus_width = dc->dcn_soc.return_bus_width;
-
-	v->rob_buffer_size_in_kbyte = dc->dcn_ip.rob_buffer_size_in_kbyte;
-	v->det_buffer_size_in_kbyte = dc->dcn_ip.det_buffer_size_in_kbyte;
-	v->dpp_output_buffer_pixels = dc->dcn_ip.dpp_output_buffer_pixels;
-	v->opp_output_buffer_lines = dc->dcn_ip.opp_output_buffer_lines;
-	v->pixel_chunk_size_in_kbyte = dc->dcn_ip.pixel_chunk_size_in_kbyte;
-	v->pte_enable = dc->dcn_ip.pte_enable;
-	v->pte_chunk_size = dc->dcn_ip.pte_chunk_size;
-	v->meta_chunk_size = dc->dcn_ip.meta_chunk_size;
-	v->writeback_chunk_size = dc->dcn_ip.writeback_chunk_size;
-	v->odm_capability = dc->dcn_ip.odm_capability;
-	v->dsc_capability = dc->dcn_ip.dsc_capability;
-	v->line_buffer_size = dc->dcn_ip.line_buffer_size;
-	v->is_line_buffer_bpp_fixed = dc->dcn_ip.is_line_buffer_bpp_fixed;
-	v->line_buffer_fixed_bpp = dc->dcn_ip.line_buffer_fixed_bpp;
-	v->max_line_buffer_lines = dc->dcn_ip.max_line_buffer_lines;
-	v->writeback_luma_buffer_size = dc->dcn_ip.writeback_luma_buffer_size;
-	v->writeback_chroma_buffer_size = dc->dcn_ip.writeback_chroma_buffer_size;
-	v->max_num_dpp = dc->dcn_ip.max_num_dpp;
-	v->max_num_writeback = dc->dcn_ip.max_num_writeback;
-	v->max_dchub_topscl_throughput = dc->dcn_ip.max_dchub_topscl_throughput;
-	v->max_pscl_tolb_throughput = dc->dcn_ip.max_pscl_tolb_throughput;
-	v->max_lb_tovscl_throughput = dc->dcn_ip.max_lb_tovscl_throughput;
-	v->max_vscl_tohscl_throughput = dc->dcn_ip.max_vscl_tohscl_throughput;
-	v->max_hscl_ratio = dc->dcn_ip.max_hscl_ratio;
-	v->max_vscl_ratio = dc->dcn_ip.max_vscl_ratio;
-	v->max_hscl_taps = dc->dcn_ip.max_hscl_taps;
-	v->max_vscl_taps = dc->dcn_ip.max_vscl_taps;
-	v->under_scan_factor = dc->dcn_ip.under_scan_factor;
-	v->pte_buffer_size_in_requests = dc->dcn_ip.pte_buffer_size_in_requests;
-	v->dispclk_ramping_margin = dc->dcn_ip.dispclk_ramping_margin;
-	v->max_inter_dcn_tile_repeaters = dc->dcn_ip.max_inter_dcn_tile_repeaters;
+			dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency;
+
+	v->dcfclkv_min0p65 = dc->dcn_soc->dcfclkv_min0p65;
+	v->dcfclkv_mid0p72 = dc->dcn_soc->dcfclkv_mid0p72;
+	v->dcfclkv_nom0p8 = dc->dcn_soc->dcfclkv_nom0p8;
+	v->dcfclkv_max0p9 = dc->dcn_soc->dcfclkv_max0p9;
+
+	v->max_dispclk_vmin0p65 = dc->dcn_soc->max_dispclk_vmin0p65;
+	v->max_dispclk_vmid0p72 = dc->dcn_soc->max_dispclk_vmid0p72;
+	v->max_dispclk_vnom0p8 = dc->dcn_soc->max_dispclk_vnom0p8;
+	v->max_dispclk_vmax0p9 = dc->dcn_soc->max_dispclk_vmax0p9;
+
+	v->max_dppclk_vmin0p65 = dc->dcn_soc->max_dppclk_vmin0p65;
+	v->max_dppclk_vmid0p72 = dc->dcn_soc->max_dppclk_vmid0p72;
+	v->max_dppclk_vnom0p8 = dc->dcn_soc->max_dppclk_vnom0p8;
+	v->max_dppclk_vmax0p9 = dc->dcn_soc->max_dppclk_vmax0p9;
+
+	v->socclk = dc->dcn_soc->socclk;
+
+	v->fabric_and_dram_bandwidth_vmin0p65 = dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65;
+	v->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72;
+	v->fabric_and_dram_bandwidth_vnom0p8 = dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8;
+	v->fabric_and_dram_bandwidth_vmax0p9 = dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9;
+
+	v->phyclkv_min0p65 = dc->dcn_soc->phyclkv_min0p65;
+	v->phyclkv_mid0p72 = dc->dcn_soc->phyclkv_mid0p72;
+	v->phyclkv_nom0p8 = dc->dcn_soc->phyclkv_nom0p8;
+	v->phyclkv_max0p9 = dc->dcn_soc->phyclkv_max0p9;
+
+	v->downspreading = dc->dcn_soc->downspreading;
+	v->round_trip_ping_latency_cycles = dc->dcn_soc->round_trip_ping_latency_cycles;
+	v->urgent_out_of_order_return_per_channel = dc->dcn_soc->urgent_out_of_order_return_per_channel;
+	v->number_of_channels = dc->dcn_soc->number_of_channels;
+	v->vmm_page_size = dc->dcn_soc->vmm_page_size;
+	v->dram_clock_change_latency = dc->dcn_soc->dram_clock_change_latency;
+	v->return_bus_width = dc->dcn_soc->return_bus_width;
+
+	v->rob_buffer_size_in_kbyte = dc->dcn_ip->rob_buffer_size_in_kbyte;
+	v->det_buffer_size_in_kbyte = dc->dcn_ip->det_buffer_size_in_kbyte;
+	v->dpp_output_buffer_pixels = dc->dcn_ip->dpp_output_buffer_pixels;
+	v->opp_output_buffer_lines = dc->dcn_ip->opp_output_buffer_lines;
+	v->pixel_chunk_size_in_kbyte = dc->dcn_ip->pixel_chunk_size_in_kbyte;
+	v->pte_enable = dc->dcn_ip->pte_enable;
+	v->pte_chunk_size = dc->dcn_ip->pte_chunk_size;
+	v->meta_chunk_size = dc->dcn_ip->meta_chunk_size;
+	v->writeback_chunk_size = dc->dcn_ip->writeback_chunk_size;
+	v->odm_capability = dc->dcn_ip->odm_capability;
+	v->dsc_capability = dc->dcn_ip->dsc_capability;
+	v->line_buffer_size = dc->dcn_ip->line_buffer_size;
+	v->is_line_buffer_bpp_fixed = dc->dcn_ip->is_line_buffer_bpp_fixed;
+	v->line_buffer_fixed_bpp = dc->dcn_ip->line_buffer_fixed_bpp;
+	v->max_line_buffer_lines = dc->dcn_ip->max_line_buffer_lines;
+	v->writeback_luma_buffer_size = dc->dcn_ip->writeback_luma_buffer_size;
+	v->writeback_chroma_buffer_size = dc->dcn_ip->writeback_chroma_buffer_size;
+	v->max_num_dpp = dc->dcn_ip->max_num_dpp;
+	v->max_num_writeback = dc->dcn_ip->max_num_writeback;
+	v->max_dchub_topscl_throughput = dc->dcn_ip->max_dchub_topscl_throughput;
+	v->max_pscl_tolb_throughput = dc->dcn_ip->max_pscl_tolb_throughput;
+	v->max_lb_tovscl_throughput = dc->dcn_ip->max_lb_tovscl_throughput;
+	v->max_vscl_tohscl_throughput = dc->dcn_ip->max_vscl_tohscl_throughput;
+	v->max_hscl_ratio = dc->dcn_ip->max_hscl_ratio;
+	v->max_vscl_ratio = dc->dcn_ip->max_vscl_ratio;
+	v->max_hscl_taps = dc->dcn_ip->max_hscl_taps;
+	v->max_vscl_taps = dc->dcn_ip->max_vscl_taps;
+	v->under_scan_factor = dc->dcn_ip->under_scan_factor;
+	v->pte_buffer_size_in_requests = dc->dcn_ip->pte_buffer_size_in_requests;
+	v->dispclk_ramping_margin = dc->dcn_ip->dispclk_ramping_margin;
+	v->max_inter_dcn_tile_repeaters = dc->dcn_ip->max_inter_dcn_tile_repeaters;
 	v->can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one =
-			dc->dcn_ip.can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one;
+			dc->dcn_ip->can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one;
 	v->bug_forcing_luma_and_chroma_request_to_same_size_fixed =
-			dc->dcn_ip.bug_forcing_luma_and_chroma_request_to_same_size_fixed;
+			dc->dcn_ip->bug_forcing_luma_and_chroma_request_to_same_size_fixed;
 
 	v->voltage[5] = dcn_bw_no_support;
 	v->voltage[4] = dcn_bw_v_max0p9;
@@ -1021,7 +1021,7 @@ bool dcn_validate_bandwidth(
 		context->bw.dcn.calc_clk.dcfclk_khz = (int)(v->dcfclk * 1000);
 		context->bw.dcn.calc_clk.dispclk_khz = (int)(v->dispclk * 1000);
 		if (dc->public.debug.max_disp_clk == true)
-			context->bw.dcn.calc_clk.dispclk_khz = (int)(dc->dcn_soc.max_dispclk_vmax0p9 * 1000);
+			context->bw.dcn.calc_clk.dispclk_khz = (int)(dc->dcn_soc->max_dispclk_vmax0p9 * 1000);
 		context->bw.dcn.calc_clk.dppclk_div = (int)(v->dispclk_dppclk_ratio) == 2;
 
 		for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
@@ -1118,15 +1118,15 @@ bool dcn_validate_bandwidth(
 		struct core_dc *dc_core = DC_TO_CORE(&dc->public);
 
 		dc_core->dml.soc.sr_enter_plus_exit_time_us =
-				dc_core->dcn_soc.sr_enter_plus_exit_time;
-		dc_core->dml.soc.sr_exit_time_us = dc_core->dcn_soc.sr_exit_time;
+				dc_core->dcn_soc->sr_enter_plus_exit_time;
+		dc_core->dml.soc.sr_exit_time_us = dc_core->dcn_soc->sr_exit_time;
 	}
 
 	/*
 	 * BW limit is set to prevent display from impacting other system functions
 	 */
 
-	bw_limit = dc->dcn_soc.percent_disp_bw_limit * v->fabric_and_dram_bandwidth_vmax0p9;
+	bw_limit = dc->dcn_soc->percent_disp_bw_limit * v->fabric_and_dram_bandwidth_vmax0p9;
 	bw_limit_pass = (v->total_data_read_bandwidth / 1000.0) < bw_limit;
 
 	kernel_fpu_end();
@@ -1149,41 +1149,41 @@ unsigned int dcn_find_normalized_clock_vdd_Level(
 
 	switch (clocks_type) {
 	case DM_PP_CLOCK_TYPE_DISPLAY_CLK:
-		if (clocks_in_khz > dc->dcn_soc.max_dispclk_vmax0p9*1000) {
+		if (clocks_in_khz > dc->dcn_soc->max_dispclk_vmax0p9*1000) {
 			vdd_level = dcn_bw_v_max0p91;
 			BREAK_TO_DEBUGGER();
-		} else if (clocks_in_khz > dc->dcn_soc.max_dispclk_vnom0p8*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->max_dispclk_vnom0p8*1000) {
 			vdd_level = dcn_bw_v_max0p9;
-		} else if (clocks_in_khz > dc->dcn_soc.max_dispclk_vmid0p72*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->max_dispclk_vmid0p72*1000) {
 			vdd_level = dcn_bw_v_nom0p8;
-		} else if (clocks_in_khz > dc->dcn_soc.max_dispclk_vmin0p65*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->max_dispclk_vmin0p65*1000) {
 			vdd_level = dcn_bw_v_mid0p72;
 		} else
 			vdd_level = dcn_bw_v_min0p65;
 		break;
 	case DM_PP_CLOCK_TYPE_DISPLAYPHYCLK:
-		if (clocks_in_khz > dc->dcn_soc.phyclkv_max0p9*1000) {
+		if (clocks_in_khz > dc->dcn_soc->phyclkv_max0p9*1000) {
 			vdd_level = dcn_bw_v_max0p91;
 			BREAK_TO_DEBUGGER();
-		} else if (clocks_in_khz > dc->dcn_soc.phyclkv_nom0p8*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->phyclkv_nom0p8*1000) {
 			vdd_level = dcn_bw_v_max0p9;
-		} else if (clocks_in_khz > dc->dcn_soc.phyclkv_mid0p72*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->phyclkv_mid0p72*1000) {
 			vdd_level = dcn_bw_v_nom0p8;
-		} else if (clocks_in_khz > dc->dcn_soc.phyclkv_min0p65*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->phyclkv_min0p65*1000) {
 			vdd_level = dcn_bw_v_mid0p72;
 		} else
 			vdd_level = dcn_bw_v_min0p65;
 		break;
 
 	case DM_PP_CLOCK_TYPE_DPPCLK:
-		if (clocks_in_khz > dc->dcn_soc.max_dppclk_vmax0p9*1000) {
+		if (clocks_in_khz > dc->dcn_soc->max_dppclk_vmax0p9*1000) {
 			vdd_level = dcn_bw_v_max0p91;
 			BREAK_TO_DEBUGGER();
-		} else if (clocks_in_khz > dc->dcn_soc.max_dppclk_vnom0p8*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->max_dppclk_vnom0p8*1000) {
 			vdd_level = dcn_bw_v_max0p9;
-		} else if (clocks_in_khz > dc->dcn_soc.max_dppclk_vmid0p72*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->max_dppclk_vmid0p72*1000) {
 			vdd_level = dcn_bw_v_nom0p8;
-		} else if (clocks_in_khz > dc->dcn_soc.max_dppclk_vmin0p65*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->max_dppclk_vmin0p65*1000) {
 			vdd_level = dcn_bw_v_mid0p72;
 		} else
 			vdd_level = dcn_bw_v_min0p65;
@@ -1191,15 +1191,16 @@ unsigned int dcn_find_normalized_clock_vdd_Level(
 
 	case DM_PP_CLOCK_TYPE_MEMORY_CLK:
 		{
-			unsigned factor = (ddr4_dram_factor_single_Channel * dc->dcn_soc.number_of_channels);
-			if (clocks_in_khz > dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9*1000000/factor) {
+			unsigned factor = (ddr4_dram_factor_single_Channel * dc->dcn_soc->number_of_channels);
+
+			if (clocks_in_khz > dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9*1000000/factor) {
 			vdd_level = dcn_bw_v_max0p91;
 				BREAK_TO_DEBUGGER();
-			} else if (clocks_in_khz > dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8*1000000/factor) {
+			} else if (clocks_in_khz > dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8*1000000/factor) {
 				vdd_level = dcn_bw_v_max0p9;
-			} else if (clocks_in_khz > dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72*1000000/factor) {
+			} else if (clocks_in_khz > dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72*1000000/factor) {
 				vdd_level = dcn_bw_v_nom0p8;
-			} else if (clocks_in_khz > dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65*1000000/factor) {
+			} else if (clocks_in_khz > dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65*1000000/factor) {
 				vdd_level = dcn_bw_v_mid0p72;
 			} else
 				vdd_level = dcn_bw_v_min0p65;
@@ -1207,14 +1208,14 @@ unsigned int dcn_find_normalized_clock_vdd_Level(
 		break;
 
 	case DM_PP_CLOCK_TYPE_DCFCLK:
-		if (clocks_in_khz > dc->dcn_soc.dcfclkv_max0p9*1000) {
+		if (clocks_in_khz > dc->dcn_soc->dcfclkv_max0p9*1000) {
 			vdd_level = dcn_bw_v_max0p91;
 			BREAK_TO_DEBUGGER();
-		} else if (clocks_in_khz > dc->dcn_soc.dcfclkv_nom0p8*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->dcfclkv_nom0p8*1000) {
 			vdd_level = dcn_bw_v_max0p9;
-		} else if (clocks_in_khz > dc->dcn_soc.dcfclkv_mid0p72*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->dcfclkv_mid0p72*1000) {
 			vdd_level = dcn_bw_v_nom0p8;
-		} else if (clocks_in_khz > dc->dcn_soc.dcfclkv_min0p65*1000) {
+		} else if (clocks_in_khz > dc->dcn_soc->dcfclkv_min0p65*1000) {
 			vdd_level = dcn_bw_v_mid0p72;
 		} else
 			vdd_level = dcn_bw_v_min0p65;
@@ -1254,15 +1255,15 @@ unsigned int dcn_find_dcfclk_suits_all(
 	vdd_level = dcn_bw_max(vdd_level, vdd_level_temp);
 	if (vdd_level == dcn_bw_v_max0p91) {
 		BREAK_TO_DEBUGGER();
-		dcf_clk = dc->dcn_soc.dcfclkv_max0p9*1000;
+		dcf_clk = dc->dcn_soc->dcfclkv_max0p9*1000;
 	} else if (vdd_level == dcn_bw_v_max0p9)
-		dcf_clk =  dc->dcn_soc.dcfclkv_max0p9*1000;
+		dcf_clk =  dc->dcn_soc->dcfclkv_max0p9*1000;
 	else if (vdd_level == dcn_bw_v_nom0p8)
-		dcf_clk =  dc->dcn_soc.dcfclkv_nom0p8*1000;
+		dcf_clk =  dc->dcn_soc->dcfclkv_nom0p8*1000;
 	else if (vdd_level == dcn_bw_v_mid0p72)
-		dcf_clk =  dc->dcn_soc.dcfclkv_mid0p72*1000;
+		dcf_clk =  dc->dcn_soc->dcfclkv_mid0p72*1000;
 	else
-		dcf_clk =  dc->dcn_soc.dcfclkv_min0p65*1000;
+		dcf_clk =  dc->dcn_soc->dcfclkv_min0p65*1000;
 
 	dm_logger_write(dc->ctx->logger, LOG_HW_MARKS,
 		"\tdcf_clk for voltage = %d\n", dcf_clk);
@@ -1282,27 +1283,27 @@ void dcn_bw_update_from_pplib(struct core_dc *dc)
 			ctx, DM_PP_CLOCK_TYPE_FCLK, &clks) &&
 			clks.num_levels != 0) {
 		ASSERT(clks.num_levels >= 3);
-		dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65 = 32 * (clks.data[0].clocks_in_khz / 1000.0) / 1000.0;
+		dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 = 32 * (clks.data[0].clocks_in_khz / 1000.0) / 1000.0;
 		if (clks.num_levels > 2) {
-			dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc.number_of_channels *
+			dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc->number_of_channels *
 					(clks.data[clks.num_levels - 3].clocks_in_khz / 1000.0) * ddr4_dram_factor_single_Channel / 1000.0;
 		} else {
-			dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc.number_of_channels *
+			dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc->number_of_channels *
 					(clks.data[clks.num_levels - 2].clocks_in_khz / 1000.0) * ddr4_dram_factor_single_Channel / 1000.0;
 		}
-		dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8 = dc->dcn_soc.number_of_channels *
+		dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 = dc->dcn_soc->number_of_channels *
 				(clks.data[clks.num_levels - 2].clocks_in_khz / 1000.0) * ddr4_dram_factor_single_Channel / 1000.0;
-		dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9 = dc->dcn_soc.number_of_channels *
+		dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = dc->dcn_soc->number_of_channels *
 				(clks.data[clks.num_levels - 1].clocks_in_khz / 1000.0) * ddr4_dram_factor_single_Channel / 1000.0;
 	} else
 		BREAK_TO_DEBUGGER();
 	if (dm_pp_get_clock_levels_by_type_with_voltage(
 				ctx, DM_PP_CLOCK_TYPE_DCFCLK, &clks) &&
 				clks.num_levels >= 3) {
-		dc->dcn_soc.dcfclkv_min0p65 = clks.data[0].clocks_in_khz / 1000.0;
-		dc->dcn_soc.dcfclkv_mid0p72 = clks.data[clks.num_levels - 3].clocks_in_khz / 1000.0;
-		dc->dcn_soc.dcfclkv_nom0p8 = clks.data[clks.num_levels - 2].clocks_in_khz / 1000.0;
-		dc->dcn_soc.dcfclkv_max0p9 = clks.data[clks.num_levels - 1].clocks_in_khz / 1000.0;
+		dc->dcn_soc->dcfclkv_min0p65 = clks.data[0].clocks_in_khz / 1000.0;
+		dc->dcn_soc->dcfclkv_mid0p72 = clks.data[clks.num_levels - 3].clocks_in_khz / 1000.0;
+		dc->dcn_soc->dcfclkv_nom0p8 = clks.data[clks.num_levels - 2].clocks_in_khz / 1000.0;
+		dc->dcn_soc->dcfclkv_max0p9 = clks.data[clks.num_levels - 1].clocks_in_khz / 1000.0;
 	} else
 		BREAK_TO_DEBUGGER();
 
@@ -1315,17 +1316,17 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct core_dc *dc)
 	int max_fclk_khz, nom_fclk_khz, min_fclk_khz, max_dcfclk_khz,
 		nom_dcfclk_khz, mid_fclk_khz, min_dcfclk_khz, socclk_khz;
 	const int overdrive = 5000000; /* 5 GHz to cover Overdrive */
-	unsigned factor = (ddr4_dram_factor_single_Channel * dc->dcn_soc.number_of_channels);
+	unsigned factor = (ddr4_dram_factor_single_Channel * dc->dcn_soc->number_of_channels);
 
 	kernel_fpu_begin();
-	max_fclk_khz = dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9 * 1000000 / factor;
-	nom_fclk_khz = dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8 * 1000000 / factor;
-	mid_fclk_khz = dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72 * 1000000 / factor;
-	min_fclk_khz = dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65 * 1000000 / 32;
-	max_dcfclk_khz = dc->dcn_soc.dcfclkv_max0p9 * 1000;
-	nom_dcfclk_khz = dc->dcn_soc.dcfclkv_nom0p8 * 1000;
-	min_dcfclk_khz = dc->dcn_soc.dcfclkv_min0p65 * 1000;
-	socclk_khz = dc->dcn_soc.socclk * 1000;
+	max_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 * 1000000 / factor;
+	nom_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 * 1000000 / factor;
+	mid_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 * 1000000 / factor;
+	min_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 * 1000000 / 32;
+	max_dcfclk_khz = dc->dcn_soc->dcfclkv_max0p9 * 1000;
+	nom_dcfclk_khz = dc->dcn_soc->dcfclkv_nom0p8 * 1000;
+	min_dcfclk_khz = dc->dcn_soc->dcfclkv_min0p65 * 1000;
+	socclk_khz = dc->dcn_soc->socclk * 1000;
 	kernel_fpu_end();
 
 	/* Now notify PPLib/SMU about which Watermarks sets they should select
@@ -1425,40 +1426,40 @@ void dcn_bw_sync_calcs_and_dml(struct core_dc *dc)
 			"vmm_page_size: %d Bytes\n"
 			"dram_clock_change_latency: %d ns\n"
 			"return_bus_width: %d Bytes\n",
-			dc->dcn_soc.sr_exit_time * 1000,
-			dc->dcn_soc.sr_enter_plus_exit_time * 1000,
-			dc->dcn_soc.urgent_latency * 1000,
-			dc->dcn_soc.write_back_latency * 1000,
-			dc->dcn_soc.percent_of_ideal_drambw_received_after_urg_latency,
-			dc->dcn_soc.max_request_size,
-			dc->dcn_soc.dcfclkv_max0p9 * 1000,
-			dc->dcn_soc.dcfclkv_nom0p8 * 1000,
-			dc->dcn_soc.dcfclkv_mid0p72 * 1000,
-			dc->dcn_soc.dcfclkv_min0p65 * 1000,
-			dc->dcn_soc.max_dispclk_vmax0p9 * 1000,
-			dc->dcn_soc.max_dispclk_vnom0p8 * 1000,
-			dc->dcn_soc.max_dispclk_vmid0p72 * 1000,
-			dc->dcn_soc.max_dispclk_vmin0p65 * 1000,
-			dc->dcn_soc.max_dppclk_vmax0p9 * 1000,
-			dc->dcn_soc.max_dppclk_vnom0p8 * 1000,
-			dc->dcn_soc.max_dppclk_vmid0p72 * 1000,
-			dc->dcn_soc.max_dppclk_vmin0p65 * 1000,
-			dc->dcn_soc.socclk * 1000,
-			dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9 * 1000,
-			dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8 * 1000,
-			dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72 * 1000,
-			dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65 * 1000,
-			dc->dcn_soc.phyclkv_max0p9 * 1000,
-			dc->dcn_soc.phyclkv_nom0p8 * 1000,
-			dc->dcn_soc.phyclkv_mid0p72 * 1000,
-			dc->dcn_soc.phyclkv_min0p65 * 1000,
-			dc->dcn_soc.downspreading * 100,
-			dc->dcn_soc.round_trip_ping_latency_cycles,
-			dc->dcn_soc.urgent_out_of_order_return_per_channel,
-			dc->dcn_soc.number_of_channels,
-			dc->dcn_soc.vmm_page_size,
-			dc->dcn_soc.dram_clock_change_latency * 1000,
-			dc->dcn_soc.return_bus_width);
+			dc->dcn_soc->sr_exit_time * 1000,
+			dc->dcn_soc->sr_enter_plus_exit_time * 1000,
+			dc->dcn_soc->urgent_latency * 1000,
+			dc->dcn_soc->write_back_latency * 1000,
+			dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency,
+			dc->dcn_soc->max_request_size,
+			dc->dcn_soc->dcfclkv_max0p9 * 1000,
+			dc->dcn_soc->dcfclkv_nom0p8 * 1000,
+			dc->dcn_soc->dcfclkv_mid0p72 * 1000,
+			dc->dcn_soc->dcfclkv_min0p65 * 1000,
+			dc->dcn_soc->max_dispclk_vmax0p9 * 1000,
+			dc->dcn_soc->max_dispclk_vnom0p8 * 1000,
+			dc->dcn_soc->max_dispclk_vmid0p72 * 1000,
+			dc->dcn_soc->max_dispclk_vmin0p65 * 1000,
+			dc->dcn_soc->max_dppclk_vmax0p9 * 1000,
+			dc->dcn_soc->max_dppclk_vnom0p8 * 1000,
+			dc->dcn_soc->max_dppclk_vmid0p72 * 1000,
+			dc->dcn_soc->max_dppclk_vmin0p65 * 1000,
+			dc->dcn_soc->socclk * 1000,
+			dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 * 1000,
+			dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 * 1000,
+			dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 * 1000,
+			dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 * 1000,
+			dc->dcn_soc->phyclkv_max0p9 * 1000,
+			dc->dcn_soc->phyclkv_nom0p8 * 1000,
+			dc->dcn_soc->phyclkv_mid0p72 * 1000,
+			dc->dcn_soc->phyclkv_min0p65 * 1000,
+			dc->dcn_soc->downspreading * 100,
+			dc->dcn_soc->round_trip_ping_latency_cycles,
+			dc->dcn_soc->urgent_out_of_order_return_per_channel,
+			dc->dcn_soc->number_of_channels,
+			dc->dcn_soc->vmm_page_size,
+			dc->dcn_soc->dram_clock_change_latency * 1000,
+			dc->dcn_soc->return_bus_width);
 	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
 			"rob_buffer_size_in_kbyte: %d\n"
 			"det_buffer_size_in_kbyte: %d\n"
@@ -1494,120 +1495,120 @@ void dcn_bw_sync_calcs_and_dml(struct core_dc *dc)
 			"can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one: %d\n"
 			"bug_forcing_luma_and_chroma_request_to_same_size_fixed: %d\n"
 			"dcfclk_cstate_latency: %d\n",
-			dc->dcn_ip.rob_buffer_size_in_kbyte,
-			dc->dcn_ip.det_buffer_size_in_kbyte,
-			dc->dcn_ip.dpp_output_buffer_pixels,
-			dc->dcn_ip.opp_output_buffer_lines,
-			dc->dcn_ip.pixel_chunk_size_in_kbyte,
-			dc->dcn_ip.pte_enable,
-			dc->dcn_ip.pte_chunk_size,
-			dc->dcn_ip.meta_chunk_size,
-			dc->dcn_ip.writeback_chunk_size,
-			dc->dcn_ip.odm_capability,
-			dc->dcn_ip.dsc_capability,
-			dc->dcn_ip.line_buffer_size,
-			dc->dcn_ip.max_line_buffer_lines,
-			dc->dcn_ip.is_line_buffer_bpp_fixed,
-			dc->dcn_ip.line_buffer_fixed_bpp,
-			dc->dcn_ip.writeback_luma_buffer_size,
-			dc->dcn_ip.writeback_chroma_buffer_size,
-			dc->dcn_ip.max_num_dpp,
-			dc->dcn_ip.max_num_writeback,
-			dc->dcn_ip.max_dchub_topscl_throughput,
-			dc->dcn_ip.max_pscl_tolb_throughput,
-			dc->dcn_ip.max_lb_tovscl_throughput,
-			dc->dcn_ip.max_vscl_tohscl_throughput,
-			dc->dcn_ip.max_hscl_ratio,
-			dc->dcn_ip.max_vscl_ratio,
-			dc->dcn_ip.max_hscl_taps,
-			dc->dcn_ip.max_vscl_taps,
-			dc->dcn_ip.pte_buffer_size_in_requests,
-			dc->dcn_ip.dispclk_ramping_margin,
-			dc->dcn_ip.under_scan_factor * 100,
-			dc->dcn_ip.max_inter_dcn_tile_repeaters,
-			dc->dcn_ip.can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one,
-			dc->dcn_ip.bug_forcing_luma_and_chroma_request_to_same_size_fixed,
-			dc->dcn_ip.dcfclk_cstate_latency);
-	dc->dml.soc.vmin.socclk_mhz = dc->dcn_soc.socclk;
-	dc->dml.soc.vmid.socclk_mhz = dc->dcn_soc.socclk;
-	dc->dml.soc.vnom.socclk_mhz = dc->dcn_soc.socclk;
-	dc->dml.soc.vmax.socclk_mhz = dc->dcn_soc.socclk;
-
-	dc->dml.soc.vmin.dcfclk_mhz = dc->dcn_soc.dcfclkv_min0p65;
-	dc->dml.soc.vmid.dcfclk_mhz = dc->dcn_soc.dcfclkv_mid0p72;
-	dc->dml.soc.vnom.dcfclk_mhz = dc->dcn_soc.dcfclkv_nom0p8;
-	dc->dml.soc.vmax.dcfclk_mhz = dc->dcn_soc.dcfclkv_max0p9;
-
-	dc->dml.soc.vmin.dispclk_mhz = dc->dcn_soc.max_dispclk_vmin0p65;
-	dc->dml.soc.vmid.dispclk_mhz = dc->dcn_soc.max_dispclk_vmid0p72;
-	dc->dml.soc.vnom.dispclk_mhz = dc->dcn_soc.max_dispclk_vnom0p8;
-	dc->dml.soc.vmax.dispclk_mhz = dc->dcn_soc.max_dispclk_vmax0p9;
-
-	dc->dml.soc.vmin.dppclk_mhz = dc->dcn_soc.max_dppclk_vmin0p65;
-	dc->dml.soc.vmid.dppclk_mhz = dc->dcn_soc.max_dppclk_vmid0p72;
-	dc->dml.soc.vnom.dppclk_mhz = dc->dcn_soc.max_dppclk_vnom0p8;
-	dc->dml.soc.vmax.dppclk_mhz = dc->dcn_soc.max_dppclk_vmax0p9;
-
-	dc->dml.soc.vmin.phyclk_mhz = dc->dcn_soc.phyclkv_min0p65;
-	dc->dml.soc.vmid.phyclk_mhz = dc->dcn_soc.phyclkv_mid0p72;
-	dc->dml.soc.vnom.phyclk_mhz = dc->dcn_soc.phyclkv_nom0p8;
-	dc->dml.soc.vmax.phyclk_mhz = dc->dcn_soc.phyclkv_max0p9;
-
-	dc->dml.soc.vmin.dram_bw_per_chan_gbps = dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65;
-	dc->dml.soc.vmid.dram_bw_per_chan_gbps = dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72;
-	dc->dml.soc.vnom.dram_bw_per_chan_gbps = dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8;
-	dc->dml.soc.vmax.dram_bw_per_chan_gbps = dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9;
-
-	dc->dml.soc.sr_exit_time_us = dc->dcn_soc.sr_exit_time;
-	dc->dml.soc.sr_enter_plus_exit_time_us = dc->dcn_soc.sr_enter_plus_exit_time;
-	dc->dml.soc.urgent_latency_us = dc->dcn_soc.urgent_latency;
-	dc->dml.soc.writeback_latency_us = dc->dcn_soc.write_back_latency;
+			dc->dcn_ip->rob_buffer_size_in_kbyte,
+			dc->dcn_ip->det_buffer_size_in_kbyte,
+			dc->dcn_ip->dpp_output_buffer_pixels,
+			dc->dcn_ip->opp_output_buffer_lines,
+			dc->dcn_ip->pixel_chunk_size_in_kbyte,
+			dc->dcn_ip->pte_enable,
+			dc->dcn_ip->pte_chunk_size,
+			dc->dcn_ip->meta_chunk_size,
+			dc->dcn_ip->writeback_chunk_size,
+			dc->dcn_ip->odm_capability,
+			dc->dcn_ip->dsc_capability,
+			dc->dcn_ip->line_buffer_size,
+			dc->dcn_ip->max_line_buffer_lines,
+			dc->dcn_ip->is_line_buffer_bpp_fixed,
+			dc->dcn_ip->line_buffer_fixed_bpp,
+			dc->dcn_ip->writeback_luma_buffer_size,
+			dc->dcn_ip->writeback_chroma_buffer_size,
+			dc->dcn_ip->max_num_dpp,
+			dc->dcn_ip->max_num_writeback,
+			dc->dcn_ip->max_dchub_topscl_throughput,
+			dc->dcn_ip->max_pscl_tolb_throughput,
+			dc->dcn_ip->max_lb_tovscl_throughput,
+			dc->dcn_ip->max_vscl_tohscl_throughput,
+			dc->dcn_ip->max_hscl_ratio,
+			dc->dcn_ip->max_vscl_ratio,
+			dc->dcn_ip->max_hscl_taps,
+			dc->dcn_ip->max_vscl_taps,
+			dc->dcn_ip->pte_buffer_size_in_requests,
+			dc->dcn_ip->dispclk_ramping_margin,
+			dc->dcn_ip->under_scan_factor * 100,
+			dc->dcn_ip->max_inter_dcn_tile_repeaters,
+			dc->dcn_ip->can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one,
+			dc->dcn_ip->bug_forcing_luma_and_chroma_request_to_same_size_fixed,
+			dc->dcn_ip->dcfclk_cstate_latency);
+	dc->dml.soc.vmin.socclk_mhz = dc->dcn_soc->socclk;
+	dc->dml.soc.vmid.socclk_mhz = dc->dcn_soc->socclk;
+	dc->dml.soc.vnom.socclk_mhz = dc->dcn_soc->socclk;
+	dc->dml.soc.vmax.socclk_mhz = dc->dcn_soc->socclk;
+
+	dc->dml.soc.vmin.dcfclk_mhz = dc->dcn_soc->dcfclkv_min0p65;
+	dc->dml.soc.vmid.dcfclk_mhz = dc->dcn_soc->dcfclkv_mid0p72;
+	dc->dml.soc.vnom.dcfclk_mhz = dc->dcn_soc->dcfclkv_nom0p8;
+	dc->dml.soc.vmax.dcfclk_mhz = dc->dcn_soc->dcfclkv_max0p9;
+
+	dc->dml.soc.vmin.dispclk_mhz = dc->dcn_soc->max_dispclk_vmin0p65;
+	dc->dml.soc.vmid.dispclk_mhz = dc->dcn_soc->max_dispclk_vmid0p72;
+	dc->dml.soc.vnom.dispclk_mhz = dc->dcn_soc->max_dispclk_vnom0p8;
+	dc->dml.soc.vmax.dispclk_mhz = dc->dcn_soc->max_dispclk_vmax0p9;
+
+	dc->dml.soc.vmin.dppclk_mhz = dc->dcn_soc->max_dppclk_vmin0p65;
+	dc->dml.soc.vmid.dppclk_mhz = dc->dcn_soc->max_dppclk_vmid0p72;
+	dc->dml.soc.vnom.dppclk_mhz = dc->dcn_soc->max_dppclk_vnom0p8;
+	dc->dml.soc.vmax.dppclk_mhz = dc->dcn_soc->max_dppclk_vmax0p9;
+
+	dc->dml.soc.vmin.phyclk_mhz = dc->dcn_soc->phyclkv_min0p65;
+	dc->dml.soc.vmid.phyclk_mhz = dc->dcn_soc->phyclkv_mid0p72;
+	dc->dml.soc.vnom.phyclk_mhz = dc->dcn_soc->phyclkv_nom0p8;
+	dc->dml.soc.vmax.phyclk_mhz = dc->dcn_soc->phyclkv_max0p9;
+
+	dc->dml.soc.vmin.dram_bw_per_chan_gbps = dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65;
+	dc->dml.soc.vmid.dram_bw_per_chan_gbps = dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72;
+	dc->dml.soc.vnom.dram_bw_per_chan_gbps = dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8;
+	dc->dml.soc.vmax.dram_bw_per_chan_gbps = dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9;
+
+	dc->dml.soc.sr_exit_time_us = dc->dcn_soc->sr_exit_time;
+	dc->dml.soc.sr_enter_plus_exit_time_us = dc->dcn_soc->sr_enter_plus_exit_time;
+	dc->dml.soc.urgent_latency_us = dc->dcn_soc->urgent_latency;
+	dc->dml.soc.writeback_latency_us = dc->dcn_soc->write_back_latency;
 	dc->dml.soc.ideal_dram_bw_after_urgent_percent =
-			dc->dcn_soc.percent_of_ideal_drambw_received_after_urg_latency;
-	dc->dml.soc.max_request_size_bytes = dc->dcn_soc.max_request_size;
-	dc->dml.soc.downspread_percent = dc->dcn_soc.downspreading;
+			dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency;
+	dc->dml.soc.max_request_size_bytes = dc->dcn_soc->max_request_size;
+	dc->dml.soc.downspread_percent = dc->dcn_soc->downspreading;
 	dc->dml.soc.round_trip_ping_latency_dcfclk_cycles =
-			dc->dcn_soc.round_trip_ping_latency_cycles;
+			dc->dcn_soc->round_trip_ping_latency_cycles;
 	dc->dml.soc.urgent_out_of_order_return_per_channel_bytes =
-			dc->dcn_soc.urgent_out_of_order_return_per_channel;
-	dc->dml.soc.num_chans = dc->dcn_soc.number_of_channels;
-	dc->dml.soc.vmm_page_size_bytes = dc->dcn_soc.vmm_page_size;
-	dc->dml.soc.dram_clock_change_latency_us = dc->dcn_soc.dram_clock_change_latency;
-	dc->dml.soc.return_bus_width_bytes = dc->dcn_soc.return_bus_width;
-
-	dc->dml.ip.rob_buffer_size_kbytes = dc->dcn_ip.rob_buffer_size_in_kbyte;
-	dc->dml.ip.det_buffer_size_kbytes = dc->dcn_ip.det_buffer_size_in_kbyte;
-	dc->dml.ip.dpp_output_buffer_pixels = dc->dcn_ip.dpp_output_buffer_pixels;
-	dc->dml.ip.opp_output_buffer_lines = dc->dcn_ip.opp_output_buffer_lines;
-	dc->dml.ip.pixel_chunk_size_kbytes = dc->dcn_ip.pixel_chunk_size_in_kbyte;
-	dc->dml.ip.pte_enable = dc->dcn_ip.pte_enable == dcn_bw_yes;
-	dc->dml.ip.pte_chunk_size_kbytes = dc->dcn_ip.pte_chunk_size;
-	dc->dml.ip.meta_chunk_size_kbytes = dc->dcn_ip.meta_chunk_size;
-	dc->dml.ip.writeback_chunk_size_kbytes = dc->dcn_ip.writeback_chunk_size;
-	dc->dml.ip.line_buffer_size_bits = dc->dcn_ip.line_buffer_size;
-	dc->dml.ip.max_line_buffer_lines = dc->dcn_ip.max_line_buffer_lines;
-	dc->dml.ip.IsLineBufferBppFixed = dc->dcn_ip.is_line_buffer_bpp_fixed == dcn_bw_yes;
-	dc->dml.ip.LineBufferFixedBpp = dc->dcn_ip.line_buffer_fixed_bpp;
-	dc->dml.ip.writeback_luma_buffer_size_kbytes = dc->dcn_ip.writeback_luma_buffer_size;
-	dc->dml.ip.writeback_chroma_buffer_size_kbytes = dc->dcn_ip.writeback_chroma_buffer_size;
-	dc->dml.ip.max_num_dpp = dc->dcn_ip.max_num_dpp;
-	dc->dml.ip.max_num_wb = dc->dcn_ip.max_num_writeback;
-	dc->dml.ip.max_dchub_pscl_bw_pix_per_clk = dc->dcn_ip.max_dchub_topscl_throughput;
-	dc->dml.ip.max_pscl_lb_bw_pix_per_clk = dc->dcn_ip.max_pscl_tolb_throughput;
-	dc->dml.ip.max_lb_vscl_bw_pix_per_clk = dc->dcn_ip.max_lb_tovscl_throughput;
-	dc->dml.ip.max_vscl_hscl_bw_pix_per_clk = dc->dcn_ip.max_vscl_tohscl_throughput;
-	dc->dml.ip.max_hscl_ratio = dc->dcn_ip.max_hscl_ratio;
-	dc->dml.ip.max_vscl_ratio = dc->dcn_ip.max_vscl_ratio;
-	dc->dml.ip.max_hscl_taps = dc->dcn_ip.max_hscl_taps;
-	dc->dml.ip.max_vscl_taps = dc->dcn_ip.max_vscl_taps;
+			dc->dcn_soc->urgent_out_of_order_return_per_channel;
+	dc->dml.soc.num_chans = dc->dcn_soc->number_of_channels;
+	dc->dml.soc.vmm_page_size_bytes = dc->dcn_soc->vmm_page_size;
+	dc->dml.soc.dram_clock_change_latency_us = dc->dcn_soc->dram_clock_change_latency;
+	dc->dml.soc.return_bus_width_bytes = dc->dcn_soc->return_bus_width;
+
+	dc->dml.ip.rob_buffer_size_kbytes = dc->dcn_ip->rob_buffer_size_in_kbyte;
+	dc->dml.ip.det_buffer_size_kbytes = dc->dcn_ip->det_buffer_size_in_kbyte;
+	dc->dml.ip.dpp_output_buffer_pixels = dc->dcn_ip->dpp_output_buffer_pixels;
+	dc->dml.ip.opp_output_buffer_lines = dc->dcn_ip->opp_output_buffer_lines;
+	dc->dml.ip.pixel_chunk_size_kbytes = dc->dcn_ip->pixel_chunk_size_in_kbyte;
+	dc->dml.ip.pte_enable = dc->dcn_ip->pte_enable == dcn_bw_yes;
+	dc->dml.ip.pte_chunk_size_kbytes = dc->dcn_ip->pte_chunk_size;
+	dc->dml.ip.meta_chunk_size_kbytes = dc->dcn_ip->meta_chunk_size;
+	dc->dml.ip.writeback_chunk_size_kbytes = dc->dcn_ip->writeback_chunk_size;
+	dc->dml.ip.line_buffer_size_bits = dc->dcn_ip->line_buffer_size;
+	dc->dml.ip.max_line_buffer_lines = dc->dcn_ip->max_line_buffer_lines;
+	dc->dml.ip.IsLineBufferBppFixed = dc->dcn_ip->is_line_buffer_bpp_fixed == dcn_bw_yes;
+	dc->dml.ip.LineBufferFixedBpp = dc->dcn_ip->line_buffer_fixed_bpp;
+	dc->dml.ip.writeback_luma_buffer_size_kbytes = dc->dcn_ip->writeback_luma_buffer_size;
+	dc->dml.ip.writeback_chroma_buffer_size_kbytes = dc->dcn_ip->writeback_chroma_buffer_size;
+	dc->dml.ip.max_num_dpp = dc->dcn_ip->max_num_dpp;
+	dc->dml.ip.max_num_wb = dc->dcn_ip->max_num_writeback;
+	dc->dml.ip.max_dchub_pscl_bw_pix_per_clk = dc->dcn_ip->max_dchub_topscl_throughput;
+	dc->dml.ip.max_pscl_lb_bw_pix_per_clk = dc->dcn_ip->max_pscl_tolb_throughput;
+	dc->dml.ip.max_lb_vscl_bw_pix_per_clk = dc->dcn_ip->max_lb_tovscl_throughput;
+	dc->dml.ip.max_vscl_hscl_bw_pix_per_clk = dc->dcn_ip->max_vscl_tohscl_throughput;
+	dc->dml.ip.max_hscl_ratio = dc->dcn_ip->max_hscl_ratio;
+	dc->dml.ip.max_vscl_ratio = dc->dcn_ip->max_vscl_ratio;
+	dc->dml.ip.max_hscl_taps = dc->dcn_ip->max_hscl_taps;
+	dc->dml.ip.max_vscl_taps = dc->dcn_ip->max_vscl_taps;
 	/*pte_buffer_size_in_requests missing in dml*/
-	dc->dml.ip.dispclk_ramp_margin_percent = dc->dcn_ip.dispclk_ramping_margin;
-	dc->dml.ip.underscan_factor = dc->dcn_ip.under_scan_factor;
-	dc->dml.ip.max_inter_dcn_tile_repeaters = dc->dcn_ip.max_inter_dcn_tile_repeaters;
+	dc->dml.ip.dispclk_ramp_margin_percent = dc->dcn_ip->dispclk_ramping_margin;
+	dc->dml.ip.underscan_factor = dc->dcn_ip->under_scan_factor;
+	dc->dml.ip.max_inter_dcn_tile_repeaters = dc->dcn_ip->max_inter_dcn_tile_repeaters;
 	dc->dml.ip.can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one =
-		dc->dcn_ip.can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one == dcn_bw_yes;
+		dc->dcn_ip->can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one == dcn_bw_yes;
 	dc->dml.ip.bug_forcing_LC_req_same_size_fixed =
-		dc->dcn_ip.bug_forcing_luma_and_chroma_request_to_same_size_fixed == dcn_bw_yes;
-	dc->dml.ip.dcfclk_cstate_latency = dc->dcn_ip.dcfclk_cstate_latency;
+		dc->dcn_ip->bug_forcing_luma_and_chroma_request_to_same_size_fixed == dcn_bw_yes;
+	dc->dml.ip.dcfclk_cstate_latency = dc->dcn_ip->dcfclk_cstate_latency;
 	kernel_fpu_end();
 }
drivers/gpu/drm/amd/display/dc/core/dc.c +38 -21

131 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +14 -14
index fa990a51ac83..c36843d497ac 100644
@@ -1322,28 +1322,28 @@ static bool construct(
 	}
 
 	dml_init_instance(&dc->dml, DML_PROJECT_RAVEN1);
-	dc->dcn_ip = dcn10_ip_defaults;
-	dc->dcn_soc = dcn10_soc_defaults;
+	memcpy(dc->dcn_ip, &dcn10_ip_defaults, sizeof(dcn10_ip_defaults));
+	memcpy(dc->dcn_soc, &dcn10_soc_defaults, sizeof(dcn10_soc_defaults));
 
 	if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
-		dc->dcn_soc.urgent_latency = 3;
+		dc->dcn_soc->urgent_latency = 3;
 		dc->public.debug.disable_dmcu = true;
-		dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9 = 41.60f;
+		dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 41.60f;
 	}
 
 
-	dc->dcn_soc.number_of_channels = dc->ctx->asic_id.vram_width / ddr4_dram_width;
-	ASSERT(dc->dcn_soc.number_of_channels < 3);
-	if (dc->dcn_soc.number_of_channels == 0)/*old sbios bug*/
-		dc->dcn_soc.number_of_channels = 2;
+	dc->dcn_soc->number_of_channels = dc->ctx->asic_id.vram_width / ddr4_dram_width;
+	ASSERT(dc->dcn_soc->number_of_channels < 3);
+	if (dc->dcn_soc->number_of_channels == 0)/*old sbios bug*/
+		dc->dcn_soc->number_of_channels = 2;
 
-	if (dc->dcn_soc.number_of_channels == 1) {
-		dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9 = 19.2f;
-		dc->dcn_soc.fabric_and_dram_bandwidth_vnom0p8 = 17.066f;
-		dc->dcn_soc.fabric_and_dram_bandwidth_vmid0p72 = 14.933f;
-		dc->dcn_soc.fabric_and_dram_bandwidth_vmin0p65 = 12.8f;
+	if (dc->dcn_soc->number_of_channels == 1) {
+		dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 19.2f;
+		dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 = 17.066f;
+		dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = 14.933f;
+		dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 = 12.8f;
 		if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
-			dc->dcn_soc.fabric_and_dram_bandwidth_vmax0p9 = 20.80f;
+			dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 20.80f;
 		}
 	}
 
drivers/gpu/drm/amd/display/dc/inc/core_dc.h +2 -2
index 982f7170f5d2..ebe1fd78a92a 100644
@@ -32,8 +32,8 @@ struct core_dc {
 	struct bw_calcs_dceip *bw_dceip;
 	struct bw_calcs_vbios *bw_vbios;
 #ifdef CONFIG_DRM_AMD_DC_DCN1_0
-	struct dcn_soc_bounding_box dcn_soc;
-	struct dcn_ip_params dcn_ip;
+	struct dcn_soc_bounding_box *dcn_soc;
+	struct dcn_ip_params *dcn_ip;
 	struct display_mode_lib dml;
 #endif
 
Signature · 6 lines
2.11.0

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

PATCH 7/77 drm/amd/display: fix eDP bootup/S4 backlight on

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

also pass-in correct dispclk tor DMCU

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 12 +++++-------
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 22 ++++++++++++++--------
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |  2 ++
 .../gpu/drm/amd/display/dc/inc/hw/display_clock.h  |  2 +-
 4 files changed, 22 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -7
index 6687baa3d8b8..2453d36aeaf3 100644
@@ -169,16 +169,14 @@ static void update_num_audio(
 	unsigned int *num_audio,
 	struct audio_support *aud_support)
 {
+	aud_support->dp_audio = true;
+	aud_support->hdmi_audio_native = false;
+	aud_support->hdmi_audio_on_dongle = false;
+
 	if (straps->hdmi_disable == 0) {
-		aud_support->hdmi_audio_native = true;
-		aud_support->hdmi_audio_on_dongle = true;
-		aud_support->dp_audio = true;
-	} else {
 		if (straps->dc_pinstraps_audio & 0x2) {
 			aud_support->hdmi_audio_on_dongle = true;
-			aud_support->dp_audio = true;
-		} else {
-			aud_support->dp_audio = true;
+			aud_support->hdmi_audio_native = true;
 		}
 	}
 
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +14 -8
index a73228b97da5..7bb2eaf07da5 100644
@@ -327,13 +327,14 @@ static bool dce_clock_set_min_clocks_state(
 	return true;
 }
 
-static void dce_set_clock(
+static int dce_set_clock(
 	struct display_clock *clk,
 	int requested_clk_khz)
 {
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 	struct bp_pixel_clock_parameters pxl_clk_params = { 0 };
 	struct dc_bios *bp = clk->ctx->dc_bios;
+	int actual_clock = requested_clk_khz;
 
 	/* Make sure requested clock isn't lower than minimum threshold*/
 	if (requested_clk_khz > 0)
@@ -351,15 +352,17 @@ static void dce_set_clock(
 		/* Cache the fixed display clock*/
 		clk_dce->dfs_bypass_disp_clk =
 			pxl_clk_params.dfs_bypass_display_clock;
+		actual_clock = pxl_clk_params.dfs_bypass_display_clock;
 	}
 
 	/* from power down, we need mark the clock state as ClocksStateNominal
 	 * from HWReset, so when resume we will call pplib voltage regulator.*/
 	if (requested_clk_khz == 0)
 		clk->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
+	return actual_clock;
 }
 
-static void dce_psr_set_clock(
+static int dce_psr_set_clock(
 	struct display_clock *clk,
 	int requested_clk_khz)
 {
@@ -367,13 +370,15 @@ static void dce_psr_set_clock(
 	struct dc_context *ctx = clk_dce->base.ctx;
 	struct core_dc *core_dc = DC_TO_CORE(ctx->dc);
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
+	int actual_clk_khz = requested_clk_khz;
 
-	dce_set_clock(clk, requested_clk_khz);
+	actual_clk_khz = dce_set_clock(clk, requested_clk_khz);
 
-	dmcu->funcs->set_psr_wait_loop(dmcu, requested_clk_khz / 1000 / 7);
+	dmcu->funcs->set_psr_wait_loop(dmcu, actual_clk_khz / 1000 / 7);
+	return actual_clk_khz;
 }
 
-static void dce112_set_clock(
+static int dce112_set_clock(
 	struct display_clock *clk,
 	int requested_clk_khz)
 {
@@ -383,7 +388,7 @@ static void dce112_set_clock(
 	struct core_dc *core_dc = DC_TO_CORE(clk->ctx->dc);
 	struct abm *abm =  core_dc->res_pool->abm;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
-
+	int actual_clock = requested_clk_khz;
 	/* Prepare to program display clock*/
 	memset(&dce_clk_params, 0, sizeof(dce_clk_params));
 
@@ -397,6 +402,7 @@ static void dce112_set_clock(
 	dce_clk_params.clock_type = DCECLOCK_TYPE_DISPLAY_CLOCK;
 
 	bp->funcs->set_dce_clock(bp, &dce_clk_params);
+	actual_clock = dce_clk_params.target_clock_frequency;
 
 	/* from power down, we need mark the clock state as ClocksStateNominal
 	 * from HWReset, so when resume we will call pplib voltage regulator.*/
@@ -415,8 +421,8 @@ static void dce112_set_clock(
 
 	if (abm->funcs->is_dmcu_initialized(abm))
 		dmcu->funcs->set_psr_wait_loop(dmcu,
-				requested_clk_khz / 1000 / 7);
-
+				actual_clock / 1000 / 7);
+	return actual_clock;
 }
 
 static void dce_clock_read_integrated_info(struct dce_disp_clk *clk_dce)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +2 -0
index 7e9afab8fca0..0dab5bacde3c 100644
@@ -1288,6 +1288,8 @@ void dce110_link_encoder_disable_output(
 		/* OF_SKIP_POWER_DOWN_INACTIVE_ENCODER */
 		return;
 	}
+	if (enc110->base.connector.id == CONNECTOR_ID_EDP)
+		dce110_link_encoder_edp_backlight_control(enc, false);
 	/* Power-down RX and disable GPU PHY should be paired.
 	 * Disabling PHY without powering down RX may cause
 	 * symbol lock loss, on which we will get DP Sink interrupt. */
drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h +1 -1
index 879c3db7cba6..f5f69cd81f6f 100644
@@ -62,7 +62,7 @@ struct display_clock {
 };
 
 struct display_clock_funcs {
-	void (*set_clock)(struct display_clock *disp_clk,
+	int (*set_clock)(struct display_clock *disp_clk,
 		int requested_clock_khz);
 
 	enum dm_pp_clocks_state (*get_required_clocks_state)(
Signature · 6 lines
2.11.0

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

PATCH 8/77 drm/amd/display: Use function pointer for update_plane_addr

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c         | 2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c     | 1 +
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index 2453d36aeaf3..f6fb19a8e934 100644
@@ -132,7 +132,7 @@ struct resource_pool *dc_create_resource_pool(
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 	case DCN_VERSION_1_0:
 		res_pool = dcn10_create_resource_pool(
-			num_virtual_links, dc);
+				num_virtual_links, dc);
 		break;
 #endif
 
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +1 -0
index cc707bd615dc..922af2d1b91a 100644
@@ -615,6 +615,7 @@ static uint32_t dce110_get_pll_pixel_rate_in_hz(
 
 	/* This function need separate to different DCE version, before separate, just use pixel clock */
 	return pipe_ctx->stream->phy_pix_clk;
+
 }
 
 static uint32_t dce110_get_dp_pixel_rate_from_combo_phy_pll(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -3
index 7b943e1837ce..184627c8685e 100644
@@ -1246,7 +1246,7 @@ static void toggle_watermark_change_req(struct dce_hwseq *hws)
 			DCHUBBUB_ARB_WATERMARK_CHANGE_REQUEST, watermark_change_req);
 }
 
-static void update_plane_addr(const struct core_dc *dc, struct pipe_ctx *pipe_ctx)
+static void dcn10_update_plane_addr(const struct core_dc *dc, struct pipe_ctx *pipe_ctx)
 {
 	bool addr_patched = false;
 	PHYSICAL_ADDRESS_LOC addr;
@@ -2115,7 +2115,7 @@ static void update_dchubp_dpp(
 	 */
 	REG_UPDATE(DCHUBP_CNTL[pipe_ctx->pipe_idx], HUBP_VTG_SEL, pipe_ctx->stream_res.tg->inst);
 
-	update_plane_addr(dc, pipe_ctx);
+	dc->hwss.update_plane_addr(dc, pipe_ctx);
 
 	mi->funcs->mem_input_setup(
 		mi,
@@ -2687,7 +2687,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = {
 	.apply_ctx_to_hw = dce110_apply_ctx_to_hw,
 	.apply_ctx_for_surface = dcn10_apply_ctx_for_surface,
 	.set_plane_config = set_plane_config,
-	.update_plane_addr = update_plane_addr,
+	.update_plane_addr = dcn10_update_plane_addr,
 	.update_dchub = dcn10_update_dchub,
 	.update_pending_status = dcn10_update_pending_status,
 	.set_input_transfer_func = dcn10_set_input_transfer_func,
Signature · 6 lines
2.11.0

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

PATCH 9/77 drm/amd/display: Flattening core_dc to dc

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

-Flattening core_dc to dc

---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |  73 +++++-----
 drivers/gpu/drm/amd/display/dc/core/dc.c           | 162 ++++++++++-----------
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c     |  20 +--
 .../gpu/drm/amd/display/dc/core/dc_hw_sequencer.c  |   3 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |  19 ++-
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   1 -
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  22 +--
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |  14 +-
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c   |  10 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  71 +++++++--
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   5 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    |  10 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c     |   4 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h     |   2 +-
 .../amd/display/dc/dce100/dce100_hw_sequencer.c    |   9 +-
 .../amd/display/dc/dce100/dce100_hw_sequencer.h    |   6 +-
 .../drm/amd/display/dc/dce100/dce100_resource.c    |  22 +--
 .../drm/amd/display/dc/dce100/dce100_resource.h    |   4 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  72 ++++-----
 .../amd/display/dc/dce110/dce110_hw_sequencer.h    |  12 +-
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  26 ++--
 .../drm/amd/display/dc/dce110/dce110_resource.h    |   4 +-
 .../amd/display/dc/dce112/dce112_hw_sequencer.c    |   5 +-
 .../amd/display/dc/dce112/dce112_hw_sequencer.h    |   4 +-
 .../drm/amd/display/dc/dce112/dce112_resource.c    |  26 ++--
 .../drm/amd/display/dc/dce112/dce112_resource.h    |  10 +-
 .../amd/display/dc/dce120/dce120_hw_sequencer.c    |   5 +-
 .../amd/display/dc/dce120/dce120_hw_sequencer.h    |   4 +-
 .../drm/amd/display/dc/dce120/dce120_resource.c    |  18 +--
 .../drm/amd/display/dc/dce120/dce120_resource.h    |   4 +-
 .../drm/amd/display/dc/dce80/dce80_hw_sequencer.c  |   5 +-
 .../drm/amd/display/dc/dce80/dce80_hw_sequencer.h  |   4 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |  46 +++---
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.h  |   8 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c   |   1 -
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 108 +++++++-------
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h  |   4 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |  34 ++---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.h  |   4 +-
 drivers/gpu/drm/amd/display/dc/inc/core_dc.h       |  55 -------
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   8 +-
 drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h     |   2 +-
 drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h     |  12 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h  |   1 +
 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h  |  50 ++++---
 drivers/gpu/drm/amd/display/dc/inc/resource.h      |  15 +-
 .../amd/display/dc/irq/dce110/irq_service_dce110.c |   6 +-
 .../amd/display/dc/irq/dce80/irq_service_dce80.c   |   1 -
 .../gpu/drm/amd/display/include/logger_interface.h |  10 +-
 .../drm/amd/display/modules/freesync/freesync.c    |  11 +-
 51 files changed, 507 insertions(+), 527 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/inc/core_dc.h
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +36 -37
index 6fb1b9a91993..f0dfd3c3c12c 100644
@@ -27,7 +27,6 @@
 #include "dcn_calcs.h"
 #include "dcn_calc_auto.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "dal_asic_id.h"
 
 #include "resource.h"
@@ -399,7 +398,7 @@ static void pipe_ctx_to_e2e_pipe_params (
 }
 
 static void dcn_bw_calc_rq_dlg_ttu(
-		const struct core_dc *dc,
+		const struct dc *dc,
 		const struct dcn_bw_internal_vars *v,
 		struct pipe_ctx *pipe,
 		int in_idx)
@@ -674,45 +673,45 @@ static void calc_wm_sets_and_perf_params(
 		context->bw.dcn.watermarks.d = context->bw.dcn.watermarks.a;
 }
 
-static bool dcn_bw_apply_registry_override(struct core_dc *dc)
+static bool dcn_bw_apply_registry_override(struct dc *dc)
 {
 	bool updated = false;
 
 	kernel_fpu_begin();
-	if ((int)(dc->dcn_soc->sr_exit_time * 1000) != dc->public.debug.sr_exit_time_ns
-			&& dc->public.debug.sr_exit_time_ns) {
+	if ((int)(dc->dcn_soc->sr_exit_time * 1000) != dc->debug.sr_exit_time_ns
+			&& dc->debug.sr_exit_time_ns) {
 		updated = true;
-		dc->dcn_soc->sr_exit_time = dc->public.debug.sr_exit_time_ns / 1000.0;
+		dc->dcn_soc->sr_exit_time = dc->debug.sr_exit_time_ns / 1000.0;
 	}
 
 	if ((int)(dc->dcn_soc->sr_enter_plus_exit_time * 1000)
-				!= dc->public.debug.sr_enter_plus_exit_time_ns
-			&& dc->public.debug.sr_enter_plus_exit_time_ns) {
+				!= dc->debug.sr_enter_plus_exit_time_ns
+			&& dc->debug.sr_enter_plus_exit_time_ns) {
 		updated = true;
 		dc->dcn_soc->sr_enter_plus_exit_time =
-				dc->public.debug.sr_enter_plus_exit_time_ns / 1000.0;
+				dc->debug.sr_enter_plus_exit_time_ns / 1000.0;
 	}
 
-	if ((int)(dc->dcn_soc->urgent_latency * 1000) != dc->public.debug.urgent_latency_ns
-			&& dc->public.debug.urgent_latency_ns) {
+	if ((int)(dc->dcn_soc->urgent_latency * 1000) != dc->debug.urgent_latency_ns
+			&& dc->debug.urgent_latency_ns) {
 		updated = true;
-		dc->dcn_soc->urgent_latency = dc->public.debug.urgent_latency_ns / 1000.0;
+		dc->dcn_soc->urgent_latency = dc->debug.urgent_latency_ns / 1000.0;
 	}
 
 	if ((int)(dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency * 1000)
-				!= dc->public.debug.percent_of_ideal_drambw
-			&& dc->public.debug.percent_of_ideal_drambw) {
+				!= dc->debug.percent_of_ideal_drambw
+			&& dc->debug.percent_of_ideal_drambw) {
 		updated = true;
 		dc->dcn_soc->percent_of_ideal_drambw_received_after_urg_latency =
-				dc->public.debug.percent_of_ideal_drambw;
+				dc->debug.percent_of_ideal_drambw;
 	}
 
 	if ((int)(dc->dcn_soc->dram_clock_change_latency * 1000)
-				!= dc->public.debug.dram_clock_change_latency_ns
-			&& dc->public.debug.dram_clock_change_latency_ns) {
+				!= dc->debug.dram_clock_change_latency_ns
+			&& dc->debug.dram_clock_change_latency_ns) {
 		updated = true;
 		dc->dcn_soc->dram_clock_change_latency =
-				dc->public.debug.dram_clock_change_latency_ns / 1000.0;
+				dc->debug.dram_clock_change_latency_ns / 1000.0;
 	}
 	kernel_fpu_end();
 
@@ -720,7 +719,7 @@ static bool dcn_bw_apply_registry_override(struct core_dc *dc)
 }
 
 bool dcn_validate_bandwidth(
-		const struct core_dc *dc,
+		struct dc *dc,
 		struct validate_context *context)
 {
 	const struct resource_pool *pool = dc->res_pool;
@@ -730,8 +729,8 @@ bool dcn_validate_bandwidth(
 	bool bw_limit_pass;
 	float bw_limit;
 
-	if (dcn_bw_apply_registry_override(DC_TO_CORE(&dc->public)))
-		dcn_bw_sync_calcs_and_dml(DC_TO_CORE(&dc->public));
+	if (dcn_bw_apply_registry_override(dc))
+		dcn_bw_sync_calcs_and_dml(dc);
 
 	memset(v, 0, sizeof(*v));
 	kernel_fpu_begin();
@@ -850,7 +849,7 @@ bool dcn_validate_bandwidth(
 	v->phyclk_per_state[1] = v->phyclkv_mid0p72;
 	v->phyclk_per_state[0] = v->phyclkv_min0p65;
 
-	if (dc->public.debug.disable_pipe_split) {
+	if (dc->debug.disable_pipe_split) {
 		v->max_dispclk[0] = v->max_dppclk_vmin0p65;
 	}
 
@@ -982,15 +981,15 @@ bool dcn_validate_bandwidth(
 	mode_support_and_system_configuration(v);
 
 	if (v->voltage_level == 0 &&
-			(dc->public.debug.sr_exit_time_dpm0_ns
-				|| dc->public.debug.sr_enter_plus_exit_time_dpm0_ns)) {
-		struct core_dc *dc_core = DC_TO_CORE(&dc->public);
+			(dc->debug.sr_exit_time_dpm0_ns
+				|| dc->debug.sr_enter_plus_exit_time_dpm0_ns)) {
+		struct dc *dc_core = dc;
 
-		if (dc->public.debug.sr_enter_plus_exit_time_dpm0_ns)
+		if (dc->debug.sr_enter_plus_exit_time_dpm0_ns)
 			v->sr_enter_plus_exit_time =
-				dc->public.debug.sr_enter_plus_exit_time_dpm0_ns / 1000.0f;
-		if (dc->public.debug.sr_exit_time_dpm0_ns)
-			v->sr_exit_time =  dc->public.debug.sr_exit_time_dpm0_ns / 1000.0f;
+				dc->debug.sr_enter_plus_exit_time_dpm0_ns / 1000.0f;
+		if (dc->debug.sr_exit_time_dpm0_ns)
+			v->sr_exit_time =  dc->debug.sr_exit_time_dpm0_ns / 1000.0f;
 		dc_core->dml.soc.sr_enter_plus_exit_time_us = v->sr_enter_plus_exit_time;
 		dc_core->dml.soc.sr_exit_time_us = v->sr_exit_time;
 		mode_support_and_system_configuration(v);
@@ -1020,7 +1019,7 @@ bool dcn_validate_bandwidth(
 		context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz = (int)(v->dcf_clk_deep_sleep * 1000);
 		context->bw.dcn.calc_clk.dcfclk_khz = (int)(v->dcfclk * 1000);
 		context->bw.dcn.calc_clk.dispclk_khz = (int)(v->dispclk * 1000);
-		if (dc->public.debug.max_disp_clk == true)
+		if (dc->debug.max_disp_clk == true)
 			context->bw.dcn.calc_clk.dispclk_khz = (int)(dc->dcn_soc->max_dispclk_vmax0p9 * 1000);
 		context->bw.dcn.calc_clk.dppclk_div = (int)(v->dispclk_dppclk_ratio) == 2;
 
@@ -1109,13 +1108,13 @@ bool dcn_validate_bandwidth(
 
 			input_idx++;
 		}
-		if (dc->public.debug.use_dml_wm)
+		if (dc->debug.use_dml_wm)
 			dcn_dml_wm_override(v, (struct display_mode_lib *)
 					&dc->dml, context, pool);
 	}
 
 	if (v->voltage_level == 0) {
-		struct core_dc *dc_core = DC_TO_CORE(&dc->public);
+		struct dc *dc_core = dc;
 
 		dc_core->dml.soc.sr_enter_plus_exit_time_us =
 				dc_core->dcn_soc->sr_enter_plus_exit_time;
@@ -1138,7 +1137,7 @@ bool dcn_validate_bandwidth(
 }
 
 unsigned int dcn_find_normalized_clock_vdd_Level(
-	const struct core_dc *dc,
+	const struct dc *dc,
 	enum dm_pp_clock_type clocks_type,
 	int clocks_in_khz)
 {
@@ -1228,7 +1227,7 @@ unsigned int dcn_find_normalized_clock_vdd_Level(
 }
 
 unsigned int dcn_find_dcfclk_suits_all(
-	const struct core_dc *dc,
+	const struct dc *dc,
 	struct clocks_value *clocks)
 {
 	unsigned vdd_level, vdd_level_temp;
@@ -1270,7 +1269,7 @@ unsigned int dcn_find_dcfclk_suits_all(
 	return dcf_clk;
 }
 
-void dcn_bw_update_from_pplib(struct core_dc *dc)
+void dcn_bw_update_from_pplib(struct dc *dc)
 {
 	struct dc_context *ctx = dc->ctx;
 	struct dm_pp_clock_levels_with_voltage clks = {0};
@@ -1310,7 +1309,7 @@ void dcn_bw_update_from_pplib(struct core_dc *dc)
 	kernel_fpu_end();
 }
 
-void dcn_bw_notify_pplib_of_wm_ranges(struct core_dc *dc)
+void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc)
 {
 	struct dm_pp_wm_sets_with_clock_ranges_soc15 clk_ranges = {0};
 	int max_fclk_khz, nom_fclk_khz, min_fclk_khz, max_dcfclk_khz,
@@ -1388,7 +1387,7 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct core_dc *dc)
 	dm_pp_notify_wm_clock_changes_soc15(dc->ctx, &clk_ranges);
 }
 
-void dcn_bw_sync_calcs_and_dml(struct core_dc *dc)
+void dcn_bw_sync_calcs_and_dml(struct dc *dc)
 {
 	kernel_fpu_begin();
 	dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
drivers/gpu/drm/amd/display/dc/core/dc.c +81 -81

528 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc_debug.c +10 -10
index 21af3bc057c7..d74eed8f9b96 100644
@@ -37,12 +37,12 @@
 } while (0)
 
 void pre_surface_trace(
-		const struct dc *dc,
+		struct dc *dc,
 		const struct dc_plane_state *const *plane_states,
 		int surface_count)
 {
 	int i;
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 
 	for (i = 0; i < surface_count; i++) {
@@ -158,12 +158,12 @@ void pre_surface_trace(
 }
 
 void update_surface_trace(
-		const struct dc *dc,
+		struct dc *dc,
 		const struct dc_surface_update *updates,
 		int surface_count)
 {
 	int i;
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 
 	for (i = 0; i < surface_count; i++) {
@@ -279,9 +279,9 @@ void update_surface_trace(
 	SURFACE_TRACE("\n");
 }
 
-void post_surface_trace(const struct dc *dc)
+void post_surface_trace(struct dc *dc)
 {
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 
 	SURFACE_TRACE("post surface process.\n");
@@ -289,11 +289,11 @@ void post_surface_trace(const struct dc *dc)
 }
 
 void context_timing_trace(
-		const struct dc *dc,
+		struct dc *dc,
 		struct resource_context *res_ctx)
 {
 	int i;
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 	int h_pos[MAX_PIPES], v_pos[MAX_PIPES];
 	struct crtc_position position;
@@ -328,11 +328,11 @@ void context_timing_trace(
 }
 
 void context_clock_trace(
-		const struct dc *dc,
+		struct dc *dc,
 		struct validate_context *context)
 {
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc  *core_dc = dc;
 	struct dal_logger *logger =  core_dc->ctx->logger;
 
 	CLOCK_TRACE("Current: dispclk_khz:%d  dppclk_div:%d  dcfclk_khz:%d\n"
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1 -2
index 7b1f2493cbc9..71993d5983bf 100644
@@ -25,7 +25,6 @@
 
 #include "dm_services.h"
 #include "core_types.h"
-#include "core_dc.h"
 #include "timing_generator.h"
 #include "hw_sequencer.h"
 
@@ -55,7 +54,7 @@ static const struct tg_color black_color_format[] = {
 };
 
 void color_space_to_black_color(
-	const struct core_dc *dc,
+	const struct dc *dc,
 	enum dc_color_space colorspace,
 	struct tg_color *black_color)
 {
drivers/gpu/drm/amd/display/dc/core/dc_link.c +9 -10
index b858fec72bd7..1888bf4d2c3f 100644
@@ -26,14 +26,13 @@
 #include "dm_services.h"
 #include "dm_helpers.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "grph_object_id.h"
 #include "gpio_service_interface.h"
 #include "core_status.h"
 #include "dc_link_dp.h"
 #include "dc_link_ddc.h"
 #include "link_hwss.h"
-#include "stream_encoder.h"
+
 #include "link_encoder.h"
 #include "hw_sequencer.h"
 #include "resource.h"
@@ -1392,7 +1391,7 @@ enum dc_status dc_link_validate_mode_timing(
 bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
 		uint32_t frame_ramp, const struct dc_stream_state *stream)
 {
-	struct core_dc *core_dc = DC_TO_CORE(link->ctx->dc);
+	struct dc  *core_dc = link->ctx->dc;
 	struct abm *abm = core_dc->res_pool->abm;
 	unsigned int controller_id = 0;
 	int i;
@@ -1431,7 +1430,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
 
 bool dc_link_set_abm_disable(const struct dc_link *link)
 {
-	struct core_dc *core_dc = DC_TO_CORE(link->ctx->dc);
+	struct dc  *core_dc = link->ctx->dc;
 	struct abm *abm = core_dc->res_pool->abm;
 
 	if ((abm == NULL) || (abm->funcs->set_backlight_level == NULL))
@@ -1445,7 +1444,7 @@ bool dc_link_set_abm_disable(const struct dc_link *link)
 
 bool dc_link_set_psr_enable(const struct dc_link *link, bool enable)
 {
-	struct core_dc *core_dc = DC_TO_CORE(link->ctx->dc);
+	struct dc  *core_dc = link->ctx->dc;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
 
 	if (dmcu != NULL && link->psr_enabled)
@@ -1456,7 +1455,7 @@ bool dc_link_set_psr_enable(const struct dc_link *link, bool enable)
 
 bool dc_link_get_psr_state(const struct dc_link *link, uint32_t *psr_state)
 {
-	struct core_dc *core_dc = DC_TO_CORE(link->ctx->dc);
+	struct dc  *core_dc = link->ctx->dc;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
 
 	if (dmcu != NULL && link->psr_enabled)
@@ -1469,7 +1468,7 @@ bool dc_link_setup_psr(struct dc_link *link,
 		const struct dc_stream_state *stream, struct psr_config *psr_config,
 		struct psr_context *psr_context)
 {
-	struct core_dc *core_dc = DC_TO_CORE(link->ctx->dc);
+	struct dc  *core_dc = link->ctx->dc;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
 	int i;
 
@@ -1874,7 +1873,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 
 void core_link_enable_stream(struct pipe_ctx *pipe_ctx)
 {
-	struct core_dc *core_dc = DC_TO_CORE(pipe_ctx->stream->ctx->dc);
+	struct dc  *core_dc = pipe_ctx->stream->ctx->dc;
 
 	enum dc_status status = enable_link(pipe_ctx);
 
@@ -1907,7 +1906,7 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx)
 
 void core_link_disable_stream(struct pipe_ctx *pipe_ctx)
 {
-	struct core_dc *core_dc = DC_TO_CORE(pipe_ctx->stream->ctx->dc);
+	struct dc  *core_dc = pipe_ctx->stream->ctx->dc;
 
 	if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
 		deallocate_mst_payload(pipe_ctx);
@@ -1919,7 +1918,7 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx)
 
 void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
 {
-	struct core_dc *core_dc = DC_TO_CORE(pipe_ctx->stream->ctx->dc);
+	struct dc  *core_dc = pipe_ctx->stream->ctx->dc;
 
 	if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
 		return;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +0 -1
index 9d5fe658d14c..0144c98fd0d5 100644
@@ -10,7 +10,6 @@
 #include "core_status.h"
 #include "dpcd_defs.h"
 
-#include "core_dc.h"
 #include "resource.h"
 
 /* maximum pre emphasis level allowed for each voltage swing level*/
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +1 -1
index d19c663c257f..da880bd02ad7 100644
@@ -3,7 +3,7 @@
 
 #include "dm_services.h"
 #include "dc.h"
-#include "inc/core_dc.h"
+#include "inc/core_types.h"
 #include "include/ddc_service_types.h"
 #include "include/i2caux_interface.h"
 #include "link_hwss.h"
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +11 -11
index f6fb19a8e934..e3cf519a6e41 100644
@@ -92,7 +92,7 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
 }
 
 struct resource_pool *dc_create_resource_pool(
-				struct core_dc *dc,
+				struct dc  *dc,
 				int num_virtual_links,
 				enum dce_version dc_version,
 				struct hw_asic_id asic_id)
@@ -153,7 +153,7 @@ struct resource_pool *dc_create_resource_pool(
 	return res_pool;
 }
 
-void dc_destroy_resource_pool(struct core_dc *dc)
+void dc_destroy_resource_pool(struct dc  *dc)
 {
 	if (dc) {
 		if (dc->res_pool)
@@ -193,7 +193,7 @@ static void update_num_audio(
 
 bool resource_construct(
 	unsigned int num_virtual_links,
-	struct core_dc *dc,
+	struct dc  *dc,
 	struct resource_pool *pool,
 	const struct resource_create_funcs *create_funcs)
 {
@@ -892,7 +892,7 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 
 
 enum dc_status resource_build_scaling_params_for_context(
-	const struct core_dc *dc,
+	const struct dc  *dc,
 	struct validate_context *context)
 {
 	int i;
@@ -1438,7 +1438,7 @@ static void calculate_phy_pix_clks(struct dc_stream_state *stream)
 }
 
 enum dc_status resource_map_pool_resources(
-		const struct core_dc *dc,
+		const struct dc  *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -2316,7 +2316,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 }
 
 enum dc_status resource_map_clock_resources(
-		const struct core_dc *dc,
+		const struct dc  *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -2343,7 +2343,7 @@ enum dc_status resource_map_clock_resources(
 			else {
 				pipe_ctx->clock_source = NULL;
 
-				if (!dc->public.config.disable_disp_pll_sharing)
+				if (!dc->config.disable_disp_pll_sharing)
 					resource_find_used_clk_src_for_sharing(
 						&context->res_ctx,
 						pipe_ctx);
@@ -2515,9 +2515,9 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
 	fmt_bit_depth->pixel_encoding = pixel_encoding;
 }
 
-bool dc_validate_stream(const struct dc *dc, struct dc_stream_state *stream)
+bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
 {
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc  *core_dc = dc;
 	struct dc_context *dc_ctx = core_dc->ctx;
 	struct dc_link *link = stream->sink->link;
 	struct timing_generator *tg = core_dc->res_pool->timing_generators[0];
@@ -2547,9 +2547,9 @@ bool dc_validate_stream(const struct dc *dc, struct dc_stream_state *stream)
 	return res == DC_OK;
 }
 
-bool dc_validate_plane(const struct dc *dc, const struct dc_plane_state *plane_state)
+bool dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state)
 {
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc *core_dc = dc;
 
 	/* TODO For now validates pixel format only */
 	if (core_dc->res_pool->funcs->validate_plane)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +7 -7
index 47e407dab4a3..5e4f7f08e3db 100644
@@ -144,7 +144,7 @@ struct dc_stream_status *dc_stream_get_status(
 	struct dc_stream_state *stream)
 {
 	uint8_t i;
-	struct core_dc *dc = DC_TO_CORE(stream->ctx->dc);
+	struct dc  *dc = stream->ctx->dc;
 
 	for (i = 0; i < dc->current_context->stream_count; i++) {
 		if (stream == dc->current_context->streams[i]) {
@@ -163,7 +163,7 @@ bool dc_stream_set_cursor_attributes(
 	const struct dc_cursor_attributes *attributes)
 {
 	int i;
-	struct core_dc *core_dc;
+	struct dc  *core_dc;
 	struct resource_context *res_ctx;
 
 	if (NULL == stream) {
@@ -175,7 +175,7 @@ bool dc_stream_set_cursor_attributes(
 			return false;
 	}
 
-	core_dc = DC_TO_CORE(stream->ctx->dc);
+	core_dc = stream->ctx->dc;
 	res_ctx = &core_dc->current_context->res_ctx;
 
 	for (i = 0; i < MAX_PIPES; i++) {
@@ -198,7 +198,7 @@ bool dc_stream_set_cursor_position(
 	const struct dc_cursor_position *position)
 {
 	int i;
-	struct core_dc *core_dc;
+	struct dc  *core_dc;
 	struct resource_context *res_ctx;
 
 	if (NULL == stream) {
@@ -211,7 +211,7 @@ bool dc_stream_set_cursor_position(
 		return false;
 	}
 
-	core_dc = DC_TO_CORE(stream->ctx->dc);
+	core_dc = stream->ctx->dc;
 	res_ctx = &core_dc->current_context->res_ctx;
 
 	for (i = 0; i < MAX_PIPES; i++) {
@@ -246,7 +246,7 @@ bool dc_stream_set_cursor_position(
 uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
 {
 	uint8_t i;
-	struct core_dc *core_dc = DC_TO_CORE(stream->ctx->dc);
+	struct dc  *core_dc = stream->ctx->dc;
 	struct resource_context *res_ctx =
 		&core_dc->current_context->res_ctx;
 
@@ -270,7 +270,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
 {
 	uint8_t i;
 	bool ret = false;
-	struct core_dc *core_dc = DC_TO_CORE(stream->ctx->dc);
+	struct dc  *core_dc = stream->ctx->dc;
 	struct resource_context *res_ctx =
 		&core_dc->current_context->res_ctx;
 
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +5 -5
index da19c7fa5151..0b6410fb2f3e 100644
@@ -28,7 +28,7 @@
 #include "dc.h"
 
 /* DC core (private) */
-#include "core_dc.h"
+#include "core_types.h"
 #include "transform.h"
 
 /*******************************************************************************
@@ -64,9 +64,9 @@ void enable_surface_flip_reporting(struct dc_plane_state *plane_state,
 	/*register_flip_interrupt(surface);*/
 }
 
-struct dc_plane_state *dc_create_plane_state(const struct dc *dc)
+struct dc_plane_state *dc_create_plane_state(struct dc *dc)
 {
-	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dc *core_dc = dc;
 
 	struct dc_plane_state *plane_state = dm_alloc(sizeof(*plane_state));
 
@@ -91,7 +91,7 @@ const struct dc_plane_status *dc_plane_get_status(
 		const struct dc_plane_state *plane_state)
 {
 	const struct dc_plane_status *plane_status;
-	struct core_dc *core_dc;
+	struct dc  *core_dc;
 	int i;
 
 	if (!plane_state ||
@@ -102,7 +102,7 @@ const struct dc_plane_status *dc_plane_get_status(
 	}
 
 	plane_status = &plane_state->status;
-	core_dc = DC_TO_CORE(plane_state->ctx->dc);
+	core_dc = plane_state->ctx->dc;
 
 	if (core_dc->current_context == NULL)
 		return NULL;
drivers/gpu/drm/amd/display/dc/dc.h +56 -15

156 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +2 -3
index 922af2d1b91a..0654fe34627c 100644
@@ -34,7 +34,6 @@
 
 #include "dce_clock_source.h"
 
-#include "core_dc.h"
 #include "reg_helper.h"
 
 #define REG(reg)\
@@ -609,7 +608,7 @@ static uint32_t dce110_get_pll_pixel_rate_in_hz(
 	struct pll_settings *pll_settings)
 {
 	uint32_t inst = pix_clk_params->controller_id - CONTROLLER_ID_D0;
-	struct core_dc *dc_core = DC_TO_CORE(cs->ctx->dc);
+	struct dc *dc_core = cs->ctx->dc;
 	struct validate_context *context = dc_core->current_context;
 	struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[inst];
 
@@ -624,7 +623,7 @@ static uint32_t dce110_get_dp_pixel_rate_from_combo_phy_pll(
 	struct pll_settings *pll_settings)
 {
 	uint32_t inst = pix_clk_params->controller_id - CONTROLLER_ID_D0;
-	struct core_dc *dc_core = DC_TO_CORE(cs->ctx->dc);
+	struct dc *dc_core = cs->ctx->dc;
 	struct validate_context *context = dc_core->current_context;
 	struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[inst];
 
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +4 -6
index 7bb2eaf07da5..9d67340a6b8b 100644
@@ -29,14 +29,12 @@
 #include "fixed32_32.h"
 #include "bios_parser_interface.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "dce_abm.h"
 #include "dmcu.h"
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 #include "dcn_calcs.h"
-#include "core_dc.h"
 #endif
-
+#include "core_types.h"
 
 
 #define TO_DCE_CLOCKS(clocks)\
@@ -368,7 +366,7 @@ static int dce_psr_set_clock(
 {
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 	struct dc_context *ctx = clk_dce->base.ctx;
-	struct core_dc *core_dc = DC_TO_CORE(ctx->dc);
+	struct dc *core_dc = ctx->dc;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
 	int actual_clk_khz = requested_clk_khz;
 
@@ -385,7 +383,7 @@ static int dce112_set_clock(
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 	struct bp_set_dce_clock_parameters dce_clk_params;
 	struct dc_bios *bp = clk->ctx->dc_bios;
-	struct core_dc *core_dc = DC_TO_CORE(clk->ctx->dc);
+	struct dc *core_dc = clk->ctx->dc;
 	struct abm *abm =  core_dc->res_pool->abm;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
 	int actual_clock = requested_clk_khz;
@@ -621,7 +619,7 @@ static bool dce_apply_clock_voltage_request(
 	if (send_request) {
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 		if (clk->ctx->dce_version >= DCN_VERSION_1_0) {
-			struct core_dc *core_dc = DC_TO_CORE(clk->ctx->dc);
+			struct dc *core_dc = clk->ctx->dc;
 			/*use dcfclk request voltage*/
 			clock_voltage_req.clk_type = DM_PP_CLOCK_TYPE_DCFCLK;
 			clock_voltage_req.clocks_in_khz =
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c +2 -2
index 4894e1755d84..d2e66b1bc0ef 100644
@@ -26,7 +26,7 @@
 #include "dce_hwseq.h"
 #include "reg_helper.h"
 #include "hw_sequencer.h"
-#include "core_dc.h"
+#include "core_types.h"
 
 #define CTX \
 	hws->ctx
@@ -44,7 +44,7 @@ void dce_enable_fe_clock(struct dce_hwseq *hws,
 			DCFE_CLOCK_ENABLE, enable);
 }
 
-void dce_pipe_control_lock(struct core_dc *dc,
+void dce_pipe_control_lock(struct dc *dc,
 		struct pipe_ctx *pipe,
 		bool lock)
 {
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +1 -1
index 9a97d8ee7971..3a1eb6a79d66 100644
@@ -528,7 +528,7 @@ enum blnd_mode {
 void dce_enable_fe_clock(struct dce_hwseq *hwss,
 		unsigned int inst, bool enable);
 
-void dce_pipe_control_lock(struct core_dc *dc,
+void dce_pipe_control_lock(struct dc *dc,
 		struct pipe_ctx *pipe,
 		bool lock);
 
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.c +4 -5
index c638f47acefc..b7e51c5ed1b1 100644
@@ -24,7 +24,6 @@
  */
 #include "dm_services.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "core_types.h"
 #include "hw_sequencer.h"
 #include "dce100_hw_sequencer.h"
@@ -71,7 +70,7 @@ static const struct dce100_hw_seq_reg_offsets reg_offsets[] = {
 /***************************PIPE_CONTROL***********************************/
 
 static bool dce100_enable_display_power_gating(
-	struct core_dc *dc,
+	struct dc *dc,
 	uint8_t controller_id,
 	struct dc_bios *dcb,
 	enum pipe_gating_control power_gating)
@@ -107,7 +106,7 @@ static bool dce100_enable_display_power_gating(
 }
 
 static void dce100_pplib_apply_display_requirements(
-	struct core_dc *dc,
+	struct dc *dc,
 	struct validate_context *context)
 {
 	struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
@@ -127,7 +126,7 @@ static void dce100_pplib_apply_display_requirements(
 }
 
 void dce100_set_bandwidth(
-		struct core_dc *dc,
+		struct dc *dc,
 		struct validate_context *context,
 		bool decrease_allowed)
 {
@@ -143,7 +142,7 @@ void dce100_set_bandwidth(
 
 /**************************************************************************/
 
-bool dce100_hw_sequencer_construct(struct core_dc *dc)
+bool dce100_hw_sequencer_construct(struct dc *dc)
 {
 	dce110_hw_sequencer_construct(dc);
 
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.h +3 -3
index 24433f0e770b..c04aa15cd656 100644
@@ -28,13 +28,13 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 struct validate_context;
 
-bool dce100_hw_sequencer_construct(struct core_dc *dc);
+bool dce100_hw_sequencer_construct(struct dc *dc);
 
 void dce100_set_bandwidth(
-		struct core_dc *dc,
+		struct dc *dc,
 		struct validate_context *context,
 		bool decrease_allowed);
 
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +11 -11
index 46f0c71fbac4..b2b03633eb4f 100644
@@ -652,7 +652,7 @@ static void destruct(struct dce110_resource_pool *pool)
 }
 
 static enum dc_status build_mapped_resource(
-		const struct core_dc *dc,
+		const struct dc  *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -688,7 +688,7 @@ static enum dc_status build_mapped_resource(
 }
 
 bool dce100_validate_bandwidth(
-	const struct core_dc *dc,
+	struct dc  *dc,
 	struct validate_context *context)
 {
 	/* TODO implement when needed but for now hardcode max value*/
@@ -720,7 +720,7 @@ static bool dce100_validate_surface_sets(
 }
 
 enum dc_status dce100_validate_with_context(
-		const struct core_dc *dc,
+		struct dc  *dc,
 		const struct dc_validation_set set[],
 		int set_count,
 		struct validate_context *context,
@@ -764,7 +764,7 @@ enum dc_status dce100_validate_with_context(
 }
 
 enum dc_status dce100_validate_guaranteed(
-		const struct core_dc *dc,
+		struct dc  *dc,
 		struct dc_stream_state *dc_stream,
 		struct validate_context *context)
 {
@@ -784,7 +784,7 @@ enum dc_status dce100_validate_guaranteed(
 
 	if (result == DC_OK) {
 		validate_guaranteed_copy_streams(
-				context, dc->public.caps.max_streams);
+				context, dc->caps.max_streams);
 		result = resource_build_scaling_params_for_context(dc, context);
 	}
 
@@ -824,7 +824,7 @@ static const struct resource_funcs dce100_res_pool_funcs = {
 
 static bool construct(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc  *dc,
 	struct dce110_resource_pool *pool)
 {
 	unsigned int i;
@@ -909,9 +909,9 @@ static bool construct(
 	*************************************************/
 	pool->base.underlay_pipe_index = NO_UNDERLAY_PIPE;
 	pool->base.pipe_count = res_cap.num_timing_generator;
-	dc->public.caps.max_downscale_ratio = 200;
-	dc->public.caps.i2c_speed_in_khz = 40;
-	dc->public.caps.max_cursor_size = 128;
+	dc->caps.max_downscale_ratio = 200;
+	dc->caps.i2c_speed_in_khz = 40;
+	dc->caps.max_cursor_size = 128;
 
 	for (i = 0; i < pool->base.pipe_count; i++) {
 		pool->base.timing_generators[i] =
@@ -958,7 +958,7 @@ static bool construct(
 		}
 	}
 
-	dc->public.caps.max_planes =  pool->base.pipe_count;
+	dc->caps.max_planes =  pool->base.pipe_count;
 
 	if (!resource_construct(num_virtual_links, dc, &pool->base,
 			&res_create_funcs))
@@ -978,7 +978,7 @@ static bool construct(
 
 struct resource_pool *dce100_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc)
+	struct dc  *dc)
 {
 	struct dce110_resource_pool *pool =
 		dm_alloc(sizeof(struct dce110_resource_pool));
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h +2 -2
index edc50caf04d1..ca7b2b7c1a48 100644
@@ -8,13 +8,13 @@
 #ifndef DCE100_RESOURCE_H_
 #define DCE100_RESOURCE_H_
 
-struct core_dc;
+struct dc;
 struct resource_pool;
 struct dc_validation_set;
 
 struct resource_pool *dce100_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc);
+	struct dc *dc);
 
 enum dc_status dce100_validate_plane(const struct dc_plane_state *plane_state);
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +36 -36

288 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +6 -6
index 89782ca1917f..d710f6e6dc07 100644
@@ -29,20 +29,20 @@
 #include "core_types.h"
 
 #define GAMMA_HW_POINTS_NUM 256
-struct core_dc;
+struct dc;
 struct validate_context;
 struct dm_pp_display_configuration;
 
-bool dce110_hw_sequencer_construct(struct core_dc *dc);
+bool dce110_hw_sequencer_construct(struct dc *dc);
 
 enum dc_status dce110_apply_ctx_to_hw(
-		struct core_dc *dc,
+		struct dc *dc,
 		struct validate_context *context);
 
 void dce110_set_display_clock(struct validate_context *context);
 
 void dce110_set_displaymarks(
-	const struct core_dc *dc,
+	const struct dc *dc,
 	struct validate_context *context);
 
 void dce110_enable_stream(struct pipe_ctx *pipe_ctx);
@@ -55,9 +55,9 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,
 void dce110_update_info_frame(struct pipe_ctx *pipe_ctx);
 
 void dce110_set_avmute(struct pipe_ctx *pipe_ctx, bool enable);
-void dce110_enable_accelerated_mode(struct core_dc *dc);
+void dce110_enable_accelerated_mode(struct dc *dc);
 
-void dce110_power_down(struct core_dc *dc);
+void dce110_power_down(struct dc *dc);
 
 void dce110_update_pending_status(struct pipe_ctx *pipe_ctx);
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +13 -13
index 56be84ce5a0d..2154c2e567f2 100644
@@ -772,7 +772,7 @@ static bool is_surface_pixel_format_supported(struct pipe_ctx *pipe_ctx, unsigne
 }
 
 static enum dc_status build_mapped_resource(
-		const struct core_dc *dc,
+		const struct dc *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -814,7 +814,7 @@ static enum dc_status build_mapped_resource(
 }
 
 static bool dce110_validate_bandwidth(
-	const struct core_dc *dc,
+	struct dc *dc,
 	struct validate_context *context)
 {
 	bool result = false;
@@ -928,7 +928,7 @@ static bool dce110_validate_surface_sets(
 }
 
 static enum dc_status dce110_validate_with_context(
-		const struct core_dc *dc,
+		struct dc *dc,
 		const struct dc_validation_set set[],
 		int set_count,
 		struct validate_context *context,
@@ -972,7 +972,7 @@ static enum dc_status dce110_validate_with_context(
 }
 
 static enum dc_status dce110_validate_guaranteed(
-		const struct core_dc *dc,
+		struct dc *dc,
 		struct dc_stream_state *dc_stream,
 		struct validate_context *context)
 {
@@ -992,7 +992,7 @@ static enum dc_status dce110_validate_guaranteed(
 
 	if (result == DC_OK) {
 		validate_guaranteed_copy_streams(
-				context, dc->public.caps.max_streams);
+				context, dc->caps.max_streams);
 		result = resource_build_scaling_params_for_context(dc, context);
 	}
 
@@ -1008,7 +1008,7 @@ static struct pipe_ctx *dce110_acquire_underlay(
 		const struct resource_pool *pool,
 		struct dc_stream_state *stream)
 {
-	struct core_dc *dc = DC_TO_CORE(stream->ctx->dc);
+	struct dc *dc = stream->ctx->dc;
 	struct resource_context *res_ctx = &context->res_ctx;
 	unsigned int underlay_idx = pool->underlay_pipe_index;
 	struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[underlay_idx];
@@ -1117,7 +1117,7 @@ static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool)
 	return true;
 }
 
-static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
+static void bw_calcs_data_update_from_pplib(struct dc *dc)
 {
 	struct dm_pp_clock_levels clks = {0};
 
@@ -1184,7 +1184,7 @@ const struct resource_caps *dce110_resource_cap(
 
 static bool construct(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc *dc,
 	struct dce110_resource_pool *pool,
 	struct hw_asic_id asic_id)
 {
@@ -1206,9 +1206,9 @@ static bool construct(
 	pool->base.pipe_count = pool->base.res_cap->num_timing_generator;
 	pool->base.underlay_pipe_index = pool->base.pipe_count;
 
-	dc->public.caps.max_downscale_ratio = 150;
-	dc->public.caps.i2c_speed_in_khz = 100;
-	dc->public.caps.max_cursor_size = 128;
+	dc->caps.max_downscale_ratio = 150;
+	dc->caps.i2c_speed_in_khz = 100;
+	dc->caps.max_cursor_size = 128;
 
 	/*************************************************
 	 *  Create resources                             *
@@ -1351,7 +1351,7 @@ static bool construct(
 	if (!dce110_hw_sequencer_construct(dc))
 		goto res_create_fail;
 
-	dc->public.caps.max_planes =  pool->base.pipe_count;
+	dc->caps.max_planes =  pool->base.pipe_count;
 
 	bw_calcs_init(dc->bw_dceip, dc->bw_vbios, dc->ctx->asic_id);
 
@@ -1366,7 +1366,7 @@ static bool construct(
 
 struct resource_pool *dce110_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc *dc,
 	struct hw_asic_id asic_id)
 {
 	struct dce110_resource_pool *pool =
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.h +2 -2
index 8e2e85dd30b9..5bb692d037d9 100644
@@ -28,7 +28,7 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 struct resource_pool;
 
 #define TO_DCE110_RES_POOL(pool)\
@@ -42,7 +42,7 @@ enum dc_status dce110_resource_build_pipe_hw_param(struct pipe_ctx *pipe_ctx);
 
 struct resource_pool *dce110_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc *dc,
 	struct hw_asic_id asic_id);
 
 #endif /* __DC_RESOURCE_DCE110_H__ */
drivers/gpu/drm/amd/display/dc/dce112/dce112_hw_sequencer.c +2 -3
index 204f613467b7..8816e09110e1 100644
@@ -25,7 +25,6 @@
 
 #include "dm_services.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "core_types.h"
 #include "dce112_hw_sequencer.h"
 
@@ -112,7 +111,7 @@ static void dce112_init_pte(struct dc_context *ctx)
 }
 
 static bool dce112_enable_display_power_gating(
-	struct core_dc *dc,
+	struct dc *dc,
 	uint8_t controller_id,
 	struct dc_bios *dcb,
 	enum pipe_gating_control power_gating)
@@ -153,7 +152,7 @@ static bool dce112_enable_display_power_gating(
 		return false;
 }
 
-bool dce112_hw_sequencer_construct(struct core_dc *dc)
+bool dce112_hw_sequencer_construct(struct dc *dc)
 {
 	/* All registers used by dce11.2 match those in dce11 in offset and
 	 * structure
drivers/gpu/drm/amd/display/dc/dce112/dce112_hw_sequencer.h +2 -2
index d96c582da45c..37bd60cc93f9 100644
@@ -28,9 +28,9 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 
-bool dce112_hw_sequencer_construct(struct core_dc *dc);
+bool dce112_hw_sequencer_construct(struct dc *dc);
 
 #endif /* __DC_HWSS_DCE112_H__ */
 
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +13 -13
index d6e58a25f3d0..89a8dfa68c01 100644
@@ -723,7 +723,7 @@ static struct clock_source *find_matching_pll(
 }
 
 static enum dc_status build_mapped_resource(
-		const struct core_dc *dc,
+		const struct dc *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -759,7 +759,7 @@ static enum dc_status build_mapped_resource(
 }
 
 bool dce112_validate_bandwidth(
-	const struct core_dc *dc,
+	struct dc *dc,
 	struct validate_context *context)
 {
 	bool result = false;
@@ -837,7 +837,7 @@ bool dce112_validate_bandwidth(
 }
 
 enum dc_status resource_map_phy_clock_resources(
-		const struct core_dc *dc,
+		const struct dc *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -904,7 +904,7 @@ static bool dce112_validate_surface_sets(
 }
 
 enum dc_status dce112_validate_with_context(
-		const struct core_dc *dc,
+		struct dc *dc,
 		const struct dc_validation_set set[],
 		int set_count,
 		struct validate_context *context,
@@ -948,7 +948,7 @@ enum dc_status dce112_validate_with_context(
 }
 
 enum dc_status dce112_validate_guaranteed(
-		const struct core_dc *dc,
+		struct dc *dc,
 		struct dc_stream_state *stream,
 		struct validate_context *context)
 {
@@ -968,7 +968,7 @@ enum dc_status dce112_validate_guaranteed(
 
 	if (result == DC_OK) {
 		validate_guaranteed_copy_streams(
-				context, dc->public.caps.max_streams);
+				context, dc->caps.max_streams);
 		result = resource_build_scaling_params_for_context(dc, context);
 	}
 
@@ -997,7 +997,7 @@ static const struct resource_funcs dce112_res_pool_funcs = {
 	.validate_plane = dce100_validate_plane
 };
 
-static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
+static void bw_calcs_data_update_from_pplib(struct dc *dc)
 {
 	struct dm_pp_clock_levels_with_latency eng_clks = {0};
 	struct dm_pp_clock_levels_with_latency mem_clks = {0};
@@ -1153,7 +1153,7 @@ const struct resource_caps *dce112_resource_cap(
 
 static bool construct(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc *dc,
 	struct dce110_resource_pool *pool)
 {
 	unsigned int i;
@@ -1170,9 +1170,9 @@ static bool construct(
 	 *************************************************/
 	pool->base.underlay_pipe_index = NO_UNDERLAY_PIPE;
 	pool->base.pipe_count = pool->base.res_cap->num_timing_generator;
-	dc->public.caps.max_downscale_ratio = 200;
-	dc->public.caps.i2c_speed_in_khz = 100;
-	dc->public.caps.max_cursor_size = 128;
+	dc->caps.max_downscale_ratio = 200;
+	dc->caps.i2c_speed_in_khz = 100;
+	dc->caps.max_cursor_size = 128;
 
 	/*************************************************
 	 *  Create resources                             *
@@ -1319,7 +1319,7 @@ static bool construct(
 			  &res_create_funcs))
 		goto res_create_fail;
 
-	dc->public.caps.max_planes =  pool->base.pipe_count;
+	dc->caps.max_planes =  pool->base.pipe_count;
 
 	/* Create hardware sequencer */
 	if (!dce112_hw_sequencer_construct(dc))
@@ -1338,7 +1338,7 @@ static bool construct(
 
 struct resource_pool *dce112_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc)
+	struct dc *dc)
 {
 	struct dce110_resource_pool *pool =
 		dm_alloc(sizeof(struct dce110_resource_pool));
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.h +5 -5
index feef559f1ecd..69f8f689196d 100644
@@ -28,27 +28,27 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 struct resource_pool;
 
 struct resource_pool *dce112_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc);
+	struct dc *dc);
 
 enum dc_status dce112_validate_with_context(
-		const struct core_dc *dc,
+		struct dc *dc,
 		const struct dc_validation_set set[],
 		int set_count,
 		struct validate_context *context,
 		struct validate_context *old_context);
 
 enum dc_status dce112_validate_guaranteed(
-		const struct core_dc *dc,
+		struct dc *dc,
 		struct dc_stream_state *dc_stream,
 		struct validate_context *context);
 
 bool dce112_validate_bandwidth(
-	const struct core_dc *dc,
+	struct dc *dc,
 	struct validate_context *context);
 
 
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c +2 -3
index 91301b412aa0..d6225f332431 100644
@@ -25,7 +25,6 @@
 
 #include "dm_services.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "core_types.h"
 #include "dce120_hw_sequencer.h"
 #include "dce/dce_hwseq.h"
@@ -149,7 +148,7 @@ static void dce120_init_pte(struct dc_context *ctx, uint8_t controller_id)
 #endif
 
 static bool dce120_enable_display_power_gating(
-	struct core_dc *dc,
+	struct dc *dc,
 	uint8_t controller_id,
 	struct dc_bios *dcb,
 	enum pipe_gating_control power_gating)
@@ -247,7 +246,7 @@ static void dce120_update_dchub(
 
 
 
-bool dce120_hw_sequencer_construct(struct core_dc *dc)
+bool dce120_hw_sequencer_construct(struct dc *dc)
 {
 	/* All registers used by dce11.2 match those in dce11 in offset and
 	 * structure
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.h +2 -2
index 3402413c7156..6448a17c2fde 100644
@@ -28,9 +28,9 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 
-bool dce120_hw_sequencer_construct(struct core_dc *dc);
+bool dce120_hw_sequencer_construct(struct dc *dc);
 
 #endif /* __DC_HWSS_DCE112_H__ */
 
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +9 -9
index 562ae2205a90..b8fcdff40db3 100644
@@ -410,7 +410,7 @@ void dce120_clock_source_destroy(struct clock_source **clk_src)
 }
 
 
-bool dce120_hw_sequencer_create(struct core_dc *dc)
+bool dce120_hw_sequencer_create(struct dc *dc)
 {
 	/* All registers used by dce11.2 match those in dce11 in offset and
 	 * structure
@@ -704,7 +704,7 @@ static const struct resource_funcs dce120_res_pool_funcs = {
 	.validate_plane = dce100_validate_plane
 };
 
-static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
+static void bw_calcs_data_update_from_pplib(struct dc *dc)
 {
 	struct dm_pp_clock_levels_with_latency eng_clks = {0};
 	struct dm_pp_clock_levels_with_latency mem_clks = {0};
@@ -831,7 +831,7 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 
 static bool construct(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc *dc,
 	struct dce110_resource_pool *pool)
 {
 	unsigned int i;
@@ -847,10 +847,10 @@ static bool construct(
 	pool->base.pipe_count = res_cap.num_timing_generator;
 	pool->base.underlay_pipe_index = NO_UNDERLAY_PIPE;
 
-	dc->public.caps.max_downscale_ratio = 200;
-	dc->public.caps.i2c_speed_in_khz = 100;
-	dc->public.caps.max_cursor_size = 128;
-	dc->public.debug = debug_defaults;
+	dc->caps.max_downscale_ratio = 200;
+	dc->caps.i2c_speed_in_khz = 100;
+	dc->caps.max_cursor_size = 128;
+	dc->debug = debug_defaults;
 
 	/*************************************************
 	 *  Create resources                             *
@@ -982,7 +982,7 @@ static bool construct(
 	if (!dce120_hw_sequencer_create(dc))
 		goto controller_create_fail;
 
-	dc->public.caps.max_planes =  pool->base.pipe_count;
+	dc->caps.max_planes =  pool->base.pipe_count;
 
 	bw_calcs_init(dc->bw_dceip, dc->bw_vbios, dc->ctx->asic_id);
 
@@ -1003,7 +1003,7 @@ static bool construct(
 
 struct resource_pool *dce120_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc)
+	struct dc *dc)
 {
 	struct dce110_resource_pool *pool =
 		dm_alloc(sizeof(struct dce110_resource_pool));
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.h +2 -2
index 038c78dcc247..3d1f3cf012f4 100644
@@ -28,12 +28,12 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 struct resource_pool;
 
 struct resource_pool *dce120_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc);
+	struct dc *dc);
 
 #endif /* __DC_RESOURCE_DCE120_H__ */
 
drivers/gpu/drm/amd/display/dc/dce80/dce80_hw_sequencer.c +2 -3
index 4cba80ff6ca4..28fe3824441f 100644
@@ -25,7 +25,6 @@
 
 #include "dm_services.h"
 #include "dc.h"
-#include "core_dc.h"
 #include "core_types.h"
 #include "dce80_hw_sequencer.h"
 
@@ -72,7 +71,7 @@ static const struct dce80_hw_seq_reg_offsets reg_offsets[] = {
 /***************************PIPE_CONTROL***********************************/
 
 static bool dce80_enable_display_power_gating(
-	struct core_dc *dc,
+	struct dc *dc,
 	uint8_t controller_id,
 	struct dc_bios *dcb,
 	enum pipe_gating_control power_gating)
@@ -107,7 +106,7 @@ static bool dce80_enable_display_power_gating(
 		return false;
 }
 
-bool dce80_hw_sequencer_construct(struct core_dc *dc)
+bool dce80_hw_sequencer_construct(struct dc *dc)
 {
 	dce110_hw_sequencer_construct(dc);
 
drivers/gpu/drm/amd/display/dc/dce80/dce80_hw_sequencer.h +2 -2
index 7cc203f433d3..9d6dd05bd596 100644
@@ -28,9 +28,9 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 
-bool dce80_hw_sequencer_construct(struct core_dc *dc);
+bool dce80_hw_sequencer_construct(struct dc *dc);
 
 #endif /* __DC_HWSS_DCE80_H__ */
 
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +23 -23

148 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.h +4 -4
index 04f0cfe24ef2..eff31ab83a39 100644
@@ -28,20 +28,20 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 struct resource_pool;
 
 struct resource_pool *dce80_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc);
+	struct dc *dc);
 
 struct resource_pool *dce81_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc);
+	struct dc *dc);
 
 struct resource_pool *dce83_create_resource_pool(
 	uint8_t num_virtual_links,
-	struct core_dc *dc);
+	struct dc *dc);
 
 #endif /* __DC_RESOURCE_DCE80_H__ */
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dwb.c +0 -1
index 11386121f8ed..684241cb40d7 100644
@@ -26,7 +26,6 @@
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 
 #include "reg_helper.h"
-#include "core_dc.h"
 #include "resource.h"
 #include "dwb.h"
 #include "dcn10_dwb.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +54 -54

421 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +2 -2
index 28218dc43522..8bb09de8dcd7 100644
@@ -28,9 +28,9 @@
 
 #include "core_types.h"
 
-struct core_dc;
+struct dc;
 
-void dcn10_hw_sequencer_construct(struct core_dc *dc);
+void dcn10_hw_sequencer_construct(struct dc *dc);
 extern void fill_display_configs(
 	const struct validate_context *context,
 	struct dm_pp_display_configuration *pp_display_cfg);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +17 -17
index c36843d497ac..2d9e88f08abb 100644
@@ -825,7 +825,7 @@ static enum dc_status build_pipe_hw_param(struct pipe_ctx *pipe_ctx)
 }
 
 static enum dc_status build_mapped_resource(
-		const struct core_dc *dc,
+		const struct dc *dc,
 		struct validate_context *context,
 		struct validate_context *old_context)
 {
@@ -872,7 +872,7 @@ static enum dc_status build_mapped_resource(
 }
 
 enum dc_status dcn10_validate_with_context(
-		const struct core_dc *dc,
+		struct dc *dc,
 		const struct dc_validation_set set[],
 		int set_count,
 		struct validate_context *context,
@@ -917,7 +917,7 @@ enum dc_status dcn10_validate_with_context(
 }
 
 enum dc_status dcn10_validate_guaranteed(
-		const struct core_dc *dc,
+		struct dc *dc,
 		struct dc_stream_state *dc_stream,
 		struct validate_context *context)
 {
@@ -937,7 +937,7 @@ enum dc_status dcn10_validate_guaranteed(
 
 	if (result == DC_OK) {
 		validate_guaranteed_copy_streams(
-				context, dc->public.caps.max_streams);
+				context, dc->caps.max_streams);
 		result = resource_build_scaling_params_for_context(dc, context);
 	}
 	if (result == DC_OK && !dcn_validate_bandwidth(dc, context))
@@ -1221,7 +1221,7 @@ static struct resource_funcs dcn10_res_pool_funcs = {
 
 static bool construct(
 	uint8_t num_virtual_links,
-	struct core_dc *dc,
+	struct dc *dc,
 	struct dcn10_resource_pool *pool)
 {
 	int i;
@@ -1244,16 +1244,16 @@ static bool construct(
 
 	/* TODO: Hardcode to correct number of functional controllers */
 	pool->base.pipe_count = 4;
-	dc->public.caps.max_downscale_ratio = 200;
-	dc->public.caps.i2c_speed_in_khz = 100;
-	dc->public.caps.max_cursor_size = 256;
+	dc->caps.max_downscale_ratio = 200;
+	dc->caps.i2c_speed_in_khz = 100;
+	dc->caps.max_cursor_size = 256;
 
-	dc->public.caps.max_slave_planes = 1;
+	dc->caps.max_slave_planes = 1;
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
-		dc->public.debug = debug_defaults_drv;
+		dc->debug = debug_defaults_drv;
 	else
-		dc->public.debug = debug_defaults_diags;
+		dc->debug = debug_defaults_diags;
 
 	/*************************************************
 	 *  Create resources                             *
@@ -1327,7 +1327,7 @@ static bool construct(
 
 	if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
 		dc->dcn_soc->urgent_latency = 3;
-		dc->public.debug.disable_dmcu = true;
+		dc->debug.disable_dmcu = true;
 		dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 41.60f;
 	}
 
@@ -1347,10 +1347,10 @@ static bool construct(
 		}
 	}
 
-	if (!dc->public.debug.disable_pplib_clock_request)
+	if (!dc->debug.disable_pplib_clock_request)
 		dcn_bw_update_from_pplib(dc);
 	dcn_bw_sync_calcs_and_dml(dc);
-	if (!dc->public.debug.disable_pplib_wm_range)
+	if (!dc->debug.disable_pplib_wm_range)
 		dcn_bw_notify_pplib_of_wm_ranges(dc);
 
 	{
@@ -1424,9 +1424,9 @@ static bool construct(
 			goto res_create_fail;
 
 	dcn10_hw_sequencer_construct(dc);
-	dc->public.caps.max_planes =  pool->base.pipe_count;
+	dc->caps.max_planes =  pool->base.pipe_count;
 
-	dc->public.cap_funcs = cap_funcs;
+	dc->cap_funcs = cap_funcs;
 
 	return true;
 
@@ -1449,7 +1449,7 @@ static bool construct(
 
 struct resource_pool *dcn10_create_resource_pool(
 		uint8_t num_virtual_links,
-		struct core_dc *dc)
+		struct dc *dc)
 {
 	struct dcn10_resource_pool *pool =
 		dm_alloc(sizeof(struct dcn10_resource_pool));
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h +2 -2
index 5f84dbd0bdea..8f71225bc61b 100644
@@ -31,7 +31,7 @@
 #define TO_DCN10_RES_POOL(pool)\
 	container_of(pool, struct dcn10_resource_pool, base)
 
-struct core_dc;
+struct dc;
 struct resource_pool;
 struct _vcs_dpi_display_pipe_params_st;
 
@@ -40,7 +40,7 @@ struct dcn10_resource_pool {
 };
 struct resource_pool *dcn10_create_resource_pool(
 		uint8_t num_virtual_links,
-		struct core_dc *dc);
+		struct dc *dc);
 
 
 #endif /* __DC_RESOURCE_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/inc/core_dc.h deleted +0 -55

55 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/core_types.h +4 -4
index 28454028434c..f8ade552c595 100644
@@ -52,7 +52,7 @@ void enable_surface_flip_reporting(struct dc_plane_state *plane_state,
 
 /************ link *****************/
 struct link_init_data {
-	const struct core_dc *dc;
+	const struct dc *dc;
 	struct dc_context *ctx; /* TODO: remove 'dal' when DC is complete. */
 	uint32_t connector_index; /* this will be mapped to the HPD pins */
 	uint32_t link_index; /* this is mapped to DAL display_index
@@ -87,19 +87,19 @@ struct resource_funcs {
 	struct link_encoder *(*link_enc_create)(
 			const struct encoder_init_data *init);
 	enum dc_status (*validate_with_context)(
-					const struct core_dc *dc,
+					struct dc *dc,
 					const struct dc_validation_set set[],
 					int set_count,
 					struct validate_context *context,
 					struct validate_context *old_context);
 
 	enum dc_status (*validate_guaranteed)(
-					const struct core_dc *dc,
+					struct dc *dc,
 					struct dc_stream_state *stream,
 					struct validate_context *context);
 
 	bool (*validate_bandwidth)(
-					const struct core_dc *dc,
+					struct dc *dc,
 					struct validate_context *context);
 
 	struct pipe_ctx *(*acquire_idle_pipe_for_layer)(
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +1 -1
index 36c48f7d3f56..6a205b010084 100644
@@ -33,7 +33,7 @@
 #include "bw_fixed.h"
 
 struct pipe_ctx;
-struct core_dc;
+struct dc;
 struct validate_context;
 struct dce_bw_output;
 
drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h +6 -6
index 7e8abcd60d12..58744fe87ed8 100644
@@ -34,7 +34,7 @@
 #include "display_clock.h"
 #include "../dml/display_mode_lib.h"
 
-struct core_dc;
+struct dc;
 struct validate_context;
 
 /*******************************************************************************

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

drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +1 -0
index a02f18ae527d..f876a11c903f 100644

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

drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +29 -21

50 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/resource.h +7 -8
index 7f30d9937d10..13218a52e2fa 100644

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

drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +3 -3
index 24e47eb8cf3f..e3a12f3e0642 100644

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

drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +0 -1
index 7e8cb22f280f..f458ef8e4c57 100644

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

drivers/gpu/drm/amd/display/include/logger_interface.h +5 -5
index beb790937769..93c8556358f0 100644

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

drivers/gpu/drm/amd/display/modules/freesync/freesync.c +5 -6
index f0a3e4332a09..f49203b3eb94 100644

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

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

Signature · 6 lines
2.11.0

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

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

#13 lore raw

PATCH 10/77 drm/amd/display: Use MAX_PIPES for DTO reg arrays

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.h +3 -3
index 238c03f14959..c45e2f76189e 100644
@@ -107,9 +107,9 @@ struct dce110_clk_src_regs {
 	/* below are for DTO.
 	 * todo: should probably use different struct to not waste space
 	 */
-	uint32_t PHASE[4];
-	uint32_t MODULO[4];
-	uint32_t PIXEL_RATE_CNTL[4];
+	uint32_t PHASE[MAX_PIPES];
+	uint32_t MODULO[MAX_PIPES];
+	uint32_t PIXEL_RATE_CNTL[MAX_PIPES];
 };
 
 struct dce110_clk_src {
Signature · 6 lines
2.11.0

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

PATCH 11/77 drm/amd/display: blank otg before power gate front end.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -1
index d5d2398d92b8..ce48d81c4442 100644
@@ -2298,8 +2298,10 @@ static void dcn10_apply_ctx_for_surface(
 			struct pipe_ctx *old_pipe_ctx =
 							&dc->current_context->res_ctx.pipe_ctx[i];
 
-			if (old_pipe_ctx->stream_res.tg && old_pipe_ctx->stream_res.tg->inst == be_idx)
+			if (old_pipe_ctx->stream_res.tg && old_pipe_ctx->stream_res.tg->inst == be_idx) {
+				old_pipe_ctx->stream_res.tg->funcs->set_blank(old_pipe_ctx->stream_res.tg, true);
 				dcn10_power_down_fe(dc, old_pipe_ctx->pipe_idx);
+			}
 		}
 		return;
 	}
Signature · 6 lines
2.11.0

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

PATCH 12/77 drm/amd/display: eDP power sequence T9 fail

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 23 ++++++++++++++++++++++
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +23 -0
index da880bd02ad7..e12f1f9fb590 100644
@@ -110,6 +110,28 @@ void dp_enable_link_phy(
 	dp_receiver_power_ctrl(link, true);
 }
 
+bool edp_receiver_ready_T9(struct dc_link *link)
+{
+	unsigned int tries = 0;
+	unsigned char sinkstatus = 0;
+	unsigned char edpRev = 0;
+	enum dc_status result = DC_OK;
+	result = core_link_read_dpcd(link, DP_EDP_DPCD_REV, &edpRev, sizeof(edpRev));
+	if (edpRev < DP_EDP_12)
+		return true;
+	/* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
+	do {
+		sinkstatus = 1;
+		result = core_link_read_dpcd(link, DP_SINK_STATUS, &sinkstatus, sizeof(sinkstatus));
+		if (sinkstatus == 0)
+			break;
+		if (result != DC_OK)
+			break;
+		dm_delay_in_microseconds(link->ctx, 100); //MAx T9
+	} while (++tries < 50);
+	return result;
+}
+
 void dp_disable_link_phy(struct dc_link *link, enum signal_type signal)
 {
 	if (!link->wa_flags.dp_keep_receiver_powered)
@@ -117,6 +139,7 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal)
 
 	if (signal == SIGNAL_TYPE_EDP) {
 		link->link_enc->funcs->backlight_control(link->link_enc, false);
+		edp_receiver_ready_T9(link);
 		link->link_enc->funcs->disable_output(link->link_enc, signal);
 		link->link_enc->funcs->power_control(link->link_enc, false);
 	} else
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +1 -1
index 0dab5bacde3c..559a9f81c9c9 100644
@@ -744,7 +744,7 @@ void dce110_link_encoder_edp_backlight_control(
 		return;
 	}
 
-	if (!enable && !is_panel_powered_on(enc110)) {
+	if (!enable && !is_panel_backlight_on(enc110)) {
 		dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
 				"%s: panel already powered down. Do nothing.\n",
 				__func__);
Signature · 6 lines
2.11.0

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

PATCH 13/77 drm/amd/display: Leave DCN config guard around fpu header

In reply to a message not in the archive

See
https://lists.freedesktop.org/archives/dri-devel/2017-August/149938.html

---
 drivers/gpu/drm/amd/display/dc/dm_services.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dm_services.h +2 -0
index a7d661d1ff1d..e9bf4c417cc7 100644
@@ -75,7 +75,9 @@
 	BREAK_TO_DEBUGGER(); \
 } while (0)
 
+#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 #include <asm/fpu/api.h>
+#endif
 
 #define dm_alloc(size) kzalloc(size, GFP_KERNEL)
 #define dm_realloc(ptr, size) krealloc(ptr, size, GFP_KERNEL)
Signature · 6 lines
2.11.0

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

PATCH 14/77 drm/amd/display: Fix FBC compilation

In reply to a message not in the archive

From: Roman Li <[email protected]>

- Fixing compilation with ENABLE_FBC flag
which was broken after flattening core_dc to dc

---
 drivers/gpu/drm/amd/display/dc/dc.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index 68056d888def..1210fdd48c56 100644
@@ -35,6 +35,7 @@
 #include <inc/hw/opp.h>
 
 #include "inc/hw_sequencer.h"
+#include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
 
Signature · 6 lines
2.11.0

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

PATCH 15/77 drm/amd/display: remove fake address reporting when blank

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +0 -8
index ce48d81c4442..23aa6e1242c5 100644
@@ -2666,14 +2666,6 @@ void dcn10_update_pending_status(struct pipe_ctx *pipe_ctx)
 			pipe_ctx->plane_res.mi->funcs->mem_input_is_flip_pending(
 					pipe_ctx->plane_res.mi);
 
-	/* DCN we read INUSE address in MI, do we still need this wa? */
-	if (plane_state->status.is_flip_pending &&
-			!plane_state->visible) {
-		pipe_ctx->plane_res.mi->current_address =
-				pipe_ctx->plane_res.mi->request_address;
-		BREAK_TO_DEBUGGER();
-	}
-
 	plane_state->status.current_address = pipe_ctx->plane_res.mi->current_address;
 	if (pipe_ctx->plane_res.mi->current_address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
 			tg->funcs->is_stereo_left_eye) {
Signature · 6 lines
2.11.0

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

PATCH 16/77 drm/amd/display: move vm registers to hwsequencer

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h     |  52 +++++++++-
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  95 +++++++++++++++++-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 106 ++-------------------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h |  41 +-------
 drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h  |  21 ++++
 5 files changed, 172 insertions(+), 143 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +50 -2
index 3a1eb6a79d66..2d3a41f744af 100644
@@ -206,7 +206,20 @@
 	SR(D1VGA_CONTROL), \
 	SR(D2VGA_CONTROL), \
 	SR(D3VGA_CONTROL), \
-	SR(D4VGA_CONTROL)
+	SR(D4VGA_CONTROL), \
+	/* todo:  get these from GVM instead of reading registers ourselves */\
+	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32),\
+	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32),\
+	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32),\
+	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32),\
+	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_END_ADDR_HI32),\
+	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_END_ADDR_LO32),\
+	MMHUB_SR(VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),\
+	MMHUB_SR(VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32),\
+	MMHUB_SR(MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB),\
+	MMHUB_SR(MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB),\
+	MMHUB_SR(MC_VM_SYSTEM_APERTURE_LOW_ADDR),\
+	MMHUB_SR(MC_VM_SYSTEM_APERTURE_HIGH_ADDR)
 
 #define HWSEQ_DCN1_REG_LIST()\
 	HWSEQ_DCN_REG_LIST(), \
@@ -312,6 +325,19 @@ struct dce_hwseq_registers {
 	uint32_t D2VGA_CONTROL;
 	uint32_t D3VGA_CONTROL;
 	uint32_t D4VGA_CONTROL;
+	/* MMHUB registers. read only. temporary hack */
+	uint32_t VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32;
+	uint32_t VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32;
+	uint32_t VM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32;
+	uint32_t VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32;
+	uint32_t VM_CONTEXT0_PAGE_TABLE_END_ADDR_HI32;
+	uint32_t VM_CONTEXT0_PAGE_TABLE_END_ADDR_LO32;
+	uint32_t VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32;
+	uint32_t VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32;
+	uint32_t MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB;
+	uint32_t MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB;
+	uint32_t MC_VM_SYSTEM_APERTURE_LOW_ADDR;
+	uint32_t MC_VM_SYSTEM_APERTURE_HIGH_ADDR;
 };
  /* set field name */
 #define HWS_SF(blk_name, reg_name, field_name, post_fix)\
@@ -432,7 +458,17 @@ struct dce_hwseq_registers {
 	HWS_SF(, DCHUBBUB_SDPIF_AGP_BASE, SDPIF_AGP_BASE, mask_sh), \
 	HWS_SF(, DCHUBBUB_SDPIF_AGP_BOT, SDPIF_AGP_BOT, mask_sh), \
 	HWS_SF(, DCHUBBUB_SDPIF_AGP_TOP, SDPIF_AGP_TOP, mask_sh), \
-	HWS_SF(DPP_TOP0_, DPP_CONTROL, DPPCLK_RATE_CONTROL, mask_sh)
+	HWS_SF(DPP_TOP0_, DPP_CONTROL, DPPCLK_RATE_CONTROL, mask_sh), \
+	/* todo:  get these from GVM instead of reading registers ourselves */\
+	HWS_SF(, VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32, PAGE_DIRECTORY_ENTRY_HI32, mask_sh),\
+	HWS_SF(, VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32, PAGE_DIRECTORY_ENTRY_LO32, mask_sh),\
+	HWS_SF(, VM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32, LOGICAL_PAGE_NUMBER_HI4, mask_sh),\
+	HWS_SF(, VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32, LOGICAL_PAGE_NUMBER_LO32, mask_sh),\
+	HWS_SF(, VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, PHYSICAL_PAGE_ADDR_HI4, mask_sh),\
+	HWS_SF(, VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32, PHYSICAL_PAGE_ADDR_LO32, mask_sh),\
+	HWS_SF(, MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB, PHYSICAL_PAGE_NUMBER_MSB, mask_sh),\
+	HWS_SF(, MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB, PHYSICAL_PAGE_NUMBER_LSB, mask_sh),\
+	HWS_SF(, MC_VM_SYSTEM_APERTURE_LOW_ADDR, LOGICAL_ADDR, mask_sh)
 
 #define HWSEQ_REG_FIELD_LIST(type) \
 	type DCFE_CLOCK_ENABLE; \
@@ -451,6 +487,18 @@ struct dce_hwseq_registers {
 	type PIXEL_RATE_SOURCE; \
 	type PHYPLL_PIXEL_RATE_SOURCE; \
 	type PIXEL_RATE_PLL_SOURCE; \
+	/* todo:  get these from GVM instead of reading registers ourselves */\
+	type PAGE_DIRECTORY_ENTRY_HI32;\
+	type PAGE_DIRECTORY_ENTRY_LO32;\
+	type LOGICAL_PAGE_NUMBER_HI4;\
+	type LOGICAL_PAGE_NUMBER_LO32;\
+	type PHYSICAL_PAGE_ADDR_HI4;\
+	type PHYSICAL_PAGE_ADDR_LO32;\
+	type PHYSICAL_PAGE_NUMBER_MSB;\
+	type PHYSICAL_PAGE_NUMBER_LSB;\
+	type LOGICAL_ADDR; \
+	type ENABLE_L1_TLB;\
+	type SYSTEM_ACCESS_MODE;
 
 #define HWSEQ_DCN_REG_FIELD_LIST(type) \
 	type VUPDATE_NO_LOCK_EVENT_CLEAR; \
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +93 -2

116 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +6 -100

134 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +2 -39

59 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +21 -0
index f876a11c903f..6f4f04da9e28 100644
@@ -74,6 +74,19 @@ struct mem_input {
 	struct stutter_modes stutter_mode;
 };
 
+struct vm_system_aperture_param {
+	PHYSICAL_ADDRESS_LOC sys_default;
+	PHYSICAL_ADDRESS_LOC sys_low;
+	PHYSICAL_ADDRESS_LOC sys_high;
+};
+
+struct vm_context0_param {
+	PHYSICAL_ADDRESS_LOC pte_base;
+	PHYSICAL_ADDRESS_LOC pte_start;
+	PHYSICAL_ADDRESS_LOC pte_end;
+	PHYSICAL_ADDRESS_LOC fault_default;
+};
+
 struct mem_input_funcs {
 	void (*mem_input_setup)(
 			struct mem_input *mem_input,
@@ -125,6 +138,14 @@ struct mem_input_funcs {
 		union dc_tiling_info *tiling_info,
 		enum dc_rotation_angle rotation);
 
+	void (*mem_input_set_vm_system_aperture_settings)(
+			struct mem_input *mem_input,
+			struct vm_system_aperture_param *apt);
+
+	void (*mem_input_set_vm_context0_settings)(
+			struct mem_input *mem_input,
+			const struct vm_context0_param *vm0);
+
 	void (*mem_input_program_surface_config)(
 		struct mem_input *mem_input,
 		enum surface_pixel_format format,
Signature · 6 lines
2.11.0

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

PATCH 17/77 drm/amd/display: Implement HDMI retimer settings for RV AM4 support.

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c |  69 ++++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 420 ++++++++++++++++++++-
 drivers/gpu/drm/amd/display/dc/dc.h                |   1 +
 drivers/gpu/drm/amd/display/dc/dm_helpers.h        |   5 -
 .../amd/display/include/grph_object_ctrl_defs.h    |  38 ++
 5 files changed, 524 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +69 -0
index 86fce5ae5856..f8d4f08bf985 100644
@@ -993,6 +993,8 @@ static struct device_id device_type_from_device_id(uint16_t device_id)
 
 	struct device_id result_device_id;
 
+	result_device_id.raw_device_tag = device_id;
+
 	switch (device_id) {
 	case ATOM_DISPLAY_LCD1_SUPPORT:
 		result_device_id.device_type = DEVICE_TYPE_LCD;
@@ -1812,10 +1814,77 @@ static enum bp_result get_integrated_info_v11(
 			info_v11->extdispconninfo.path[i].hpdlut_index;
 		info->ext_disp_conn_info.path[i].channel_mapping.raw =
 			info_v11->extdispconninfo.path[i].channelmapping;
+		info->ext_disp_conn_info.path[i].caps =
+				le16_to_cpu(info_v11->extdispconninfo.path[i].caps);
 	}
 	info->ext_disp_conn_info.checksum =
 	info_v11->extdispconninfo.checksum;
 
+	info->dp0_ext_hdmi_slv_addr = info_v11->dp0_retimer_set.HdmiSlvAddr;
+	info->dp0_ext_hdmi_reg_num = info_v11->dp0_retimer_set.HdmiRegNum;
+	for (i = 0; i < info->dp0_ext_hdmi_reg_num; i++) {
+		info->dp0_ext_hdmi_reg_settings[i].i2c_reg_index =
+				info_v11->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
+		info->dp0_ext_hdmi_reg_settings[i].i2c_reg_val =
+				info_v11->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
+	}
+	info->dp0_ext_hdmi_6g_reg_num = info_v11->dp0_retimer_set.Hdmi6GRegNum;
+	for (i = 0; i < info->dp0_ext_hdmi_6g_reg_num; i++) {
+		info->dp0_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
+				info_v11->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
+		info->dp0_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
+				info_v11->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
+	}
+
+	info->dp1_ext_hdmi_slv_addr = info_v11->dp1_retimer_set.HdmiSlvAddr;
+	info->dp1_ext_hdmi_reg_num = info_v11->dp1_retimer_set.HdmiRegNum;
+	for (i = 0; i < info->dp1_ext_hdmi_reg_num; i++) {
+		info->dp1_ext_hdmi_reg_settings[i].i2c_reg_index =
+				info_v11->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
+		info->dp1_ext_hdmi_reg_settings[i].i2c_reg_val =
+				info_v11->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
+	}
+	info->dp1_ext_hdmi_6g_reg_num = info_v11->dp1_retimer_set.Hdmi6GRegNum;
+	for (i = 0; i < info->dp1_ext_hdmi_6g_reg_num; i++) {
+		info->dp1_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
+				info_v11->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
+		info->dp1_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
+				info_v11->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
+	}
+
+	info->dp2_ext_hdmi_slv_addr = info_v11->dp2_retimer_set.HdmiSlvAddr;
+	info->dp2_ext_hdmi_reg_num = info_v11->dp2_retimer_set.HdmiRegNum;
+	for (i = 0; i < info->dp2_ext_hdmi_reg_num; i++) {
+		info->dp2_ext_hdmi_reg_settings[i].i2c_reg_index =
+				info_v11->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
+		info->dp2_ext_hdmi_reg_settings[i].i2c_reg_val =
+				info_v11->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
+	}
+	info->dp2_ext_hdmi_6g_reg_num = info_v11->dp2_retimer_set.Hdmi6GRegNum;
+	for (i = 0; i < info->dp2_ext_hdmi_6g_reg_num; i++) {
+		info->dp2_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
+				info_v11->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
+		info->dp2_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
+				info_v11->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
+	}
+
+	info->dp3_ext_hdmi_slv_addr = info_v11->dp3_retimer_set.HdmiSlvAddr;
+	info->dp3_ext_hdmi_reg_num = info_v11->dp3_retimer_set.HdmiRegNum;
+	for (i = 0; i < info->dp3_ext_hdmi_reg_num; i++) {
+		info->dp3_ext_hdmi_reg_settings[i].i2c_reg_index =
+				info_v11->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegIndex;
+		info->dp3_ext_hdmi_reg_settings[i].i2c_reg_val =
+				info_v11->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegVal;
+	}
+	info->dp3_ext_hdmi_6g_reg_num = info_v11->dp3_retimer_set.Hdmi6GRegNum;
+	for (i = 0; i < info->dp3_ext_hdmi_6g_reg_num; i++) {
+		info->dp3_ext_hdmi_6g_reg_settings[i].i2c_reg_index =
+				info_v11->dp3_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
+		info->dp3_ext_hdmi_6g_reg_settings[i].i2c_reg_val =
+				info_v11->dp3_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal;
+	}
+
+
 	/** TODO - review **/
 	#if 0
 	info->boot_up_engine_clock = le32_to_cpu(info_v11->ulBootUpEngineClock)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +416 -4

437 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index 1210fdd48c56..629aa3c323ca 100644
@@ -815,6 +815,7 @@ struct dc_link {
 	union ddi_channel_mapping ddi_channel_mapping;
 	struct connector_device_tag_info device_tag;
 	struct dpcd_caps dpcd_caps;
+	unsigned short chip_caps;
 	unsigned int dpcd_sink_count;
 
 	enum edp_revision edp_revision;
drivers/gpu/drm/amd/display/dc/dm_helpers.h +0 -5
index 39010325cef9..ab88f07772a3 100644
@@ -96,11 +96,6 @@ bool dm_helpers_submit_i2c(
 		const struct dc_link *link,
 		struct i2c_command *cmd);
 
-
-
-
-
-
 enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_context *ctx,
 		struct dc_link *link,
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +38 -0
index 6cdbf84f34e6..92fe00fab87c 100644
@@ -65,6 +65,7 @@ enum dal_device_type {
 struct device_id {
 	enum dal_device_type device_type:16;
 	uint32_t enum_id:16;	/* 1 based enum */
+	uint16_t raw_device_tag;
 };
 
 struct graphics_object_i2c_info {
@@ -264,6 +265,20 @@ struct transmitter_configuration {
 #define NUMBER_OF_DISP_CLK_VOLTAGE 4
 #define NUMBER_OF_AVAILABLE_SCLK 5
 
+struct i2c_reg_info {
+    unsigned char       i2c_reg_index;
+    unsigned char       i2c_reg_val;
+};
+
+struct ext_hdmi_settings {
+    unsigned char   slv_addr;
+    unsigned char   reg_num;
+    struct i2c_reg_info      reg_settings[9];
+    unsigned char   reg_num_6g;
+    struct i2c_reg_info      reg_settings_6g[3];
+};
+
+
 /* V6 */
 struct integrated_info {
 	struct clock_voltage_caps {
@@ -291,6 +306,8 @@ struct integrated_info {
 			struct graphics_object_id ext_encoder_obj_id;
 			/* XBAR mapping of the PHY channels */
 			union ddi_channel_mapping channel_mapping;
+
+			unsigned short caps;
 		} path[MAX_NUMBER_OF_EXT_DISPLAY_PATH];
 
 		uint8_t gu_id[NUMBER_OF_UCHAR_FOR_GUID];
@@ -357,6 +374,27 @@ struct integrated_info {
 	uint32_t lvds_pwr_off_seq_blon_to_vary_bl_in_4ms;
 	uint32_t lvds_reserved1;
 	uint32_t lvds_bit_depth_control_val;
+	//Start from V9
+	unsigned char dp0_ext_hdmi_slv_addr;
+	unsigned char dp0_ext_hdmi_reg_num;
+	struct i2c_reg_info dp0_ext_hdmi_reg_settings[9];
+	unsigned char dp0_ext_hdmi_6g_reg_num;
+	struct i2c_reg_info dp0_ext_hdmi_6g_reg_settings[3];
+	unsigned char dp1_ext_hdmi_slv_addr;
+	unsigned char dp1_ext_hdmi_reg_num;
+	struct i2c_reg_info dp1_ext_hdmi_reg_settings[9];
+	unsigned char dp1_ext_hdmi_6g_reg_num;
+	struct i2c_reg_info dp1_ext_hdmi_6g_reg_settings[3];
+	unsigned char dp2_ext_hdmi_slv_addr;
+	unsigned char dp2_ext_hdmi_reg_num;
+	struct i2c_reg_info dp2_ext_hdmi_reg_settings[9];
+	unsigned char dp2_ext_hdmi_6g_reg_num;
+	struct i2c_reg_info dp2_ext_hdmi_6g_reg_settings[3];
+	unsigned char dp3_ext_hdmi_slv_addr;
+	unsigned char dp3_ext_hdmi_reg_num;
+	struct i2c_reg_info dp3_ext_hdmi_reg_settings[9];
+	unsigned char dp3_ext_hdmi_6g_reg_num;
+	struct i2c_reg_info dp3_ext_hdmi_6g_reg_settings[3];
 };
 
 /**
Signature · 6 lines
2.11.0

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

PATCH 18/77 drm/amd/display: refactor pplib/smu communication

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

new per SoC interface instead legacy interface with lots of un-used field that only cause confusion

model pp_smu like one of our HW objects with func_ptr interface to call into it. struct pp_smu as handle to call pp/smu

---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c |  13 +-
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   | 100 ++++++++--------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |  19 ++-
 drivers/gpu/drm/amd/display/dc/dm_pp_smu.h         | 131 +++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dm_services.h       |   5 +-
 drivers/gpu/drm/amd/display/dc/dm_services_types.h |   2 +
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   2 +
 drivers/gpu/drm/amd/display/dc/inc/resource.h      |   1 +
 8 files changed, 213 insertions(+), 60 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dm_pp_smu.h
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +5 -8
index 3348e90a0a37..aefd9ebc7bce 100644
@@ -401,14 +401,6 @@ bool dm_pp_notify_wm_clock_changes(
 	return false;
 }
 
-bool dm_pp_notify_wm_clock_changes_soc15(
-	const struct dc_context *ctx,
-	struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges)
-{
-	/* TODO: to be implemented */
-	return false;
-}
-
 bool dm_pp_apply_power_level_change_request(
 	const struct dc_context *ctx,
 	struct dm_pp_power_level_change_request *level_change_req)
@@ -433,4 +425,9 @@ bool dm_pp_get_static_clocks(
 	return false;
 }
 
+void dm_pp_get_funcs_rv(
+		struct dc_context *ctx,
+		struct pp_smu_funcs_rv *funcs)
+{}
+
 /**** end of power component interfaces ****/
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +52 -48

119 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +18 -1
index 2d9e88f08abb..954c234090db 100644
@@ -678,6 +678,17 @@ void dcn10_clock_source_destroy(struct clock_source **clk_src)
 	*clk_src = NULL;
 }
 
+static struct pp_smu_funcs_rv *dcn10_pp_smu_create(struct dc_context *ctx)
+{
+	struct pp_smu_funcs_rv *pp_smu = dm_alloc(sizeof(*pp_smu));
+
+	if (!pp_smu)
+		return pp_smu;
+
+	dm_pp_get_funcs_rv(ctx, pp_smu);
+	return pp_smu;
+}
+
 static void destruct(struct dcn10_resource_pool *pool)
 {
 	unsigned int i;
@@ -751,6 +762,8 @@ static void destruct(struct dcn10_resource_pool *pool)
 
 	if (pool->base.display_clock != NULL)
 		dce_disp_clk_destroy(&pool->base.display_clock);
+
+	dm_free(pool->base.pp_smu);
 }
 
 static struct mem_input *dcn10_mem_input_create(
@@ -1347,11 +1360,15 @@ static bool construct(
 		}
 	}
 
+	pool->base.pp_smu = dcn10_pp_smu_create(ctx);
+
 	if (!dc->debug.disable_pplib_clock_request)
 		dcn_bw_update_from_pplib(dc);
 	dcn_bw_sync_calcs_and_dml(dc);
-	if (!dc->debug.disable_pplib_wm_range)
+	if (!dc->debug.disable_pplib_wm_range) {
+		dc->res_pool = &pool->base;
 		dcn_bw_notify_pplib_of_wm_ranges(dc);
+	}
 
 	{
 	#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h new file +131 -0

131 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dm_services.h +2 -3
index e9bf4c417cc7..8ab0af6f4c6b 100644
@@ -339,9 +339,8 @@ bool dm_pp_notify_wm_clock_changes(
 	const struct dc_context *ctx,
 	struct dm_pp_wm_sets_with_clock_ranges *wm_with_clock_ranges);
 
-bool dm_pp_notify_wm_clock_changes_soc15(
-	const struct dc_context *ctx,
-	struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges);
+void dm_pp_get_funcs_rv(struct dc_context *ctx,
+		struct pp_smu_funcs_rv *funcs);
 
 /* DAL calls this function to notify PP about completion of Mode Set.
  * For PP it means that current DCE clocks are those which were returned
drivers/gpu/drm/amd/display/dc/dm_services_types.h +2 -0
index 4c04ec587308..fa26cf488b3c 100644
@@ -29,6 +29,8 @@
 #include "os_types.h"
 #include "dc_types.h"
 
+#include "dm_pp_smu.h"
+
 struct dm_pp_clock_range {
 	int min_khz;
 	int max_khz;
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -0
index f8ade552c595..a3f0039088ab 100644
@@ -48,6 +48,7 @@ void enable_surface_flip_reporting(struct dc_plane_state *plane_state,
 #include "clock_source.h"
 #include "audio.h"
 #include "hw_sequencer_types.h"
+#include "dm_pp_smu.h"
 
 
 /************ link *****************/
@@ -126,6 +127,7 @@ struct resource_pool {
 	struct stream_encoder *stream_enc[MAX_PIPES * 2];
 #ifdef CONFIG_DRM_AMD_DC_DCN1_0
 	struct mpc *mpc;
+	struct pp_smu_funcs_rv *pp_smu;
 #endif
 
 	struct dwbc *dwbc[MAX_DWB_PIPES];
drivers/gpu/drm/amd/display/dc/inc/resource.h +1 -0
index 13218a52e2fa..9085ec7ceac7 100644
@@ -28,6 +28,7 @@
 #include "core_types.h"
 #include "core_status.h"
 #include "dal_asic_id.h"
+#include "dm_pp_smu.h"
 
 /* TODO unhardcode, 4 for CZ*/
 #define MEMORY_TYPE_MULTIPLIER 4
Signature · 6 lines
2.11.0

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

PATCH 19/77 drm/amd/display: Per stream validate_context build v2.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Until now new context would start as empty, then populated with exsisting pipes + new. Now we start with duplication of existing context and then add/delete from the context pipes as needed.

This allows to do a per stream resource
population, start discarding dc_validation_set
and by this brings DC closer to to DRM.

v2: Add some fixes and rebase.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  68 ++-
 drivers/gpu/drm/amd/display/dc/core/dc.c           | 108 +----
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 468 +++++++++++++++------
 drivers/gpu/drm/amd/display/dc/dc.h                |  32 +-
 .../drm/amd/display/dc/dce100/dce100_resource.c    |  78 +---
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  86 +---
 .../drm/amd/display/dc/dce112/dce112_resource.c    | 143 +++----
 .../drm/amd/display/dc/dce112/dce112_resource.h    |   5 +
 .../drm/amd/display/dc/dce120/dce120_resource.c    |   4 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |  79 +---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |  85 ++--
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  19 +-
 drivers/gpu/drm/amd/display/dc/inc/resource.h      |   6 +-
 13 files changed, 577 insertions(+), 604 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +57 -11
index 73a0fdb98cbd..4c5714dde9a0 100644
@@ -25,6 +25,7 @@
 
 #include "dm_services_types.h"
 #include "dc.h"
+#include "dc/inc/core_types.h"
 
 #include "vid.h"
 #include "amdgpu.h"
@@ -690,13 +691,33 @@ struct drm_atomic_state *
 dm_atomic_state_alloc(struct drm_device *dev)
 {
 	struct dm_atomic_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
+	struct validate_context *new_ctx;
+	struct amdgpu_device *adev = dev->dev_private;
+	struct dc *dc = adev->dm.dc;
 
-	if (!state || drm_atomic_state_init(dev, &state->base) < 0) {
-		kfree(state);
+	if (!state)
 		return NULL;
-	}
+
+	if (drm_atomic_state_init(dev, &state->base) < 0)
+		goto fail;
+
+	/* copy existing configuration */
+	new_ctx = dm_alloc(sizeof(*new_ctx));
+
+	if (!new_ctx)
+		goto fail;
+
+	atomic_inc(&new_ctx->ref_count);
+
+	dc_resource_validate_ctx_copy_construct_current(dc, new_ctx);
+
+	state->context = new_ctx;
 
 	return &state->base;
+
+fail:
+	kfree(state);
+	return NULL;
 }
 
 static void
@@ -4518,7 +4539,6 @@ static int do_aquire_global_lock(
 int amdgpu_dm_atomic_check(struct drm_device *dev,
 			struct drm_atomic_state *state)
 {
-	struct dm_atomic_state *dm_state;
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *crtc_state;
 	struct drm_plane *plane;
@@ -4532,6 +4552,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 	int set_count;
 	struct dc_validation_set set[MAX_STREAMS] = { { 0 } };
 	struct dm_crtc_state *old_acrtc_state, *new_acrtc_state;
+	struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
 
 	/*
 	 * This bool will be set for true for any modeset/reset
@@ -4546,8 +4567,6 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		return ret;
 	}
 
-	dm_state = to_dm_atomic_state(state);
-
 	/* copy existing configuration */
 	set_count = 0;
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -4590,8 +4609,17 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 
 		if (modereset_required(crtc_state)) {
 
-					/* i.e. reset mode */
+			/* i.e. reset mode */
 			if (new_acrtc_state->stream) {
+
+				if (!dc_remove_stream_from_ctx(
+						dc,
+						dm_state->context,
+						new_acrtc_state->stream)) {
+					ret = -EINVAL;
+					goto fail;
+				}
+
 				set_count = remove_from_val_sets(
 						set,
 						set_count,
@@ -4639,8 +4667,19 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 			if (modeset_required(crtc_state, new_stream,
 					     old_acrtc_state->stream)) {
 
-				if (new_acrtc_state->stream)
+				if (new_acrtc_state->stream) {
+
+					if (!dc_remove_stream_from_ctx(
+							dc,
+							dm_state->context,
+							new_acrtc_state->stream)) {
+						ret = -EINVAL;
+						goto fail;
+					}
+
+
 					dc_stream_release(new_acrtc_state->stream);
+				}
 
 				new_acrtc_state->stream = new_stream;
 
@@ -4651,6 +4690,14 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 						new_acrtc_state->stream,
 						crtc);
 
+				if (!dc_add_stream_to_ctx(
+						dc,
+						dm_state->context,
+						new_acrtc_state->stream)) {
+					ret = -EINVAL;
+					goto fail;
+				}
+
 				lock_and_validation_needed = true;
 			} else {
 				/*
@@ -4767,9 +4814,8 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		ret = do_aquire_global_lock(dev, state);
 		if (ret)
 			goto fail;
-		WARN_ON(dm_state->context);
-		dm_state->context = dc_get_validate_context(dc, set, set_count);
-		if (!dm_state->context) {
+
+		if (!dc_validate_global_state(dc, set, set_count, dm_state->context)) {
 			ret = -EINVAL;
 			goto fail;
 		}
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -95

154 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc_resource.c +330 -138

560 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dc.h +24 -8
index 629aa3c323ca..2b4fc6616243 100644
@@ -618,6 +618,16 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
 				  uint32_t *h_position,
 				  uint32_t *v_position);
 
+bool dc_remove_stream_from_ctx(
+			struct dc *dc,
+			struct validate_context *new_ctx,
+			struct dc_stream_state *stream);
+
+bool dc_add_stream_to_ctx(
+		struct dc *dc,
+		struct validate_context *new_ctx,
+		struct dc_stream_state *stream);
+
 /*
  * Structure to store surface/stream associations for validation
  */
@@ -630,16 +640,18 @@ struct dc_validation_set {
 bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream);
 
 bool dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state);
-/*
- * This function takes a set of resources and checks that they are cofunctional.
- *
- * After this call:
- *   No hardware is programmed for call.  Only validation is done.
- */
-struct validate_context *dc_get_validate_context(
+
+bool dc_validate_with_context(
 		struct dc *dc,
 		const struct dc_validation_set set[],
-		uint8_t set_count);
+		int set_count,
+		struct validate_context *context);
+
+bool dc_validate_global_state(
+		struct dc *dc,
+		const struct dc_validation_set set[],
+		int set_count,
+		struct validate_context *new_ctx);
 
 bool dc_validate_resources(
 		struct dc *dc,
@@ -662,6 +674,10 @@ void dc_resource_validate_ctx_copy_construct(
 		const struct validate_context *src_ctx,
 		struct validate_context *dst_ctx);
 
+void dc_resource_validate_ctx_copy_construct_current(
+		const struct dc *dc,
+		struct validate_context *dst_ctx);
+
 void dc_resource_validate_ctx_destruct(struct validate_context *context);
 
 /*
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +16 -62

122 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +20 -66

132 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +52 -91

207 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.h +5 -0
index 69f8f689196d..f1834bfe3d1e 100644
@@ -51,6 +51,11 @@ bool dce112_validate_bandwidth(
 	struct dc *dc,
 	struct validate_context *context);
 
+enum dc_status dce112_add_stream_to_ctx(
+		struct dc *dc,
+		struct validate_context *new_ctx,
+		struct dc_stream_state *dc_stream);
+
 
 #endif /* __DC_RESOURCE_DCE112_H__ */
 
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +2 -2
index b8fcdff40db3..e5d2d98982f7 100644
@@ -698,10 +698,10 @@ static void dce120_destroy_resource_pool(struct resource_pool **pool)
 static const struct resource_funcs dce120_res_pool_funcs = {
 	.destroy = dce120_destroy_resource_pool,
 	.link_enc_create = dce120_link_encoder_create,
-	.validate_with_context = dce112_validate_with_context,
 	.validate_guaranteed = dce112_validate_guaranteed,
 	.validate_bandwidth = dce112_validate_bandwidth,
-	.validate_plane = dce100_validate_plane
+	.validate_plane = dce100_validate_plane,
+	.add_stream_to_ctx = dce112_add_stream_to_ctx
 };
 
 static void bw_calcs_data_update_from_pplib(struct dc *dc)
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +17 -62

122 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +25 -60

139 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/core_types.h +13 -6
index a3f0039088ab..9a3239028377 100644
@@ -87,12 +87,6 @@ struct resource_funcs {
 	void (*destroy)(struct resource_pool **pool);
 	struct link_encoder *(*link_enc_create)(
 			const struct encoder_init_data *init);
-	enum dc_status (*validate_with_context)(
-					struct dc *dc,
-					const struct dc_validation_set set[],
-					int set_count,
-					struct validate_context *context,
-					struct validate_context *old_context);
 
 	enum dc_status (*validate_guaranteed)(
 					struct dc *dc,
@@ -103,11 +97,24 @@ struct resource_funcs {
 					struct dc *dc,
 					struct validate_context *context);
 
+	enum dc_status (*validate_global)(
+		struct dc *dc,
+		const struct dc_validation_set set[],
+		int set_count,
+		struct validate_context *old_context,
+		struct validate_context *context);
+
 	struct pipe_ctx *(*acquire_idle_pipe_for_layer)(
 			struct validate_context *context,
 			const struct resource_pool *pool,
 			struct dc_stream_state *stream);
+
 	enum dc_status (*validate_plane)(const struct dc_plane_state *plane_state);
+
+	enum dc_status (*add_stream_to_ctx)(
+			struct dc *dc,
+			struct validate_context *new_ctx,
+			struct dc_stream_state *dc_stream);
 };
 
 struct audio_support{
drivers/gpu/drm/amd/display/dc/inc/resource.h +3 -3
index 9085ec7ceac7..ebc0f5b02365 100644
@@ -82,7 +82,7 @@ void dc_destroy_resource_pool(struct dc *dc);
 enum dc_status resource_map_pool_resources(
 		const struct dc *dc,
 		struct validate_context *context,
-		struct validate_context *old_context);
+		struct dc_stream_state *stream);
 
 bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx);
 
@@ -150,12 +150,12 @@ void resource_validate_ctx_update_pointer_after_copy(
 enum dc_status resource_map_clock_resources(
 		const struct dc *dc,
 		struct validate_context *context,
-		struct validate_context *old_context);
+		struct dc_stream_state *stream);
 
 enum dc_status resource_map_phy_clock_resources(
 		const struct dc *dc,
 		struct validate_context *context,
-		struct validate_context *old_context);
+		struct dc_stream_state *stream);
 
 bool pipe_need_reprogram(
 		struct pipe_ctx *pipe_ctx_old,
Signature · 6 lines
2.11.0

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

PATCH 20/77 drm/amd/display: increase polling interval for fbc status update

In reply to a message not in the archive

From: Roman Li <[email protected]>

1.Fixing error message:
"wait counter exceeded, changes to HW not applied"
2. Added "FBC status changed to 0/1" logs

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +7 -1
index 9759d8e790a3..2e97e5757fb9 100644
@@ -115,7 +115,7 @@ static void wait_for_fbc_state_changed(
 			FBC_STATUS,
 			FBC_ENABLE_STATUS) == enabled)
 			break;
-		udelay(10);
+		msleep(10);
 		counter++;
 	}
 
@@ -124,7 +124,13 @@ static void wait_for_fbc_state_changed(
 			cp110->base.ctx->logger, LOG_WARNING,
 			"%s: wait counter exceeded, changes to HW not applied",
 			__func__);
+	} else {
+		dm_logger_write(
+			cp110->base.ctx->logger, LOG_SYNC,
+			"FBC status changed to %d", enabled);
 	}
+
+
 }
 
 void dce110_compressor_power_up_fbc(struct compressor *compressor)
Signature · 6 lines
2.11.0

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

PATCH 21/77 drm/amd/display: fix not enter/exit PSR with latest driver/SBIOS

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c   | 2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c   | 5 ++++-
 3 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index d77f0de0f2bf..cab54afa1131 100644
@@ -1975,7 +1975,7 @@ bool dc_link_setup_psr(struct dc_link *link,
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 		/*skip power down the single pipe since it blocks the cstate*/
 		if (ASIC_REV_IS_RAVEN(link->ctx->asic_id.hw_internal_rev))
-			psr_context->psr_level.bits.SKIP_SINGLE_OTG_DISABLE = true;
+			psr_context->psr_level.bits.SKIP_SINGLE_OTG_DISABLE = false;
 #endif
 
 		/* SMU will perform additional powerdown sequence.
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +2 -1
index 9d67340a6b8b..06d9a3e7c8a2 100644
@@ -417,9 +417,10 @@ static int dce112_set_clock(
 
 	bp->funcs->set_dce_clock(bp, &dce_clk_params);
 
-	if (abm->funcs->is_dmcu_initialized(abm))
+	if (abm->funcs->is_dmcu_initialized(abm) && clk_dce->dfs_bypass_disp_clk != actual_clock)
 		dmcu->funcs->set_psr_wait_loop(dmcu,
 				actual_clock / 1000 / 7);
+	clk_dce->dfs_bypass_disp_clk = actual_clock;
 	return actual_clock;
 }
 
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +4 -1
index 92902f011418..efcdb2bf4d0d 100644
@@ -260,6 +260,8 @@ static void dce_psr_wait_loop(
 {
 	struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu);
 	union dce_dmcu_psr_config_data_wait_loop_reg1 masterCmdData1;
+	if (cached_wait_loop_number == wait_loop_number)
+		return;
 
 	/* waitDMCUReadyForCmd */
 	REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 0, 1, 10000);
@@ -500,7 +502,7 @@ static void dcn10_psr_wait_loop(
 {
 	struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu);
 	union dce_dmcu_psr_config_data_wait_loop_reg1 masterCmdData1;
-
+	if (wait_loop_number != 0) {
 	/* waitDMCUReadyForCmd */
 	REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 0, 1, 10000);
 
@@ -514,6 +516,7 @@ static void dcn10_psr_wait_loop(
 
 	/* notifyDMCUMsg */
 	REG_UPDATE(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 1);
+	}
 }
 
 static void dcn10_get_psr_wait_loop(unsigned int *psr_wait_loop_number)
Signature · 6 lines
2.11.0

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

PATCH 22/77 drm/amd/display: Log OTG registers with dcn10 hw state

In reply to a message not in the archive

From: Corbin McElhanney <[email protected]>

---
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 33 +++++++++++++++++
 .../amd/display/dc/dcn10/dcn10_timing_generator.c  | 42 ++++++++++++++++++++++
 .../amd/display/dc/dcn10/dcn10_timing_generator.h  | 25 +++++++++++++
 3 files changed, 100 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +33 -0
index f0e49d16019c..ddfa6a8d087b 100644
@@ -32,6 +32,7 @@
 #include "dce/dce_hwseq.h"
 #include "abm.h"
 #include "dcn10/dcn10_mem_input.h"
+#include "dcn10/dcn10_timing_generator.h"
 #include "dcn10/dcn10_dpp.h"
 #include "dcn10/dcn10_mpc.h"
 #include "timing_generator.h"
@@ -200,6 +201,38 @@ static void dcn10_log_hw_state(struct dc *dc)
 	}
 	DTN_INFO("\n");
 
+	DTN_INFO("OTG:\t v_bs \t v_be \t v_ss \t v_se \t vpol \t vmax \t vmin \t "
+			"h_bs \t h_be \t h_ss \t h_se \t hpol \t htot \t vtot \t underflow\n");
+
+	for (i = 0; i < pool->pipe_count; i++) {
+		struct timing_generator *tg = pool->timing_generators[i];
+		struct dcn_otg_state s;
+
+		tgn10_read_otg_state(DCN10TG_FROM_TG(tg), &s);
+
+		DTN_INFO("[%d]:\t %d \t %d \t %d \t %d \t "
+				"%d \t %d \t %d \t %d \t %d \t %d \t "
+				"%d \t %d \t %d \t %d \t %d \t ",
+				i,
+				s.v_blank_start,
+				s.v_blank_end,
+				s.v_sync_a_start,
+				s.v_sync_a_end,
+				s.v_sync_a_pol,
+				s.v_total_max,
+				s.v_total_min,
+				s.h_blank_start,
+				s.h_blank_end,
+				s.h_sync_a_start,
+				s.h_sync_a_end,
+				s.h_sync_a_pol,
+				s.h_total,
+				s.v_total,
+				s.underflow_occurred_status);
+		DTN_INFO("\n");
+	}
+	DTN_INFO("\n");
+
 	log_mpc_crc(dc);
 
 	DTN_INFO_END();
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +42 -0

48 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.h +25 -0
index 747e8211e507..654889318fc1 100644
@@ -67,6 +67,7 @@
 	SRI(OTG_CLOCK_CONTROL, OTG, inst),\
 	SRI(OPTC_INPUT_CLOCK_CONTROL, ODM, inst),\
 	SRI(OPTC_DATA_SOURCE_SELECT, ODM, inst),\
+	SRI(OPTC_INPUT_GLOBAL_CONTROL, ODM, inst),\
 	SRI(OPPBUF_CONTROL, OPPBUF, inst),\
 	SRI(OPPBUF_3D_PARAMETERS_0, OPPBUF, inst),\
 	SRI(CONTROL, VTG, inst),\
@@ -121,6 +122,7 @@ struct dcn_tg_registers {
 	uint32_t OTG_CLOCK_CONTROL;
 	uint32_t OPTC_INPUT_CLOCK_CONTROL;
 	uint32_t OPTC_DATA_SOURCE_SELECT;
+	uint32_t OPTC_INPUT_GLOBAL_CONTROL;
 	uint32_t OPPBUF_CONTROL;
 	uint32_t OPPBUF_3D_PARAMETERS_0;
 	uint32_t CONTROL;
@@ -204,6 +206,7 @@ struct dcn_tg_registers {
 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_EN, mask_sh),\
 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_ON, mask_sh),\
 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_GATE_DIS, mask_sh),\
+	SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_OCCURRED_STATUS, mask_sh),\
 	SF(OPPBUF0_OPPBUF_CONTROL, OPPBUF_ACTIVE_WIDTH, mask_sh),\
 	SF(OPPBUF0_OPPBUF_3D_PARAMETERS_0, OPPBUF_3D_VACT_SPACE1_SIZE, mask_sh),\
 	SF(VTG0_CONTROL, VTG0_ENABLE, mask_sh),\
@@ -310,6 +313,7 @@ struct dcn_tg_registers {
 	type OPTC_INPUT_CLK_GATE_DIS;\
 	type OPTC_SRC_SEL;\
 	type OPTC_SEG0_SRC_SEL;\
+	type OPTC_UNDERFLOW_OCCURRED_STATUS;\
 	type OPPBUF_ACTIVE_WIDTH;\
 	type OPPBUF_3D_VACT_SPACE1_SIZE;\
 	type VTG0_ENABLE;\
@@ -346,4 +350,25 @@ struct dcn10_timing_generator {
 
 void dcn10_timing_generator_init(struct dcn10_timing_generator *tg);
 
+struct dcn_otg_state {
+	uint32_t v_blank_start;
+	uint32_t v_blank_end;
+	uint32_t v_sync_a_pol;
+	uint32_t v_total;
+	uint32_t v_total_max;
+	uint32_t v_total_min;
+	uint32_t v_sync_a_start;
+	uint32_t v_sync_a_end;
+	uint32_t h_blank_start;
+	uint32_t h_blank_end;
+	uint32_t h_sync_a_start;
+	uint32_t h_sync_a_end;
+	uint32_t h_sync_a_pol;
+	uint32_t h_total;
+	uint32_t underflow_occurred_status;
+};
+
+void tgn10_read_otg_state(struct dcn10_timing_generator *tgn10,
+		struct dcn_otg_state *s);
+
 #endif /* __DC_TIMING_GENERATOR_DCN10_H__ */
Signature · 6 lines
2.11.0

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

PATCH 23/77 drm/amd/display: Fix FBC disable for stereo

In reply to a message not in the archive

From: Roman Li <[email protected]>

Removed FBC disable from dc_enable_stereo().
It should be implemented in stereo_setup callback, which is not implemented yet. Otherwise it always disable FBC regardless if stereo supported or not.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -11
index 10126d9a7233..8c6fae27828f 100644
@@ -883,10 +883,6 @@ bool dc_enable_stereo(
 	struct pipe_ctx *pipe;
 	struct dc  *core_dc = dc;
 
-#ifdef ENABLE_FBC
-	struct compressor *fbc_compressor = core_dc->fbc_compressor;
-#endif
-
 	for (i = 0; i < MAX_PIPES; i++) {
 		if (context != NULL)
 			pipe = &context->res_ctx.pipe_ctx[i];
@@ -899,13 +895,6 @@ bool dc_enable_stereo(
 		}
 	}
 
-#ifdef ENABLE_FBC
-	if (fbc_compressor != NULL &&
-	    fbc_compressor->funcs->is_fbc_enabled_in_hw(core_dc->fbc_compressor,
-							NULL))
-		fbc_compressor->funcs->disable_fbc(fbc_compressor);
-
-#endif
 	return ret;
 }
 
Signature · 6 lines
2.11.0

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

PATCH 24/77 drm/amd/display: separate scl functions out from dcn10_dpp

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/Makefile      |   3 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 650 +-----------------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h   |   5 +
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  | 762 +++++++++++++++++++++
 4 files changed, 770 insertions(+), 650 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
drivers/gpu/drm/amd/display/dc/dcn10/Makefile +2 -1
index 8af201a51a2a..83619e6b8a05 100644
@@ -3,7 +3,8 @@
 
 DCN10 = dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \
 		dcn10_dpp.o dcn10_opp.o dcn10_timing_generator.o \
-		dcn10_mem_input.o dcn10_mpc.o dcn10_dwb.o
+		dcn10_mem_input.o dcn10_mpc.o dcn10_dwb.o \
+		dcn10_dpp_dscl.o
 
 AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +1 -649

668 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +5 -0
index 1c9d3320064a..496df1fad8c4 100644
@@ -1386,6 +1386,11 @@ struct dcn10_dpp {
 	int lb_bits_per_entry;
 	bool is_write_to_ram_a_safe;
 };
+
+void dcn10_dpp_set_scaler_manual_scale(
+	struct transform *xfm_base,
+	const struct scaler_data *scl_data);
+
 bool dcn10_dpp_construct(struct dcn10_dpp *xfm110,
 	struct dc_context *ctx,
 	uint32_t inst,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c new file +762 -0

762 lines not on this page · raw message

Signature · 6 lines
2.11.0

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

PATCH 25/77 drm/amd/display: Cache edp config in dc link

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 ++
 drivers/gpu/drm/amd/display/dc/dc.h              | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -0
index 0144c98fd0d5..d621237e923e 100644
@@ -2258,6 +2258,8 @@ static void retrieve_link_cap(struct dc_link *link)
 		DP_EDP_CONFIGURATION_CAP - DP_DPCD_REV];
 	link->dpcd_caps.panel_mode_edp =
 		edp_config_cap.bits.ALT_SCRAMBLER_RESET;
+	link->dpcd_caps.dpcd_display_control_capable =
+		edp_config_cap.bits.DPCD_DISPLAY_CONTROL_CAPABLE;
 
 	link->test_pattern_enabled = false;
 	link->compliance_test_state.raw = 0;
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 2b4fc6616243..9e4d0715c132 100644
@@ -759,6 +759,7 @@ struct dpcd_caps {
 
 	bool allow_invalid_MSA_timing_param;
 	bool panel_mode_edp;
+	bool dpcd_display_control_capable;
 };
 
 struct dc_link_status {
@@ -833,7 +834,6 @@ struct dc_link {
 	struct dpcd_caps dpcd_caps;
 	unsigned short chip_caps;
 	unsigned int dpcd_sink_count;
-
 	enum edp_revision edp_revision;
 	bool psr_enabled;
 
Signature · 6 lines
2.11.0

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

PATCH 26/77 drm/amd/display: re-enable audio after LT test

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

[Description]
Audio should be attached to the same pipe once it is attached. We will not remove audio endpoint in disable stream. We will reeanble the audio after automated link training test

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c         | 14 ++++++++++++++
 .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c    |  2 --
 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +14 -0
index e12f1f9fb590..3a5abd92036a 100644
@@ -310,6 +310,20 @@ void dp_retrain_link_dp_test(struct dc_link *link,
 
 			link->dc->hwss.unblank_stream(&pipes[i],
 					link_setting);
+
+			if (pipes[i].stream_res.audio) {
+				/* notify audio driver for
+				 * audio modes of monitor */
+				pipes[i].stream_res.audio->funcs->az_enable(
+						pipes[i].stream_res.audio);
+
+				/* un-mute audio */
+				/* TODO: audio should be per stream rather than
+				 * per link */
+				pipes[i].stream_res.stream_enc->funcs->
+				audio_mute_control(
+					pipes[i].stream_res.stream_enc, false);
+			}
 		}
 	}
 }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -2
index e6c6f1108078..7516c198d13a 100644
@@ -758,8 +758,6 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 			pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_disable(
 					pipe_ctx->stream_res.stream_enc);
 
-		pipe_ctx->stream_res.audio = NULL;
-
 		/* TODO: notify audio driver for if audio modes list changed
 		 * add audio mode list change flag */
 		/* dal_audio_disable_azalia_audio_jack_presence(stream->audio,
Signature · 6 lines
2.11.0

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

PATCH 27/77 drm/amd/display: separate cm functions out from dcn10_dpp

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/Makefile      |   2 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 662 ------------------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h   |  34 +
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    | 776 +++++++++++++++++++++
 4 files changed, 811 insertions(+), 663 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c
drivers/gpu/drm/amd/display/dc/dcn10/Makefile +1 -1
index 83619e6b8a05..52b56d19ca40 100644
@@ -4,7 +4,7 @@
 DCN10 = dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \
 		dcn10_dpp.o dcn10_opp.o dcn10_timing_generator.o \
 		dcn10_mem_input.o dcn10_mpc.o dcn10_dwb.o \
-		dcn10_dpp_dscl.o
+		dcn10_dpp_dscl.o dcn10_dpp_cm.o
 
 AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +0 -662

669 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +34 -0
index 496df1fad8c4..a4dfdb9b4d69 100644
@@ -1387,6 +1387,40 @@ struct dcn10_dpp {
 	bool is_write_to_ram_a_safe;
 };
 
+void opp_program_regamma_lut(
+		struct transform *xfm_base,
+		const struct pwl_result_data *rgb,
+		uint32_t num);
+
+void oppn10_power_on_regamma_lut(
+	struct transform *xfm_base,
+	bool power_on);
+
+void opp_configure_regamma_lut(
+		struct transform *xfm_base,
+		bool is_ram_a);
+
+/*program re gamma RAM A*/
+void opp_program_regamma_luta_settings(
+		struct transform *xfm_base,
+		const struct pwl_params *params);
+
+/*program re gamma RAM B*/
+void opp_program_regamma_lutb_settings(
+		struct transform *xfm_base,
+		const struct pwl_params *params);
+void oppn10_set_output_csc_adjustment(
+		struct transform *xfm_base,
+		const struct out_csc_color_matrix *tbl_entry);
+
+void oppn10_set_output_csc_default(
+		struct transform *xfm_base,
+		const struct default_adjustment *default_adjust);
+
+void dcn_dpp_set_gamut_remap(
+	struct transform *xfm,
+	const struct xfm_grph_csc_adjustment *adjust);
+
 void dcn10_dpp_set_scaler_manual_scale(
 	struct transform *xfm_base,
 	const struct scaler_data *scl_data);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c new file +776 -0

776 lines not on this page · raw message

Signature · 6 lines
2.11.0

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

PATCH 28/77 drm/amd/display: Fix two MST not light up regressions

In reply to a message not in the archive

From: Jerry Zuo <[email protected]>

1. Change 100104: Move verify link cap after read edid causes MST link_cap struct not being set. It leads to zero denominator pbn_per_slot value, leading to the crash at dal_fixed31_32_div(). Skip MST link training for now and will need to add MST specific link traning routine later.

2. Change 98822: Adding edp supports changes link setting condition from max_link to verified_link. It leads to MST is getting wrong link settings.
e.g. LINK_SPREAD_05_DOWNSPREAD_30KHZ not set in MST case

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c    | 16 +++++++++-------
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c |  8 ++++++++
 2 files changed, 17 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +9 -7
index cab54afa1131..ee9b98472029 100644
@@ -607,6 +607,12 @@ bool dc_link_detect(struct dc_link *link, bool boot)
 			if (link->type == dc_connection_mst_branch) {
 				LINK_INFO("link=%d, mst branch is now Connected\n",
 					link->link_index);
+				/* Need to setup mst link_cap struct here
+				 * otherwise dc_link_detect() will leave mst link_cap
+				 * empty which leads to allocate_mst_payload() has "0"
+				 * pbn_per_slot value leading to exception on dal_fixed31_32_div()
+				 */
+				link->verified_link_cap = link->reported_link_cap;
 				return false;
 			}
 
@@ -672,13 +678,9 @@ bool dc_link_detect(struct dc_link *link, bool boot)
 			 * TODO debug why Dell 2413 doesn't like
 			 *  two link trainings
 			 */
-			if (is_mst_supported(link)) {
-				link->verified_link_cap =
-						link->reported_link_cap;
-			} else {
-				dp_hbr_verify_link_cap(link,
-				    &link->reported_link_cap);
-			}
+
+			/* deal with non-mst cases */
+			dp_hbr_verify_link_cap(link, &link->reported_link_cap);
 		}
 
 		/* HDMI-DVI Dongle */
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +8 -0
index d621237e923e..e35bdce6a0f3 100644
@@ -1459,6 +1459,14 @@ void decide_link_settings(struct dc_stream_state *stream,
 		return;
 	}
 
+	/* MST doesn't perform link training for now
+	 * TODO: add MST specific link training routine
+	 */
+	if (is_mst_supported(link)) {
+		*link_setting = link->verified_link_cap;
+		return;
+	}
+
     /* search for the minimum link setting that:
      * 1. is supported according to the link training result
      * 2. could support the b/w requested by the timing
Signature · 6 lines
2.11.0

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

PATCH 29/77 drm/amd/display: Disable stutter for Raven

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
index 4c5714dde9a0..bb322f94f72e 100644
@@ -1398,6 +1398,10 @@ int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 			DRM_ERROR("DM: Failed to initialize IRQ\n");
 			goto fail_free_encoder;
 		}
+		/*
+		 * Temporary disable until pplib/smu interaction is implemented
+		 */
+		dm->dc->debug.disable_stutter = true;
 		break;
 #endif
 	default:
Signature · 6 lines
2.11.0

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

PATCH 30/77 drm/amd/display: Remove unnecessary assignemnt

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +0 -1
index 5e4f7f08e3db..aaa6d2326190 100644
@@ -41,7 +41,6 @@ static bool construct(struct dc_stream_state *stream,
 
 	stream->sink = dc_sink_data;
 	stream->ctx = stream->sink->ctx;
-	stream->sink = dc_sink_data;
 
 	dc_sink_retain(dc_sink_data);
 
Signature · 6 lines
2.11.0

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

PATCH 31/77 drm/amd/display: fix hubp mpcc and opp tracking

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

This should be handled by mi and mpc only

---
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c        | 2 ++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 6 ++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c    | 3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +2 -0
index 627669749740..83d9caa4f438 100644
@@ -686,6 +686,8 @@ void dce_mem_input_construct(
 	dce_mi->shifts = mi_shift;
 	dce_mi->masks = mi_mask;
 
+	dce_mi->base.mpcc_id = 0xf;
+	dce_mi->base.opp_id = 0xf;
 }
 
 void dce112_mem_input_construct(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -4
index ddfa6a8d087b..69f67f6e27b1 100644
@@ -1066,9 +1066,6 @@ static void plane_atomic_disable(struct dc *dc,
 			fe_idx);*/
 
 	mi->funcs->set_blank(mi, true);
-	/*todo: unhack this*/
-	mi->opp_id = 0xf;
-	mi->mpcc_id = 0xf;
 
 	if (dc->debug.sanity_checks)
 		verify_allow_pstate_change_high(dc->hwseq);
@@ -2304,7 +2301,8 @@ static void update_dchubp_dpp(
 		&plane_state->dcc,
 		plane_state->horizontal_mirror);
 
-	mi->funcs->set_blank(mi, !is_pipe_tree_visible(pipe_ctx));
+	if (is_pipe_tree_visible(pipe_ctx))
+		mi->funcs->set_blank(mi, false);
 }
 
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +1 -2
index 11daf6b5c7d8..0a47e6ad4286 100644
@@ -51,9 +51,8 @@ static void min10_set_blank(struct mem_input *mem_input, bool blank)
 		REG_WAIT(DCHUBP_CNTL,
 				HUBP_NO_OUTSTANDING_REQ, 1,
 				1, 200);
-		/*todo: unhack this
 		mem_input->mpcc_id = 0xf;
-		mem_input->opp_id = 0xf;*/
+		mem_input->opp_id = 0xf;
 	}
 }
 
Signature · 6 lines
2.11.0

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

PATCH 32/77 drm/amd/display: Fixed mpc add, enable always scaler for video surface.

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c      | 6 +++---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +3 -3
index 52f2f2dd9a43..ce408ccb428e 100644
@@ -229,9 +229,9 @@ static void mpc10_mpcc_add(struct mpc *mpc, struct mpcc_cfg *cfg)
 	mpc10_set_bg_color(mpc10, &cfg->black_color, mpcc_id);
 
 	mpc10->mpcc_in_use_mask |= 1 << mpcc_id;
-	for (z_idx = cfg->z_index; z_idx < cfg->opp->mpc_tree.num_pipes; z_idx++) {
-		cfg->opp->mpc_tree.dpp[z_idx + 1] = cfg->opp->mpc_tree.dpp[z_idx];
-		cfg->opp->mpc_tree.mpcc[z_idx + 1] = cfg->opp->mpc_tree.mpcc[z_idx];
+	for (z_idx = cfg->opp->mpc_tree.num_pipes; z_idx > cfg->z_index; z_idx--) {
+		cfg->opp->mpc_tree.dpp[z_idx] = cfg->opp->mpc_tree.dpp[z_idx - 1];
+		cfg->opp->mpc_tree.mpcc[z_idx] = cfg->opp->mpc_tree.mpcc[z_idx - 1];
 	}
 	cfg->opp->mpc_tree.dpp[cfg->z_index] = cfg->mi->inst;
 	cfg->opp->mpc_tree.mpcc[cfg->z_index] = mpcc_id;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +4 -0
index ee43cbc70c8a..9c7ec047f083 100644
@@ -422,6 +422,10 @@ static const struct dc_debug debug_defaults_drv = {
 		.force_abm_enable = false,
 		.timing_trace = false,
 		.clock_trace = true,
+		/* spread sheet doesn't handle taps_c is one properly,
+		 * need to enable scaler for video surface to pass
+		 * bandwidth validation.*/
+		.always_scale = true,
 		.disable_pplib_clock_request = true,
 		.disable_pplib_wm_range = false,
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
Signature · 6 lines
2.11.0

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

PATCH 33/77 drm/amd/display: cleanup naming of DCN DPP functions

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 41 +++++++++++-----------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h   | 25 ++++++++-----
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    | 20 +++++------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  |  2 +-
 4 files changed, 48 insertions(+), 40 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +21 -20
index f0e74afc4518..30722495de0a 100644
@@ -123,7 +123,7 @@ void dpp_set_gamut_remap_bypass(struct dcn10_dpp *xfm)
 #define IDENTITY_RATIO(ratio) (dal_fixed31_32_u2d19(ratio) == (1 << 19))
 
 
-static bool dpp_get_optimal_number_of_taps(
+bool dpp_get_optimal_number_of_taps(
 		struct transform *xfm,
 		struct scaler_data *scl_data,
 		const struct scaling_taps *in_taps)
@@ -182,7 +182,7 @@ static bool dpp_get_optimal_number_of_taps(
 	return true;
 }
 
-static void dpp_reset(struct transform *xfm_base)
+void dpp_reset(struct transform *xfm_base)
 {
 	struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base);
 
@@ -197,26 +197,26 @@ static void dpp_reset(struct transform *xfm_base)
 
 
 
-static bool oppn10_set_regamma_pwl(
+static bool dcn10_dpp_cm_set_regamma_pwl(
 	struct transform *xfm_base, const struct pwl_params *params)
 {
 	struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base);
 
-	oppn10_power_on_regamma_lut(xfm_base, true);
-	opp_configure_regamma_lut(xfm_base, xfm->is_write_to_ram_a_safe);
+	dcn10_dpp_cm_power_on_regamma_lut(xfm_base, true);
+	dcn10_dpp_cm_configure_regamma_lut(xfm_base, xfm->is_write_to_ram_a_safe);
 
 	if (xfm->is_write_to_ram_a_safe)
-		opp_program_regamma_luta_settings(xfm_base, params);
+		dcn10_dpp_cm_program_regamma_luta_settings(xfm_base, params);
 	else
-		opp_program_regamma_lutb_settings(xfm_base, params);
+		dcn10_dpp_cm_program_regamma_lutb_settings(xfm_base, params);
 
-	opp_program_regamma_lut(
+	dcn10_dpp_cm_program_regamma_lut(
 			xfm_base, params->rgb_resulted, params->hw_points_num);
 
 	return true;
 }
 
-static void oppn10_set_regamma_mode(
+static void dcn10_dpp_cm_set_regamma_mode(
 	struct transform *xfm_base,
 	enum opp_regamma mode)
 {
@@ -251,20 +251,21 @@ static void oppn10_set_regamma_mode(
 
 static struct transform_funcs dcn10_dpp_funcs = {
 		.transform_reset = dpp_reset,
-		.transform_set_scaler = dcn10_dpp_set_scaler_manual_scale,
+		.transform_set_scaler = dcn10_dpp_dscl_set_scaler_manual_scale,
 		.transform_get_optimal_number_of_taps = dpp_get_optimal_number_of_taps,
-		.transform_set_gamut_remap = dcn_dpp_set_gamut_remap,
-		.opp_set_csc_adjustment = oppn10_set_output_csc_adjustment,
-		.opp_set_csc_default = oppn10_set_output_csc_default,
-		.opp_power_on_regamma_lut = oppn10_power_on_regamma_lut,
-		.opp_program_regamma_lut = opp_program_regamma_lut,
-		.opp_configure_regamma_lut = opp_configure_regamma_lut,
-		.opp_program_regamma_lutb_settings = opp_program_regamma_lutb_settings,
-		.opp_program_regamma_luta_settings = opp_program_regamma_luta_settings,
-		.opp_program_regamma_pwl = oppn10_set_regamma_pwl,
-		.opp_set_regamma_mode = oppn10_set_regamma_mode,
+		.transform_set_gamut_remap = dcn10_dpp_cm_set_gamut_remap,
+		.opp_set_csc_adjustment = dcn10_dpp_cm_set_output_csc_adjustment,
+		.opp_set_csc_default = dcn10_dpp_cm_set_output_csc_default,
+		.opp_power_on_regamma_lut = dcn10_dpp_cm_power_on_regamma_lut,
+		.opp_program_regamma_lut = dcn10_dpp_cm_program_regamma_lut,
+		.opp_configure_regamma_lut = dcn10_dpp_cm_configure_regamma_lut,
+		.opp_program_regamma_lutb_settings = dcn10_dpp_cm_program_regamma_lutb_settings,
+		.opp_program_regamma_luta_settings = dcn10_dpp_cm_program_regamma_luta_settings,
+		.opp_program_regamma_pwl = dcn10_dpp_cm_set_regamma_pwl,
+		.opp_set_regamma_mode = dcn10_dpp_cm_set_regamma_mode,
 };
 
+
 /*****************************************/
 /* Constructor, Destructor               */
 /*****************************************/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +16 -9
index a4dfdb9b4d69..18ee338f6b28 100644
@@ -1387,41 +1387,48 @@ struct dcn10_dpp {
 	bool is_write_to_ram_a_safe;
 };
 
-void opp_program_regamma_lut(
+bool dpp_get_optimal_number_of_taps(
+		struct transform *xfm,
+		struct scaler_data *scl_data,
+		const struct scaling_taps *in_taps);
+
+void dpp_reset(struct transform *xfm_base);
+
+void dcn10_dpp_cm_program_regamma_lut(
 		struct transform *xfm_base,
 		const struct pwl_result_data *rgb,
 		uint32_t num);
 
-void oppn10_power_on_regamma_lut(
+void dcn10_dpp_cm_power_on_regamma_lut(
 	struct transform *xfm_base,
 	bool power_on);
 
-void opp_configure_regamma_lut(
+void dcn10_dpp_cm_configure_regamma_lut(
 		struct transform *xfm_base,
 		bool is_ram_a);
 
 /*program re gamma RAM A*/
-void opp_program_regamma_luta_settings(
+void dcn10_dpp_cm_program_regamma_luta_settings(
 		struct transform *xfm_base,
 		const struct pwl_params *params);
 
 /*program re gamma RAM B*/
-void opp_program_regamma_lutb_settings(
+void dcn10_dpp_cm_program_regamma_lutb_settings(
 		struct transform *xfm_base,
 		const struct pwl_params *params);
-void oppn10_set_output_csc_adjustment(
+void dcn10_dpp_cm_set_output_csc_adjustment(
 		struct transform *xfm_base,
 		const struct out_csc_color_matrix *tbl_entry);
 
-void oppn10_set_output_csc_default(
+void dcn10_dpp_cm_set_output_csc_default(
 		struct transform *xfm_base,
 		const struct default_adjustment *default_adjust);
 
-void dcn_dpp_set_gamut_remap(
+void dcn10_dpp_cm_set_gamut_remap(
 	struct transform *xfm,
 	const struct xfm_grph_csc_adjustment *adjust);
 
-void dcn10_dpp_set_scaler_manual_scale(
+void dcn10_dpp_dscl_set_scaler_manual_scale(
 	struct transform *xfm_base,
 	const struct scaler_data *scl_data);
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +10 -10
index 7eb4334c30fc..9ff283bff007 100644
@@ -221,7 +221,7 @@ static void program_gamut_remap(
 
 }
 
-void dcn_dpp_set_gamut_remap(
+void dcn10_dpp_cm_set_gamut_remap(
 	struct transform *xfm,
 	const struct xfm_grph_csc_adjustment *adjust)
 {
@@ -256,7 +256,7 @@ void dcn_dpp_set_gamut_remap(
 	}
 }
 
-void oppn10_set_output_csc_default(
+void dcn10_dpp_cm_set_output_csc_default(
 		struct transform *xfm_base,
 		const struct default_adjustment *default_adjust)
 {
@@ -293,7 +293,7 @@ void oppn10_set_output_csc_default(
 
 }
 
-static void oppn10_program_color_matrix(
+static void dcn10_dpp_cm_program_color_matrix(
 		struct dcn10_dpp *xfm,
 		const struct out_csc_color_matrix *tbl_entry)
 {
@@ -363,7 +363,7 @@ static void oppn10_program_color_matrix(
 	}
 }
 
-void oppn10_set_output_csc_adjustment(
+void dcn10_dpp_cm_set_output_csc_adjustment(
 		struct transform *xfm_base,
 		const struct out_csc_color_matrix *tbl_entry)
 {
@@ -399,10 +399,10 @@ void oppn10_set_output_csc_adjustment(
 	*/
 
 	REG_SET(CM_OCSC_CONTROL, 0, CM_OCSC_MODE, ocsc_mode);
-	oppn10_program_color_matrix(xfm, tbl_entry);
+	dcn10_dpp_cm_program_color_matrix(xfm, tbl_entry);
 }
 
-void oppn10_power_on_regamma_lut(
+void dcn10_dpp_cm_power_on_regamma_lut(
 	struct transform *xfm_base,
 	bool power_on)
 {
@@ -412,7 +412,7 @@ void oppn10_power_on_regamma_lut(
 
 }
 
-void opp_program_regamma_lut(
+void dcn10_dpp_cm_program_regamma_lut(
 		struct transform *xfm_base,
 		const struct pwl_result_data *rgb,
 		uint32_t num)
@@ -435,7 +435,7 @@ void opp_program_regamma_lut(
 
 }
 
-void opp_configure_regamma_lut(
+void dcn10_dpp_cm_configure_regamma_lut(
 		struct transform *xfm_base,
 		bool is_ram_a)
 {
@@ -449,7 +449,7 @@ void opp_configure_regamma_lut(
 }
 
 /*program re gamma RAM A*/
-void opp_program_regamma_luta_settings(
+void dcn10_dpp_cm_program_regamma_luta_settings(
 		struct transform *xfm_base,
 		const struct pwl_params *params)
 {
@@ -612,7 +612,7 @@ void opp_program_regamma_luta_settings(
 }
 
 /*program re gamma RAM B*/
-void opp_program_regamma_lutb_settings(
+void dcn10_dpp_cm_program_regamma_lutb_settings(
 		struct transform *xfm_base,
 		const struct pwl_params *params)
 {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +1 -1
index 95f014b5e7ed..76d5f5d4d82f 100644
@@ -636,7 +636,7 @@ static void dpp_set_recout(
 }
 
 /* Main function to program scaler and line buffer in manual scaling mode */
-void dcn10_dpp_set_scaler_manual_scale(
+void dcn10_dpp_dscl_set_scaler_manual_scale(
 	struct transform *xfm_base,
 	const struct scaler_data *scl_data)
 {
Signature · 6 lines
2.11.0

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

PATCH 34/77 drm/amd/display: memory leak dwb

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +5 -0
index 9c7ec047f083..4af40f5138fc 100644
@@ -747,6 +747,11 @@ static void destruct(struct dcn10_resource_pool *pool)
 			dce_aud_destroy(&pool->base.audios[i]);
 	}
 
+	for (i = 0; i < pool->base.res_cap->num_dwb; i++) {
+		dm_free(pool->base.dwbc[i]);
+		pool->base.dwbc[i] = NULL;
+	}
+
 	for (i = 0; i < pool->base.clk_src_count; i++) {
 		if (pool->base.clock_sources[i] != NULL) {
 			dcn10_clock_source_destroy(&pool->base.clock_sources[i]);
Signature · 6 lines
2.11.0

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

PATCH 35/77 drm/amd/display: dc: Remove unneeded includes in DCN

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +0 -3
index 69f67f6e27b1..54e37b10ffbf 100644
@@ -39,9 +39,6 @@
 #include "opp.h"
 #include "ipp.h"
 #include "mpc.h"
-#include "raven1/DCN/dcn_1_0_offset.h"
-#include "raven1/DCN/dcn_1_0_sh_mask.h"
-#include "vega10/soc15ip.h"
 #include "reg_helper.h"
 
 #define CTX \
Signature · 6 lines
2.11.0

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

PATCH 36/77 drm/amd/display: Enable double buffer when unblank crtc.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

Change-Id I69bcb30ffb1ec1409d8e61adc009b9c87a7ccc30
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +3 -0
index 6a5f2683c2e5..cc58f43400d7 100644
@@ -289,6 +289,9 @@ static void tgn10_unblank_crtc(struct timing_generator *tg)
 {
 	struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
 
+	REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
+			OTG_BLANK_DATA_DOUBLE_BUFFER_EN, 1);
+
 	REG_UPDATE_2(OTG_BLANK_CONTROL,
 			OTG_BLANK_DATA_EN, 0,
 			OTG_BLANK_DE_MODE, 0);
Signature · 6 lines
2.11.0

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

PATCH 37/77 drm/amd/display: version 3.1.01

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id I46ef2f3c129dd712b9e19f4c459d4bb5a40569c5
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++
 drivers/gpu/drm/amd/display/dc/dc.h      | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
index 8c6fae27828f..ad3b35209f55 100644
@@ -48,6 +48,9 @@
 #include "dm_helpers.h"
 #include "mem_input.h"
 
+
+char dc_ver[] = DC_VER;
+
 /*******************************************************************************
  * Private functions
  ******************************************************************************/
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 9e4d0715c132..935f4432570b 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-
+#define DC_VER "3.1.01"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.11.0

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

PATCH 38/77 drm/amd/display: write dpcd 0x600 to 2 for DP/eDP when powerdown

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id Id83238a2f1b7cc66bdf7a9a02fc630f8805fdd17
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c               |  2 +-
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 10 +++++++++-
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h |  1 +
 3 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index ee9b98472029..0bdd41ca8799 100644
@@ -1977,7 +1977,7 @@ bool dc_link_setup_psr(struct dc_link *link,
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 		/*skip power down the single pipe since it blocks the cstate*/
 		if (ASIC_REV_IS_RAVEN(link->ctx->asic_id.hw_internal_rev))
-			psr_context->psr_level.bits.SKIP_SINGLE_OTG_DISABLE = false;
+			psr_context->psr_level.bits.SKIP_CRTC_DISABLE = true;
 #endif
 
 		/* SMU will perform additional powerdown sequence.
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +9 -1
index 7516c198d13a..8ba61b9b8792 100644
@@ -1147,8 +1147,16 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 static void power_down_encoders(struct dc *dc)
 {
 	int i;
-
+	enum connector_id connector_id;
 	for (i = 0; i < dc->link_count; i++) {
+		connector_id = dal_graphics_object_id_get_connector_id(dc->links[i]->link_id);
+		if ((connector_id == CONNECTOR_ID_DISPLAY_PORT) ||
+			(connector_id == CONNECTOR_ID_EDP)) {
+
+			if (!dc->links[i]->wa_flags.dp_keep_receiver_powered)
+				dp_receiver_power_ctrl(dc->links[i], false);
+		}
+
 		dc->links[i]->link_enc->funcs->disable_output(
 				dc->links[i]->link_enc, SIGNAL_TYPE_NONE);
 	}
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +1 -0
index d710f6e6dc07..ac418fd83894 100644
@@ -67,5 +67,6 @@ void dce110_fill_display_configs(
 
 uint32_t dce110_get_min_vblank_time_us(const struct validate_context *context);
 
+void dp_receiver_power_ctrl(struct dc_link *link, bool on);
 #endif /* __DC_HWSS_DCE110_H__ */
 
Signature · 6 lines
2.11.0

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

PATCH 39/77 drm/amd/display: retire dm_pp_apply_clock_for_voltage_request

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

set dcfclk and fclk req with pp_smu_display_requirement_rv

Change-Id Ifb26473798cb6d7b79dd831900dfc3abb939f4eb
---
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 26 +++++++++++++---------
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  8 ++-----
 2 files changed, 17 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +15 -11
index 54e37b10ffbf..20c4164a59d0 100644
@@ -2550,7 +2550,10 @@ static void dcn10_set_bandwidth(
 		struct validate_context *context,
 		bool decrease_allowed)
 {
-	struct dm_pp_clock_for_voltage_req clock;
+	struct pp_smu_display_requirement_rv *smu_req_cur =
+			&dc->res_pool->pp_smu_req;
+	struct pp_smu_display_requirement_rv smu_req = *smu_req_cur;
+	struct pp_smu_funcs_rv *pp_smu = dc->res_pool->pp_smu;
 
 	if (dc->debug.sanity_checks) {
 		verify_allow_pstate_change_high(dc->hwseq);
@@ -2569,19 +2572,12 @@ static void dcn10_set_bandwidth(
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.dcfclk_khz
 			> dc->current_context->bw.dcn.cur_clk.dcfclk_khz) {
-		clock.clk_type = DM_PP_CLOCK_TYPE_DCFCLK;
-		clock.clocks_in_khz = context->bw.dcn.calc_clk.dcfclk_khz;
-		dm_pp_apply_clock_for_voltage_request(dc->ctx, &clock);
-		dc->current_context->bw.dcn.cur_clk.dcfclk_khz = clock.clocks_in_khz;
-		context->bw.dcn.cur_clk.dcfclk_khz = clock.clocks_in_khz;
+		smu_req.hard_min_dcefclk_khz =
+				context->bw.dcn.calc_clk.dcfclk_khz;
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.fclk_khz
 			> dc->current_context->bw.dcn.cur_clk.fclk_khz) {
-		clock.clk_type = DM_PP_CLOCK_TYPE_FCLK;
-		clock.clocks_in_khz = context->bw.dcn.calc_clk.fclk_khz;
-		dm_pp_apply_clock_for_voltage_request(dc->ctx, &clock);
-		dc->current_context->bw.dcn.calc_clk.fclk_khz = clock.clocks_in_khz;
-		context->bw.dcn.cur_clk.fclk_khz = clock.clocks_in_khz;
+		smu_req.hard_min_fclk_khz = context->bw.dcn.calc_clk.fclk_khz;
 	}
 	if (decrease_allowed || context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz
 			> dc->current_context->bw.dcn.cur_clk.dcfclk_deep_sleep_khz) {
@@ -2590,6 +2586,14 @@ static void dcn10_set_bandwidth(
 		context->bw.dcn.cur_clk.dcfclk_deep_sleep_khz =
 				context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz;
 	}
+
+	smu_req.display_count = context->stream_count;
+
+	if (pp_smu->set_display_requirement)
+		pp_smu->set_display_requirement(&pp_smu->pp_smu, &smu_req);
+
+	*smu_req_cur = smu_req;
+
 	/* Decrease in freq is increase in period so opposite comparison for dram_ccm */
 	if (decrease_allowed || context->bw.dcn.calc_clk.dram_ccm_us
 			< dc->current_context->bw.dcn.cur_clk.dram_ccm_us) {
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -6
index 9a3239028377..62bd11d250c5 100644
@@ -132,10 +132,10 @@ struct resource_pool {
 	struct output_pixel_processor *opps[MAX_PIPES];
 	struct timing_generator *timing_generators[MAX_PIPES];
 	struct stream_encoder *stream_enc[MAX_PIPES * 2];
-#ifdef CONFIG_DRM_AMD_DC_DCN1_0
+
 	struct mpc *mpc;
 	struct pp_smu_funcs_rv *pp_smu;
-#endif
+	struct pp_smu_display_requirement_rv pp_smu_req;
 
 	struct dwbc *dwbc[MAX_DWB_PIPES];
 
@@ -234,7 +234,6 @@ struct dce_bw_output {
 	int blackout_recovery_time_us;
 };
 
-#ifdef CONFIG_DRM_AMD_DC_DCN1_0
 struct dcn_bw_clocks {
 	int dispclk_khz;
 	bool dppclk_div;
@@ -250,12 +249,9 @@ struct dcn_bw_output {
 	struct dcn_bw_clocks calc_clk;
 	struct dcn_watermark_set watermarks;
 };
-#endif
 
 union bw_context {
-#ifdef CONFIG_DRM_AMD_DC_DCN1_0
 	struct dcn_bw_output dcn;
-#endif
 	struct dce_bw_output dce;
 };
 
Signature · 6 lines
2.11.0

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

PATCH 40/77 drm/amd/display: Change log level for DCN powergatting

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

Change log level from LOG_DC to LOG_DEBUG
LOG_DC spams dmesg on linux when hotpluging

Change-Id I60a1b9c86f6867ce986fb5f2a16cfc5eadd07009
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 -6
index 20c4164a59d0..bd023299e2af 100644
@@ -772,7 +772,7 @@ static void power_on_plane(
 	hubp_pg_control(hws, plane_id, true);
 	REG_SET(DC_IP_REQUEST_CNTL, 0,
 			IP_REQUEST_EN, 0);
-	dm_logger_write(hws->ctx->logger, LOG_DC,
+	dm_logger_write(hws->ctx->logger, LOG_DEBUG,
 			"Un-gated front end for pipe %d\n", plane_id);
 }
 
@@ -1003,7 +1003,7 @@ static void reset_back_end_for_pipe(
 		return;
 
 	pipe_ctx->stream = NULL;
-	dm_logger_write(dc->ctx->logger, LOG_DC,
+	dm_logger_write(dc->ctx->logger, LOG_DEBUG,
 					"Reset back end for pipe %d, tg:%d\n",
 					pipe_ctx->pipe_idx, pipe_ctx->stream_res.tg->inst);
 }
@@ -1096,7 +1096,7 @@ static void plane_atomic_power_down(struct dc *dc, int fe_idx)
 	xfm->funcs->transform_reset(xfm);
 	REG_SET(DC_IP_REQUEST_CNTL, 0,
 			IP_REQUEST_EN, 0);
-	dm_logger_write(dc->ctx->logger, LOG_DC,
+	dm_logger_write(dc->ctx->logger, LOG_DEBUG,
 			"Power gated front end %d\n", fe_idx);
 
 	if (dc->debug.sanity_checks)
@@ -1153,7 +1153,7 @@ static void dcn10_power_down_fe(struct dc *dc, int fe_idx)
 	xfm->funcs->transform_reset(xfm);
 	REG_SET(DC_IP_REQUEST_CNTL, 0,
 			IP_REQUEST_EN, 0);
-	dm_logger_write(dc->ctx->logger, LOG_DC,
+	dm_logger_write(dc->ctx->logger, LOG_DEBUG,
 			"Power gated front end %d\n", fe_idx);
 
 	if (dc->debug.sanity_checks)
@@ -1921,7 +1921,7 @@ static void dcn10_power_on_fe(
 	/*TODO: REG_UPDATE(DENTIST_DISPCLK_CNTL, DENTIST_DPPCLK_WDIVIDER, 0x1f);*/
 
 	if (plane_state) {
-		dm_logger_write(dc->ctx->logger, LOG_DC,
+		dm_logger_write(dc->ctx->logger, LOG_DEBUG,
 				"Pipe:%d 0x%x: addr hi:0x%x, "
 				"addr low:0x%x, "
 				"src: %d, %d, %d,"
@@ -1939,7 +1939,7 @@ static void dcn10_power_on_fe(
 				plane_state->dst_rect.width,
 				plane_state->dst_rect.height);
 
-		dm_logger_write(dc->ctx->logger, LOG_HW_SET_MODE,
+		dm_logger_write(dc->ctx->logger, LOG_DEBUG,
 				"Pipe %d: width, height, x, y\n"
 				"viewport:%d, %d, %d, %d\n"
 				"recout:  %d, %d, %d, %d\n",
Signature · 6 lines
2.11.0

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

PATCH 41/77 drm/amd/display: retry LT on failing LT in automated request

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

[Description]
Link training is not retried in automated link training request. In case link training is occasionally failing, there is not way to retry so the requested lane settings will not set.

Change-Id I46fbdcf9d115bb5d8a841134e5db2c95ef81ee3f
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +3 -2
index 3a5abd92036a..23d8b614e0fd 100644
@@ -299,10 +299,11 @@ void dp_retrain_link_dp_test(struct dc_link *link,
 
 			dp_receiver_power_ctrl(link, true);
 
-			dc_link_dp_perform_link_training(
+			perform_link_training_with_retries(
 					link,
 					link_setting,
-					skip_video_pattern);
+					skip_video_pattern,
+					LINK_TRAINING_ATTEMPTS);
 
 			link->cur_link_settings = *link_setting;
 
Signature · 6 lines
2.11.0

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

PATCH 42/77 drm/amd/display: Remove unneeded code

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

Change-Id I1735203833573473200e19bf0324aecd92663535
---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 145 ----------------------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c |  73 -----------
 drivers/gpu/drm/amd/display/dc/dc.h               |  71 -----------
 3 files changed, 289 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -145
index ad3b35209f55..00637a5d0324 100644
@@ -672,67 +672,6 @@ void dc_destroy(struct dc **dc)
 	*dc = NULL;
 }
 
-static bool validate_streams (
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count)
-{
-	int i;
-
-	for (i = 0; i < set_count; i++)
-		if (!dc_validate_stream(dc, set[i].stream))
-			return false;
-
-	return true;
-}
-
-static bool validate_surfaces(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count)
-{
-	int i, j;
-
-	for (i = 0; i < set_count; i++)
-		for (j = 0; j < set[i].plane_count; j++)
-			if (!dc_validate_plane(dc, set[i].plane_states[j]))
-				return false;
-
-	return true;
-}
-
-bool dc_validate_resources(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		uint8_t set_count)
-{
-	bool result = false;
-	struct validate_context *context;
-
-	if (!validate_streams(dc, set, set_count))
-		return false;
-
-	if (!validate_surfaces(dc, set, set_count))
-		return false;
-
-	context = dm_alloc(sizeof(struct validate_context));
-	if (context == NULL)
-		goto context_alloc_fail;
-
-	atomic_inc(&context->ref_count);
-
-	dc_resource_validate_ctx_copy_construct_current(dc, context);
-
-	result = dc_validate_with_context(
-				dc, set, set_count, context);
-
-context_alloc_fail:
-	dc_release_validate_context(context);
-	context = NULL;
-
-	return result;
-}
-
 bool dc_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *stream)
@@ -857,24 +796,6 @@ static bool context_changed(
 	return false;
 }
 
-static bool streams_changed(
-		struct dc *dc,
-		struct dc_stream_state *streams[],
-		uint8_t stream_count)
-{
-	uint8_t i;
-
-	if (stream_count != dc->current_context->stream_count)
-		return true;
-
-	for (i = 0; i < dc->current_context->stream_count; i++) {
-		if (dc->current_context->streams[i] != streams[i])
-			return true;
-	}
-
-	return false;
-}
-
 bool dc_enable_stereo(
 	struct dc *dc,
 	struct validate_context *context,
@@ -999,72 +920,6 @@ bool dc_commit_context(struct dc *dc, struct validate_context *context)
 }
 
 
-bool dc_commit_streams(
-	struct dc *dc,
-	struct dc_stream_state *streams[],
-	uint8_t stream_count)
-{
-	struct dc  *core_dc = dc;
-	bool result = false;
-	struct validate_context *context;
-	struct dc_validation_set set[MAX_STREAMS] = { {0, {0} } };
-	int i;
-
-	if (false == streams_changed(core_dc, streams, stream_count))
-		return DC_OK;
-
-	dm_logger_write(core_dc->ctx->logger, LOG_DC, "%s: %d streams\n",
-				__func__, stream_count);
-
-	for (i = 0; i < stream_count; i++) {
-		struct dc_stream_state *stream = streams[i];
-		struct dc_stream_status *status = dc_stream_get_status(stream);
-		int j;
-
-		dc_stream_log(stream,
-				core_dc->ctx->logger,
-				LOG_DC);
-
-		set[i].stream = stream;
-
-		if (status) {
-			set[i].plane_count = status->plane_count;
-			for (j = 0; j < status->plane_count; j++)
-				set[i].plane_states[j] = status->plane_states[j];
-		}
-
-	}
-
-	if (!validate_streams(dc, set, stream_count))
-		return false;
-
-	if (!validate_surfaces(dc, set, stream_count))
-		return false;
-
-	context = dm_alloc(sizeof(struct validate_context));
-	if (context == NULL)
-		goto context_alloc_fail;
-
-	atomic_inc(&context->ref_count);
-
-	dc_resource_validate_ctx_copy_construct_current(dc, context);
-
-	result = dc_validate_with_context(
-			dc, set, stream_count, context);
-	if (!result) {
-		BREAK_TO_DEBUGGER();
-		goto fail;
-	}
-
-	result = dc_commit_context_no_check(dc, context);
-
-fail:
-	dc_release_validate_context(context);
-
-context_alloc_fail:
-	return result;
-}
-
 bool dc_post_update_surfaces_to_stream(struct dc *dc)
 {
 	int i;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -73

79 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dc.h +0 -71

129 lines not on this page · raw message

Signature · 6 lines
2.11.0

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

PATCH 43/77 drm/amd/display: Remove old, misleading comment

In reply to a message not in the archive
Change-Id I967334d365b5b7780af8e63de0196cf4ce9903e3
---
 drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c +0 -1
index d6225f332431..56e3b124f19c 100644
@@ -31,7 +31,6 @@
 
 #include "dce110/dce110_hw_sequencer.h"
 
-/* include DCE12.0 register header files */
 #include "vega10/DC/dce_12_0_offset.h"
 #include "vega10/DC/dce_12_0_sh_mask.h"
 #include "vega10/soc15ip.h"
Signature · 6 lines
2.11.0

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

PATCH 44/77 drm/amd/display: Stop including atomfimrwareid.h directly

In reply to a message not in the archive

It's already included in atomfirmware.h

Change-Id I311b4e8b53780dc5650716396f1c14981437b1a5
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c          | 1 -
 drivers/gpu/drm/amd/display/dc/bios/command_table2.c        | 1 -
 drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c | 1 -
 3 files changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -1
index f8d4f08bf985..95fe50f62c57 100644
@@ -29,7 +29,6 @@
 
 #include "ObjectID.h"
 #include "atomfirmware.h"
-#include "atomfirmwareid.h"
 
 #include "dc_bios_types.h"
 #include "include/grph_object_ctrl_defs.h"
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +0 -1
index e33e6bfccb6d..64eab356d336 100644
@@ -27,7 +27,6 @@
 
 #include "ObjectID.h"
 #include "atomfirmware.h"
-#include "atomfirmwareid.h"
 
 #include "include/bios_parser_interface.h"
 
drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c +0 -1
index 35c3f3a8e493..9a4d30dd4969 100644
@@ -27,7 +27,6 @@
 
 #include "ObjectID.h"
 #include "atomfirmware.h"
-#include "atomfirmwareid.h"
 
 #include "include/bios_parser_types.h"
 
Signature · 6 lines
2.11.0

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

PATCH 45/77 drm/amd/display: Fix return value from rx irq handler on up request

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

Change-Id Ifa864d3788ae34a6dfa315bd4148f5d5c4ae0c5a
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +4 -4
index e35bdce6a0f3..e19447d526ea 100644
@@ -1964,11 +1964,11 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 	 * so do not handle as a normal sink status change interrupt.
 	 */
 
+	if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.UP_REQ_MSG_RDY)
+		return true;
+
 	/* check if we have MST msg and return since we poll for it */
-	if (hpd_irq_dpcd_data.bytes.device_service_irq.
-			bits.DOWN_REP_MSG_RDY ||
-		hpd_irq_dpcd_data.bytes.device_service_irq.
-			bits.UP_REQ_MSG_RDY)
+	if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.DOWN_REP_MSG_RDY)
 		return false;
 
 	/* For now we only handle 'Downstream port status' case.
Signature · 6 lines
2.11.0

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

PATCH 46/77 drm/amd/display: Safe stream encoder id in stream_status

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

Change-Id Ic4773faafb39e3c3725c4d4a298c79eb44512c0d
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dc.h               | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -0
index 90bf367a023b..941562940784 100644
@@ -1599,6 +1599,7 @@ enum dc_status resource_map_pool_resources(
 	for (i = 0; i < context->stream_count; i++)
 		if (context->streams[i] == stream) {
 			context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst;
+			context->stream_status[i].stream_enc_inst = pipe_ctx->stream_res.stream_enc->id;
 			return DC_OK;
 		}
 
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index 42aa332dfd46..8a6475f76482 100644
@@ -510,6 +510,7 @@ enum surface_update_type {
 
 struct dc_stream_status {
 	int primary_otg_inst;
+	int stream_enc_inst;
 	int plane_count;
 	struct dc_plane_state *plane_states[MAX_SURFACE_NUM];
 
Signature · 6 lines
2.11.0

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

PATCH 47/77 drm/amd/display: Block 6Ghz timing if SBIOS set HDMI_6G_en to 0

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id I902f693c9501737c8611c641f589b23fdfe5da50
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c     | 1 +
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 4 ++++
 drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h  | 1 +
 3 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +1 -0
index 2c683d468bb8..2c411441771b 100644
@@ -1853,6 +1853,7 @@ static enum bp_result bios_parser_get_encoder_cap_info(
 
 	info->DP_HBR2_EN = record->usHBR2En;
 	info->DP_HBR3_EN = record->usHBR3En;
+	info->HDMI_6GB_EN = record->usHDMI6GEn;
 	return BP_RESULT_OK;
 }
 
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +4 -0
index 559a9f81c9c9..0ce94ede80bf 100644
@@ -887,6 +887,9 @@ static bool dce110_link_encoder_validate_hdmi_output(
 			crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
 		return false;
 
+	if (!enc110->base.features.flags.bits.HDMI_6GB_EN &&
+		adjusted_pix_clk_khz >= 300000)
+		return false;
 	return true;
 }
 
@@ -1008,6 +1011,7 @@ bool dce110_link_encoder_construct(
 				bp_cap_info.DP_HBR2_EN;
 		enc110->base.features.flags.bits.IS_HBR3_CAPABLE =
 				bp_cap_info.DP_HBR3_EN;
+		enc110->base.features.flags.bits.HDMI_6GB_EN = bp_cap_info.HDMI_6GB_EN;
 	}
 
 	return true;
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +1 -0
index 38e4070806cb..961bbcc9202c 100644
@@ -37,6 +37,7 @@ struct encoder_feature_support {
 			uint32_t IS_TPS3_CAPABLE:1;
 			uint32_t IS_TPS4_CAPABLE:1;
 			uint32_t IS_YCBCR_CAPABLE:1;
+			uint32_t HDMI_6GB_EN:1;
 		} bits;
 		uint32_t raw;
 	} flags;
Signature · 6 lines
2.11.0

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

PATCH 48/77 drm/amd/display: Per plane validation context build.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Introduce add/remove plane to/from context.
Make DC wrapper to use them in WIndows/Diags.
Use them in dc_update_surface_to_stream.
Call add/remove plane from Linux DM.

Remove dc_validation_set from dc_validate_global_state interface and by this remove clean Linux DM from using it.

Change-Id I387a22f63cf67bcdf7f9d86144efc3a8096306a7
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 165 ++++------
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  12 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 362 +++++++++++++--------
 drivers/gpu/drm/amd/display/dc/dc.h                |  37 ++-
 .../drm/amd/display/dc/dce100/dce100_resource.c    |  16 +-
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  26 +-
 .../drm/amd/display/dc/dce112/dce112_resource.c    |  16 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |  16 +-
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   3 -
 9 files changed, 353 insertions(+), 300 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +58 -107
index bb322f94f72e..5218432361fd 100644
@@ -4419,77 +4419,6 @@ void dm_restore_drm_connector_state(struct drm_device *dev, struct drm_connector
 		dm_force_atomic_commit(&aconnector->base);
 }
 
-static uint32_t add_val_sets_plane(
-	struct dc_validation_set *val_sets,
-	uint32_t set_count,
-	const struct dc_stream_state *stream,
-	struct dc_plane_state *plane_state)
-{
-	uint32_t i = 0, j = 0;
-
-	while (i < set_count) {
-		if (val_sets[i].stream == stream) {
-			while (val_sets[i].plane_states[j])
-				j++;
-			break;
-		}
-		++i;
-	}
-
-	val_sets[i].plane_states[j] = plane_state;
-	val_sets[i].plane_count++;
-
-	return val_sets[i].plane_count;
-}
-
-static uint32_t update_in_val_sets_stream(
-	struct dc_validation_set *val_sets,
-	uint32_t set_count,
-	struct dc_stream_state *old_stream,
-	struct dc_stream_state *new_stream,
-	struct drm_crtc *crtc)
-{
-	uint32_t i = 0;
-
-	while (i < set_count) {
-		if (val_sets[i].stream == old_stream)
-			break;
-		++i;
-	}
-
-	val_sets[i].stream = new_stream;
-
-	if (i == set_count)
-		/* nothing found. add new one to the end */
-		return set_count + 1;
-
-	return set_count;
-}
-
-static uint32_t remove_from_val_sets(
-	struct dc_validation_set *val_sets,
-	uint32_t set_count,
-	const struct dc_stream_state *stream)
-{
-	int i;
-
-	for (i = 0; i < set_count; i++)
-		if (val_sets[i].stream == stream)
-			break;
-
-	if (i == set_count) {
-		/* nothing found */
-		return set_count;
-	}
-
-	set_count--;
-
-	for (; i < set_count; i++)
-		val_sets[i] = val_sets[i + 1];
-
-	return set_count;
-}
-
 /*`
  * Grabs all modesetting locks to serialize against any blocking commits,
  * Waits for completion of all non blocking commits.
@@ -4553,10 +4482,9 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 	struct dc *dc = adev->dm.dc;
 	struct drm_connector *connector;
 	struct drm_connector_state *conn_state;
-	int set_count;
-	struct dc_validation_set set[MAX_STREAMS] = { { 0 } };
 	struct dm_crtc_state *old_acrtc_state, *new_acrtc_state;
 	struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
+	bool pflip_needed  = !state->allow_modeset;
 
 	/*
 	 * This bool will be set for true for any modeset/reset
@@ -4571,16 +4499,44 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		return ret;
 	}
 
-	/* copy existing configuration */
-	set_count = 0;
-	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+	/* Remove exiting planes if they are disabled or their CRTC is updated */
+	for_each_crtc_in_state(state, crtc, crtc_state, i) {
+		new_acrtc_state = to_dm_crtc_state(crtc_state);
 
-		old_acrtc_state = to_dm_crtc_state(crtc->state);
+		if (pflip_needed)
+			continue;
 
-		if (old_acrtc_state->stream) {
-			dc_stream_retain(old_acrtc_state->stream);
-			set[set_count].stream = old_acrtc_state->stream;
-			++set_count;
+		for_each_plane_in_state(state, plane, plane_state, j) {
+			struct drm_crtc *plane_crtc = plane_state->crtc;
+			struct dm_plane_state *dm_plane_state = to_dm_plane_state(plane_state);
+
+			if (plane->type == DRM_PLANE_TYPE_CURSOR)
+				continue;
+
+			if (crtc != plane_crtc || !dm_plane_state->dc_state)
+				continue;
+
+			WARN_ON(!new_acrtc_state->stream);
+
+			if (drm_atomic_plane_disabling(plane->state, plane_state) ||
+					drm_atomic_crtc_needs_modeset(crtc_state)) {
+				if (!dc_remove_plane_from_context(
+						dc,
+						new_acrtc_state->stream,
+						dm_plane_state->dc_state,
+						dm_state->context)) {
+
+					ret = EINVAL;
+					goto fail;
+				}
+
+			}
+
+			dc_plane_state_release(dm_plane_state->dc_state);
+			dm_plane_state->dc_state = NULL;
+
+			DRM_DEBUG_KMS("Disabling DRM plane: %d on DRM crtc %d\n",
+					plane->base.id, crtc->base.id);
 		}
 	}
 
@@ -4624,11 +4580,6 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 					goto fail;
 				}
 
-				set_count = remove_from_val_sets(
-						set,
-						set_count,
-						new_acrtc_state->stream);
-
 				dc_stream_release(new_acrtc_state->stream);
 				new_acrtc_state->stream = NULL;
 
@@ -4687,13 +4638,6 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 
 				new_acrtc_state->stream = new_stream;
 
-				set_count = update_in_val_sets_stream(
-						set,
-						set_count,
-						old_acrtc_state->stream,
-						new_acrtc_state->stream,
-						crtc);
-
 				if (!dc_add_stream_to_ctx(
 						dc,
 						dm_state->context,
@@ -4750,32 +4694,32 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		lock_and_validation_needed = true;
 	}
 
+	/* Add new planes */
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
 		new_acrtc_state = to_dm_crtc_state(crtc_state);
 
+		if (pflip_needed)
+			continue;
+
 		for_each_plane_in_state(state, plane, plane_state, j) {
 			struct drm_crtc *plane_crtc = plane_state->crtc;
-			struct drm_framebuffer *fb = plane_state->fb;
-			bool pflip_needed;
 			struct dm_plane_state *dm_plane_state = to_dm_plane_state(plane_state);
 
 			/*TODO Implement atomic check for cursor plane */
 			if (plane->type == DRM_PLANE_TYPE_CURSOR)
 				continue;
 
-			if (!fb || !plane_crtc || crtc != plane_crtc || !crtc_state->active)
+			if (crtc != plane_crtc)
 				continue;
 
-			WARN_ON(!new_acrtc_state->stream);
-
-			pflip_needed = !state->allow_modeset;
-			if (!pflip_needed) {
+			if (!drm_atomic_plane_disabling(plane->state, plane_state)) {
 				struct dc_plane_state *dc_plane_state;
 
+				WARN_ON(!new_acrtc_state->stream);
+
 				dc_plane_state = dc_create_plane_state(dc);
 
-				if (dm_plane_state->dc_state)
-					dc_plane_state_release(dm_plane_state->dc_state);
+				WARN_ON(dm_plane_state->dc_state);
 
 				dm_plane_state->dc_state = dc_plane_state;
 
@@ -4788,10 +4732,17 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 				if (ret)
 					goto fail;
 
-				add_val_sets_plane(set,
-						     set_count,
-						     new_acrtc_state->stream,
-						     dc_plane_state);
+
+				if (!dc_add_plane_to_context(
+						dc,
+						new_acrtc_state->stream,
+						dc_plane_state,
+						dm_state->context)) {
+
+					ret = EINVAL;
+					goto fail;
+				}
+
 
 				lock_and_validation_needed = true;
 			}
@@ -4819,7 +4770,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		if (ret)
 			goto fail;
 
-		if (!dc_validate_global_state(dc, set, set_count, dm_state->context)) {
+		if (!dc_validate_global_state(dc, dm_state->context)) {
 			ret = -EINVAL;
 			goto fail;
 		}
drivers/gpu/drm/amd/display/dc/core/dc.c +9 -3
index 00637a5d0324..0339f98e94c1 100644
@@ -1298,10 +1298,16 @@ void dc_update_planes_and_stream(struct dc *dc,
 		dc_resource_validate_ctx_copy_construct(
 				core_dc->current_context, context);
 
+		/*remove old surfaces from context */
+		if (!dc_rem_all_planes_for_stream(dc, stream, context)) {
+
+			BREAK_TO_DEBUGGER();
+			goto fail;
+		}
+
 		/* add surface to context */
-		if (!resource_attach_surfaces_to_context(
-				new_planes, surface_count, stream,
-				context, core_dc->res_pool)) {
+		if (!dc_add_all_planes_for_stream(dc, stream, new_planes, surface_count, context)) {
+
 			BREAK_TO_DEBUGGER();
 			goto fail;
 		}
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +227 -135

464 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dc.h +30 -7
index 8a6475f76482..5a852685558a 100644
@@ -619,15 +619,40 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
 				  uint32_t *h_position,
 				  uint32_t *v_position);
 
-bool dc_remove_stream_from_ctx(
+bool dc_add_stream_to_ctx(
 			struct dc *dc,
+		struct validate_context *new_ctx,
+		struct dc_stream_state *stream);
+
+bool dc_remove_stream_from_ctx(
+		struct dc *dc,
 			struct validate_context *new_ctx,
 			struct dc_stream_state *stream);
 
-bool dc_add_stream_to_ctx(
-		struct dc *dc,
-		struct validate_context *new_ctx,
-		struct dc_stream_state *stream);
+
+bool dc_add_plane_to_context(
+		const struct dc *dc,
+		struct dc_stream_state *stream,
+		struct dc_plane_state *plane_state,
+		struct validate_context *context);
+
+bool dc_remove_plane_from_context(
+		const struct dc *dc,
+		struct dc_stream_state *stream,
+		struct dc_plane_state *plane_state,
+		struct validate_context *context);
+
+bool dc_rem_all_planes_for_stream(
+		const struct dc *dc,
+		struct dc_stream_state *stream,
+		struct validate_context *context);
+
+bool dc_add_all_planes_for_stream(
+		const struct dc *dc,
+		struct dc_stream_state *stream,
+		struct dc_plane_state * const *plane_states,
+		int plane_count,
+		struct validate_context *context);
 
 /*
  * Structure to store surface/stream associations for validation
@@ -644,8 +669,6 @@ bool dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state);
 
 bool dc_validate_global_state(
 		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
 		struct validate_context *new_ctx);
 
 /*
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +6 -10
index c9dad4e2a7c8..c991610315b2 100644
@@ -684,19 +684,18 @@ bool dce100_validate_bandwidth(
 }
 
 static bool dce100_validate_surface_sets(
-		const struct dc_validation_set set[],
-		int set_count)
+		struct validate_context *context)
 {
 	int i;
 
-	for (i = 0; i < set_count; i++) {
-		if (set[i].plane_count == 0)
+	for (i = 0; i < context->stream_count; i++) {
+		if (context->stream_status[i].plane_count == 0)
 			continue;
 
-		if (set[i].plane_count > 1)
+		if (context->stream_status[i].plane_count > 1)
 			return false;
 
-		if (set[i].plane_states[0]->format
+		if (context->stream_status[i].plane_states[0]->format
 				>= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
 			return false;
 	}
@@ -706,12 +705,9 @@ static bool dce100_validate_surface_sets(
 
 enum dc_status dce100_validate_global(
 		struct dc  *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *old_context,
 		struct validate_context *context)
 {
-	if (!dce100_validate_surface_sets(set, set_count))
+	if (!dce100_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
 
 	return DC_OK;
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +11 -15
index d682180f2eaf..18c67f89e9b5 100644
@@ -880,31 +880,30 @@ static bool dce110_validate_bandwidth(
 }
 
 static bool dce110_validate_surface_sets(
-		const struct dc_validation_set set[],
-		int set_count)
+		struct validate_context *context)
 {
 	int i;
 
-	for (i = 0; i < set_count; i++) {
-		if (set[i].plane_count == 0)
+	for (i = 0; i < context->stream_count; i++) {
+		if (context->stream_status[i].plane_count == 0)
 			continue;
 
-		if (set[i].plane_count > 2)
+		if (context->stream_status[i].plane_count > 2)
 			return false;
 
-		if (set[i].plane_states[0]->format
+		if (context->stream_status[i].plane_states[0]->format
 				>= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
 			return false;
 
-		if (set[i].plane_count == 2) {
-			if (set[i].plane_states[1]->format
+		if (context->stream_status[i].plane_count == 2) {
+			if (context->stream_status[i].plane_states[1]->format
 					< SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
 				return false;
-			if (set[i].plane_states[1]->src_rect.width > 1920
-					|| set[i].plane_states[1]->src_rect.height > 1080)
+			if (context->stream_status[i].plane_states[1]->src_rect.width > 1920
+					|| context->stream_status[i].plane_states[1]->src_rect.height > 1080)
 				return false;
 
-			if (set[i].stream->timing.pixel_encoding != PIXEL_ENCODING_RGB)
+			if (context->streams[i]->timing.pixel_encoding != PIXEL_ENCODING_RGB)
 				return false;
 		}
 	}
@@ -914,12 +913,9 @@ static bool dce110_validate_surface_sets(
 
 enum dc_status dce110_validate_global(
 		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *old_context,
 		struct validate_context *context)
 {
-	if (!dce110_validate_surface_sets(set, set_count))
+	if (!dce110_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
 
 	return DC_OK;
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +6 -10
index 85a396ef5aa5..d5a8ee69171d 100644
@@ -855,19 +855,18 @@ enum dc_status resource_map_phy_clock_resources(
 }
 
 static bool dce112_validate_surface_sets(
-		const struct dc_validation_set set[],
-		int set_count)
+		struct validate_context *context)
 {
 	int i;
 
-	for (i = 0; i < set_count; i++) {
-		if (set[i].plane_count == 0)
+	for (i = 0; i < context->stream_count; i++) {
+		if (context->stream_status[i].plane_count == 0)
 			continue;
 
-		if (set[i].plane_count > 1)
+		if (context->stream_status[i].plane_count > 1)
 			return false;
 
-		if (set[i].plane_states[0]->format
+		if (context->stream_status[i].plane_states[0]->format
 				>= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
 			return false;
 	}
@@ -928,12 +927,9 @@ enum dc_status dce112_validate_guaranteed(
 
 enum dc_status dce112_validate_global(
 		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *old_context,
 		struct validate_context *context)
 {
-	if (!dce112_validate_surface_sets(set, set_count))
+	if (!dce112_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
 
 	return DC_OK;
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +6 -10
index ac3f42a44030..945ff7ee6cd9 100644
@@ -716,19 +716,18 @@ bool dce80_validate_bandwidth(
 }
 
 static bool dce80_validate_surface_sets(
-		const struct dc_validation_set set[],
-		int set_count)
+		struct validate_context *context)
 {
 	int i;
 
-	for (i = 0; i < set_count; i++) {
-		if (set[i].plane_count == 0)
+	for (i = 0; i < context->stream_count; i++) {
+		if (context->stream_status[i].plane_count == 0)
 			continue;
 
-		if (set[i].plane_count > 1)
+		if (context->stream_status[i].plane_count > 1)
 			return false;
 
-		if (set[i].plane_states[0]->format
+		if (context->stream_status[i].plane_states[0]->format
 				>= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
 			return false;
 	}
@@ -738,12 +737,9 @@ static bool dce80_validate_surface_sets(
 
 enum dc_status dce80_validate_global(
 		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *old_context,
 		struct validate_context *context)
 {
-	if (!dce80_validate_surface_sets(set, set_count))
+	if (!dce80_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
 
 	return DC_OK;
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -3
index 62bd11d250c5..bd1a6367872f 100644
@@ -99,9 +99,6 @@ struct resource_funcs {
 
 	enum dc_status (*validate_global)(
 		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *old_context,
 		struct validate_context *context);
 
 	struct pipe_ctx *(*acquire_idle_pipe_for_layer)(
Signature · 6 lines
2.11.0

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

PATCH 49/77 drm/amd/display: Refactor atomic check.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Split into update crtcs and update plane functions.

Change-Id I57a739070861553de9b787f995e44a1da4e3c2d0
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 453 ++++++++++++----------
 1 file changed, 257 insertions(+), 196 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +257 -196
index 5218432361fd..e24c44f6720b 100644
@@ -1660,12 +1660,6 @@ static bool modeset_required(struct drm_crtc_state *crtc_state,
 			     struct dc_stream_state *new_stream,
 			     struct dc_stream_state *old_stream)
 {
-	if (dc_is_stream_unchanged(new_stream, old_stream)) {
-		crtc_state->mode_changed = false;
-		DRM_DEBUG_KMS("Mode change not required, setting mode_changed to %d",
-			      crtc_state->mode_changed);
-	}
-
 	if (!drm_atomic_crtc_needs_modeset(crtc_state))
 		return false;
 
@@ -3990,9 +3984,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 			continue;
 		}
 
-		if (!fb || !crtc || pcrtc != crtc || !crtc->state->active ||
-				(!crtc->state->planes_changed &&
-						!pcrtc->state->color_mgmt_changed))
+		if (!fb || !crtc || pcrtc != crtc || !crtc->state->active)
 			continue;
 
 		pflip_needed = !state->allow_modeset;
@@ -4469,91 +4461,77 @@ static int do_aquire_global_lock(
 	return ret < 0 ? ret : 0;
 }
 
-int amdgpu_dm_atomic_check(struct drm_device *dev,
-			struct drm_atomic_state *state)
+static int dm_update_crtcs_state(
+		struct dc *dc,
+		struct drm_atomic_state *state,
+		bool enable,
+		bool *lock_and_validation_needed)
 {
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *crtc_state;
-	struct drm_plane *plane;
-	struct drm_plane_state *plane_state;
-	int i, j;
-	int ret;
-	struct amdgpu_device *adev = dev->dev_private;
-	struct dc *dc = adev->dm.dc;
-	struct drm_connector *connector;
-	struct drm_connector_state *conn_state;
+	int i;
 	struct dm_crtc_state *old_acrtc_state, *new_acrtc_state;
 	struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
-	bool pflip_needed  = !state->allow_modeset;
-
-	/*
-	 * This bool will be set for true for any modeset/reset
-	 * or plane update which implies non fast surface update.
-	 */
-	bool lock_and_validation_needed = false;
+	int ret = 0;
 
-	ret = drm_atomic_helper_check_modeset(dev, state);
+	/*TODO Move this code into dm_crtc_atomic_check once we get rid of dc_validation_set */
+	/* update changed items */
+	for_each_crtc_in_state(state, crtc, crtc_state, i) {
+		struct amdgpu_crtc *acrtc = NULL;
+		struct amdgpu_connector *aconnector = NULL;
+		struct dc_stream_state *new_stream = NULL;
+		struct drm_connector_state *conn_state = NULL;
+		struct dm_connector_state *dm_conn_state = NULL;
 
-	if (ret) {
-		DRM_ERROR("Atomic state validation failed with error :%d !\n", ret);
-		return ret;
-	}
 
-	/* Remove exiting planes if they are disabled or their CRTC is updated */
-	for_each_crtc_in_state(state, crtc, crtc_state, i) {
+		old_acrtc_state = to_dm_crtc_state(crtc->state);
 		new_acrtc_state = to_dm_crtc_state(crtc_state);
+		acrtc = to_amdgpu_crtc(crtc);
 
-		if (pflip_needed)
-			continue;
+		aconnector = amdgpu_dm_find_first_crct_matching_connector(state, crtc, true);
 
-		for_each_plane_in_state(state, plane, plane_state, j) {
-			struct drm_crtc *plane_crtc = plane_state->crtc;
-			struct dm_plane_state *dm_plane_state = to_dm_plane_state(plane_state);
+		/* TODO This hack should go away */
+		if (aconnector && aconnector->dc_sink) {
+			conn_state = drm_atomic_get_connector_state(state,
+								    &aconnector->base);
 
-			if (plane->type == DRM_PLANE_TYPE_CURSOR)
-				continue;
-
-			if (crtc != plane_crtc || !dm_plane_state->dc_state)
-				continue;
+			if (IS_ERR(conn_state)) {
+				ret = PTR_ERR_OR_ZERO(conn_state);
+				break;
+			}
 
-			WARN_ON(!new_acrtc_state->stream);
+			dm_conn_state = to_dm_connector_state(conn_state);
 
-			if (drm_atomic_plane_disabling(plane->state, plane_state) ||
-					drm_atomic_crtc_needs_modeset(crtc_state)) {
-				if (!dc_remove_plane_from_context(
-						dc,
-						new_acrtc_state->stream,
-						dm_plane_state->dc_state,
-						dm_state->context)) {
+			new_stream = create_stream_for_sink(aconnector,
+							    &crtc_state->mode,
+							    dm_conn_state);
 
-					ret = EINVAL;
-					goto fail;
-				}
+			/*
+			 * we can have no stream on ACTION_SET if a display
+			 * was disconnected during S3, in this case it not and
+			 * error, the OS will be updated after detection, and
+			 * do the right thing on next atomic commit
+			 */
 
+			if (!new_stream) {
+				DRM_DEBUG_KMS("%s: Failed to create new stream for crtc %d\n",
+						__func__, acrtc->base.base.id);
+				break;
 			}
+		}
 
-			dc_plane_state_release(dm_plane_state->dc_state);
-			dm_plane_state->dc_state = NULL;
+		if (dc_is_stream_unchanged(new_stream,
+				old_acrtc_state->stream)) {
 
-			DRM_DEBUG_KMS("Disabling DRM plane: %d on DRM crtc %d\n",
-					plane->base.id, crtc->base.id);
-		}
-	}
+				crtc_state->mode_changed = false;
 
-	/*TODO Move this code into dm_crtc_atomic_check once we get rid of dc_validation_set */
-	/* update changed items */
-	for_each_crtc_in_state(state, crtc, crtc_state, i) {
-		struct amdgpu_crtc *acrtc = NULL;
-		struct amdgpu_connector *aconnector = NULL;
-		struct dc_stream_state *new_stream = NULL;
-		struct drm_connector_state *conn_state = NULL;
-		struct dm_connector_state *dm_conn_state = NULL;
+				DRM_DEBUG_KMS("Mode change not required, setting mode_changed to %d",
+					      crtc_state->mode_changed);
+		}
 
-		old_acrtc_state = to_dm_crtc_state(crtc->state);
-		new_acrtc_state = to_dm_crtc_state(crtc_state);
-		acrtc = to_amdgpu_crtc(crtc);
 
-		aconnector = amdgpu_dm_find_first_crct_matching_connector(state, crtc, true);
+		if (!drm_atomic_crtc_needs_modeset(crtc_state))
+				continue;
 
 		DRM_DEBUG_KMS(
 			"amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, "
@@ -4567,109 +4545,252 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 			crtc_state->active_changed,
 			crtc_state->connectors_changed);
 
-		if (modereset_required(crtc_state)) {
+		/* Remove stream for any changed/disabled CRTC */
+		if (!enable) {
+
+			if (!old_acrtc_state->stream)
+				continue;
+
+			DRM_DEBUG_KMS("Disabling DRM crtc: %d\n",
+					crtc->base.id);
 
 			/* i.e. reset mode */
-			if (new_acrtc_state->stream) {
+			if (!dc_remove_stream_from_ctx(
+					dc,
+					dm_state->context,
+					old_acrtc_state->stream)) {
+				ret = -EINVAL;
+				break;
+			}
+
+			dc_stream_release(old_acrtc_state->stream);
+			new_acrtc_state->stream = NULL;
+
+			*lock_and_validation_needed = true;
+
+		} else {/* Add stream for any updated/enabled CRTC */
+
+			if (modereset_required(crtc_state))
+				continue;
+
+			if (modeset_required(crtc_state, new_stream,
+					     old_acrtc_state->stream)) {
+
+				WARN_ON(new_acrtc_state->stream);
+
+				new_acrtc_state->stream = new_stream;
+				dc_stream_retain(new_stream);
+
+				DRM_DEBUG_KMS("Enabling DRM crtc: %d\n",
+							crtc->base.id);
 
-				if (!dc_remove_stream_from_ctx(
+				if (!dc_add_stream_to_ctx(
 						dc,
 						dm_state->context,
 						new_acrtc_state->stream)) {
 					ret = -EINVAL;
-					goto fail;
+					break;
 				}
 
-				dc_stream_release(new_acrtc_state->stream);
-				new_acrtc_state->stream = NULL;
-
-				lock_and_validation_needed = true;
+				*lock_and_validation_needed = true;
 			}
+		}
 
-		} else {
+		/* Release extra reference */
+		if (new_stream)
+			 dc_stream_release(new_stream);
+	}
 
-			if (aconnector) {
-				conn_state = drm_atomic_get_connector_state(state,
-									    &aconnector->base);
+	return ret;
+}
 
-				if (IS_ERR(conn_state)) {
-					ret = PTR_ERR_OR_ZERO(conn_state);
-					goto fail;
-				}
+static int dm_update_planes_state(
+		struct dc *dc,
+		struct drm_atomic_state *state,
+		bool enable,
+		bool *lock_and_validation_needed)
+{
+	struct drm_crtc *new_plane_crtc, *old_plane_crtc;
+	struct drm_crtc_state *new_crtc_state;
+	struct drm_plane *plane;
+	struct drm_plane_state *old_plane_state, *new_plane_state;
+	struct dm_crtc_state *new_acrtc_state, *old_acrtc_state;
+	struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
+	struct dm_plane_state *new_dm_plane_state, *old_dm_plane_state;
+	int i ;
+	/* TODO return page_flip_needed() function */
+	bool pflip_needed  = !state->allow_modeset;
+	int ret = 0;
 
-				dm_conn_state = to_dm_connector_state(conn_state);
+	if (pflip_needed)
+		return ret;
 
-				new_stream = create_stream_for_sink(aconnector,
-								    &crtc_state->mode,
-								    dm_conn_state);
+	/* Add new planes */
+	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
+		new_plane_crtc = new_plane_state->crtc;
+		old_plane_crtc = old_plane_state->crtc;
+		new_dm_plane_state = to_dm_plane_state(new_plane_state);
+		old_dm_plane_state = to_dm_plane_state(old_plane_state);
+
+		/*TODO Implement atomic check for cursor plane */
+		if (plane->type == DRM_PLANE_TYPE_CURSOR)
+			continue;
 
-				/*
-				 * we can have no stream on ACTION_SET if a display
-				 * was disconnected during S3, in this case it not and
-				 * error, the OS will be updated after detection, and
-				 * do the right thing on next atomic commit
-				 */
+		/* Remove any changed/removed planes */
+		if (!enable) {
 
-				if (!new_stream) {
-					DRM_DEBUG_KMS("%s: Failed to create new stream for crtc %d\n",
-							__func__, acrtc->base.base.id);
-					break;
-				}
+			if (!old_plane_crtc)
+				continue;
+
+			old_acrtc_state = to_dm_crtc_state(
+					drm_atomic_get_old_crtc_state(
+							state,
+							old_plane_crtc));
+
+			if (!old_acrtc_state->stream)
+				continue;
+
+			DRM_DEBUG_KMS("Disabling DRM plane: %d on DRM crtc %d\n",
+					plane->base.id, old_plane_crtc->base.id);
 
+			if (!dc_remove_plane_from_context(
+					dc,
+					old_acrtc_state->stream,
+					old_dm_plane_state->dc_state,
+					dm_state->context)) {
 
+				ret = EINVAL;
+				return ret;
 			}
 
-			if (modeset_required(crtc_state, new_stream,
-					     old_acrtc_state->stream)) {
 
-				if (new_acrtc_state->stream) {
+			dc_plane_state_release(old_dm_plane_state->dc_state);
+			new_dm_plane_state->dc_state = NULL;
 
-					if (!dc_remove_stream_from_ctx(
-							dc,
-							dm_state->context,
-							new_acrtc_state->stream)) {
-						ret = -EINVAL;
-						goto fail;
-					}
+			*lock_and_validation_needed = true;
 
+		} else { /* Add new planes */
 
-					dc_stream_release(new_acrtc_state->stream);
-				}
+			if (drm_atomic_plane_disabling(plane->state, new_plane_state))
+				continue;
 
-				new_acrtc_state->stream = new_stream;
+			if (!new_plane_crtc)
+				continue;
 
-				if (!dc_add_stream_to_ctx(
-						dc,
-						dm_state->context,
-						new_acrtc_state->stream)) {
-					ret = -EINVAL;
-					goto fail;
-				}
+			new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_crtc);
+			new_acrtc_state = to_dm_crtc_state(new_crtc_state);
 
-				lock_and_validation_needed = true;
-			} else {
-				/*
-				 * The new stream is unused, so we release it
-				 */
-				if (new_stream)
-					dc_stream_release(new_stream);
+			if (!new_acrtc_state->stream)
+				continue;
+
+
+			WARN_ON(new_dm_plane_state->dc_state);
+
+			new_dm_plane_state->dc_state = dc_create_plane_state(dc);
+
+			DRM_DEBUG_KMS("Enabling DRM plane: %d on DRM crtc %d\n",
+					plane->base.id, new_plane_crtc->base.id);
+
+			if (!new_dm_plane_state->dc_state) {
+				ret = -EINVAL;
+				return ret;
+			}
+
+			ret = fill_plane_attributes(
+				new_plane_crtc->dev->dev_private,
+				new_dm_plane_state->dc_state,
+				new_plane_state,
+				new_crtc_state,
+				false);
+			if (ret)
+				return ret;
+
+
+			if (!dc_add_plane_to_context(
+					dc,
+					new_acrtc_state->stream,
+					new_dm_plane_state->dc_state,
+					dm_state->context)) {
 
+				ret = -EINVAL;
+				return ret;
 			}
+
+			*lock_and_validation_needed = true;
 		}
+	}
 
 
-		/*
-		 * Hack: Commit needs planes right now, specifically for gamma
-		 * TODO rework commit to check CRTC for gamma change
-		 */
-		if (crtc_state->color_mgmt_changed) {
+	return ret;
+}
+
+int amdgpu_dm_atomic_check(struct drm_device *dev,
+			struct drm_atomic_state *state)
+{
+	int i;
+	int ret;
+	struct amdgpu_device *adev = dev->dev_private;
+	struct dc *dc = adev->dm.dc;
+	struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
+	struct drm_connector *connector;
+	struct drm_connector_state *conn_state;
+	struct drm_crtc *crtc;
+	struct drm_crtc_state *crtc_state;
+
+	/*
+	 * This bool will be set for true for any modeset/reset
+	 * or plane update which implies non fast surface update.
+	 */
+	bool lock_and_validation_needed = false;
+
+	ret = drm_atomic_helper_check_modeset(dev, state);
 
+	if (ret) {
+		DRM_ERROR("Atomic state validation failed with error :%d !\n", ret);
+		return ret;
+	}
+
+	/*
+	 * Hack: Commit needs planes right now, specifically for gamma
+	 * TODO rework commit to check CRTC for gamma change
+	 */
+	for_each_crtc_in_state(state, crtc, crtc_state, i) {
+		if (crtc_state->color_mgmt_changed) {
 			ret = drm_atomic_add_affected_planes(state, crtc);
 			if (ret)
 				goto fail;
 		}
 	}
 
+	/* Remove exiting planes if they are modified */
+	ret = dm_update_planes_state(dc, state, false, &lock_and_validation_needed);
+	if (ret) {
+		goto fail;
+	}
+
+	/* Disable all crtcs which require disable */
+	ret = dm_update_crtcs_state(dc, state, false, &lock_and_validation_needed);
+	if (ret) {
+		goto fail;
+	}
+
+	/* Enable all crtcs which require enable */
+	ret = dm_update_crtcs_state(dc, state, true, &lock_and_validation_needed);
+	if (ret) {
+		goto fail;
+	}
+
+	/* Add new/modified planes */
+	ret = dm_update_planes_state(dc, state, true, &lock_and_validation_needed);
+	if (ret) {
+		goto fail;
+	}
+
+	 /* Run this here since we want to validate the streams we created */
+	 ret = drm_atomic_helper_check_planes(dev, state);
+	 if (ret)
+		 goto fail;
+
 	/* Check scaling and undersacn changes*/
 	/*TODO Removed scaling changes validation due to inability to commit
 	 * new stream into context w\o causing full reset. Need to
@@ -4694,66 +4815,6 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		lock_and_validation_needed = true;
 	}
 
-	/* Add new planes */
-	for_each_crtc_in_state(state, crtc, crtc_state, i) {
-		new_acrtc_state = to_dm_crtc_state(crtc_state);
-
-		if (pflip_needed)
-			continue;
-
-		for_each_plane_in_state(state, plane, plane_state, j) {
-			struct drm_crtc *plane_crtc = plane_state->crtc;
-			struct dm_plane_state *dm_plane_state = to_dm_plane_state(plane_state);
-
-			/*TODO Implement atomic check for cursor plane */
-			if (plane->type == DRM_PLANE_TYPE_CURSOR)
-				continue;
-
-			if (crtc != plane_crtc)
-				continue;
-
-			if (!drm_atomic_plane_disabling(plane->state, plane_state)) {
-				struct dc_plane_state *dc_plane_state;
-
-				WARN_ON(!new_acrtc_state->stream);
-
-				dc_plane_state = dc_create_plane_state(dc);
-
-				WARN_ON(dm_plane_state->dc_state);
-
-				dm_plane_state->dc_state = dc_plane_state;
-
-				ret = fill_plane_attributes(
-					plane_crtc->dev->dev_private,
-					dc_plane_state,
-					plane_state,
-					crtc_state,
-					false);
-				if (ret)
-					goto fail;
-
-
-				if (!dc_add_plane_to_context(
-						dc,
-						new_acrtc_state->stream,
-						dc_plane_state,
-						dm_state->context)) {
-
-					ret = EINVAL;
-					goto fail;
-				}
-
-
-				lock_and_validation_needed = true;
-			}
-		}
-	}
-
-	/* Run this here since we want to validate the streams we created */
-	ret = drm_atomic_helper_check_planes(dev, state);
-	if (ret)
-		goto fail;
-
 	/*
 	 * For full updates case when
 	 * removing/adding/updating  streams on once CRTC while flipping
@@ -4786,7 +4847,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 	else if (ret == -EINTR || ret == -EAGAIN || ret == -ERESTARTSYS)
 		DRM_DEBUG_KMS("Atomic check stopped due to to signal.\n");
 	else
-		DRM_ERROR("Atomic check failed with err: %d .\n", ret);
+		DRM_ERROR("Atomic check failed with err: %d \n", ret);
 
 	return ret;
 }
Signature · 6 lines
2.11.0

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

PATCH 50/77 drm/amd/display: Clean up flattening core_dc to dc

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

Clean up some code related to flattening core_dc commit (Remove redundent dc = dc, which was the result of removing DC_TO_CORE() macro)

Change-Id Ib2e3bba1a8eca27c6229d6bac8387e3fdb91de9f
---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |  12 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           | 335 +++++++++------------
 .../drm/amd/display/modules/freesync/freesync.c    |  19 +-
 3 files changed, 164 insertions(+), 202 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +5 -7
index afd403ceb2a7..5e5766a63a47 100644
@@ -983,15 +983,14 @@ bool dcn_validate_bandwidth(
 	if (v->voltage_level == 0 &&
 			(dc->debug.sr_exit_time_dpm0_ns
 				|| dc->debug.sr_enter_plus_exit_time_dpm0_ns)) {
-		struct dc *dc_core = dc;
 
 		if (dc->debug.sr_enter_plus_exit_time_dpm0_ns)
 			v->sr_enter_plus_exit_time =
 				dc->debug.sr_enter_plus_exit_time_dpm0_ns / 1000.0f;
 		if (dc->debug.sr_exit_time_dpm0_ns)
 			v->sr_exit_time =  dc->debug.sr_exit_time_dpm0_ns / 1000.0f;
-		dc_core->dml.soc.sr_enter_plus_exit_time_us = v->sr_enter_plus_exit_time;
-		dc_core->dml.soc.sr_exit_time_us = v->sr_exit_time;
+		dc->dml.soc.sr_enter_plus_exit_time_us = v->sr_enter_plus_exit_time;
+		dc->dml.soc.sr_exit_time_us = v->sr_exit_time;
 		mode_support_and_system_configuration(v);
 	}
 
@@ -1114,11 +1113,10 @@ bool dcn_validate_bandwidth(
 	}
 
 	if (v->voltage_level == 0) {
-		struct dc *dc_core = dc;
 
-		dc_core->dml.soc.sr_enter_plus_exit_time_us =
-				dc_core->dcn_soc->sr_enter_plus_exit_time;
-		dc_core->dml.soc.sr_exit_time_us = dc_core->dcn_soc->sr_exit_time;
+		dc->dml.soc.sr_enter_plus_exit_time_us =
+				dc->dcn_soc->sr_enter_plus_exit_time;
+		dc->dml.soc.sr_exit_time_us = dc->dcn_soc->sr_exit_time;
 	}
 
 	/*
drivers/gpu/drm/amd/display/dc/core/dc.c +150 -185

887 lines not on this page · raw message

drivers/gpu/drm/amd/display/modules/freesync/freesync.c +9 -10
index f49203b3eb94..52350d0e68d0 100644
@@ -145,7 +145,6 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
 	struct core_freesync *core_freesync =
 			dm_alloc(sizeof(struct core_freesync));
 
-	struct dc  *core_dc = dc;
 
 	struct persistent_data_flag flag;
 
@@ -176,19 +175,19 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
 	/* Create initial module folder in registry for freesync enable data */
 	flag.save_per_edid = true;
 	flag.save_per_link = false;
-	dm_write_persistent_data(core_dc->ctx, NULL, FREESYNC_REGISTRY_NAME,
+	dm_write_persistent_data(dc->ctx, NULL, FREESYNC_REGISTRY_NAME,
 			NULL, NULL, 0, &flag);
 	flag.save_per_edid = false;
 	flag.save_per_link = false;
 
-	if (dm_read_persistent_data(core_dc->ctx, NULL, NULL,
+	if (dm_read_persistent_data(dc->ctx, NULL, NULL,
 			FREESYNC_NO_STATIC_FOR_INTERNAL_REGKEY,
 			&data, sizeof(data), &flag)) {
 		core_freesync->opts.drr_internal_supported =
 			(data & 1) ? false : true;
 	}
 
-	if (dm_read_persistent_data(core_dc->ctx, NULL, NULL,
+	if (dm_read_persistent_data(dc->ctx, NULL, NULL,
 			FREESYNC_NO_STATIC_FOR_EXTERNAL_DP_REGKEY,
 			&data, sizeof(data), &flag)) {
 		core_freesync->opts.drr_external_supported =
@@ -245,7 +244,7 @@ static unsigned int map_index_from_stream(struct core_freesync *core_freesync,
 bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 		struct dc_stream_state *stream, struct mod_freesync_caps *caps)
 {
-	struct dc  *core_dc = NULL;
+	struct dc  *dc = NULL;
 	struct core_freesync *core_freesync = NULL;
 	int persistent_freesync_enable = 0;
 	struct persistent_data_flag flag;
@@ -256,7 +255,7 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 		return false;
 
 	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
-	core_dc = core_freesync->dc;
+	dc = core_freesync->dc;
 
 	flag.save_per_edid = true;
 	flag.save_per_link = false;
@@ -287,7 +286,7 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 			static_ramp.ramp_is_active = false;
 
 		/* get persistent data from registry */
-		if (dm_read_persistent_data(core_dc->ctx, stream->sink,
+		if (dm_read_persistent_data(dc->ctx, stream->sink,
 					FREESYNC_REGISTRY_NAME,
 					"userenable", &persistent_freesync_enable,
 					sizeof(int), &flag)) {
@@ -970,14 +969,14 @@ bool mod_freesync_set_user_enable(struct mod_freesync *mod_freesync,
 	unsigned int stream_index, map_index;
 	int persistent_data = 0;
 	struct persistent_data_flag flag;
-	struct dc  *core_dc = NULL;
+	struct dc  *dc = NULL;
 	struct core_freesync *core_freesync = NULL;
 
 	if (mod_freesync == NULL)
 		return false;
 
 	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
-	core_dc = core_freesync->dc;
+	dc = core_freesync->dc;
 
 	flag.save_per_edid = true;
 	flag.save_per_link = false;
@@ -1001,7 +1000,7 @@ bool mod_freesync_set_user_enable(struct mod_freesync *mod_freesync,
 				enable_for_video)
 			persistent_data = persistent_data | 4;
 
-		dm_write_persistent_data(core_dc->ctx,
+		dm_write_persistent_data(dc->ctx,
 					streams[stream_index]->sink,
 					FREESYNC_REGISTRY_NAME,
 					"userenable",
Signature · 6 lines
2.11.0

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

PATCH 51/77 drm/amd/display: do not reset lane count in EQ fallback

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

[Description]
According to DP1.4 specs we should not reset lane count back when falling back in failing EQ training.
This causes PHY test pattern compliance to fail as infinite LT when LT fails EQ to 4 RBR and fails CR in a loop.

Change-Id I057bab303ee15ceccb458beeb5a61aab9208d27b
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +0 -2
index e19447d526ea..446e2933474c 100644
@@ -1302,8 +1302,6 @@ bool decide_fallback_link_setting(
 					current_link_setting->lane_count);
 		} else if (!reached_minimum_link_rate
 				(current_link_setting->link_rate)) {
-			current_link_setting->lane_count =
-				initial_link_settings.lane_count;
 			current_link_setting->link_rate =
 				reduce_link_rate(
 					current_link_setting->link_rate);
Signature · 6 lines
2.11.0

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

PATCH 52/77 drm/amd/display: work around for 8k sleep crash

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

Change-Id I1a7819cdb737b9cdab31479c91a389119f23b296
---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c          | 1 +
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -0
index 5e5766a63a47..6c85a54e47d6 100644
@@ -581,6 +581,7 @@ static void split_stream_across_pipes(
 	secondary_pipe->plane_res.ipp = pool->ipps[secondary_pipe->pipe_idx];
 	secondary_pipe->plane_res.xfm = pool->transforms[secondary_pipe->pipe_idx];
 	if (primary_pipe->bottom_pipe) {
+		ASSERT(primary_pipe->bottom_pipe != secondary_pipe);
 		secondary_pipe->bottom_pipe = primary_pipe->bottom_pipe;
 		secondary_pipe->bottom_pipe->top_pipe = secondary_pipe;
 	}
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
index bd023299e2af..498680a9b996 100644
@@ -2358,7 +2358,7 @@ static void program_all_pipe_in_tree(
 		verify_allow_pstate_change_high(dc->hwseq);
 	}
 
-	if (pipe_ctx->bottom_pipe != NULL)
+	if (pipe_ctx->bottom_pipe != NULL && pipe_ctx->bottom_pipe != pipe_ctx)
 		program_all_pipe_in_tree(dc, pipe_ctx->bottom_pipe, context);
 }
 
Signature · 6 lines
2.11.0

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

PATCH 53/77 drm/amd/display: Use DRM provided page flip flag.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Starting with 4.12 kernel DRM provides page flip flags so we don't need to have our own copy.

Change-Id I15d8db215001f887c47d16be82df04216f9265c3
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -7
index e24c44f6720b..2f2592d8e7d5 100644
@@ -3882,7 +3882,7 @@ static void amdgpu_dm_do_flip(
 	struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(fb);
 	struct amdgpu_bo *abo = gem_to_amdgpu_bo(afb->obj);
 	struct amdgpu_device *adev = crtc->dev->dev_private;
-	bool async_flip = (acrtc->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
+	bool async_flip = (crtc->state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
 	struct dc_flip_addrs addr = { {0} };
 	/* TODO eliminate or rename surface_update */
 	struct dc_surface_update surface_updates[1] = { {0} };
@@ -4014,7 +4014,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 			 * TODO Check if it's correct
 			 */
 			*wait_for_vblank =
-				acrtc_attach->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
+					pcrtc->state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
 				false : true;
 
 			/* TODO: Needs rework for multiplane flip */
@@ -4025,11 +4025,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 				crtc,
 				fb,
 				drm_crtc_vblank_count(crtc) + *wait_for_vblank);
-
-			/*TODO BUG remove ASAP in 4.12 to avoid race between worker and flip IOCTL */
-
-			/*clean up the flags for next usage*/
-			acrtc_attach->flip_flags = 0;
 		}
 
 	}
Signature · 6 lines
2.11.0

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

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

Reviewed-by
#58 lore raw

Re: [PATCH 53/77] drm/amd/display: Use DRM provided page flip flag.

Quoted 37 lines · Harry Wentland

From: Andrey Grodzovsky <[email protected]>

Starting with 4.12 kernel DRM provides page flip flags so we don't need to have our own copy.

Change-Id I15d8db215001f887c47d16be82df04216f9265c3
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
index e24c44f6720b..2f2592d8e7d5 100644
@@ -3882,7 +3882,7 @@ static void amdgpu_dm_do_flip(
 	struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(fb);
 	struct amdgpu_bo *abo = gem_to_amdgpu_bo(afb->obj);
 	struct amdgpu_device *adev = crtc->dev->dev_private;
-	bool async_flip = (acrtc->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
+	bool async_flip = (crtc->state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
 	struct dc_flip_addrs addr = { {0} };
 	/* TODO eliminate or rename surface_update */
 	struct dc_surface_update surface_updates[1] = { {0} };
@@ -4014,7 +4014,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 			 * TODO Check if it's correct
 			 */
 			*wait_for_vblank =
-				acrtc_attach->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
+					pcrtc->state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
 				false : true;
 
 			/* TODO: Needs rework for multiplane flip */
@@ -4025,11 +4025,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 				crtc,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · line 4030

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -5
 				fb,
 				drm_crtc_vblank_count(crtc) + *wait_for_vblank);
-
-			/*TODO BUG remove ASAP in 4.12 to avoid race between worker and flip IOCTL */
-
-			/*clean up the flags for next usage*/
-			acrtc_attach->flip_flags = 0;
 		}
 
 	}

Can the acrtc->flip_flags field be removed now? If so, with that,

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 864031f9-1d5a-f54a-ad3e-4725008ac6e7-otUistvHUpPR7s880joybQ@public.gmane.org

#60 lore raw

Re: [PATCH 53/77] drm/amd/display: Use DRM provided page flip flag.

Quoted 46 lines · Michel Dänzer
Quoted 45 lines · Harry Wentland

From: Andrey Grodzovsky <[email protected]>

Starting with 4.12 kernel DRM provides page flip flags so we don't need to have our own copy.

Change-Id I15d8db215001f887c47d16be82df04216f9265c3
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -7
index e24c44f6720b..2f2592d8e7d5 100644
@@ -3882,7 +3882,7 @@ static void amdgpu_dm_do_flip(
  	struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(fb);
  	struct amdgpu_bo *abo = gem_to_amdgpu_bo(afb->obj);
  	struct amdgpu_device *adev = crtc->dev->dev_private;
-	bool async_flip = (acrtc->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
+	bool async_flip = (crtc->state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
  	struct dc_flip_addrs addr = { {0} };
  	/* TODO eliminate or rename surface_update */
  	struct dc_surface_update surface_updates[1] = { {0} };
@@ -4014,7 +4014,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
  			 * TODO Check if it's correct
  			 */
  			*wait_for_vblank =
-				acrtc_attach->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
+					pcrtc->state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
  				false : true;
 
  			/* TODO: Needs rework for multiplane flip */
@@ -4025,11 +4025,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
  				crtc,
  				fb,
  				drm_crtc_vblank_count(crtc) + *wait_for_vblank);
-
-			/*TODO BUG remove ASAP in 4.12 to avoid race between worker and flip IOCTL */
-
-			/*clean up the flags for next usage*/
-			acrtc_attach->flip_flags = 0;
  		}
 
Quoted 3 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · line 4030

Quoted 2 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
  	}

Can the acrtc->flip_flags field be removed now? If so, with that,

It was, I guess we missed that change on our private kernel branch, Harry can you please check in emails to see a patch about that

Quoted 4 lines

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

A message that is not in the archive (sent off-list or not yet received): 3ca8c64d-2781-1652-c244-b478c7f4899b-5C7GfCeVMHo@public.gmane.org

#62 lore raw

Re: [PATCH 53/77] drm/amd/display: Use DRM provided page flip flag.

Patch incoming.

Harry

Quoted 58 lines · andrey
Quoted 46 lines · Michel Dänzer
Quoted 45 lines · Harry Wentland

From: Andrey Grodzovsky <[email protected]>

Starting with 4.12 kernel DRM provides page flip flags so we don't need to have our own copy.

Change-Id I15d8db215001f887c47d16be82df04216f9265c3
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index e24c44f6720b..2f2592d8e7d5 100644
@@ -3882,7 +3882,7 @@ static void amdgpu_dm_do_flip(
      struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(fb);
      struct amdgpu_bo *abo = gem_to_amdgpu_bo(afb->obj);
      struct amdgpu_device *adev = crtc->dev->dev_private;
-    bool async_flip = (acrtc->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC)
 != 0;
+    bool async_flip = (crtc->state->pageflip_flags &
 DRM_MODE_PAGE_FLIP_ASYNC) != 0;
      struct dc_flip_addrs addr = { {0} };
      /* TODO eliminate or rename surface_update */
      struct dc_surface_update surface_updates[1] = { {0} };
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -4014,7 +4014,7 @@ static void amdgpu_dm_commit_planes(struct
 drm_atomic_state *state,
               * TODO Check if it's correct
               */
              *wait_for_vblank =
-                acrtc_attach->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC ?
+                    pcrtc->state->pageflip_flags &

DRM_MODE_PAGE_FLIP_ASYNC ?

                  false : true;
                /* TODO: Needs rework for multiplane flip */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
@@ -4025,11 +4025,6 @@ static void amdgpu_dm_commit_planes(struct
 drm_atomic_state *state,
                  crtc,
                  fb,
                  drm_crtc_vblank_count(crtc) + *wait_for_vblank);
-
-            /*TODO BUG remove ASAP in 4.12 to avoid race between
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · line 4030

Quoted 7 lines

worker and flip IOCTL */

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -3
-
-            /*clean up the flags for next usage*/
-            acrtc_attach->flip_flags = 0;
          }
        }

Can the acrtc->flip_flags field be removed now? If so, with that,

Quoted 7 lines

It was, I guess we missed that change on our private kernel branch, Harry can you please check in emails to see a patch about that

Quoted 4 lines

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

#63 lore raw

PATCH 54/77 drm/amd/display: Fix MST downstream display not light up regression

In reply to a message not in the archive

From: Jerry Zuo <[email protected]>

The fix is for the scenario: MST+SST chain together, and hook up to the card.

Regression: Per stream validate_context build v2
Before dc_add_stream_to_ctx(), need to update/reset stream signal type to SIGNAL_TYPE_DISPLAY_PORT_MST. Otherwise, downstream device cannot be added to ctx due to the lack of signal type info (SIGNAL_TYPE_NONE).
update_stream_signal() needs to be done after stream is created.

Change-Id I02430c362e3394b5a450a4609d7bcf10b9573995
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 25 -----------------------
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c   | 24 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -25
index d21e8d32d868..2ee3399d0d01 100644
@@ -1323,7 +1323,6 @@ bool dc_is_stream_unchanged(
 
 /* Maximum TMDS single link pixel clock 165MHz */
 #define TMDS_MAX_PIXEL_CLOCK_IN_KHZ 165000
-#define TMDS_MAX_PIXEL_CLOCK_IN_KHZ_UPMOST 297000
 
 static void update_stream_engine_usage(
 		struct resource_context *res_ctx,
@@ -1434,28 +1433,6 @@ static struct audio *find_first_free_audio(
 	return 0;
 }
 
-static void update_stream_signal(struct dc_stream_state *stream)
-{
-	if (stream->output_signal == SIGNAL_TYPE_NONE) {
-		struct dc_sink *dc_sink = stream->sink;
-
-		if (dc_sink->sink_signal == SIGNAL_TYPE_NONE)
-			stream->signal = stream->sink->link->connector_signal;
-		else
-			stream->signal = dc_sink->sink_signal;
-	} else {
-		stream->signal = stream->output_signal;
-	}
-
-	if (dc_is_dvi_signal(stream->signal)) {
-		if (stream->timing.pix_clk_khz > TMDS_MAX_PIXEL_CLOCK_IN_KHZ_UPMOST &&
-			stream->sink->sink_signal != SIGNAL_TYPE_DVI_SINGLE_LINK)
-			stream->signal = SIGNAL_TYPE_DVI_DUAL_LINK;
-		else
-			stream->signal = SIGNAL_TYPE_DVI_SINGLE_LINK;
-	}
-}
-
 bool resource_is_stream_unchanged(
 	struct validate_context *old_context, struct dc_stream_state *stream)
 {
@@ -1627,8 +1604,6 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing)
 
 static void calculate_phy_pix_clks(struct dc_stream_state *stream)
 {
-	update_stream_signal(stream);
-
 	/* update actual pixel clock on all streams */
 	if (dc_is_hdmi_signal(stream->signal))
 		stream->phy_pix_clk = get_norm_pix_clk(
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +24 -0
index aaa6d2326190..0e7cc293184e 100644
@@ -33,6 +33,28 @@
 /*******************************************************************************
  * Private functions
  ******************************************************************************/
+#define TMDS_MAX_PIXEL_CLOCK_IN_KHZ_UPMOST 297000
+static void update_stream_signal(struct dc_stream_state *stream)
+{
+	if (stream->output_signal == SIGNAL_TYPE_NONE) {
+		struct dc_sink *dc_sink = stream->sink;
+
+		if (dc_sink->sink_signal == SIGNAL_TYPE_NONE)
+			stream->signal = stream->sink->link->connector_signal;
+		else
+			stream->signal = dc_sink->sink_signal;
+	} else {
+		stream->signal = stream->output_signal;
+	}
+
+	if (dc_is_dvi_signal(stream->signal)) {
+		if (stream->timing.pix_clk_khz > TMDS_MAX_PIXEL_CLOCK_IN_KHZ_UPMOST &&
+			stream->sink->sink_signal != SIGNAL_TYPE_DVI_SINGLE_LINK)
+			stream->signal = SIGNAL_TYPE_DVI_DUAL_LINK;
+		else
+			stream->signal = SIGNAL_TYPE_DVI_SINGLE_LINK;
+	}
+}
 
 static bool construct(struct dc_stream_state *stream,
 	struct dc_sink *dc_sink_data)
@@ -80,6 +102,8 @@ static bool construct(struct dc_stream_state *stream,
 	stream->timing.flags.LTE_340MCSC_SCRAMBLE = dc_sink_data->edid_caps.lte_340mcsc_scramble;
 
 	stream->status.link = stream->sink->link;
+
+	update_stream_signal(stream);
 	return true;
 }
 
Signature · 6 lines
2.11.0

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

PATCH 55/77 drm/amd/display: Update DSCL

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

Change-Id I1efc6d2cda212008597784be9bf4c11db48ee180
---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  | 101 ++++++---------------
 1 file changed, 29 insertions(+), 72 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +29 -72
index 76d5f5d4d82f..33830639e210 100644
@@ -215,14 +215,18 @@ static void dpp_set_lb(
 {
 	uint32_t pixel_depth = get_pixel_depth_val(lb_params->depth);
 	uint32_t dyn_pix_depth = lb_params->dynamic_pixel_depth;
-	REG_SET_7(LB_DATA_FORMAT, 0,
-		PIXEL_DEPTH, pixel_depth, /* Pixel depth stored in LB */
-		PIXEL_EXPAN_MODE, lb_params->pixel_expan_mode, /* Pixel expansion mode */
-		PIXEL_REDUCE_MODE, 1, /* Pixel reduction mode: Rounding */
-		DYNAMIC_PIXEL_DEPTH, dyn_pix_depth, /* Dynamic expansion pixel depth */
-		DITHER_EN, 0, /* Dithering enable: Disabled */
-		INTERLEAVE_EN, lb_params->interleave_en, /* Interleave source enable */
-		ALPHA_EN, lb_params->alpha_en); /* Alpha enable */
+
+	/* LB */
+	if (xfm->tf_mask->PIXEL_DEPTH) {
+		REG_SET_7(LB_DATA_FORMAT, 0,
+			PIXEL_DEPTH, pixel_depth, /* Pixel depth stored in LB */
+			PIXEL_EXPAN_MODE, lb_params->pixel_expan_mode, /* Pixel expansion mode */
+			PIXEL_REDUCE_MODE, 1, /* Pixel reduction mode: Rounding */
+			DYNAMIC_PIXEL_DEPTH, dyn_pix_depth, /* Dynamic expansion pixel depth */
+			DITHER_EN, 0, /* Dithering enable: Disabled */
+			INTERLEAVE_EN, lb_params->interleave_en, /* Interleave source enable */
+			ALPHA_EN, lb_params->alpha_en); /* Alpha enable */
+	}
 
 	REG_SET_2(LB_MEMORY_CTRL, 0,
 		MEMORY_CONFIG, mem_size_config,
@@ -462,7 +466,8 @@ static bool is_lb_conf_valid(int ceil_vratio, int num_partitions, int vtaps)
 }
 
 /*find first match configuration which meets the min required lb size*/
-static enum lb_memory_config find_lb_memory_config(const struct scaler_data *scl_data)
+static enum lb_memory_config dpp10_find_lb_memory_config(
+		const struct scaler_data *scl_data)
 {
 	int num_part_y, num_part_c;
 	int vtaps = scl_data->taps.v_taps;
@@ -504,6 +509,18 @@ static enum lb_memory_config find_lb_memory_config(const struct scaler_data *scl
 	return LB_MEMORY_CONFIG_0;
 }
 
+/*find first match configuration which meets the min required lb size*/
+static enum lb_memory_config find_lb_memory_config(struct dcn10_dpp *xfm,
+		const struct scaler_data *scl_data)
+{
+	enum lb_memory_config mem_cfg = LB_MEMORY_CONFIG_0;
+
+	if (xfm->tf_mask->PIXEL_DEPTH) {
+		mem_cfg = dpp10_find_lb_memory_config(scl_data);
+	}
+	return mem_cfg;
+}
+
 void dpp_set_scaler_auto_scale(
 	struct transform *xfm_base,
 	const struct scaler_data *scl_data)
@@ -524,7 +541,7 @@ void dpp_set_scaler_auto_scale(
 	if (dscl_mode == DSCL_MODE_DSCL_BYPASS)
 		return;
 
-	lb_config =  find_lb_memory_config(scl_data);
+	lb_config =  find_lb_memory_config(xfm, scl_data);
 	dpp_set_lb(xfm, &scl_data->lb_params, lb_config);
 
 	if (dscl_mode == DSCL_MODE_SCALING_444_BYPASS)
@@ -662,8 +679,9 @@ void dcn10_dpp_dscl_set_scaler_manual_scale(
 
 	if (dscl_mode == DSCL_MODE_DSCL_BYPASS)
 		return;
+
 	/* LB */
-	lb_config =  find_lb_memory_config(scl_data);
+	lb_config =  find_lb_memory_config(xfm, scl_data);
 	dpp_set_lb(xfm, &scl_data->lb_params, lb_config);
 
 	if (dscl_mode == DSCL_MODE_SCALING_444_BYPASS)
@@ -699,64 +717,3 @@ void dcn10_dpp_dscl_set_scaler_manual_scale(
 	dpp_set_scl_filter(xfm, scl_data, ycbcr);
 }
 
-
-#if 0
-bool dpp_set_pixel_storage_depth(
-	struct dpp *xfm,
-	enum lb_pixel_depth depth,
-	const struct bit_depth_reduction_params *bit_depth_params)
-{
-	struct dcn10_dpp *xfm110 = TO_DCN10_DPP(xfm);
-	bool ret = true;
-	uint32_t value;
-	enum dc_color_depth color_depth;
-
-	value = dm_read_reg(xfm->ctx, LB_REG(mmLB_DATA_FORMAT));
-	switch (depth) {
-	case LB_PIXEL_DEPTH_18BPP:
-		color_depth = COLOR_DEPTH_666;
-		set_reg_field_value(value, 2, LB_DATA_FORMAT, PIXEL_DEPTH);
-		set_reg_field_value(value, 1, LB_DATA_FORMAT, PIXEL_EXPAN_MODE);
-		break;
-	case LB_PIXEL_DEPTH_24BPP:
-		color_depth = COLOR_DEPTH_888;
-		set_reg_field_value(value, 1, LB_DATA_FORMAT, PIXEL_DEPTH);
-		set_reg_field_value(value, 1, LB_DATA_FORMAT, PIXEL_EXPAN_MODE);
-		break;
-	case LB_PIXEL_DEPTH_30BPP:
-		color_depth = COLOR_DEPTH_101010;
-		set_reg_field_value(value, 0, LB_DATA_FORMAT, PIXEL_DEPTH);
-		set_reg_field_value(value, 1, LB_DATA_FORMAT, PIXEL_EXPAN_MODE);
-		break;
-	case LB_PIXEL_DEPTH_36BPP:
-		color_depth = COLOR_DEPTH_121212;
-		set_reg_field_value(value, 3, LB_DATA_FORMAT, PIXEL_DEPTH);
-		set_reg_field_value(value, 0, LB_DATA_FORMAT, PIXEL_EXPAN_MODE);
-		break;
-	default:
-		ret = false;
-		break;
-	}
-
-	if (ret == true) {
-		set_denormalization(xfm110, color_depth);
-		ret = program_bit_depth_reduction(xfm110, color_depth,
-				bit_depth_params);
-
-		set_reg_field_value(value, 0, LB_DATA_FORMAT, ALPHA_EN);
-		dm_write_reg(xfm->ctx, LB_REG(mmLB_DATA_FORMAT), value);
-		if (!(xfm110->lb_pixel_depth_supported & depth)) {
-			/* We should use unsupported capabilities
-			 * unless it is required by w/a
-			 */
-			dm_logger_write(xfm->ctx->logger, LOG_WARNING,
-				"%s: Capability not supported",
-				__func__);
-		}
-	}
-
-	return ret;
-}
-#endif
-
-
Signature · 6 lines
2.11.0

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

PATCH 56/77 drm/amd/display: move cm registers from ipp to dpp_cm

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

Change-Id Ie54e9d6997e8b8733a2b290653bb4c8f652165ce
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 150 +++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h   | 489 ++++++++++++++-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    | 555 +++++++++++++++++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  |   3 +-
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  20 +-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c   | 676 +--------------------
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.h   | 416 -------------
 drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h  |  18 +
 drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h        |  17 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/transform.h  |  20 +
 10 files changed, 1239 insertions(+), 1125 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +150 -0
index 30722495de0a..20163668e2a8 100644
@@ -52,6 +52,12 @@
 #define FN(reg_name, field_name) \
 	xfm->tf_shift->field_name, xfm->tf_mask->field_name
 
+enum pixel_format_description {
+	PIXEL_FORMAT_FIXED = 0,
+	PIXEL_FORMAT_FIXED16,
+	PIXEL_FORMAT_FLOAT
+
+};
 
 enum dcn10_coef_filter_type_sel {
 	SCL_COEF_LUMA_VERT_FILTER = 0,
@@ -249,6 +255,145 @@ static void dcn10_dpp_cm_set_regamma_mode(
 			OBUF_H_2X_UPSCALE_EN, obuf_hupscale);
 }
 
+static void ippn10_setup_format_flags(enum surface_pixel_format input_format,\
+						enum pixel_format_description *fmt)
+{
+
+	if (input_format == SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616F ||
+		input_format == SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616F)
+		*fmt = PIXEL_FORMAT_FLOAT;
+	else if (input_format == SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616)
+		*fmt = PIXEL_FORMAT_FIXED16;
+	else
+		*fmt = PIXEL_FORMAT_FIXED;
+}
+
+static void ippn10_set_degamma_format_float(
+		struct transform *xfm_base,
+		bool is_float)
+{
+	struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base);
+
+	if (is_float) {
+		REG_UPDATE(CM_IGAM_CONTROL, CM_IGAM_INPUT_FORMAT, 3);
+		REG_UPDATE(CM_IGAM_CONTROL, CM_IGAM_LUT_MODE, 1);
+	} else {
+		REG_UPDATE(CM_IGAM_CONTROL, CM_IGAM_INPUT_FORMAT, 2);
+		REG_UPDATE(CM_IGAM_CONTROL, CM_IGAM_LUT_MODE, 0);
+	}
+}
+
+void ippn10_cnv_setup (
+		struct transform *xfm_base,
+		enum surface_pixel_format input_format,
+		enum expansion_mode mode,
+		enum ipp_output_format cnv_out_format)
+{
+	uint32_t pixel_format;
+	uint32_t alpha_en;
+	enum pixel_format_description fmt ;
+	enum dc_color_space color_space;
+	enum dcn10_input_csc_select select;
+	bool is_float;
+	struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base);
+	bool force_disable_cursor = false;
+
+	ippn10_setup_format_flags(input_format, &fmt);
+	alpha_en = 1;
+	pixel_format = 0;
+	color_space = COLOR_SPACE_SRGB;
+	select = INPUT_CSC_SELECT_BYPASS;
+	is_float = false;
+
+	switch (fmt) {
+	case PIXEL_FORMAT_FIXED:
+	case PIXEL_FORMAT_FIXED16:
+	/*when output is float then FORMAT_CONTROL__OUTPUT_FP=1*/
+		REG_SET_3(FORMAT_CONTROL, 0,
+			CNVC_BYPASS, 0,
+			FORMAT_EXPANSION_MODE, mode,
+			OUTPUT_FP, 0);
+		break;
+	case PIXEL_FORMAT_FLOAT:
+		REG_SET_3(FORMAT_CONTROL, 0,
+			CNVC_BYPASS, 0,
+			FORMAT_EXPANSION_MODE, mode,
+			OUTPUT_FP, 1);
+		is_float = true;
+		break;
+	default:
+
+		break;
+	}
+
+	ippn10_set_degamma_format_float(xfm_base, is_float);
+
+	switch (input_format) {
+	case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555:
+		pixel_format = 1;
+		break;
+	case SURFACE_PIXEL_FORMAT_GRPH_RGB565:
+		pixel_format = 3;
+		alpha_en = 0;
+		break;
+	case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
+	case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
+		pixel_format = 8;
+		break;
+	case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010:
+	case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010:
+		pixel_format = 10;
+		break;
+	case SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr:
+		force_disable_cursor = false;
+		pixel_format = 65;
+		color_space = COLOR_SPACE_YCBCR709;
+		select = INPUT_CSC_SELECT_ICSC;
+		break;
+	case SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb:
+		force_disable_cursor = true;
+		pixel_format = 64;
+		color_space = COLOR_SPACE_YCBCR709;
+		select = INPUT_CSC_SELECT_ICSC;
+		break;
+	case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr:
+		force_disable_cursor = true;
+		pixel_format = 67;
+		color_space = COLOR_SPACE_YCBCR709;
+		select = INPUT_CSC_SELECT_ICSC;
+		break;
+	case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb:
+		force_disable_cursor = true;
+		pixel_format = 66;
+		color_space = COLOR_SPACE_YCBCR709;
+		select = INPUT_CSC_SELECT_ICSC;
+		break;
+	case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
+		pixel_format = 22;
+		break;
+	case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616F:
+		pixel_format = 24;
+		break;
+	case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616F:
+		pixel_format = 25;
+		break;
+	default:
+		break;
+	}
+	REG_SET(CNVC_SURFACE_PIXEL_FORMAT, 0,
+			CNVC_SURFACE_PIXEL_FORMAT, pixel_format);
+	REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en);
+
+	ippn10_program_input_csc(xfm_base, color_space, select);
+
+	if (force_disable_cursor) {
+		REG_UPDATE(CURSOR_CONTROL,
+				CURSOR_ENABLE, 0);
+		REG_UPDATE(CURSOR0_CONTROL,
+				CUR0_ENABLE, 0);
+	}
+}
+
 static struct transform_funcs dcn10_dpp_funcs = {
 		.transform_reset = dpp_reset,
 		.transform_set_scaler = dcn10_dpp_dscl_set_scaler_manual_scale,
@@ -263,6 +408,11 @@ static struct transform_funcs dcn10_dpp_funcs = {
 		.opp_program_regamma_luta_settings = dcn10_dpp_cm_program_regamma_luta_settings,
 		.opp_program_regamma_pwl = dcn10_dpp_cm_set_regamma_pwl,
 		.opp_set_regamma_mode = dcn10_dpp_cm_set_regamma_mode,
+		.ipp_set_degamma = ippn10_set_degamma,
+		.ipp_program_input_lut		= ippn10_program_input_lut,
+		.ipp_program_degamma_pwl	= ippn10_set_degamma_pwl,
+		.ipp_setup			= ippn10_cnv_setup,
+		.ipp_full_bypass		= ippn10_full_bypass,
 };
 
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +479 -10

555 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +555 -0

570 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +1 -2
index 33830639e210..14c3b330b27b 100644
@@ -225,7 +225,7 @@ static void dpp_set_lb(
 			DYNAMIC_PIXEL_DEPTH, dyn_pix_depth, /* Dynamic expansion pixel depth */
 			DITHER_EN, 0, /* Dithering enable: Disabled */
 			INTERLEAVE_EN, lb_params->interleave_en, /* Interleave source enable */
-			ALPHA_EN, lb_params->alpha_en); /* Alpha enable */
+			LB_DATA_FORMAT__ALPHA_EN, lb_params->alpha_en); /* Alpha enable */
 	}
 
 	REG_SET_2(LB_MEMORY_CTRL, 0,
@@ -716,4 +716,3 @@ void dcn10_dpp_dscl_set_scaler_manual_scale(
 
 	dpp_set_scl_filter(xfm, scl_data, ycbcr);
 }
-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +10 -10
index 498680a9b996..4a24893486e8 100644
@@ -1294,34 +1294,34 @@ static void dcn10_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_c
 static bool dcn10_set_input_transfer_func(
 	struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state)
 {
-	struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
+	struct transform *xfm_base = pipe_ctx->plane_res.xfm;
 	const struct dc_transfer_func *tf = NULL;
 	bool result = true;
 
-	if (ipp == NULL)
+	if (xfm_base == NULL)
 		return false;
 
 	if (plane_state->in_transfer_func)
 		tf = plane_state->in_transfer_func;
 
 	if (plane_state->gamma_correction && dce_use_lut(plane_state))
-		ipp->funcs->ipp_program_input_lut(ipp,
+		xfm_base->funcs->ipp_program_input_lut(xfm_base,
 				plane_state->gamma_correction);
 
 	if (tf == NULL)
-		ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_BYPASS);
+		xfm_base->funcs->ipp_set_degamma(xfm_base, IPP_DEGAMMA_MODE_BYPASS);
 	else if (tf->type == TF_TYPE_PREDEFINED) {
 		switch (tf->tf) {
 		case TRANSFER_FUNCTION_SRGB:
-			ipp->funcs->ipp_set_degamma(ipp,
+			xfm_base->funcs->ipp_set_degamma(xfm_base,
 					IPP_DEGAMMA_MODE_HW_sRGB);
 			break;
 		case TRANSFER_FUNCTION_BT709:
-			ipp->funcs->ipp_set_degamma(ipp,
+			xfm_base->funcs->ipp_set_degamma(xfm_base,
 					IPP_DEGAMMA_MODE_HW_xvYCC);
 			break;
 		case TRANSFER_FUNCTION_LINEAR:
-			ipp->funcs->ipp_set_degamma(ipp,
+			xfm_base->funcs->ipp_set_degamma(xfm_base,
 					IPP_DEGAMMA_MODE_BYPASS);
 			break;
 		case TRANSFER_FUNCTION_PQ:
@@ -1332,7 +1332,7 @@ static bool dcn10_set_input_transfer_func(
 			break;
 		}
 	} else if (tf->type == TF_TYPE_BYPASS) {
-		ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_BYPASS);
+		xfm_base->funcs->ipp_set_degamma(xfm_base, IPP_DEGAMMA_MODE_BYPASS);
 	} else {
 		/*TF_TYPE_DISTRIBUTED_POINTS*/
 		result = false;
@@ -2204,7 +2204,7 @@ static void update_dchubp_dpp(
 {
 	struct dce_hwseq *hws = dc->hwseq;
 	struct mem_input *mi = pipe_ctx->plane_res.mi;
-	struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
+	struct transform *xfm = pipe_ctx->plane_res.xfm;
 	struct dc_plane_state *plane_state = pipe_ctx->plane_state;
 	union plane_size size = plane_state->plane_size;
 	struct default_adjustment ocsc = {0};
@@ -2249,7 +2249,7 @@ static void update_dchubp_dpp(
 				hws
 				);
 
-	ipp->funcs->ipp_setup(ipp,
+	xfm->funcs->ipp_setup(xfm,
 			plane_state->format,
 			1,
 			IPP_OUTPUT_FORMAT_12_BIT_FIX);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c +5 -671

695 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.h +0 -416

469 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +18 -0
index 589bddad7e66..9602f261b614 100644
@@ -98,6 +98,24 @@ enum graphics_csc_adjust_type {
 	GRAPHICS_CSC_ADJUST_TYPE_SW  /*use adjustments */
 };
 
+enum ipp_degamma_mode {
+	IPP_DEGAMMA_MODE_BYPASS,
+	IPP_DEGAMMA_MODE_HW_sRGB,
+	IPP_DEGAMMA_MODE_HW_xvYCC,
+	IPP_DEGAMMA_MODE_USER_PWL
+};
+
+enum ipp_output_format {
+	IPP_OUTPUT_FORMAT_12_BIT_FIX,
+	IPP_OUTPUT_FORMAT_16_BIT_BYPASS,
+	IPP_OUTPUT_FORMAT_FLOAT
+};
+
+enum expansion_mode {
+	EXPANSION_MODE_DYNAMIC,
+	EXPANSION_MODE_ZERO
+};
+
 struct default_adjustment {
 	enum lb_pixel_depth lb_color_depth;
 	enum dc_color_space out_color_space;
drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h +1 -16
index 0f952e5b3ae8..7ebfdc1c19c1 100644
@@ -54,12 +54,7 @@ struct ipp_prescale_params {
 	uint16_t scale;
 };
 
-enum ipp_degamma_mode {
-	IPP_DEGAMMA_MODE_BYPASS,
-	IPP_DEGAMMA_MODE_HW_sRGB,
-	IPP_DEGAMMA_MODE_HW_xvYCC,
-	IPP_DEGAMMA_MODE_USER_PWL
-};
+
 
 enum ovl_color_space {
 	OVL_COLOR_SPACE_UNKNOWN = 0,
@@ -68,16 +63,6 @@ enum ovl_color_space {
 	OVL_COLOR_SPACE_YUV709
 };
 
-enum expansion_mode {
-	EXPANSION_MODE_DYNAMIC,
-	EXPANSION_MODE_ZERO
-};
-
-enum ipp_output_format {
-	IPP_OUTPUT_FORMAT_12_BIT_FIX,
-	IPP_OUTPUT_FORMAT_16_BIT_BYPASS,
-	IPP_OUTPUT_FORMAT_FLOAT
-};
 
 struct ipp_funcs {
 
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +20 -0
index f3d66752ed90..623042d2c272 100644
@@ -219,6 +219,26 @@ struct transform_funcs {
 	void (*opp_set_regamma_mode)(
 			struct transform *xfm_base,
 			enum opp_regamma mode);
+
+	void (*ipp_set_degamma)(
+			struct transform *xfm_base,
+			enum ipp_degamma_mode mode);
+
+	void (*ipp_program_input_lut)(
+			struct transform *xfm_base,
+			const struct dc_gamma *gamma);
+
+	void (*ipp_program_degamma_pwl)(struct transform *xfm_base,
+									 const struct pwl_params *params);
+
+	void (*ipp_setup)(
+			struct transform *xfm_base,
+			enum surface_pixel_format input_format,
+			enum expansion_mode mode,
+			enum ipp_output_format cnv_out_format);
+
+	void (*ipp_full_bypass)(struct transform *xfm_base);
+
 };
 
 extern const uint16_t filter_2tap_16p[18];
Signature · 6 lines
2.11.0

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

PATCH 57/77 drm/amd/display: DF C-state entry blocked when DPMS

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

Change-Id Iebdbc77d58dda5adbdf0ab1bb2441d9b2559c2fd
---
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  4 ++
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  9 +++-
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 48 +++++++++++++++++++++-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c |  9 ++++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |  1 +
 drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h  |  2 +
 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h  |  3 ++
 7 files changed, 74 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -0
index e9fd59c4552a..5c03afb34d9c 100644
@@ -832,6 +832,8 @@ static bool dc_commit_context_no_check(struct dc *dc, struct validate_context *c
 	if (!dcb->funcs->is_accelerated_mode(dcb))
 		dc->hwss.enable_accelerated_mode(dc);
 
+	dc->hwss.ready_shared_resources(dc);
+
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {
 		pipe = &context->res_ctx.pipe_ctx[i];
 		dc->hwss.wait_for_mpcc_disconnect(dc, dc->res_pool, pipe);
@@ -881,6 +883,8 @@ static bool dc_commit_context_no_check(struct dc *dc, struct validate_context *c
 
 	dc_retain_validate_context(dc->current_context);
 
+	dc->hwss.optimize_shared_resources(dc);
+
 	return (result == DC_OK);
 }
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +8 -1
index 8ba61b9b8792..3502faa1458f 100644
@@ -2697,6 +2697,10 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx,
 	}
 }
 
+static void ready_shared_resources(struct dc *dc) {}
+
+static void optimize_shared_resources(struct dc *dc) {}
+
 static const struct hw_sequencer_funcs dce110_funcs = {
 	.program_gamut_remap = program_gamut_remap,
 	.program_csc_matrix = program_csc_matrix,
@@ -2727,7 +2731,10 @@ static const struct hw_sequencer_funcs dce110_funcs = {
 	.prog_pixclk_crtc_otg = dce110_prog_pixclk_crtc_otg,
 	.setup_stereo = NULL,
 	.set_avmute = dce110_set_avmute,
-	.wait_for_mpcc_disconnect = dce110_wait_for_mpcc_disconnect
+	.wait_for_mpcc_disconnect = dce110_wait_for_mpcc_disconnect,
+	.ready_shared_resources = ready_shared_resources,
+	.optimize_shared_resources = optimize_shared_resources,
+
 };
 
 bool dce110_hw_sequencer_construct(struct dc *dc)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +47 -1

60 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +9 -0
index 0a47e6ad4286..9008cd03b139 100644
@@ -56,6 +56,14 @@ static void min10_set_blank(struct mem_input *mem_input, bool blank)
 	}
 }
 
+static void min10_set_hubp_blank_en(struct mem_input *mem_input, bool blank)
+{
+	struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
+	uint32_t blank_en = blank ? 1 : 0;
+
+	REG_UPDATE(DCHUBP_CNTL, HUBP_BLANK_EN, blank_en);
+}
+
 static void min10_vready_workaround(struct mem_input *mem_input,
 		struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest)
 {
@@ -771,6 +779,7 @@ static struct mem_input_funcs dcn10_mem_input_funcs = {
 	.set_blank = min10_set_blank,
 	.dcc_control = min10_dcc_control,
 	.mem_program_viewport = min_set_viewport,
+	.set_hubp_blank_en = min10_set_hubp_blank_en,
 };
 
 /*****************************************/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
index 4af40f5138fc..d09ed13fb8ea 100644
@@ -439,6 +439,7 @@ static const struct dc_debug debug_defaults_diags = {
 		.force_abm_enable = false,
 		.timing_trace = true,
 		.clock_trace = true,
+		.disable_stutter = true,
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 		.disable_pplib_clock_request = true,
 		.disable_pplib_wm_range = true,
drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +2 -0
index 6f4f04da9e28..6cef9ad0af91 100644
@@ -161,6 +161,8 @@ struct mem_input_funcs {
 				struct dchub_init_data *dh_data);
 
 	void (*set_blank)(struct mem_input *mi, bool blank);
+	void (*set_hubp_blank_en)(struct mem_input *mi, bool blank);
+
 };
 
 #endif
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +3 -0
index c73dca9f6d46..01e426194163 100644
@@ -173,6 +173,9 @@ struct hw_sequencer_funcs {
 	void (*wait_for_mpcc_disconnect)(struct dc *dc,
 			struct resource_pool *res_pool,
 			struct pipe_ctx *pipe_ctx);
+
+	void (*ready_shared_resources)(struct dc *dc);
+	void (*optimize_shared_resources)(struct dc *dc);
 };
 
 void color_space_to_black_color(
Signature · 6 lines
2.11.0

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

PATCH 58/77 drm/amd/display: Remove mpc from bios left over, keep double buffer disabled.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

Change-Id Ife3ff042c9f70a6e8c08f0e5a395117de04eed14
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c              | 10 +++++++++-
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c |  3 ---
 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +9 -1
index ce408ccb428e..082b39a65e6a 100644
@@ -127,10 +127,18 @@ static void mpc10_mpcc_remove(
 	for (z_idx = 0; z_idx < opp->mpc_tree.num_pipes; z_idx++)
 		if (opp->mpc_tree.dpp[z_idx] == dpp_id)
 			break;
+
 	if (z_idx == opp->mpc_tree.num_pipes) {
-		ASSERT(0);
+		/* In case of resume from S3/S4, remove mpcc from bios left over */
+		REG_SET(MPCC_OPP_ID[dpp_id], 0,
+				MPCC_OPP_ID, 0xf);
+		REG_SET(MPCC_TOP_SEL[dpp_id], 0,
+				MPCC_TOP_SEL, 0xf);
+		REG_SET(MPCC_BOT_SEL[dpp_id], 0,
+				MPCC_BOT_SEL, 0xf);
 		return;
 	}
+
 	mpcc_id = opp->mpc_tree.mpcc[z_idx];
 
 	REG_SET(MPCC_OPP_ID[mpcc_id], 0,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +0 -3
index cc58f43400d7..6a5f2683c2e5 100644
@@ -289,9 +289,6 @@ static void tgn10_unblank_crtc(struct timing_generator *tg)
 {
 	struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
 
-	REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
-			OTG_BLANK_DATA_DOUBLE_BUFFER_EN, 1);
-
 	REG_UPDATE_2(OTG_BLANK_CONTROL,
 			OTG_BLANK_DATA_EN, 0,
 			OTG_BLANK_DE_MODE, 0);
Signature · 6 lines
2.11.0

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

PATCH 59/77 drm/amd/display: clean up header file includes

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

Change-Id Ic3096918ef31786ff523ed1487bde5afb9382f91
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 20 -----------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    | 20 -----------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  |  8 -----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c   | 41 ----------------------
 4 files changed, 89 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +0 -20
index 20163668e2a8..99caafb27b37 100644
@@ -27,10 +27,6 @@
 
 #include "core_types.h"
 
-#include "include/grph_object_id.h"
-#include "include/fixed31_32.h"
-#include "include/logger_interface.h"
-
 #include "reg_helper.h"
 #include "dcn10_dpp.h"
 #include "basics/conversion.h"
@@ -68,22 +64,6 @@ enum dcn10_coef_filter_type_sel {
 	SCL_COEF_ALPHA_HORZ_FILTER = 5
 };
 
-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
-};
-
 enum dscl_autocal_mode {
 	AUTOCAL_MODE_OFF = 0,
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +0 -20
index 409462f29f54..81620241a978 100644
@@ -27,10 +27,6 @@
 
 #include "core_types.h"
 
-#include "include/grph_object_id.h"
-#include "include/fixed31_32.h"
-#include "include/logger_interface.h"
-
 #include "reg_helper.h"
 #include "dcn10_dpp.h"
 #include "basics/conversion.h"
@@ -66,22 +62,6 @@ enum dcn10_coef_filter_type_sel {
 	SCL_COEF_ALPHA_HORZ_FILTER = 5
 };
 
-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
-};
-
 enum dscl_autocal_mode {
 	AUTOCAL_MODE_OFF = 0,
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +0 -8
index 14c3b330b27b..b62cb38f523c 100644
@@ -100,14 +100,6 @@ enum dscl_mode_sel {
 	DSCL_MODE_DSCL_BYPASS = 6
 };
 
-enum gamut_remap_select {
-	GAMUT_REMAP_BYPASS = 0,
-	GAMUT_REMAP_COEFF,
-	GAMUT_REMAP_COMA_COEFF,
-	GAMUT_REMAP_COMB_COEFF
-};
-
-
 static void dpp_set_overscan(
 	struct dcn10_dpp *xfm,
 	const struct scaler_data *data)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c +0 -41

53 lines not on this page · raw message

Signature · 6 lines
2.11.0

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

PATCH 60/77 drm/amd/display: Rename dc validate_context and current_context

In reply to a message not in the archive

From: Jerry Zuo <[email protected]>

Rename all the dc validate_context to dc_state and dc current_context to current_state.

Change-Id I39f896ac7f311f74ca26b78b822f12a9e2ff8583
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   6 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |   2 +-
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |   6 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           | 106 ++++++++++-----------
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c     |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |   8 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |   4 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  40 ++++----
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |  15 ++-
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c   |   4 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  36 +++----
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   4 +-
 .../amd/display/dc/dce100/dce100_hw_sequencer.c    |   8 +-
 .../amd/display/dc/dce100/dce100_hw_sequencer.h    |   4 +-
 .../drm/amd/display/dc/dce100/dce100_resource.c    |  10 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  70 +++++++-------
 .../amd/display/dc/dce110/dce110_hw_sequencer.h    |  12 +--
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  16 ++--
 .../drm/amd/display/dc/dce112/dce112_resource.c    |  16 ++--
 .../drm/amd/display/dc/dce112/dce112_resource.h    |  10 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |  10 +-
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  62 ++++++------
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h  |   2 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |   8 +-
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  14 +--
 drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h     |   2 +-
 drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h     |   4 +-
 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h  |  14 +--
 drivers/gpu/drm/amd/display/dc/inc/resource.h      |  22 ++---
 .../amd/display/dc/irq/dce110/irq_service_dce110.c |   2 +-
 .../gpu/drm/amd/display/include/logger_interface.h |   4 +-
 32 files changed, 262 insertions(+), 263 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -3
index 2f2592d8e7d5..3f8429b1fd4e 100644
@@ -691,7 +691,7 @@ struct drm_atomic_state *
 dm_atomic_state_alloc(struct drm_device *dev)
 {
 	struct dm_atomic_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
-	struct validate_context *new_ctx;
+	struct dc_state *new_ctx;
 	struct amdgpu_device *adev = dev->dev_private;
 	struct dc *dc = adev->dm.dc;
 
@@ -726,7 +726,7 @@ dm_atomic_state_clear(struct drm_atomic_state *state)
 	struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
 
 	if (dm_state->context) {
-		dc_release_validate_context(dm_state->context);
+		dc_release_state(dm_state->context);
 		dm_state->context = NULL;
 	}
 
@@ -4213,7 +4213,7 @@ void amdgpu_dm_atomic_commit_tail(
 	}
 
 	if (dm_state->context)
-		WARN_ON(!dc_commit_context(dm->dc, dm_state->context));
+		WARN_ON(!dc_commit_state(dm->dc, dm_state->context));
 
 
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -1
index e0a5632f00a3..71cbee199016 100644
@@ -209,7 +209,7 @@ struct dm_crtc_state {
 struct dm_atomic_state {
 	struct drm_atomic_state base;
 
-	struct validate_context *context;
+	struct dc_state *context;
 };
 
 #define to_dm_atomic_state(x) container_of(x, struct dm_atomic_state, base)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +3 -3
index 6c85a54e47d6..ee1b76c074e6 100644
@@ -476,7 +476,7 @@ static void dcn_bw_calc_rq_dlg_ttu(
 static void dcn_dml_wm_override(
 		const struct dcn_bw_internal_vars *v,
 		struct display_mode_lib *dml,
-		struct validate_context *context,
+		struct dc_state *context,
 		const struct resource_pool *pool)
 {
 	int i, in_idx, active_count;
@@ -593,7 +593,7 @@ static void split_stream_across_pipes(
 }
 
 static void calc_wm_sets_and_perf_params(
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dcn_bw_internal_vars *v)
 {
 	/* Calculate set A last to keep internal var state consistent for required config */
@@ -721,7 +721,7 @@ static bool dcn_bw_apply_registry_override(struct dc *dc)
 
 bool dcn_validate_bandwidth(
 		struct dc *dc,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	const struct resource_pool *pool = dc->res_pool;
 	struct dcn_bw_internal_vars *v = &context->dcn_bw_vars;
drivers/gpu/drm/amd/display/dc/core/dc.c +53 -53

327 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc_debug.c +1 -1
index d74eed8f9b96..6acee5426e4b 100644
@@ -329,7 +329,7 @@ void context_timing_trace(
 
 void context_clock_trace(
 		struct dc *dc,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
 	struct dc  *core_dc = dc;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -4
index 0bdd41ca8799..65e12614d96c 100644
@@ -1819,14 +1819,14 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
 	if (dc_is_embedded_signal(link->connector_signal)) {
 		if (stream != NULL) {
 			for (i = 0; i < MAX_PIPES; i++) {
-				if (core_dc->current_context->res_ctx.
+				if (core_dc->current_state->res_ctx.
 						pipe_ctx[i].stream
 						== stream)
 					/* DMCU -1 for all controller id values,
 					 * therefore +1 here
 					 */
 					controller_id =
-						core_dc->current_context->
+						core_dc->current_state->
 						res_ctx.pipe_ctx[i].stream_res.tg->inst +
 						1;
 			}
@@ -1926,13 +1926,13 @@ bool dc_link_setup_psr(struct dc_link *link,
 		psr_context->engineId = link->link_enc->preferred_engine;
 
 		for (i = 0; i < MAX_PIPES; i++) {
-			if (core_dc->current_context->res_ctx.pipe_ctx[i].stream
+			if (core_dc->current_state->res_ctx.pipe_ctx[i].stream
 					== stream) {
 				/* dmcu -1 for all controller id values,
 				 * therefore +1 here
 				 */
 				psr_context->controllerId =
-					core_dc->current_context->res_ctx.
+					core_dc->current_state->res_ctx.
 					pipe_ctx[i].stream_res.tg->inst + 1;
 				break;
 			}
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
index 446e2933474c..5f2b52e41427 100644
@@ -2406,7 +2406,7 @@ bool dc_link_dp_set_test_pattern(
 	const unsigned char *p_custom_pattern,
 	unsigned int cust_pattern_size)
 {
-	struct pipe_ctx *pipes = link->dc->current_context->res_ctx.pipe_ctx;
+	struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx;
 	struct pipe_ctx *pipe_ctx = &pipes[0];
 	unsigned int lane;
 	unsigned int i;
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +2 -2
index 23d8b614e0fd..3427fb5b7e30 100644
@@ -62,7 +62,7 @@ void dp_enable_link_phy(
 	struct link_encoder *link_enc = link->link_enc;
 
 	struct pipe_ctx *pipes =
-			link->dc->current_context->res_ctx.pipe_ctx;
+			link->dc->current_state->res_ctx.pipe_ctx;
 	struct clock_source *dp_cs =
 			link->dc->res_pool->dp_clock_source;
 	unsigned int i;
@@ -262,7 +262,7 @@ void dp_retrain_link_dp_test(struct dc_link *link,
 			bool skip_video_pattern)
 {
 	struct pipe_ctx *pipes =
-			&link->dc->current_context->res_ctx.pipe_ctx[0];
+			&link->dc->current_state->res_ctx.pipe_ctx[0];
 	unsigned int i;
 
 	for (i = 0; i < MAX_PIPES; i++) {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +20 -20
index 2ee3399d0d01..b5ccbdb3d33b 100644
@@ -893,7 +893,7 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 
 enum dc_status resource_build_scaling_params_for_context(
 	const struct dc  *dc,
-	struct validate_context *context)
+	struct dc_state *context)
 {
 	int i;
 
@@ -971,7 +971,7 @@ static struct pipe_ctx *resource_get_tail_pipe_for_stream(
  * that has no surface attached yet
  */
 static struct pipe_ctx *acquire_free_pipe_for_stream(
-		struct validate_context *context,
+		struct dc_state *context,
 		const struct resource_pool *pool,
 		struct dc_stream_state *stream)
 {
@@ -1048,7 +1048,7 @@ bool dc_add_plane_to_context(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
 		struct dc_plane_state *plane_state,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 	struct resource_pool *pool = dc->res_pool;
@@ -1124,7 +1124,7 @@ bool dc_remove_plane_from_context(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
 		struct dc_plane_state *plane_state,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 	struct dc_stream_status *stream_status = NULL;
@@ -1199,7 +1199,7 @@ bool dc_remove_plane_from_context(
 bool dc_rem_all_planes_for_stream(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i, old_plane_count;
 	struct dc_stream_status *stream_status = NULL;
@@ -1233,7 +1233,7 @@ static bool add_all_planes_for_stream(
 		struct dc_stream_state *stream,
 		const struct dc_validation_set set[],
 		int set_count,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i, j;
 
@@ -1258,7 +1258,7 @@ bool dc_add_all_planes_for_stream(
 		struct dc_stream_state *stream,
 		struct dc_plane_state * const *plane_states,
 		int plane_count,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	struct dc_validation_set set;
 	int i;
@@ -1434,7 +1434,7 @@ static struct audio *find_first_free_audio(
 }
 
 bool resource_is_stream_unchanged(
-	struct validate_context *old_context, struct dc_stream_state *stream)
+	struct dc_state *old_context, struct dc_stream_state *stream)
 {
 	int i;
 
@@ -1450,7 +1450,7 @@ bool resource_is_stream_unchanged(
 
 bool dc_add_stream_to_ctx(
 		struct dc *dc,
-		struct validate_context *new_ctx,
+		struct dc_state *new_ctx,
 		struct dc_stream_state *stream)
 {
 	struct dc_context *dc_ctx = dc->ctx;
@@ -1474,7 +1474,7 @@ bool dc_add_stream_to_ctx(
 
 bool dc_remove_stream_from_ctx(
 			struct dc *dc,
-			struct validate_context *new_ctx,
+			struct dc_state *new_ctx,
 			struct dc_stream_state *stream)
 {
 	int i;
@@ -1553,7 +1553,7 @@ static void copy_pipe_ctx(
 
 static struct dc_stream_state *find_pll_sharable_stream(
 		struct dc_stream_state *stream_needs_pll,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 
@@ -1615,7 +1615,7 @@ static void calculate_phy_pix_clks(struct dc_stream_state *stream)
 
 enum dc_status resource_map_pool_resources(
 		const struct dc  *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	const struct resource_pool *pool = dc->res_pool;
@@ -1689,7 +1689,7 @@ enum dc_status resource_map_pool_resources(
 
 /* first stream in the context is used to populate the rest */
 void validate_guaranteed_copy_streams(
-		struct validate_context *context,
+		struct dc_state *context,
 		int max_streams)
 {
 	int i;
@@ -1709,14 +1709,14 @@ void validate_guaranteed_copy_streams(
 
 void dc_resource_validate_ctx_copy_construct_current(
 		const struct dc *dc,
-		struct validate_context *dst_ctx)
+		struct dc_state *dst_ctx)
 {
-	dc_resource_validate_ctx_copy_construct(dc->current_context, dst_ctx);
+	dc_resource_validate_ctx_copy_construct(dc->current_state, dst_ctx);
 }
 
 bool dc_validate_global_state(
 		struct dc *dc,
-		struct validate_context *new_ctx)
+		struct dc_state *new_ctx)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 	int i, j;
@@ -2413,7 +2413,7 @@ static void set_vsc_info_packet(
 	/*TODO: stereo 3D support and extend pixel encoding colorimetry*/
 }
 
-void dc_resource_validate_ctx_destruct(struct validate_context *context)
+void dc_resource_validate_ctx_destruct(struct dc_state *context)
 {
 	int i, j;
 
@@ -2433,8 +2433,8 @@ void dc_resource_validate_ctx_destruct(struct validate_context *context)
  * by the src_ctx
  */
 void dc_resource_validate_ctx_copy_construct(
-		const struct validate_context *src_ctx,
-		struct validate_context *dst_ctx)
+		const struct dc_state *src_ctx,
+		struct dc_state *dst_ctx)
 {
 	int i, j;
 	atomic_t ref_count = dst_ctx->ref_count;
@@ -2518,7 +2518,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 
 enum dc_status resource_map_clock_resources(
 		const struct dc  *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	/* acquire new resources */
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +7 -8
index 0e7cc293184e..a421779093d9 100644
@@ -169,10 +169,9 @@ struct dc_stream_status *dc_stream_get_status(
 	uint8_t i;
 	struct dc  *dc = stream->ctx->dc;
 
-	for (i = 0; i < dc->current_context->stream_count; i++) {
-		if (stream == dc->current_context->streams[i]) {
-			return &dc->current_context->stream_status[i];
-		}
+	for (i = 0; i < dc->current_state->stream_count; i++) {
+		if (stream == dc->current_state->streams[i])
+			return &dc->current_state->stream_status[i];
 	}
 
 	return NULL;
@@ -199,7 +198,7 @@ bool dc_stream_set_cursor_attributes(
 	}
 
 	core_dc = stream->ctx->dc;
-	res_ctx = &core_dc->current_context->res_ctx;
+	res_ctx = &core_dc->current_state->res_ctx;
 
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
@@ -235,7 +234,7 @@ bool dc_stream_set_cursor_position(
 	}
 
 	core_dc = stream->ctx->dc;
-	res_ctx = &core_dc->current_context->res_ctx;
+	res_ctx = &core_dc->current_state->res_ctx;
 
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
@@ -271,7 +270,7 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
 	uint8_t i;
 	struct dc  *core_dc = stream->ctx->dc;
 	struct resource_context *res_ctx =
-		&core_dc->current_context->res_ctx;
+		&core_dc->current_state->res_ctx;
 
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
@@ -295,7 +294,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
 	bool ret = false;
 	struct dc  *core_dc = stream->ctx->dc;
 	struct resource_context *res_ctx =
-		&core_dc->current_context->res_ctx;
+		&core_dc->current_state->res_ctx;
 
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +2 -2
index 0b6410fb2f3e..e96f63eed070 100644
@@ -104,12 +104,12 @@ const struct dc_plane_status *dc_plane_get_status(
 	plane_status = &plane_state->status;
 	core_dc = plane_state->ctx->dc;
 
-	if (core_dc->current_context == NULL)
+	if (core_dc->current_state == NULL)
 		return NULL;
 
 	for (i = 0; i < core_dc->res_pool->pipe_count; i++) {
 		struct pipe_ctx *pipe_ctx =
-				&core_dc->current_context->res_ctx.pipe_ctx[i];
+				&core_dc->current_state->res_ctx.pipe_ctx[i];
 
 		if (pipe_ctx->plane_state != plane_state)
 			continue;
drivers/gpu/drm/amd/display/dc/dc.h +18 -18
index 5a852685558a..2890dbb55a63 100644
@@ -99,7 +99,7 @@ struct dc_static_screen_events {
 /* Forward declaration*/
 struct dc;
 struct dc_plane_state;
-struct validate_context;
+struct dc_state;
 
 struct dc_cap_funcs {
 	bool (*get_dcc_compression_cap)(const struct dc *dc,
@@ -192,7 +192,7 @@ struct dc_debug {
 	bool disable_psr;
 	bool force_abm_enable;
 };
-struct validate_context;
+struct dc_state;
 struct resource_pool;
 struct dce_hwseq;
 struct dc {
@@ -208,7 +208,7 @@ struct dc {
 	uint8_t link_count;
 	struct dc_link *links[MAX_PIPES * 2];
 
-	struct validate_context *current_context;
+	struct dc_state *current_state;
 	struct resource_pool *res_pool;
 
 	/* Display Engine Clock levels */
@@ -621,12 +621,12 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
 
 bool dc_add_stream_to_ctx(
 			struct dc *dc,
-		struct validate_context *new_ctx,
+		struct dc_state *new_ctx,
 		struct dc_stream_state *stream);
 
 bool dc_remove_stream_from_ctx(
 		struct dc *dc,
-			struct validate_context *new_ctx,
+			struct dc_state *new_ctx,
 			struct dc_stream_state *stream);
 
 
@@ -634,25 +634,25 @@ bool dc_add_plane_to_context(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
 		struct dc_plane_state *plane_state,
-		struct validate_context *context);
+		struct dc_state *context);
 
 bool dc_remove_plane_from_context(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
 		struct dc_plane_state *plane_state,
-		struct validate_context *context);
+		struct dc_state *context);
 
 bool dc_rem_all_planes_for_stream(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
-		struct validate_context *context);
+		struct dc_state *context);
 
 bool dc_add_all_planes_for_stream(
 		const struct dc *dc,
 		struct dc_stream_state *stream,
 		struct dc_plane_state * const *plane_states,
 		int plane_count,
-		struct validate_context *context);
+		struct dc_state *context);
 
 /*
  * Structure to store surface/stream associations for validation
@@ -669,7 +669,7 @@ bool dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state);
 
 bool dc_validate_global_state(
 		struct dc *dc,
-		struct validate_context *new_ctx);
+		struct dc_state *new_ctx);
 
 /*
  * This function takes a stream and checks if it is guaranteed to be supported.
@@ -680,14 +680,14 @@ bool dc_validate_global_state(
  */
 
 void dc_resource_validate_ctx_copy_construct(
-		const struct validate_context *src_ctx,
-		struct validate_context *dst_ctx);
+		const struct dc_state *src_ctx,
+		struct dc_state *dst_ctx);
 
 void dc_resource_validate_ctx_copy_construct_current(
 		const struct dc *dc,
-		struct validate_context *dst_ctx);
+		struct dc_state *dst_ctx);
 
-void dc_resource_validate_ctx_destruct(struct validate_context *context);
+void dc_resource_validate_ctx_destruct(struct dc_state *context);
 
 /*
  * TODO update to make it about validation sets
@@ -698,7 +698,7 @@ void dc_resource_validate_ctx_destruct(struct validate_context *context);
  *   Phy, Encoder, Timing Generator are programmed and enabled.
  *   New streams are enabled with blank stream; no memory read.
  */
-bool dc_commit_context(struct dc *dc, struct validate_context *context);
+bool dc_commit_state(struct dc *dc, struct dc_state *context);
 
 /*
  * Set up streams and links associated to drive sinks
@@ -714,7 +714,7 @@ bool dc_commit_context(struct dc *dc, struct validate_context *context);
  */
 bool dc_enable_stereo(
 	struct dc *dc,
-	struct validate_context *context,
+	struct dc_state *context,
 	struct dc_stream_state *streams[],
 	uint8_t stream_count);
 
@@ -737,8 +737,8 @@ enum surface_update_type dc_check_update_surfaces_for_stream(
 		const struct dc_stream_status *stream_status);
 
 
-void dc_retain_validate_context(struct validate_context *context);
-void dc_release_validate_context(struct validate_context *context);
+void dc_retain_state(struct dc_state *context);
+void dc_release_state(struct dc_state *context);
 
 /*******************************************************************************
  * Link Interfaces
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +2 -2
index 0654fe34627c..d3b61b92ebec 100644
@@ -609,7 +609,7 @@ static uint32_t dce110_get_pll_pixel_rate_in_hz(
 {
 	uint32_t inst = pix_clk_params->controller_id - CONTROLLER_ID_D0;
 	struct dc *dc_core = cs->ctx->dc;
-	struct validate_context *context = dc_core->current_context;
+	struct dc_state *context = dc_core->current_state;
 	struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[inst];
 
 	/* This function need separate to different DCE version, before separate, just use pixel clock */
@@ -624,7 +624,7 @@ static uint32_t dce110_get_dp_pixel_rate_from_combo_phy_pll(
 {
 	uint32_t inst = pix_clk_params->controller_id - CONTROLLER_ID_D0;
 	struct dc *dc_core = cs->ctx->dc;
-	struct validate_context *context = dc_core->current_context;
+	struct dc_state *context = dc_core->current_state;
 	struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[inst];
 
 	/* This function need separate to different DCE version, before separate, just use pixel clock */
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.c +4 -4
index b7e51c5ed1b1..492ea6069eb4 100644
@@ -107,7 +107,7 @@ static bool dce100_enable_display_power_gating(
 
 static void dce100_pplib_apply_display_requirements(
 	struct dc *dc,
-	struct validate_context *context)
+	struct dc_state *context)
 {
 	struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
 
@@ -127,14 +127,14 @@ static void dce100_pplib_apply_display_requirements(
 
 void dce100_set_bandwidth(
 		struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		bool decrease_allowed)
 {
-	if (decrease_allowed || context->bw.dce.dispclk_khz > dc->current_context->bw.dce.dispclk_khz) {
+	if (decrease_allowed || context->bw.dce.dispclk_khz > dc->current_state->bw.dce.dispclk_khz) {
 		dc->res_pool->display_clock->funcs->set_clock(
 				dc->res_pool->display_clock,
 				context->bw.dce.dispclk_khz * 115 / 100);
-		dc->current_context->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz;
+		dc->current_state->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz;
 	}
 	dce100_pplib_apply_display_requirements(dc, context);
 }
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.h +2 -2
index c04aa15cd656..770b5bb1ff40 100644
@@ -29,13 +29,13 @@
 #include "core_types.h"
 
 struct dc;
-struct validate_context;
+struct dc_state;
 
 bool dce100_hw_sequencer_construct(struct dc *dc);
 
 void dce100_set_bandwidth(
 		struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		bool decrease_allowed);
 
 #endif /* __DC_HWSS_DCE100_H__ */
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +5 -5
index c991610315b2..36d79175354c 100644
@@ -653,7 +653,7 @@ static void destruct(struct dce110_resource_pool *pool)
 
 static enum dc_status build_mapped_resource(
 		const struct dc  *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	enum dc_status status = DC_OK;
@@ -674,7 +674,7 @@ static enum dc_status build_mapped_resource(
 
 bool dce100_validate_bandwidth(
 	struct dc  *dc,
-	struct validate_context *context)
+	struct dc_state *context)
 {
 	/* TODO implement when needed but for now hardcode max value*/
 	context->bw.dce.dispclk_khz = 681000;
@@ -684,7 +684,7 @@ bool dce100_validate_bandwidth(
 }
 
 static bool dce100_validate_surface_sets(
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 
@@ -705,7 +705,7 @@ static bool dce100_validate_surface_sets(
 
 enum dc_status dce100_validate_global(
 		struct dc  *dc,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	if (!dce100_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
@@ -716,7 +716,7 @@ enum dc_status dce100_validate_global(
 enum dc_status dce100_validate_guaranteed(
 		struct dc  *dc,
 		struct dc_stream_state *dc_stream,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +35 -35

247 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +6 -6
index ac418fd83894..baa20c1f17ad 100644
@@ -30,20 +30,20 @@
 
 #define GAMMA_HW_POINTS_NUM 256
 struct dc;
-struct validate_context;
+struct dc_state;
 struct dm_pp_display_configuration;
 
 bool dce110_hw_sequencer_construct(struct dc *dc);
 
 enum dc_status dce110_apply_ctx_to_hw(
 		struct dc *dc,
-		struct validate_context *context);
+		struct dc_state *context);
 
-void dce110_set_display_clock(struct validate_context *context);
+void dce110_set_display_clock(struct dc_state *context);
 
 void dce110_set_displaymarks(
 	const struct dc *dc,
-	struct validate_context *context);
+	struct dc_state *context);
 
 void dce110_enable_stream(struct pipe_ctx *pipe_ctx);
 
@@ -62,10 +62,10 @@ void dce110_power_down(struct dc *dc);
 void dce110_update_pending_status(struct pipe_ctx *pipe_ctx);
 
 void dce110_fill_display_configs(
-	const struct validate_context *context,
+	const struct dc_state *context,
 	struct dm_pp_display_configuration *pp_display_cfg);
 
-uint32_t dce110_get_min_vblank_time_us(const struct validate_context *context);
+uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context);
 
 void dp_receiver_power_ctrl(struct dc_link *link, bool on);
 #endif /* __DC_HWSS_DCE110_H__ */
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +8 -8
index 18c67f89e9b5..94b6eb83e01e 100644
@@ -773,7 +773,7 @@ static bool is_surface_pixel_format_supported(struct pipe_ctx *pipe_ctx, unsigne
 
 static enum dc_status build_mapped_resource(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	enum dc_status status = DC_OK;
@@ -800,7 +800,7 @@ static enum dc_status build_mapped_resource(
 
 static bool dce110_validate_bandwidth(
 	struct dc *dc,
-	struct validate_context *context)
+	struct dc_state *context)
 {
 	bool result = false;
 
@@ -826,7 +826,7 @@ static bool dce110_validate_bandwidth(
 			context->streams[0]->timing.v_addressable,
 			context->streams[0]->timing.pix_clk_khz);
 
-	if (memcmp(&dc->current_context->bw.dce,
+	if (memcmp(&dc->current_state->bw.dce,
 			&context->bw.dce, sizeof(context->bw.dce))) {
 		struct log_entry log_entry;
 		dm_logger_open(
@@ -880,7 +880,7 @@ static bool dce110_validate_bandwidth(
 }
 
 static bool dce110_validate_surface_sets(
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 
@@ -913,7 +913,7 @@ static bool dce110_validate_surface_sets(
 
 enum dc_status dce110_validate_global(
 		struct dc *dc,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	if (!dce110_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
@@ -924,7 +924,7 @@ enum dc_status dce110_validate_global(
 static enum dc_status dce110_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *dc_stream,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 
@@ -954,7 +954,7 @@ static enum dc_status dce110_validate_guaranteed(
 }
 
 static struct pipe_ctx *dce110_acquire_underlay(
-		struct validate_context *context,
+		struct dc_state *context,
 		const struct resource_pool *pool,
 		struct dc_stream_state *stream)
 {
@@ -976,7 +976,7 @@ static struct pipe_ctx *dce110_acquire_underlay(
 
 	pipe_ctx->stream = stream;
 
-	if (!dc->current_context->res_ctx.pipe_ctx[underlay_idx].stream) {
+	if (!dc->current_state->res_ctx.pipe_ctx[underlay_idx].stream) {
 		struct tg_color black_color = {0};
 		struct dc_bios *dcb = dc->ctx->dc_bios;
 
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +8 -8
index d5a8ee69171d..de6f71d8a89b 100644
@@ -724,7 +724,7 @@ static struct clock_source *find_matching_pll(
 
 static enum dc_status build_mapped_resource(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	enum dc_status status = DC_OK;
@@ -745,7 +745,7 @@ static enum dc_status build_mapped_resource(
 
 bool dce112_validate_bandwidth(
 	struct dc *dc,
-	struct validate_context *context)
+	struct dc_state *context)
 {
 	bool result = false;
 
@@ -768,7 +768,7 @@ bool dce112_validate_bandwidth(
 			"%s: Bandwidth validation failed!",
 			__func__);
 
-	if (memcmp(&dc->current_context->bw.dce,
+	if (memcmp(&dc->current_state->bw.dce,
 			&context->bw.dce, sizeof(context->bw.dce))) {
 		struct log_entry log_entry;
 		dm_logger_open(
@@ -823,7 +823,7 @@ bool dce112_validate_bandwidth(
 
 enum dc_status resource_map_phy_clock_resources(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 
@@ -855,7 +855,7 @@ enum dc_status resource_map_phy_clock_resources(
 }
 
 static bool dce112_validate_surface_sets(
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 
@@ -876,7 +876,7 @@ static bool dce112_validate_surface_sets(
 
 enum dc_status dce112_add_stream_to_ctx(
 		struct dc *dc,
-		struct validate_context *new_ctx,
+		struct dc_state *new_ctx,
 		struct dc_stream_state *dc_stream)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
@@ -896,7 +896,7 @@ enum dc_status dce112_add_stream_to_ctx(
 enum dc_status dce112_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *stream,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 
@@ -927,7 +927,7 @@ enum dc_status dce112_validate_guaranteed(
 
 enum dc_status dce112_validate_global(
 		struct dc *dc,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	if (!dce112_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.h +5 -5
index f1834bfe3d1e..d5c19d34eb0a 100644
@@ -39,21 +39,21 @@ enum dc_status dce112_validate_with_context(
 		struct dc *dc,
 		const struct dc_validation_set set[],
 		int set_count,
-		struct validate_context *context,
-		struct validate_context *old_context);
+		struct dc_state *context,
+		struct dc_state *old_context);
 
 enum dc_status dce112_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *dc_stream,
-		struct validate_context *context);
+		struct dc_state *context);
 
 bool dce112_validate_bandwidth(
 	struct dc *dc,
-	struct validate_context *context);
+	struct dc_state *context);
 
 enum dc_status dce112_add_stream_to_ctx(
 		struct dc *dc,
-		struct validate_context *new_ctx,
+		struct dc_state *new_ctx,
 		struct dc_stream_state *dc_stream);
 
 
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +5 -5
index 945ff7ee6cd9..316080767a21 100644
@@ -685,7 +685,7 @@ static void destruct(struct dce110_resource_pool *pool)
 
 static enum dc_status build_mapped_resource(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	enum dc_status status = DC_OK;
@@ -706,7 +706,7 @@ static enum dc_status build_mapped_resource(
 
 bool dce80_validate_bandwidth(
 	struct dc *dc,
-	struct validate_context *context)
+	struct dc_state *context)
 {
 	/* TODO implement when needed but for now hardcode max value*/
 	context->bw.dce.dispclk_khz = 681000;
@@ -716,7 +716,7 @@ bool dce80_validate_bandwidth(
 }
 
 static bool dce80_validate_surface_sets(
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	int i;
 
@@ -737,7 +737,7 @@ static bool dce80_validate_surface_sets(
 
 enum dc_status dce80_validate_global(
 		struct dc *dc,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	if (!dce80_validate_surface_sets(context))
 		return DC_FAIL_SURFACE_VALIDATE;
@@ -748,7 +748,7 @@ enum dc_status dce80_validate_global(
 enum dc_status dce80_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *dc_stream,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +31 -31

218 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 -1
index 8bb09de8dcd7..ca53dc1cc19b 100644
@@ -32,7 +32,7 @@ struct dc;
 
 void dcn10_hw_sequencer_construct(struct dc *dc);
 extern void fill_display_configs(
-	const struct validate_context *context,
+	const struct dc_state *context,
 	struct dm_pp_display_configuration *pp_display_cfg);
 
 #endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +4 -4
index d09ed13fb8ea..fff86ad0c411 100644
@@ -850,7 +850,7 @@ static enum dc_status build_pipe_hw_param(struct pipe_ctx *pipe_ctx)
 
 static enum dc_status build_mapped_resource(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream)
 {
 	enum dc_status status = DC_OK;
@@ -887,7 +887,7 @@ static enum dc_status build_mapped_resource(
 
 enum dc_status dcn10_add_stream_to_ctx(
 		struct dc *dc,
-		struct validate_context *new_ctx,
+		struct dc_state *new_ctx,
 		struct dc_stream_state *dc_stream)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
@@ -907,7 +907,7 @@ enum dc_status dcn10_add_stream_to_ctx(
 enum dc_status dcn10_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *dc_stream,
-		struct validate_context *context)
+		struct dc_state *context)
 {
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 
@@ -935,7 +935,7 @@ enum dc_status dcn10_validate_guaranteed(
 }
 
 static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer(
-		struct validate_context *context,
+		struct dc_state *context,
 		const struct resource_pool *pool,
 		struct dc_stream_state *stream)
 {
drivers/gpu/drm/amd/display/dc/inc/core_types.h +7 -7
index bd1a6367872f..71eb9859faf2 100644
@@ -80,7 +80,7 @@ void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable);
 #include "transform.h"
 
 struct resource_pool;
-struct validate_context;
+struct dc_state;
 struct resource_context;
 
 struct resource_funcs {
@@ -91,18 +91,18 @@ struct resource_funcs {
 	enum dc_status (*validate_guaranteed)(
 					struct dc *dc,
 					struct dc_stream_state *stream,
-					struct validate_context *context);
+					struct dc_state *context);
 
 	bool (*validate_bandwidth)(
 					struct dc *dc,
-					struct validate_context *context);
+					struct dc_state *context);
 
 	enum dc_status (*validate_global)(
 		struct dc *dc,
-		struct validate_context *context);
+		struct dc_state *context);
 
 	struct pipe_ctx *(*acquire_idle_pipe_for_layer)(
-			struct validate_context *context,
+			struct dc_state *context,
 			const struct resource_pool *pool,
 			struct dc_stream_state *stream);
 
@@ -110,7 +110,7 @@ struct resource_funcs {
 
 	enum dc_status (*add_stream_to_ctx)(
 			struct dc *dc,
-			struct validate_context *new_ctx,
+			struct dc_state *new_ctx,
 			struct dc_stream_state *dc_stream);
 };
 
@@ -252,7 +252,7 @@ union bw_context {
 	struct dce_bw_output dce;
 };
 
-struct validate_context {
+struct dc_state {
 	struct dc_stream_state *streams[MAX_PIPES];
 	struct dc_stream_status stream_status[MAX_PIPES];
 	uint8_t stream_count;
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +1 -1
index 6a205b010084..ae2399f16d1c 100644
@@ -34,7 +34,7 @@
 
 struct pipe_ctx;
 struct dc;
-struct validate_context;
+struct dc_state;
 struct dce_bw_output;
 
 enum bw_calcs_version {
drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h +2 -2
index 58744fe87ed8..1e231f6de732 100644
@@ -35,7 +35,7 @@
 #include "../dml/display_mode_lib.h"
 
 struct dc;
-struct validate_context;
+struct dc_state;
 
 /*******************************************************************************
  * DCN data structures.
@@ -621,7 +621,7 @@ extern const struct dcn_ip_params dcn10_ip_defaults;
 
 bool dcn_validate_bandwidth(
 		struct dc *dc,
-		struct validate_context *context);
+		struct dc_state *context);
 
 unsigned int dcn_find_dcfclk_suits_all(
 	const struct dc *dc,
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +7 -7
index 01e426194163..aae7629b1c08 100644
@@ -49,7 +49,7 @@ struct dce_hwseq {
 };
 
 struct pipe_ctx;
-struct validate_context;
+struct dc_state;
 struct dchub_init_data;
 struct dc_static_screen_events;
 struct resource_pool;
@@ -60,16 +60,16 @@ struct hw_sequencer_funcs {
 	void (*init_hw)(struct dc *dc);
 
 	enum dc_status (*apply_ctx_to_hw)(
-			struct dc *dc, struct validate_context *context);
+			struct dc *dc, struct dc_state *context);
 
 	void (*reset_hw_ctx_wrap)(
-			struct dc *dc, struct validate_context *context);
+			struct dc *dc, struct dc_state *context);
 
 	void (*apply_ctx_for_surface)(
 			struct dc *dc,
 			const struct dc_stream_state *stream,
 			int num_planes,
-			struct validate_context *context);
+			struct dc_state *context);
 
 	void (*set_plane_config)(
 			const struct dc *dc,
@@ -127,7 +127,7 @@ struct hw_sequencer_funcs {
 
 	void (*power_on_front_end)(struct dc *dc,
 			struct pipe_ctx *pipe,
-			struct validate_context *context);
+			struct dc_state *context);
 
 	void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
 
@@ -145,7 +145,7 @@ struct hw_sequencer_funcs {
 
 	void (*set_bandwidth)(
 			struct dc *dc,
-			struct validate_context *context,
+			struct dc_state *context,
 			bool decrease_allowed);
 
 	void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
@@ -159,7 +159,7 @@ struct hw_sequencer_funcs {
 
 	enum dc_status (*prog_pixclk_crtc_otg)(
 			struct pipe_ctx *pipe_ctx,
-			struct validate_context *context,
+			struct dc_state *context,
 			struct dc *dc);
 
 	void (*setup_stereo)(
drivers/gpu/drm/amd/display/dc/inc/resource.h +11 -11
index ebc0f5b02365..41437da5fb9b 100644
@@ -81,14 +81,14 @@ void dc_destroy_resource_pool(struct dc *dc);
 
 enum dc_status resource_map_pool_resources(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream);
 
 bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx);
 
 enum dc_status resource_build_scaling_params_for_context(
 		const struct dc *dc,
-		struct validate_context *context);
+		struct dc_state *context);
 
 void resource_build_info_frame(struct pipe_ctx *pipe_ctx);
 
@@ -122,7 +122,7 @@ bool resource_attach_surfaces_to_context(
 		struct dc_plane_state *const *plane_state,
 		int surface_count,
 		struct dc_stream_state *dc_stream,
-		struct validate_context *context,
+		struct dc_state *context,
 		const struct resource_pool *pool);
 
 struct pipe_ctx *find_idle_secondary_pipe(
@@ -130,31 +130,31 @@ struct pipe_ctx *find_idle_secondary_pipe(
 		const struct resource_pool *pool);
 
 bool resource_is_stream_unchanged(
-	struct validate_context *old_context, struct dc_stream_state *stream);
+	struct dc_state *old_context, struct dc_stream_state *stream);
 
 bool resource_validate_attach_surfaces(
 		const struct dc_validation_set set[],
 		int set_count,
-		const struct validate_context *old_context,
-		struct validate_context *context,
+		const struct dc_state *old_context,
+		struct dc_state *context,
 		const struct resource_pool *pool);
 
 void validate_guaranteed_copy_streams(
-		struct validate_context *context,
+		struct dc_state *context,
 		int max_streams);
 
 void resource_validate_ctx_update_pointer_after_copy(
-		const struct validate_context *src_ctx,
-		struct validate_context *dst_ctx);
+		const struct dc_state *src_ctx,
+		struct dc_state *dst_ctx);
 
 enum dc_status resource_map_clock_resources(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream);
 
 enum dc_status resource_map_phy_clock_resources(
 		const struct dc *dc,
-		struct validate_context *context,
+		struct dc_state *context,
 		struct dc_stream_state *stream);
 
 bool pipe_need_reprogram(
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +1 -1
index e3a12f3e0642..7cce28489dba 100644
@@ -214,7 +214,7 @@ bool dce110_vblank_set(
 	uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
 
 	struct timing_generator *tg =
-			core_dc->current_context->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
+			core_dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
 
 	if (enable) {
 		if (!tg->funcs->arm_vert_intr(tg, 2)) {
drivers/gpu/drm/amd/display/include/logger_interface.h +2 -2
index 93c8556358f0..6641e8001e97 100644
@@ -32,7 +32,7 @@ struct dc_context;
 struct dc_link;
 struct dc_surface_update;
 struct resource_context;
-struct validate_context;
+struct dc_state;
 
 /*
  *
@@ -93,7 +93,7 @@ void context_timing_trace(
 
 void context_clock_trace(
 		struct dc *dc,
-		struct validate_context *context);
+		struct dc_state *context);
 
 /* Any function which is empty or have incomplete implementation should be
  * marked by this macro.
Signature · 6 lines
2.11.0

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

PATCH 61/77 drm/amd/display: Rename dc resource_validate_ctx methods

In reply to a message not in the archive

From: Bhawanpreet Lakha <[email protected]>

Rename dc_resource methods from validate_ctx to state

Change-Id Ia43f6863b463bc3834e2df27b69f64291194f7d9
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 6 +++---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dc.h               | 6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 3f8429b1fd4e..7a408d753be8 100644
@@ -709,7 +709,7 @@ dm_atomic_state_alloc(struct drm_device *dev)
 
 	atomic_inc(&new_ctx->ref_count);
 
-	dc_resource_validate_ctx_copy_construct_current(dc, new_ctx);
+	dc_resource_state_copy_construct_current(dc, new_ctx);
 
 	state->context = new_ctx;
 
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -3
index 522555d752a5..20362b1f8c1d 100644
@@ -1013,7 +1013,7 @@ void dc_release_state(struct dc_state *context)
 	atomic_dec(&context->ref_count);
 
 	if (atomic_read(&context->ref_count) == 0) {
-		dc_resource_validate_ctx_destruct(context);
+		dc_resource_state_destruct(context);
 		dm_free(context);
 	}
 }
@@ -1285,7 +1285,7 @@ void dc_update_planes_and_stream(struct dc *dc,
 
 		atomic_inc(&context->ref_count);
 
-		dc_resource_validate_ctx_copy_construct(
+		dc_resource_state_copy_construct(
 				dc->current_state, context);
 
 		/*remove old surfaces from context */
@@ -1628,7 +1628,7 @@ void dc_set_power_state(
 
 		/* Preserve refcount */
 		ref_count = dc->current_state->ref_count;
-		dc_resource_validate_ctx_destruct(dc->current_state);
+		dc_resource_state_destruct(dc->current_state);
 		memset(dc->current_state, 0,
 				sizeof(*dc->current_state));
 		dc->current_state->ref_count = ref_count;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 -4
index b5ccbdb3d33b..c80650ed70dd 100644
@@ -1707,11 +1707,11 @@ void validate_guaranteed_copy_streams(
 	}
 }
 
-void dc_resource_validate_ctx_copy_construct_current(
+void dc_resource_state_copy_construct_current(
 		const struct dc *dc,
 		struct dc_state *dst_ctx)
 {
-	dc_resource_validate_ctx_copy_construct(dc->current_state, dst_ctx);
+	dc_resource_state_copy_construct(dc->current_state, dst_ctx);
 }
 
 bool dc_validate_global_state(
@@ -2413,7 +2413,7 @@ static void set_vsc_info_packet(
 	/*TODO: stereo 3D support and extend pixel encoding colorimetry*/
 }
 
-void dc_resource_validate_ctx_destruct(struct dc_state *context)
+void dc_resource_state_destruct(struct dc_state *context)
 {
 	int i, j;
 
@@ -2432,7 +2432,7 @@ void dc_resource_validate_ctx_destruct(struct dc_state *context)
  * Copy src_ctx into dst_ctx and retain all surfaces and streams referenced
  * by the src_ctx
  */
-void dc_resource_validate_ctx_copy_construct(
+void dc_resource_state_copy_construct(
 		const struct dc_state *src_ctx,
 		struct dc_state *dst_ctx)
 {
drivers/gpu/drm/amd/display/dc/dc.h +3 -3
index 2890dbb55a63..1b6ed21b9bb3 100644
@@ -679,15 +679,15 @@ bool dc_validate_global_state(
  *   No hardware is programmed for call.  Only validation is done.
  */
 
-void dc_resource_validate_ctx_copy_construct(
+void dc_resource_state_copy_construct(
 		const struct dc_state *src_ctx,
 		struct dc_state *dst_ctx);
 
-void dc_resource_validate_ctx_copy_construct_current(
+void dc_resource_state_copy_construct_current(
 		const struct dc *dc,
 		struct dc_state *dst_ctx);
 
-void dc_resource_validate_ctx_destruct(struct dc_state *context);
+void dc_resource_state_destruct(struct dc_state *context);
 
 /*
  * TODO update to make it about validation sets
Signature · 6 lines
2.11.0

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

PATCH 62/77 drm/amd/display: Add a clock source to a sharing pipe

In reply to a message not in the archive

From: Mikita Lipski <[email protected]>

Fix to allow DVI displays to share the same clock source

Change-Id I181201e004aef029429d2bf0d90b45aab19c11fc
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index c80650ed70dd..660d606929d1 100644
@@ -2536,7 +2536,7 @@ enum dc_status resource_map_clock_resources(
 		pipe_ctx->clock_source = NULL;
 
 		if (!dc->config.disable_disp_pll_sharing)
-			resource_find_used_clk_src_for_sharing(
+			pipe_ctx->clock_source = resource_find_used_clk_src_for_sharing(
 				&context->res_ctx,
 				pipe_ctx);
 
Signature · 6 lines
2.11.0

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

PATCH 63/77 drm/amd/display: add aux arbitration logic

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id I10e9c69f5557a7ee030b423703a7aa677fd3f4d9
---
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c |  6 +++++
 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h |  2 ++
 .../display/dc/i2caux/dce110/aux_engine_dce110.c   | 30 ++++++++++++++++++++--
 3 files changed, 36 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c +6 -0
index 667660f3fa26..3c9608ce94b8 100644
@@ -69,6 +69,12 @@ bool dal_aux_engine_acquire(
 	struct aux_engine *aux_engine = FROM_ENGINE(engine);
 
 	enum gpio_result result;
+	if (aux_engine->funcs->is_engine_available) {
+		/*check whether SW could use the engine*/
+		if (!aux_engine->funcs->is_engine_available(aux_engine)) {
+			return false;
+		}
+	}
 
 	result = dal_ddc_open(ddc, GPIO_MODE_HARDWARE,
 		GPIO_DDC_CONFIG_TYPE_MODE_AUX);
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h +2 -0
index b5d6c79eb029..40b202893772 100644
@@ -86,6 +86,8 @@ struct aux_engine_funcs {
 	enum aux_channel_operation_result (*get_channel_status)(
 		struct aux_engine *engine,
 		uint8_t *returned_bytes);
+	bool (*is_engine_available) (
+		struct aux_engine *engine);
 };
 
 struct aux_engine {
drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c +28 -2
index f49fd1ad3807..98ce0fe5ac37 100644
@@ -93,15 +93,36 @@ static void destroy(
 }
 
 #define SW_CAN_ACCESS_AUX 1
+#define DMCU_CAN_ACCESS_AUX 2
 
+static bool is_engine_available(
+	struct aux_engine *engine)
+{
+	struct aux_engine_dce110 *aux110 = FROM_AUX_ENGINE(engine);
+
+	uint32_t value = REG_READ(AUX_ARB_CONTROL);
+	uint32_t field = get_reg_field_value(
+			value,
+			AUX_ARB_CONTROL,
+			AUX_REG_RW_CNTL_STATUS);
+
+	return (field != DMCU_CAN_ACCESS_AUX);
+}
 static bool acquire_engine(
 	struct aux_engine *engine)
 {
 	struct aux_engine_dce110 *aux110 = FROM_AUX_ENGINE(engine);
 
+	uint32_t value = REG_READ(AUX_ARB_CONTROL);
+	uint32_t field = get_reg_field_value(
+			value,
+			AUX_ARB_CONTROL,
+			AUX_REG_RW_CNTL_STATUS);
+	if (field == DMCU_CAN_ACCESS_AUX)
+	 return false;
 	/* enable AUX before request SW to access AUX */
-	uint32_t value = REG_READ(AUX_CONTROL);
-	uint32_t field = get_reg_field_value(value,
+	value = REG_READ(AUX_CONTROL);
+	field = get_reg_field_value(value,
 				AUX_CONTROL,
 				AUX_EN);
 
@@ -395,6 +416,7 @@ static const struct aux_engine_funcs aux_engine_funcs = {
 	.submit_channel_request = submit_channel_request,
 	.process_channel_reply = process_channel_reply,
 	.get_channel_status = get_channel_status,
+	.is_engine_available = is_engine_available,
 };
 
 static const struct engine_funcs engine_funcs = {
@@ -425,6 +447,10 @@ static bool construct(
 static void destruct(
 	struct aux_engine_dce110 *engine)
 {
+	struct aux_engine_dce110 *aux110 = engine;
+/*temp w/a, to do*/
+	REG_UPDATE(AUX_ARB_CONTROL, AUX_DMCU_DONE_USING_AUX_REG, 1);
+	REG_UPDATE(AUX_ARB_CONTROL, AUX_SW_DONE_USING_AUX_REG, 1);
 	dal_aux_engine_destruct(&engine->base);
 }
 
Signature · 6 lines
2.11.0

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

PATCH 64/77 drm/amd/display: Move dis_clk into dc_state.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

dis_clk is single instance across pipes.

Change-Id I88b678e2b9574787d2b8f8f6c7f0ae872d31b428
---
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  7 +++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 38 +++++++-----
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 10 +++-
 drivers/gpu/drm/amd/display/dc/dc.h                |  5 ++
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 67 ++++++++++------------
 .../drm/amd/display/dc/dce110/dce110_resource.c    |  1 -
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  7 ++-
 7 files changed, 78 insertions(+), 57 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -0
index 20362b1f8c1d..15ba9c9887fd 100644
@@ -575,6 +575,8 @@ static bool construct(struct dc *dc,
 	if (!dc->res_pool)
 		goto fail;
 
+	dc_resource_state_construct(dc, dc->current_state);
+
 	if (!create_links(dc, init_params->num_virtual_links))
 		goto fail;
 
@@ -679,6 +681,8 @@ bool dc_validate_guaranteed(
 	if (context == NULL)
 		goto context_alloc_fail;
 
+	dc_resource_state_construct(dc, dc->current_state);
+
 	atomic_inc(&context->ref_count);
 
 	result = dc->res_pool->funcs->validate_guaranteed(
@@ -1615,6 +1619,8 @@ void dc_set_power_state(
 
 	switch (power_state) {
 	case DC_ACPI_CM_POWER_STATE_D0:
+		dc_resource_state_construct(dc, dc->current_state);
+
 		dc->hwss.init_hw(dc);
 		break;
 	default:
@@ -1631,6 +1637,7 @@ void dc_set_power_state(
 		dc_resource_state_destruct(dc->current_state);
 		memset(dc->current_state, 0,
 				sizeof(*dc->current_state));
+
 		dc->current_state->ref_count = ref_count;
 
 		break;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +23 -15
index 65e12614d96c..b95b58d3648a 100644
@@ -1181,7 +1181,9 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx)
 			&downspread.raw, sizeof(downspread));
 }
 
-static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx)
+static enum dc_status enable_link_dp(
+		struct dc_state *state,
+		struct pipe_ctx *pipe_ctx)
 {
 	struct dc_stream_state *stream = pipe_ctx->stream;
 	enum dc_status status;
@@ -1201,14 +1203,14 @@ static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx)
 		max_link_rate = LINK_RATE_HIGH3;
 
 	if (link_settings.link_rate == max_link_rate) {
-		if (pipe_ctx->dis_clk->funcs->set_min_clocks_state) {
-			if (pipe_ctx->dis_clk->cur_min_clks_state < DM_PP_CLOCKS_STATE_NOMINAL)
-				pipe_ctx->dis_clk->funcs->set_min_clocks_state(
-					pipe_ctx->dis_clk, DM_PP_CLOCKS_STATE_NOMINAL);
+		if (state->dis_clk->funcs->set_min_clocks_state) {
+			if (state->dis_clk->cur_min_clks_state < DM_PP_CLOCKS_STATE_NOMINAL)
+				state->dis_clk->funcs->set_min_clocks_state(
+					state->dis_clk, DM_PP_CLOCKS_STATE_NOMINAL);
 		} else {
 			uint32_t dp_phyclk_in_khz;
 			const struct clocks_value clocks_value =
-					pipe_ctx->dis_clk->cur_clocks_value;
+					state->dis_clk->cur_clocks_value;
 
 			/* 27mhz = 27000000hz= 27000khz */
 			dp_phyclk_in_khz = link_settings.link_rate * 27000;
@@ -1216,8 +1218,8 @@ static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx)
 			if (((clocks_value.max_non_dp_phyclk_in_khz != 0) &&
 				(dp_phyclk_in_khz > clocks_value.max_non_dp_phyclk_in_khz)) ||
 				(dp_phyclk_in_khz > clocks_value.max_dp_phyclk_in_khz)) {
-				pipe_ctx->dis_clk->funcs->apply_clock_voltage_request(
-						pipe_ctx->dis_clk,
+				state->dis_clk->funcs->apply_clock_voltage_request(
+						state->dis_clk,
 						DM_PP_CLOCK_TYPE_DISPLAYPHYCLK,
 						dp_phyclk_in_khz,
 						false,
@@ -1256,7 +1258,9 @@ static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx)
 	return status;
 }
 
-static enum dc_status enable_link_dp_mst(struct pipe_ctx *pipe_ctx)
+static enum dc_status enable_link_dp_mst(
+		struct dc_state *state,
+		struct pipe_ctx *pipe_ctx)
 {
 	struct dc_link *link = pipe_ctx->stream->sink->link;
 
@@ -1269,7 +1273,7 @@ static enum dc_status enable_link_dp_mst(struct pipe_ctx *pipe_ctx)
 	/* set the sink to MST mode before enabling the link */
 	dp_enable_mst_on_sink(link, true);
 
-	return enable_link_dp(pipe_ctx);
+	return enable_link_dp(state, pipe_ctx);
 }
 
 static bool get_ext_hdmi_settings(struct pipe_ctx *pipe_ctx,
@@ -1709,16 +1713,18 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)
 }
 
 /****************************enable_link***********************************/
-static enum dc_status enable_link(struct pipe_ctx *pipe_ctx)
+static enum dc_status enable_link(
+		struct dc_state *state,
+		struct pipe_ctx *pipe_ctx)
 {
 	enum dc_status status = DC_ERROR_UNEXPECTED;
 	switch (pipe_ctx->stream->signal) {
 	case SIGNAL_TYPE_DISPLAY_PORT:
 	case SIGNAL_TYPE_EDP:
-		status = enable_link_dp(pipe_ctx);
+		status = enable_link_dp(state, pipe_ctx);
 		break;
 	case SIGNAL_TYPE_DISPLAY_PORT_MST:
-		status = enable_link_dp_mst(pipe_ctx);
+		status = enable_link_dp_mst(state, pipe_ctx);
 		msleep(200);
 		break;
 	case SIGNAL_TYPE_DVI_SINGLE_LINK:
@@ -2285,11 +2291,13 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 	return DC_OK;
 }
 
-void core_link_enable_stream(struct pipe_ctx *pipe_ctx)
+void core_link_enable_stream(
+		struct dc_state *state,
+		struct pipe_ctx *pipe_ctx)
 {
 	struct dc  *core_dc = pipe_ctx->stream->ctx->dc;
 
-	enum dc_status status = enable_link(pipe_ctx);
+	enum dc_status status = enable_link(state, pipe_ctx);
 
 	if (status != DC_OK) {
 			dm_logger_write(pipe_ctx->stream->ctx->logger,
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +8 -2
index 660d606929d1..3b8f380edd3e 100644
@@ -1033,7 +1033,6 @@ static int acquire_first_split_pipe(
 			pipe_ctx->plane_res.ipp = pool->ipps[i];
 			pipe_ctx->plane_res.xfm = pool->transforms[i];
 			pipe_ctx->stream_res.opp = pool->opps[i];
-			pipe_ctx->dis_clk = pool->display_clock;
 			pipe_ctx->pipe_idx = i;
 
 			pipe_ctx->stream = stream;
@@ -1368,7 +1367,6 @@ static int acquire_first_free_pipe(
 			pipe_ctx->plane_res.ipp = pool->ipps[i];
 			pipe_ctx->plane_res.xfm = pool->transforms[i];
 			pipe_ctx->stream_res.opp = pool->opps[i];
-			pipe_ctx->dis_clk = pool->display_clock;
 			pipe_ctx->pipe_idx = i;
 
 
@@ -1714,6 +1712,14 @@ void dc_resource_state_copy_construct_current(
 	dc_resource_state_copy_construct(dc->current_state, dst_ctx);
 }
 
+
+void dc_resource_state_construct(
+		const struct dc *dc,
+		struct dc_state *dst_ctx)
+{
+	dst_ctx->dis_clk = dc->res_pool->display_clock;
+}
+
 bool dc_validate_global_state(
 		struct dc *dc,
 		struct dc_state *new_ctx)
drivers/gpu/drm/amd/display/dc/dc.h +5 -0
index 1b6ed21b9bb3..5cafe7c288a6 100644
@@ -679,6 +679,11 @@ bool dc_validate_global_state(
  *   No hardware is programmed for call.  Only validation is done.
  */
 
+
+void dc_resource_state_construct(
+		const struct dc *dc,
+		struct dc_state *dst_ctx);
+
 void dc_resource_state_copy_construct(
 		const struct dc_state *src_ctx,
 		struct dc_state *dst_ctx);
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +30 -37

142 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +0 -1
index 94b6eb83e01e..4942460d42ca 100644
@@ -971,7 +971,6 @@ static struct pipe_ctx *dce110_acquire_underlay(
 	/*pipe_ctx->plane_res.ipp = res_ctx->pool->ipps[underlay_idx];*/
 	pipe_ctx->plane_res.xfm = pool->transforms[underlay_idx];
 	pipe_ctx->stream_res.opp = pool->opps[underlay_idx];
-	pipe_ctx->dis_clk = pool->display_clock;
 	pipe_ctx->pipe_idx = underlay_idx;
 
 	pipe_ctx->stream = stream;
drivers/gpu/drm/amd/display/dc/inc/core_types.h +5 -2
index 71eb9859faf2..915d5c10361b 100644
@@ -70,7 +70,9 @@ enum dc_status dc_link_validate_mode_timing(
 
 void core_link_resume(struct dc_link *link);
 
-void core_link_enable_stream(struct pipe_ctx *pipe_ctx);
+void core_link_enable_stream(
+		struct dc_state *state,
+		struct pipe_ctx *pipe_ctx);
 
 void core_link_disable_stream(struct pipe_ctx *pipe_ctx);
 
@@ -188,7 +190,6 @@ struct pipe_ctx {
 	struct plane_resource plane_res;
 	struct stream_resource stream_res;
 
-	struct display_clock *dis_clk;
 	struct clock_source *clock_source;
 
 	struct pll_settings pll_settings;
@@ -268,6 +269,8 @@ struct dc_state {
 	struct dcn_bw_internal_vars dcn_bw_vars;
 #endif
 
+	struct display_clock *dis_clk;
+
 	atomic_t ref_count;
 };
 
Signature · 6 lines
2.11.0

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

PATCH 65/77 drm/amd/display: Fix time out on boot

In reply to a message not in the archive

From: Eric Yang <[email protected]>

On boot, hubp 0 is powergated during enable accel mode, so we time out when we try to blank in undo wa.

Fix: Check power gate status before set blank

Change-Id Ia14455722e5a8b6136d47083f1986827ed07175a
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 -0
index 71ff1cedbdf4..7ea274475598 100644
@@ -780,6 +780,12 @@ static void undo_DEGVIDCN10_253_wa(struct dc *dc)
 {
 	struct dce_hwseq *hws = dc->hwseq;
 	struct mem_input *mi = dc->res_pool->mis[0];
+	int pwr_status = 0;
+
+	REG_GET(DOMAIN0_PG_STATUS, DOMAIN0_PGFSM_PWR_STATUS, &pwr_status);
+	/* Don't need to blank if hubp is power gated*/
+	if (pwr_status == 2)
+		return;
 
 	mi->funcs->set_blank(mi, true);
 
Signature · 6 lines
2.11.0

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

PATCH 66/77 drm/amd/display: only polling VSync Phase within VSync peroroid

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id I9b40c7217b030f0d21ee0f4d3f871e872ba8332a
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c    |  4 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c |  4 ++--
 drivers/gpu/drm/amd/display/dc/dc.h              |  2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c    | 27 +++++++++++++-----------
 drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h     |  2 +-
 5 files changed, 21 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index b95b58d3648a..cea8dafd2edc 100644
@@ -1862,13 +1862,13 @@ bool dc_link_set_abm_disable(const struct dc_link *link)
 }
 
 
-bool dc_link_set_psr_enable(const struct dc_link *link, bool enable)
+bool dc_link_set_psr_enable(const struct dc_link *link, bool enable, bool wait)
 {
 	struct dc  *core_dc = link->ctx->dc;
 	struct dmcu *dmcu = core_dc->res_pool->dmcu;
 
 	if (dmcu != NULL && link->psr_enabled)
-		dmcu->funcs->set_psr_enable(dmcu, enable);
+		dmcu->funcs->set_psr_enable(dmcu, enable, wait);
 
 	return true;
 }
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -2
index 5f2b52e41427..527cc0400fd3 100644
@@ -1653,8 +1653,8 @@ static bool handle_hpd_irq_psr_sink(const struct dc_link *link)
 				sizeof(psr_error_status.raw));
 
 			/* PSR error, disable and re-enable PSR */
-			dc_link_set_psr_enable(link, false);
-			dc_link_set_psr_enable(link, true);
+			dc_link_set_psr_enable(link, false, true);
+			dc_link_set_psr_enable(link, true, true);
 
 			return true;
 		} else if (psr_sink_psr_status.bits.SINK_SELF_REFRESH_STATUS ==
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 5cafe7c288a6..f005add1aba3 100644
@@ -870,7 +870,7 @@ struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_index);
 bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
 		uint32_t frame_ramp, const struct dc_stream_state *stream);
 
-bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable);
+bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable, bool wait);
 
 bool dc_link_get_psr_state(const struct dc_link *dc_link, uint32_t *psr_state);
 
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +15 -12
index efcdb2bf4d0d..313f61bf06e1 100644
@@ -103,7 +103,7 @@ static void dce_get_dmcu_psr_state(struct dmcu *dmcu, uint32_t *psr_state)
 	REG_UPDATE(DMCU_RAM_ACCESS_CTRL, IRAM_HOST_ACCESS_EN, 0);
 }
 
-static void dce_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable)
+static void dce_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable, bool wait)
 {
 	struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu);
 	unsigned int dmcu_max_retry_on_wait_reg_ready = 801;
@@ -127,17 +127,18 @@ static void dce_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable)
 
 	/* notifyDMCUMsg */
 	REG_UPDATE(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 1);
-
-	for (retryCount = 0; retryCount <= 100; retryCount++) {
-		dce_get_dmcu_psr_state(dmcu, &psr_state);
-		if (enable) {
-			if (psr_state != 0)
-				break;
-		} else {
-			if (psr_state == 0)
-				break;
+	if (wait == true) {
+		for (retryCount = 0; retryCount <= 100; retryCount++) {
+			dce_get_dmcu_psr_state(dmcu, &psr_state);
+				if (enable) {
+					if (psr_state != 0)
+						break;
+				} else {
+					if (psr_state == 0)
+						break;
+				}
+				dm_delay_in_microseconds(dmcu->ctx, 10);
 		}
-		dm_delay_in_microseconds(dmcu->ctx, 10);
 	}
 }
 
@@ -338,7 +339,7 @@ static void dcn10_get_dmcu_psr_state(struct dmcu *dmcu, uint32_t *psr_state)
 	REG_UPDATE(DMCU_RAM_ACCESS_CTRL, IRAM_HOST_ACCESS_EN, 0);
 }
 
-static void dcn10_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable)
+static void dcn10_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable, bool wait)
 {
 	struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu);
 	unsigned int dmcu_max_retry_on_wait_reg_ready = 801;
@@ -367,6 +368,7 @@ static void dcn10_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable)
 	 *  Exit PSR may need to wait 1-2 frames to power up. Timeout after at
 	 *  least a few frames. Should never hit the max retry assert below.
 	 */
+	if (wait == true) {
 	for (retryCount = 0; retryCount <= 1000; retryCount++) {
 		dcn10_get_dmcu_psr_state(dmcu, &psr_state);
 		if (enable) {
@@ -381,6 +383,7 @@ static void dcn10_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable)
 
 	/* assert if max retry hit */
 	ASSERT(retryCount <= 1000);
+	}
 }
 
 static void dcn10_dmcu_setup_psr(struct dmcu *dmcu,
drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h +1 -1
index e34b25939a98..0574c29cc4a8 100644
@@ -37,7 +37,7 @@ struct dmcu_funcs {
 			unsigned int start_offset,
 			const char *src,
 			unsigned int bytes);
-	void (*set_psr_enable)(struct dmcu *dmcu, bool enable);
+	void (*set_psr_enable)(struct dmcu *dmcu, bool enable, bool wait);
 	void (*setup_psr)(struct dmcu *dmcu,
 			struct dc_link *link,
 			struct psr_context *psr_context);
Signature · 6 lines
2.11.0

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

PATCH 67/77 drm/amd/display: clean up functions in dcn10_dpp_cm

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

Change-Id Ifeca77690784f197273f2d41e67b331ad9dfe674
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h   | 420 --------------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    | 628 +++++----------------
 2 files changed, 140 insertions(+), 908 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +0 -420
index 9a678dcaa908..717930584111 100644
@@ -97,12 +97,6 @@
 	SRI(CM_DGAM_RAMB_END_CNTL1_R, CM, id), \
 	SRI(CM_DGAM_RAMB_END_CNTL2_R, CM, id), \
 	SRI(CM_DGAM_RAMB_REGION_0_1, CM, id), \
-	SRI(CM_DGAM_RAMB_REGION_2_3, CM, id), \
-	SRI(CM_DGAM_RAMB_REGION_4_5, CM, id), \
-	SRI(CM_DGAM_RAMB_REGION_6_7, CM, id), \
-	SRI(CM_DGAM_RAMB_REGION_8_9, CM, id), \
-	SRI(CM_DGAM_RAMB_REGION_10_11, CM, id), \
-	SRI(CM_DGAM_RAMB_REGION_12_13, CM, id), \
 	SRI(CM_DGAM_RAMB_REGION_14_15, CM, id), \
 	SRI(CM_DGAM_RAMA_START_CNTL_B, CM, id), \
 	SRI(CM_DGAM_RAMA_START_CNTL_G, CM, id), \
@@ -117,12 +111,6 @@
 	SRI(CM_DGAM_RAMA_END_CNTL1_R, CM, id), \
 	SRI(CM_DGAM_RAMA_END_CNTL2_R, CM, id), \
 	SRI(CM_DGAM_RAMA_REGION_0_1, CM, id), \
-	SRI(CM_DGAM_RAMA_REGION_2_3, CM, id), \
-	SRI(CM_DGAM_RAMA_REGION_4_5, CM, id), \
-	SRI(CM_DGAM_RAMA_REGION_6_7, CM, id), \
-	SRI(CM_DGAM_RAMA_REGION_8_9, CM, id), \
-	SRI(CM_DGAM_RAMA_REGION_10_11, CM, id), \
-	SRI(CM_DGAM_RAMA_REGION_12_13, CM, id), \
 	SRI(CM_DGAM_RAMA_REGION_14_15, CM, id), \
 	SRI(CM_MEM_PWR_CTRL, CM, id), \
 	SRI(CM_DGAM_LUT_WRITE_EN_MASK, CM, id), \
@@ -174,21 +162,6 @@
 	SRI(CM_RGAM_RAMB_END_CNTL1_R, CM, id), \
 	SRI(CM_RGAM_RAMB_END_CNTL2_R, CM, id), \
 	SRI(CM_RGAM_RAMB_REGION_0_1, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_2_3, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_4_5, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_6_7, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_8_9, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_10_11, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_12_13, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_14_15, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_16_17, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_18_19, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_20_21, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_22_23, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_24_25, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_26_27, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_28_29, CM, id), \
-	SRI(CM_RGAM_RAMB_REGION_30_31, CM, id), \
 	SRI(CM_RGAM_RAMB_REGION_32_33, CM, id), \
 	SRI(CM_RGAM_RAMA_START_CNTL_B, CM, id), \
 	SRI(CM_RGAM_RAMA_START_CNTL_G, CM, id), \
@@ -203,21 +176,6 @@
 	SRI(CM_RGAM_RAMA_END_CNTL1_R, CM, id), \
 	SRI(CM_RGAM_RAMA_END_CNTL2_R, CM, id), \
 	SRI(CM_RGAM_RAMA_REGION_0_1, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_2_3, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_4_5, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_6_7, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_8_9, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_10_11, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_12_13, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_14_15, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_16_17, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_18_19, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_20_21, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_22_23, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_24_25, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_26_27, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_28_29, CM, id), \
-	SRI(CM_RGAM_RAMA_REGION_30_31, CM, id), \
 	SRI(CM_RGAM_RAMA_REGION_32_33, CM, id), \
 	SRI(CM_RGAM_CONTROL, CM, id), \
 	SRI(CM_IGAM_CONTROL, CM, id), \
@@ -338,30 +296,6 @@
 	TF_SF(CM0_CM_DGAM_RAMB_REGION_0_1, CM_DGAM_RAMB_EXP_REGION0_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMB_REGION_0_1, CM_DGAM_RAMB_EXP_REGION1_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMB_REGION_0_1, CM_DGAM_RAMB_EXP_REGION1_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_2_3, CM_DGAM_RAMB_EXP_REGION2_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_2_3, CM_DGAM_RAMB_EXP_REGION2_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_2_3, CM_DGAM_RAMB_EXP_REGION3_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_2_3, CM_DGAM_RAMB_EXP_REGION3_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_4_5, CM_DGAM_RAMB_EXP_REGION4_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_4_5, CM_DGAM_RAMB_EXP_REGION4_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_4_5, CM_DGAM_RAMB_EXP_REGION5_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_4_5, CM_DGAM_RAMB_EXP_REGION5_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_6_7, CM_DGAM_RAMB_EXP_REGION6_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_6_7, CM_DGAM_RAMB_EXP_REGION6_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_6_7, CM_DGAM_RAMB_EXP_REGION7_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_6_7, CM_DGAM_RAMB_EXP_REGION7_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_8_9, CM_DGAM_RAMB_EXP_REGION8_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_8_9, CM_DGAM_RAMB_EXP_REGION8_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_8_9, CM_DGAM_RAMB_EXP_REGION9_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_8_9, CM_DGAM_RAMB_EXP_REGION9_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_10_11, CM_DGAM_RAMB_EXP_REGION10_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_10_11, CM_DGAM_RAMB_EXP_REGION10_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_10_11, CM_DGAM_RAMB_EXP_REGION11_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_10_11, CM_DGAM_RAMB_EXP_REGION11_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_12_13, CM_DGAM_RAMB_EXP_REGION12_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_12_13, CM_DGAM_RAMB_EXP_REGION12_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_12_13, CM_DGAM_RAMB_EXP_REGION13_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMB_REGION_12_13, CM_DGAM_RAMB_EXP_REGION13_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMB_REGION_14_15, CM_DGAM_RAMB_EXP_REGION14_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMB_REGION_14_15, CM_DGAM_RAMB_EXP_REGION14_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMB_REGION_14_15, CM_DGAM_RAMB_EXP_REGION15_LUT_OFFSET, mask_sh), \
@@ -388,30 +322,6 @@
 	TF_SF(CM0_CM_DGAM_RAMA_REGION_0_1, CM_DGAM_RAMA_EXP_REGION0_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMA_REGION_0_1, CM_DGAM_RAMA_EXP_REGION1_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMA_REGION_0_1, CM_DGAM_RAMA_EXP_REGION1_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_2_3, CM_DGAM_RAMA_EXP_REGION2_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_2_3, CM_DGAM_RAMA_EXP_REGION2_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_2_3, CM_DGAM_RAMA_EXP_REGION3_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_2_3, CM_DGAM_RAMA_EXP_REGION3_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_4_5, CM_DGAM_RAMA_EXP_REGION4_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_4_5, CM_DGAM_RAMA_EXP_REGION4_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_4_5, CM_DGAM_RAMA_EXP_REGION5_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_4_5, CM_DGAM_RAMA_EXP_REGION5_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_6_7, CM_DGAM_RAMA_EXP_REGION6_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_6_7, CM_DGAM_RAMA_EXP_REGION6_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_6_7, CM_DGAM_RAMA_EXP_REGION7_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_6_7, CM_DGAM_RAMA_EXP_REGION7_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_8_9, CM_DGAM_RAMA_EXP_REGION8_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_8_9, CM_DGAM_RAMA_EXP_REGION8_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_8_9, CM_DGAM_RAMA_EXP_REGION9_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_8_9, CM_DGAM_RAMA_EXP_REGION9_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_10_11, CM_DGAM_RAMA_EXP_REGION10_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_10_11, CM_DGAM_RAMA_EXP_REGION10_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_10_11, CM_DGAM_RAMA_EXP_REGION11_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_10_11, CM_DGAM_RAMA_EXP_REGION11_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_12_13, CM_DGAM_RAMA_EXP_REGION12_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_12_13, CM_DGAM_RAMA_EXP_REGION12_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_12_13, CM_DGAM_RAMA_EXP_REGION13_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_DGAM_RAMA_REGION_12_13, CM_DGAM_RAMA_EXP_REGION13_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMA_REGION_14_15, CM_DGAM_RAMA_EXP_REGION14_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMA_REGION_14_15, CM_DGAM_RAMA_EXP_REGION14_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_DGAM_RAMA_REGION_14_15, CM_DGAM_RAMA_EXP_REGION15_LUT_OFFSET, mask_sh), \
@@ -501,66 +411,6 @@
 	TF_SF(CM0_CM_RGAM_RAMB_REGION_0_1, CM_RGAM_RAMB_EXP_REGION0_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMB_REGION_0_1, CM_RGAM_RAMB_EXP_REGION1_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMB_REGION_0_1, CM_RGAM_RAMB_EXP_REGION1_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_2_3, CM_RGAM_RAMB_EXP_REGION2_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_2_3, CM_RGAM_RAMB_EXP_REGION2_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_2_3, CM_RGAM_RAMB_EXP_REGION3_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_2_3, CM_RGAM_RAMB_EXP_REGION3_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_4_5, CM_RGAM_RAMB_EXP_REGION4_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_4_5, CM_RGAM_RAMB_EXP_REGION4_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_4_5, CM_RGAM_RAMB_EXP_REGION5_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_4_5, CM_RGAM_RAMB_EXP_REGION5_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_6_7, CM_RGAM_RAMB_EXP_REGION6_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_6_7, CM_RGAM_RAMB_EXP_REGION6_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_6_7, CM_RGAM_RAMB_EXP_REGION7_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_6_7, CM_RGAM_RAMB_EXP_REGION7_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_8_9, CM_RGAM_RAMB_EXP_REGION8_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_8_9, CM_RGAM_RAMB_EXP_REGION8_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_8_9, CM_RGAM_RAMB_EXP_REGION9_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_8_9, CM_RGAM_RAMB_EXP_REGION9_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_10_11, CM_RGAM_RAMB_EXP_REGION10_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_10_11, CM_RGAM_RAMB_EXP_REGION10_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_10_11, CM_RGAM_RAMB_EXP_REGION11_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_10_11, CM_RGAM_RAMB_EXP_REGION11_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_12_13, CM_RGAM_RAMB_EXP_REGION12_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_12_13, CM_RGAM_RAMB_EXP_REGION12_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_12_13, CM_RGAM_RAMB_EXP_REGION13_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_12_13, CM_RGAM_RAMB_EXP_REGION13_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_14_15, CM_RGAM_RAMB_EXP_REGION14_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_14_15, CM_RGAM_RAMB_EXP_REGION14_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_14_15, CM_RGAM_RAMB_EXP_REGION15_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_14_15, CM_RGAM_RAMB_EXP_REGION15_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_16_17, CM_RGAM_RAMB_EXP_REGION16_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_16_17, CM_RGAM_RAMB_EXP_REGION16_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_16_17, CM_RGAM_RAMB_EXP_REGION17_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_16_17, CM_RGAM_RAMB_EXP_REGION17_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_18_19, CM_RGAM_RAMB_EXP_REGION18_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_18_19, CM_RGAM_RAMB_EXP_REGION18_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_18_19, CM_RGAM_RAMB_EXP_REGION19_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_18_19, CM_RGAM_RAMB_EXP_REGION19_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_20_21, CM_RGAM_RAMB_EXP_REGION20_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_20_21, CM_RGAM_RAMB_EXP_REGION20_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_20_21, CM_RGAM_RAMB_EXP_REGION21_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_20_21, CM_RGAM_RAMB_EXP_REGION21_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_22_23, CM_RGAM_RAMB_EXP_REGION22_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_22_23, CM_RGAM_RAMB_EXP_REGION22_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_22_23, CM_RGAM_RAMB_EXP_REGION23_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_22_23, CM_RGAM_RAMB_EXP_REGION23_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_24_25, CM_RGAM_RAMB_EXP_REGION24_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_24_25, CM_RGAM_RAMB_EXP_REGION24_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_24_25, CM_RGAM_RAMB_EXP_REGION25_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_24_25, CM_RGAM_RAMB_EXP_REGION25_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_26_27, CM_RGAM_RAMB_EXP_REGION26_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_26_27, CM_RGAM_RAMB_EXP_REGION26_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_26_27, CM_RGAM_RAMB_EXP_REGION27_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_26_27, CM_RGAM_RAMB_EXP_REGION27_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_28_29, CM_RGAM_RAMB_EXP_REGION28_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_28_29, CM_RGAM_RAMB_EXP_REGION28_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_28_29, CM_RGAM_RAMB_EXP_REGION29_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_28_29, CM_RGAM_RAMB_EXP_REGION29_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_30_31, CM_RGAM_RAMB_EXP_REGION30_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_30_31, CM_RGAM_RAMB_EXP_REGION30_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_30_31, CM_RGAM_RAMB_EXP_REGION31_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMB_REGION_30_31, CM_RGAM_RAMB_EXP_REGION31_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMB_REGION_32_33, CM_RGAM_RAMB_EXP_REGION32_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMB_REGION_32_33, CM_RGAM_RAMB_EXP_REGION32_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMB_REGION_32_33, CM_RGAM_RAMB_EXP_REGION33_LUT_OFFSET, mask_sh), \
@@ -587,66 +437,6 @@
 	TF_SF(CM0_CM_RGAM_RAMA_REGION_0_1, CM_RGAM_RAMA_EXP_REGION0_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMA_REGION_0_1, CM_RGAM_RAMA_EXP_REGION1_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMA_REGION_0_1, CM_RGAM_RAMA_EXP_REGION1_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_2_3, CM_RGAM_RAMA_EXP_REGION2_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_2_3, CM_RGAM_RAMA_EXP_REGION2_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_2_3, CM_RGAM_RAMA_EXP_REGION3_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_2_3, CM_RGAM_RAMA_EXP_REGION3_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_4_5, CM_RGAM_RAMA_EXP_REGION4_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_4_5, CM_RGAM_RAMA_EXP_REGION4_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_4_5, CM_RGAM_RAMA_EXP_REGION5_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_4_5, CM_RGAM_RAMA_EXP_REGION5_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_6_7, CM_RGAM_RAMA_EXP_REGION6_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_6_7, CM_RGAM_RAMA_EXP_REGION6_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_6_7, CM_RGAM_RAMA_EXP_REGION7_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_6_7, CM_RGAM_RAMA_EXP_REGION7_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_8_9, CM_RGAM_RAMA_EXP_REGION8_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_8_9, CM_RGAM_RAMA_EXP_REGION8_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_8_9, CM_RGAM_RAMA_EXP_REGION9_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_8_9, CM_RGAM_RAMA_EXP_REGION9_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_10_11, CM_RGAM_RAMA_EXP_REGION10_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_10_11, CM_RGAM_RAMA_EXP_REGION10_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_10_11, CM_RGAM_RAMA_EXP_REGION11_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_10_11, CM_RGAM_RAMA_EXP_REGION11_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_12_13, CM_RGAM_RAMA_EXP_REGION12_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_12_13, CM_RGAM_RAMA_EXP_REGION12_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_12_13, CM_RGAM_RAMA_EXP_REGION13_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_12_13, CM_RGAM_RAMA_EXP_REGION13_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_14_15, CM_RGAM_RAMA_EXP_REGION14_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_14_15, CM_RGAM_RAMA_EXP_REGION14_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_14_15, CM_RGAM_RAMA_EXP_REGION15_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_14_15, CM_RGAM_RAMA_EXP_REGION15_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_16_17, CM_RGAM_RAMA_EXP_REGION16_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_16_17, CM_RGAM_RAMA_EXP_REGION16_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_16_17, CM_RGAM_RAMA_EXP_REGION17_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_16_17, CM_RGAM_RAMA_EXP_REGION17_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_18_19, CM_RGAM_RAMA_EXP_REGION18_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_18_19, CM_RGAM_RAMA_EXP_REGION18_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_18_19, CM_RGAM_RAMA_EXP_REGION19_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_18_19, CM_RGAM_RAMA_EXP_REGION19_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_20_21, CM_RGAM_RAMA_EXP_REGION20_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_20_21, CM_RGAM_RAMA_EXP_REGION20_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_20_21, CM_RGAM_RAMA_EXP_REGION21_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_20_21, CM_RGAM_RAMA_EXP_REGION21_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_22_23, CM_RGAM_RAMA_EXP_REGION22_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_22_23, CM_RGAM_RAMA_EXP_REGION22_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_22_23, CM_RGAM_RAMA_EXP_REGION23_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_22_23, CM_RGAM_RAMA_EXP_REGION23_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_24_25, CM_RGAM_RAMA_EXP_REGION24_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_24_25, CM_RGAM_RAMA_EXP_REGION24_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_24_25, CM_RGAM_RAMA_EXP_REGION25_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_24_25, CM_RGAM_RAMA_EXP_REGION25_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_26_27, CM_RGAM_RAMA_EXP_REGION26_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_26_27, CM_RGAM_RAMA_EXP_REGION26_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_26_27, CM_RGAM_RAMA_EXP_REGION27_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_26_27, CM_RGAM_RAMA_EXP_REGION27_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_28_29, CM_RGAM_RAMA_EXP_REGION28_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_28_29, CM_RGAM_RAMA_EXP_REGION28_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_28_29, CM_RGAM_RAMA_EXP_REGION29_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_28_29, CM_RGAM_RAMA_EXP_REGION29_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_30_31, CM_RGAM_RAMA_EXP_REGION30_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_30_31, CM_RGAM_RAMA_EXP_REGION30_NUM_SEGMENTS, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_30_31, CM_RGAM_RAMA_EXP_REGION31_LUT_OFFSET, mask_sh), \
-	TF_SF(CM0_CM_RGAM_RAMA_REGION_30_31, CM_RGAM_RAMA_EXP_REGION31_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMA_REGION_32_33, CM_RGAM_RAMA_EXP_REGION32_LUT_OFFSET, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMA_REGION_32_33, CM_RGAM_RAMA_EXP_REGION32_NUM_SEGMENTS, mask_sh), \
 	TF_SF(CM0_CM_RGAM_RAMA_REGION_32_33, CM_RGAM_RAMA_EXP_REGION33_LUT_OFFSET, mask_sh), \
@@ -816,66 +606,6 @@
 	type CM_RGAM_RAMB_EXP_REGION0_NUM_SEGMENTS; \
 	type CM_RGAM_RAMB_EXP_REGION1_LUT_OFFSET; \
 	type CM_RGAM_RAMB_EXP_REGION1_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION2_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION2_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION3_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION3_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION4_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION4_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION5_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION5_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION6_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION6_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION7_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION7_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION8_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION8_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION9_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION9_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION10_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION10_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION11_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION11_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION12_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION12_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION13_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION13_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION14_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION14_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION15_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION15_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION16_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION16_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION17_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION17_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION18_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION18_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION19_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION19_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION20_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION20_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION21_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION21_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION22_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION22_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION23_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION23_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION24_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION24_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION25_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION25_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION26_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION26_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION27_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION27_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION28_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION28_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION29_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION29_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION30_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION30_NUM_SEGMENTS; \
-	type CM_RGAM_RAMB_EXP_REGION31_LUT_OFFSET; \
-	type CM_RGAM_RAMB_EXP_REGION31_NUM_SEGMENTS; \
 	type CM_RGAM_RAMB_EXP_REGION32_LUT_OFFSET; \
 	type CM_RGAM_RAMB_EXP_REGION32_NUM_SEGMENTS; \
 	type CM_RGAM_RAMB_EXP_REGION33_LUT_OFFSET; \
@@ -902,66 +632,6 @@
 	type CM_RGAM_RAMA_EXP_REGION0_NUM_SEGMENTS; \
 	type CM_RGAM_RAMA_EXP_REGION1_LUT_OFFSET; \
 	type CM_RGAM_RAMA_EXP_REGION1_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION2_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION2_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION3_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION3_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION4_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION4_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION5_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION5_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION6_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION6_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION7_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION7_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION8_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION8_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION9_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION9_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION10_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION10_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION11_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION11_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION12_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION12_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION13_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION13_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION14_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION14_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION15_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION15_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION16_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION16_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION17_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION17_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION18_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION18_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION19_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION19_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION20_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION20_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION21_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION21_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION22_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION22_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION23_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION23_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION24_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION24_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION25_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION25_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION26_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION26_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION27_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION27_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION28_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION28_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION29_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION29_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION30_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION30_NUM_SEGMENTS; \
-	type CM_RGAM_RAMA_EXP_REGION31_LUT_OFFSET; \
-	type CM_RGAM_RAMA_EXP_REGION31_NUM_SEGMENTS; \
 	type CM_RGAM_RAMA_EXP_REGION32_LUT_OFFSET; \
 	type CM_RGAM_RAMA_EXP_REGION32_NUM_SEGMENTS; \
 	type CM_RGAM_RAMA_EXP_REGION33_LUT_OFFSET; \
@@ -1370,30 +1040,6 @@
 	type CM_DGAM_RAMB_EXP_REGION0_NUM_SEGMENTS; \
 	type CM_DGAM_RAMB_EXP_REGION1_LUT_OFFSET; \
 	type CM_DGAM_RAMB_EXP_REGION1_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION2_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION2_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION3_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION3_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION4_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION4_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION5_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION5_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION6_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION6_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION7_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION7_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION8_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION8_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION9_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION9_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION10_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION10_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION11_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION11_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION12_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION12_NUM_SEGMENTS; \
-	type CM_DGAM_RAMB_EXP_REGION13_LUT_OFFSET; \
-	type CM_DGAM_RAMB_EXP_REGION13_NUM_SEGMENTS; \
 	type CM_DGAM_RAMB_EXP_REGION14_LUT_OFFSET; \
 	type CM_DGAM_RAMB_EXP_REGION14_NUM_SEGMENTS; \
 	type CM_DGAM_RAMB_EXP_REGION15_LUT_OFFSET; \
@@ -1420,30 +1066,6 @@
 	type CM_DGAM_RAMA_EXP_REGION0_NUM_SEGMENTS; \
 	type CM_DGAM_RAMA_EXP_REGION1_LUT_OFFSET; \
 	type CM_DGAM_RAMA_EXP_REGION1_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION2_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION2_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION3_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION3_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION4_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION4_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION5_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION5_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION6_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION6_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION7_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION7_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION8_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION8_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION9_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION9_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION10_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION10_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION11_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION11_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION12_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION12_NUM_SEGMENTS; \
-	type CM_DGAM_RAMA_EXP_REGION13_LUT_OFFSET; \
-	type CM_DGAM_RAMA_EXP_REGION13_NUM_SEGMENTS; \
 	type CM_DGAM_RAMA_EXP_REGION14_LUT_OFFSET; \
 	type CM_DGAM_RAMA_EXP_REGION14_NUM_SEGMENTS; \
 	type CM_DGAM_RAMA_EXP_REGION15_LUT_OFFSET; \
@@ -1565,21 +1187,6 @@ struct dcn_dpp_registers {
 	uint32_t CM_RGAM_RAMB_END_CNTL1_R;
 	uint32_t CM_RGAM_RAMB_END_CNTL2_R;
 	uint32_t CM_RGAM_RAMB_REGION_0_1;
-	uint32_t CM_RGAM_RAMB_REGION_2_3;
-	uint32_t CM_RGAM_RAMB_REGION_4_5;
-	uint32_t CM_RGAM_RAMB_REGION_6_7;
-	uint32_t CM_RGAM_RAMB_REGION_8_9;
-	uint32_t CM_RGAM_RAMB_REGION_10_11;
-	uint32_t CM_RGAM_RAMB_REGION_12_13;
-	uint32_t CM_RGAM_RAMB_REGION_14_15;
-	uint32_t CM_RGAM_RAMB_REGION_16_17;
-	uint32_t CM_RGAM_RAMB_REGION_18_19;
-	uint32_t CM_RGAM_RAMB_REGION_20_21;
-	uint32_t CM_RGAM_RAMB_REGION_22_23;
-	uint32_t CM_RGAM_RAMB_REGION_24_25;
-	uint32_t CM_RGAM_RAMB_REGION_26_27;
-	uint32_t CM_RGAM_RAMB_REGION_28_29;
-	uint32_t CM_RGAM_RAMB_REGION_30_31;
 	uint32_t CM_RGAM_RAMB_REGION_32_33;
 	uint32_t CM_RGAM_RAMA_START_CNTL_B;
 	uint32_t CM_RGAM_RAMA_START_CNTL_G;
@@ -1594,21 +1201,6 @@ struct dcn_dpp_registers {
 	uint32_t CM_RGAM_RAMA_END_CNTL1_R;
 	uint32_t CM_RGAM_RAMA_END_CNTL2_R;
 	uint32_t CM_RGAM_RAMA_REGION_0_1;
-	uint32_t CM_RGAM_RAMA_REGION_2_3;
-	uint32_t CM_RGAM_RAMA_REGION_4_5;
-	uint32_t CM_RGAM_RAMA_REGION_6_7;
-	uint32_t CM_RGAM_RAMA_REGION_8_9;
-	uint32_t CM_RGAM_RAMA_REGION_10_11;
-	uint32_t CM_RGAM_RAMA_REGION_12_13;
-	uint32_t CM_RGAM_RAMA_REGION_14_15;
-	uint32_t CM_RGAM_RAMA_REGION_16_17;
-	uint32_t CM_RGAM_RAMA_REGION_18_19;
-	uint32_t CM_RGAM_RAMA_REGION_20_21;
-	uint32_t CM_RGAM_RAMA_REGION_22_23;
-	uint32_t CM_RGAM_RAMA_REGION_24_25;
-	uint32_t CM_RGAM_RAMA_REGION_26_27;
-	uint32_t CM_RGAM_RAMA_REGION_28_29;
-	uint32_t CM_RGAM_RAMA_REGION_30_31;
 	uint32_t CM_RGAM_RAMA_REGION_32_33;
 	uint32_t CM_RGAM_CONTROL;
 	uint32_t OBUF_CONTROL;
@@ -1743,12 +1335,6 @@ struct dcn_dpp_registers {
 	uint32_t CM_DGAM_RAMB_END_CNTL1_R;
 	uint32_t CM_DGAM_RAMB_END_CNTL2_R;
 	uint32_t CM_DGAM_RAMB_REGION_0_1;
-	uint32_t CM_DGAM_RAMB_REGION_2_3;
-	uint32_t CM_DGAM_RAMB_REGION_4_5;
-	uint32_t CM_DGAM_RAMB_REGION_6_7;
-	uint32_t CM_DGAM_RAMB_REGION_8_9;
-	uint32_t CM_DGAM_RAMB_REGION_10_11;
-	uint32_t CM_DGAM_RAMB_REGION_12_13;
 	uint32_t CM_DGAM_RAMB_REGION_14_15;
 	uint32_t CM_DGAM_RAMA_START_CNTL_B;
 	uint32_t CM_DGAM_RAMA_START_CNTL_G;
@@ -1763,12 +1349,6 @@ struct dcn_dpp_registers {
 	uint32_t CM_DGAM_RAMA_END_CNTL1_R;
 	uint32_t CM_DGAM_RAMA_END_CNTL2_R;
 	uint32_t CM_DGAM_RAMA_REGION_0_1;
-	uint32_t CM_DGAM_RAMA_REGION_2_3;
-	uint32_t CM_DGAM_RAMA_REGION_4_5;
-	uint32_t CM_DGAM_RAMA_REGION_6_7;
-	uint32_t CM_DGAM_RAMA_REGION_8_9;
-	uint32_t CM_DGAM_RAMA_REGION_10_11;
-	uint32_t CM_DGAM_RAMA_REGION_12_13;
 	uint32_t CM_DGAM_RAMA_REGION_14_15;
 	uint32_t CM_DGAM_LUT_WRITE_EN_MASK;
 	uint32_t CM_DGAM_LUT_INDEX;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +140 -488

683 lines not on this page · raw message

Signature · 6 lines
2.11.0

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

PATCH 68/77 drm/amd/display: not override the FMT setting set by VBIOS for eDP

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id Ibc8e1803b6f3ee22ae6d27bb5b9eaff666e899a5
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +5 -2
index 42caad423430..3b4ca1a9217f 100644
@@ -1082,11 +1082,14 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 
 
 /*vbios crtc_source_selection and encoder_setup will override fmt_C*/
-	pipe_ctx->stream_res.opp->funcs->opp_program_fmt(
+	if (pipe_ctx->stream->signal != SIGNAL_TYPE_EDP &&
+		pipe_ctx->stream->signal != SIGNAL_TYPE_LVDS) {
+	/*for embedded panel, don't override VBIOS's setting*/
+		pipe_ctx->stream_res.opp->funcs->opp_program_fmt(
 			pipe_ctx->stream_res.opp,
 			&stream->bit_depth_params,
 			&stream->clamping);
-
+	}
 	if (dc_is_dp_signal(pipe_ctx->stream->signal))
 		pipe_ctx->stream_res.stream_enc->funcs->dp_set_stream_attribute(
 			pipe_ctx->stream_res.stream_enc,
Signature · 6 lines
2.11.0

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

PATCH 69/77 drm/amd/display: add backlight control in blankstream.

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id I17ff8fe4b031dae5428f8267ec3eb280f79fbbb4
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +7 -2
index 3b4ca1a9217f..9fb0ba7e7b7d 100644
@@ -778,9 +778,11 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 
 
 	/* blank at encoder level */
-	if (dc_is_dp_signal(pipe_ctx->stream->signal))
+	if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
+		if (pipe_ctx->stream->sink->link->connector_signal == SIGNAL_TYPE_EDP)
+			link->link_enc->funcs->backlight_control(link->link_enc, false);
 		pipe_ctx->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);
-
+	}
 	link->link_enc->funcs->connect_dig_be_to_fe(
 			link->link_enc,
 			pipe_ctx->stream_res.stream_enc->id,
@@ -792,12 +794,15 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,
 		struct dc_link_settings *link_settings)
 {
 	struct encoder_unblank_param params = { { 0 } };
+	struct dc_link *link = pipe_ctx->stream->sink->link;
 
 	/* only 3 items below are used by unblank */
 	params.pixel_clk_khz =
 		pipe_ctx->stream->timing.pix_clk_khz;
 	params.link_settings.link_rate = link_settings->link_rate;
 	pipe_ctx->stream_res.stream_enc->funcs->dp_unblank(pipe_ctx->stream_res.stream_enc, &params);
+	if (link->connector_signal == SIGNAL_TYPE_EDP)
+			link->link_enc->funcs->backlight_control(link->link_enc, true);
 }
 
 
Signature · 6 lines
2.11.0

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

PATCH 70/77 drm/amd/display: program fbc for scatter/gather

In reply to a message not in the archive

From: Roman Li <[email protected]>

Fixing screen flickering when FBC enabled on Stoney

Change-Id I14bb589ecc537b02ac62c710c852f3886156d15c
---
 .../gpu/drm/amd/display/dc/dce110/dce110_compressor.c  | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +16 -2
index 2e97e5757fb9..f82c26995609 100644
@@ -189,7 +189,7 @@ void dce110_compressor_enable_fbc(
 		(!dce110_compressor_is_fbc_enabled_in_hw(compressor, NULL))) {
 
 		uint32_t addr;
-		uint32_t value;
+		uint32_t value, misc_value;
 
 
 		addr = mmFBC_CNTL;
@@ -206,9 +206,23 @@ void dce110_compressor_enable_fbc(
 		compressor->attached_inst = params->inst;
 		cp110->offsets = reg_offsets[params->inst];
 
-		/*Toggle it as there is bug in HW */
+		/* Toggle it as there is bug in HW */
 		set_reg_field_value(value, 0, FBC_CNTL, FBC_GRPH_COMP_EN);
 		dm_write_reg(compressor->ctx, addr, value);
+
+		/* FBC usage with scatter & gather for dce110 */
+		misc_value = dm_read_reg(compressor->ctx, mmFBC_MISC);
+
+		set_reg_field_value(misc_value, 1,
+				FBC_MISC, FBC_INVALIDATE_ON_ERROR);
+		set_reg_field_value(misc_value, 1,
+				FBC_MISC, FBC_DECOMPRESS_ERROR_CLEAR);
+		set_reg_field_value(misc_value, 0x14,
+				FBC_MISC, FBC_SLOW_REQ_INTERVAL);
+
+		dm_write_reg(compressor->ctx, mmFBC_MISC, misc_value);
+
+		/* Enable FBC */
 		set_reg_field_value(value, 1, FBC_CNTL, FBC_GRPH_COMP_EN);
 		dm_write_reg(compressor->ctx, addr, value);
 
Signature · 6 lines
2.11.0

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

PATCH 71/77 drm/amd/display: Program reg for vertical interrupt.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

Change-Id Iedc229c5bb753ad64819ffb1bbea1909764e46db
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 10 ++++++++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.h |  4 ++++
 2 files changed, 14 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +10 -0
index 6a5f2683c2e5..94ea3a9f6bb4 100644
@@ -118,6 +118,7 @@ static void tgn10_program_timing(
 	uint32_t start_point = 0;
 	uint32_t field_num = 0;
 	uint32_t h_div_2;
+	uint32_t vertial_line_start;
 
 	struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
 
@@ -212,6 +213,12 @@ static void tgn10_program_timing(
 			OTG_V_BLANK_START, asic_blank_start,
 			OTG_V_BLANK_END, asic_blank_end);
 
+	/* Use OTG_VERTICAL_INTERRUPT2 replace VUPDATE interrupt,
+	 * program the reg for interrupt postition.
+	 */
+	vertial_line_start = asic_blank_end - tg->dlg_otg_param.vstartup_start + 1;
+	REG_SET(OTG_VERTICAL_INTERRUPT2_POSITION, 0,
+			OTG_VERTICAL_INTERRUPT2_LINE_START, vertial_line_start);
 
 	/* v_sync polarity */
 	v_sync_polarity = patched_crtc_timing.flags.VSYNC_POSITIVE_POLARITY ?
@@ -289,6 +296,9 @@ static void tgn10_unblank_crtc(struct timing_generator *tg)
 {
 	struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
 
+	REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
+					OTG_BLANK_DATA_DOUBLE_BUFFER_EN, 1);
+
 	REG_UPDATE_2(OTG_BLANK_CONTROL,
 			OTG_BLANK_DATA_EN, 0,
 			OTG_BLANK_DE_MODE, 0);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.h +4 -0
index 654889318fc1..38d3dcf89d60 100644
@@ -65,6 +65,7 @@
 	SRI(OTG_NOM_VERT_POSITION, OTG, inst),\
 	SRI(OTG_BLACK_COLOR, OTG, inst),\
 	SRI(OTG_CLOCK_CONTROL, OTG, inst),\
+	SRI(OTG_VERTICAL_INTERRUPT2_POSITION, OTG, inst),\
 	SRI(OPTC_INPUT_CLOCK_CONTROL, ODM, inst),\
 	SRI(OPTC_DATA_SOURCE_SELECT, ODM, inst),\
 	SRI(OPTC_INPUT_GLOBAL_CONTROL, ODM, inst),\
@@ -120,6 +121,7 @@ struct dcn_tg_registers {
 	uint32_t OTG_TEST_PATTERN_CONTROL;
 	uint32_t OTG_TEST_PATTERN_COLOR;
 	uint32_t OTG_CLOCK_CONTROL;
+	uint32_t OTG_VERTICAL_INTERRUPT2_POSITION;
 	uint32_t OPTC_INPUT_CLOCK_CONTROL;
 	uint32_t OPTC_DATA_SOURCE_SELECT;
 	uint32_t OPTC_INPUT_GLOBAL_CONTROL;
@@ -203,6 +205,7 @@ struct dcn_tg_registers {
 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_CLOCK_EN, mask_sh),\
 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_CLOCK_ON, mask_sh),\
 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_CLOCK_GATE_DIS, mask_sh),\
+	SF(OTG0_OTG_VERTICAL_INTERRUPT2_POSITION, OTG_VERTICAL_INTERRUPT2_LINE_START, mask_sh),\
 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_EN, mask_sh),\
 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_ON, mask_sh),\
 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_GATE_DIS, mask_sh),\
@@ -308,6 +311,7 @@ struct dcn_tg_registers {
 	type OTG_CLOCK_EN;\
 	type OTG_CLOCK_ON;\
 	type OTG_CLOCK_GATE_DIS;\
+	type OTG_VERTICAL_INTERRUPT2_LINE_START;\
 	type OPTC_INPUT_CLK_EN;\
 	type OPTC_INPUT_CLK_ON;\
 	type OPTC_INPUT_CLK_GATE_DIS;\
Signature · 6 lines
2.11.0

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

PATCH 72/77 drm/amd/display: Disable OTG double buffer.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

Change-Id Iea5b5ed54b807f456520de0fb629cf7f9e8f683b
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +0 -3
index 94ea3a9f6bb4..15f1f44e102a 100644
@@ -296,9 +296,6 @@ static void tgn10_unblank_crtc(struct timing_generator *tg)
 {
 	struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
 
-	REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
-					OTG_BLANK_DATA_DOUBLE_BUFFER_EN, 1);
-
 	REG_UPDATE_2(OTG_BLANK_CONTROL,
 			OTG_BLANK_DATA_EN, 0,
 			OTG_BLANK_DE_MODE, 0);
Signature · 6 lines
2.11.0

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

PATCH 73/77 drm/amd/display: Set add_stream_ctx for CZ, Hawaii and others

In reply to a message not in the archive
Change-Id Ieed31e202f7c92b605ceb7d1c95401296549c662
---
 .../gpu/drm/amd/display/dc/dce100/dce100_resource.c  | 19 +++++++++++++++++++
 .../gpu/drm/amd/display/dc/dce100/dce100_resource.h  |  5 +++++
 .../gpu/drm/amd/display/dc/dce110/dce110_resource.c  | 20 ++++++++++++++++++++
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c    |  1 +
 4 files changed, 45 insertions(+)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +19 -0
index 36d79175354c..ca6c7c2a1b4c 100644
@@ -713,6 +713,24 @@ enum dc_status dce100_validate_global(
 	return DC_OK;
 }
 
+enum dc_status dce100_add_stream_to_ctx(
+		struct dc *dc,
+		struct dc_state *new_ctx,
+		struct dc_stream_state *dc_stream)
+{
+	enum dc_status result = DC_ERROR_UNEXPECTED;
+
+	result = resource_map_pool_resources(dc, new_ctx, dc_stream);
+
+	if (result == DC_OK)
+		result = resource_map_clock_resources(dc, new_ctx, dc_stream);
+
+	if (result == DC_OK)
+		result = build_mapped_resource(dc, new_ctx, dc_stream);
+
+	return result;
+}
+
 enum dc_status dce100_validate_guaranteed(
 		struct dc  *dc,
 		struct dc_stream_state *dc_stream,
@@ -769,6 +787,7 @@ static const struct resource_funcs dce100_res_pool_funcs = {
 	.validate_guaranteed = dce100_validate_guaranteed,
 	.validate_bandwidth = dce100_validate_bandwidth,
 	.validate_plane = dce100_validate_plane,
+	.add_stream_to_ctx = dce100_add_stream_to_ctx,
 	.validate_global = dce100_validate_global
 };
 
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h +5 -0
index ca7b2b7c1a48..f52cae24ee23 100644
@@ -18,4 +18,9 @@ struct resource_pool *dce100_create_resource_pool(
 
 enum dc_status dce100_validate_plane(const struct dc_plane_state *plane_state);
 
+enum dc_status dce100_add_stream_to_ctx(
+		struct dc *dc,
+		struct dc_state *new_ctx,
+		struct dc_stream_state *dc_stream);
+
 #endif /* DCE100_RESOURCE_H_ */
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +20 -0
index 4942460d42ca..41bfddf9574e 100644
@@ -921,6 +921,25 @@ enum dc_status dce110_validate_global(
 	return DC_OK;
 }
 
+static enum dc_status dce110_add_stream_to_ctx(
+		struct dc *dc,
+		struct dc_state *new_ctx,
+		struct dc_stream_state *dc_stream)
+{
+	enum dc_status result = DC_ERROR_UNEXPECTED;
+
+	result = resource_map_pool_resources(dc, new_ctx, dc_stream);
+
+	if (result == DC_OK)
+		result = resource_map_clock_resources(dc, new_ctx, dc_stream);
+
+
+	if (result == DC_OK)
+		result = build_mapped_resource(dc, new_ctx, dc_stream);
+
+	return result;
+}
+
 static enum dc_status dce110_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *dc_stream,
@@ -1030,6 +1049,7 @@ static const struct resource_funcs dce110_res_pool_funcs = {
 	.validate_guaranteed = dce110_validate_guaranteed,
 	.validate_bandwidth = dce110_validate_bandwidth,
 	.acquire_idle_pipe_for_layer = dce110_acquire_underlay,
+	.add_stream_to_ctx = dce110_add_stream_to_ctx,
 	.validate_global = dce110_validate_global
 };
 
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +1 -0
index 316080767a21..9234086aac27 100644
@@ -791,6 +791,7 @@ static const struct resource_funcs dce80_res_pool_funcs = {
 	.validate_guaranteed = dce80_validate_guaranteed,
 	.validate_bandwidth = dce80_validate_bandwidth,
 	.validate_plane = dce100_validate_plane,
+	.add_stream_to_ctx = dce100_add_stream_to_ctx,
 	.validate_global = dce80_validate_global
 };
 
Signature · 6 lines
2.11.0

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

PATCH 74/77 drm/amd/display: Restore missing DCE8 xfm regs

In reply to a message not in the archive
Change-Id I22aab0455e4e813fd4f82a21b37b08ce2c80e320
---
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.h    | 10 ++++++++++
 drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c |  6 +++---
 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_transform.h +10 -0
index d87225d15cd9..805bb9c4e188 100644
@@ -94,6 +94,10 @@
 	SRI(SCL_UPDATE, SCL, id), \
 	SRI(SCL_F_SHARP_CONTROL, SCL, id)
 
+#define XFM_COMMON_REG_LIST_DCE80(id) \
+	XFM_COMMON_REG_LIST_DCE_BASE(id), \
+	SRI(DCFE_MEM_LIGHT_SLEEP_CNTL, CRTC, id)
+
 #define XFM_COMMON_REG_LIST_DCE100(id) \
 	XFM_COMMON_REG_LIST_DCE_BASE(id), \
 	SRI(DCFE_MEM_PWR_CTRL, CRTC, id), \
@@ -185,6 +189,12 @@
 	XFM_SF(SCL_UPDATE, SCL_COEF_UPDATE_COMPLETE, mask_sh), \
 	XFM_SF(LB_DATA_FORMAT, ALPHA_EN, mask_sh)
 
+#define XFM_COMMON_MASK_SH_LIST_DCE80(mask_sh) \
+	XFM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh), \
+	OPP_SF(DCFE_MEM_LIGHT_SLEEP_CNTL, REGAMMA_LUT_LIGHT_SLEEP_DIS, mask_sh),\
+	OPP_SF(DCFE_MEM_LIGHT_SLEEP_CNTL, DCP_LUT_LIGHT_SLEEP_DIS, mask_sh),\
+	OPP_SF(DCFE_MEM_LIGHT_SLEEP_CNTL, REGAMMA_LUT_MEM_PWR_STATE, mask_sh)
+
 #define XFM_COMMON_MASK_SH_LIST_DCE110(mask_sh) \
 	XFM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh), \
 	XFM_SF(DCFE_MEM_PWR_CTRL, SCL_COEFF_MEM_PWR_DIS, mask_sh), \
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +3 -3
index 9234086aac27..5453f02ea8ca 100644
@@ -187,7 +187,7 @@ static const struct dce_ipp_mask ipp_mask = {
 
 #define transform_regs(id)\
 [id] = {\
-		XFM_COMMON_REG_LIST_DCE_BASE(id)\
+		XFM_COMMON_REG_LIST_DCE80(id)\
 }
 
 static const struct dce_transform_registers xfm_regs[] = {
@@ -200,11 +200,11 @@ static const struct dce_transform_registers xfm_regs[] = {
 };
 
 static const struct dce_transform_shift xfm_shift = {
-		XFM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(__SHIFT)
+		XFM_COMMON_MASK_SH_LIST_DCE80(__SHIFT)
 };
 
 static const struct dce_transform_mask xfm_mask = {
-		XFM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
+		XFM_COMMON_MASK_SH_LIST_DCE80(_MASK)
 };
 
 #define aux_regs(id)\
Signature · 6 lines
2.11.0

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

PATCH 75/77 drm/amd/display: Don't spam log with failed validation

In reply to a message not in the archive

In a lot of case we fail validation of timings for legitimate reasons. No need to print an error.

Change-Id Ia5d4903debd4ab5856b0854d3d361e0811c36037
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -5
index 3b8f380edd3e..8e60e838b455 100644
@@ -2711,7 +2711,6 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
 bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
 {
 	struct dc  *core_dc = dc;
-	struct dc_context *dc_ctx = core_dc->ctx;
 	struct dc_link *link = stream->sink->link;
 	struct timing_generator *tg = core_dc->res_pool->timing_generators[0];
 	enum dc_status res = DC_OK;
@@ -2733,10 +2732,6 @@ bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
 		      link,
 		      &stream->timing);
 
-	if (res != DC_OK)
-		DC_ERROR("Failed validation for stream %p, err:%d, !\n",
-				stream, res);
-
 	return res == DC_OK;
 }
 
Signature · 6 lines
2.11.0

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

PATCH 76/77 drm/amd/display: delete dead code

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id Ibd8124dd01e6d86f1614daaba7a32be0ce98ea01
---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +3 -3
index ee1b76c074e6..1b0f64756be6 100644
@@ -1312,8 +1312,9 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc)
 {
 	struct pp_smu_funcs_rv *pp = dc->res_pool->pp_smu;
 	struct pp_smu_wm_range_sets ranges = {0};
-	int max_fclk_khz, nom_fclk_khz, min_fclk_khz, max_dcfclk_khz,
-		nom_dcfclk_khz, mid_fclk_khz, min_dcfclk_khz, socclk_khz;
+	int max_fclk_khz, nom_fclk_khz, mid_fclk_khz, min_fclk_khz;
+	int max_dcfclk_khz, min_dcfclk_khz;
+	int socclk_khz;
 	const int overdrive = 5000000; /* 5 GHz to cover Overdrive */
 	unsigned factor = (ddr4_dram_factor_single_Channel * dc->dcn_soc->number_of_channels);
 
@@ -1326,7 +1327,6 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc)
 	mid_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 * 1000000 / factor;
 	min_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 * 1000000 / 32;
 	max_dcfclk_khz = dc->dcn_soc->dcfclkv_max0p9 * 1000;
-	nom_dcfclk_khz = dc->dcn_soc->dcfclkv_nom0p8 * 1000;
 	min_dcfclk_khz = dc->dcn_soc->dcfclkv_min0p65 * 1000;
 	socclk_khz = dc->dcn_soc->socclk * 1000;
 	kernel_fpu_end();
Signature · 6 lines
2.11.0

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