DC Patches Jun 19, 2026
cover DC Patches Jun 19, 2026
This DC patchset brings improvements in multiple areas. In summary, we have:
* Fixes on DCN4, cursor, and others;
* Improvements on DPM, DCN4, DCC, and others;
* Code cleanup.
Alex Hung (1):
drm/amd/display: Remove redundant IPS mode case for DCN 4.2
Alvin Lee (1):
drm/amd/display: Update LSDMA commands to explicitly handle DCC fields
Austin Zheng (2):
drm/amd/display: Allow Per-DPM De-rates Instead Of A Single Global
Value
Add Debug Option To Enable Per-DPM De-rate Usage
Chandana G B (1):
drm/amd/display: Fix intermittently CRC open failure during active
rendering
Gabe Teeger (1):
drm/amd/display: Enable PSR and Replay on DCN4 variant and fix AUX
instance
George Shen (1):
drm/amd/display: Add flag to disable dynamic expansion for 12bpc
Harry Wentland (2):
drm/amd/display: drop redundant colorop type and TF checks drm/amd/display: split TF/LUT colorop state lookups into separate
upfront phases
Ivan Lipski (1):
drm/amd/display: Reintroduce "Force validation link training on all
ASICs"
Karen Chen (1):
drm/amd/display: Disable DPPCLK RCG to fix cursor disappearing
Leo Chen (4):
drm/amd/display: Update ONO PG Workaround for DCN42 drm/amd/display: Remove unnecessary DSCCLK enable during DSC PG drm/amd/display: Enable HUBP/DPP power gate for DCN42 drm/amd/display: Refactor Driver PG's skip PG logic
Lohita Mudimela (1):
drm/amd/display: Integrate power_helpers.c functionality into power.c.
Matthew Stewart (4):
drm/amd/display: Add dcn42b_soc_and_ip_translator drm/amd/display: Fix DCN42 null registers & register masks drm/amd/display: Rewrite dccg42_init drm/amd/display: Remove DCCG registers not needed in DCN42
Michael Strauss (1):
drm/amd/display: Add 12bpc Color Ramp Support
Piotr Maziarz (1):
drm/amd/display: Explicitly declare unsigned ints
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.64.0 drm/amd/display: Promote DC to 3.2.387
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 96 +++---- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 4 - .../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 18 -- .../gpu/drm/amd/display/dc/core/dc_resource.c | 11 +- drivers/gpu/drm/amd/display/dc/dc.h | 6 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 29 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 34 ++- drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + .../amd/display/dc/dccg/dcn42/dcn42_dccg.c | 53 ++-- .../amd/display/dc/dccg/dcn42/dcn42_dccg.h | 63 +++-- .../dc/dml/dcn31/display_mode_vba_31.c | 2 +- .../dc/dml/dcn314/display_mode_vba_314.c | 2 +- .../dml21/inc/bounding_boxes/dcn42b_soc_bb.h | 38 +++ .../dml21/inc/dml_top_soc_parameter_types.h | 13 + .../src/dml2_core/dml2_core_dcn4_calcs.c | 41 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 1 + .../drm/amd/display/dc/link/link_detection.c | 2 +- .../dc/link/protocols/link_dp_panel_replay.c | 6 +- .../link/protocols/link_edp_panel_control.c | 11 +- .../drm/amd/display/dc/opp/dcn20/dcn20_opp.c | 51 +++- .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.c | 258 +++++++++--------- .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.h | 22 +- .../dc/resource/dcn30/dcn30_resource.c | 1 - .../dc/resource/dcn302/dcn302_resource.c | 1 - .../dc/resource/dcn303/dcn303_resource.c | 1 - .../dc/resource/dcn31/dcn31_resource.c | 1 - .../dc/resource/dcn315/dcn315_resource.c | 1 - .../dc/resource/dcn316/dcn316_resource.c | 1 - .../dc/resource/dcn32/dcn32_resource.c | 1 - .../dc/resource/dcn321/dcn321_resource.c | 1 - .../dc/resource/dcn35/dcn35_resource.c | 1 - .../dc/resource/dcn351/dcn351_resource.c | 1 - .../dc/resource/dcn36/dcn36_resource.c | 1 - .../dc/resource/dcn42/dcn42_resource.c | 4 +- .../display/dc/soc_and_ip_translator/Makefile | 3 + .../dcn401/dcn401_soc_and_ip_translator.c | 16 ++ .../dcn42/dcn42_soc_and_ip_translator.c | 18 +- .../dcn42/dcn42_soc_and_ip_translator.h | 1 + .../dcn42b/dcn42b_soc_and_ip_translator.c | 42 +++ .../dcn42b/dcn42b_soc_and_ip_translator.h | 17 ++ .../soc_and_ip_translator.c | 5 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 111 +++++++- .../drm/amd/display/modules/power/Makefile | 2 +- .../gpu/drm/amd/display/modules/power/power.c | 5 + .../amd/display/modules/power/power_helpers.c | 39 --- 46 files changed, 658 insertions(+), 380 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.c create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.h delete mode 100644 drivers/gpu/drm/amd/display/modules/power/power_helpers.c
--
2.54.0
PATCH 1/24 drm/amd/display: Add dcn42b_soc_and_ip_translator
From: Matthew Stewart <[email protected]>
[why]
DCN42B was not using its own max_ip_caps table. Need to create a separate soc_and_ip_translator in order to not reuse the DCN42 one.
[how]
Separate DCN42B into its own soc_and_ip_translator.c file to handle this.
--- .../dml21/inc/bounding_boxes/dcn42b_soc_bb.h | 38 +++++++++++++++++ .../display/dc/soc_and_ip_translator/Makefile | 3 ++ .../dcn42/dcn42_soc_and_ip_translator.c | 18 +++----- .../dcn42/dcn42_soc_and_ip_translator.h | 1 + .../dcn42b/dcn42b_soc_and_ip_translator.c | 42 +++++++++++++++++++ .../dcn42b/dcn42b_soc_and_ip_translator.h | 17 ++++++++ .../soc_and_ip_translator.c | 5 ++- 7 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.c create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.h
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/dcn42b_soc_bb.h +38 -0
@@ -224,4 +224,42 @@ static const struct dml2_soc_bb dml2_socbb_dcn42b = { .max_fclk_for_uclk_dpm_khz = 2200 * 1000, }; +static const struct dml2_ip_capabilities dml2_dcn42b_max_ip_caps = { + .pipe_count =4 , + .otg_count =3 , + .num_dsc =3 , + .max_num_dp2p0_streams =3 , + .max_num_hdmi_frl_outputs =0 , + .max_num_dp2p0_outputs =2 , + .rob_buffer_size_kbytes =64 , + .config_return_buffer_size_in_kbytes =1792 , + .config_return_buffer_segment_size_in_kbytes =64 , + .meta_fifo_size_in_kentries =32 , + .compressed_buffer_segment_size_in_kbytes =64 , + .cursor_buffer_size =24 , + .max_flip_time_us =110 , + .max_flip_time_lines =50 , + .hostvm_mode =0 , + .subvp_drr_scheduling_margin_us =100 , + .subvp_prefetch_end_to_mall_start_us =15 , + .subvp_fw_processing_delay =15 , + .max_vactive_det_fill_delay_us =400 , + + .fams2 = { + .max_allow_delay_us =100 *1000 , + .scheduling_delay_us =550 , + .vertical_interrupt_ack_delay_us =40 , + .allow_programming_delay_us =18 , + .min_allow_width_us =20 , + .subvp_df_throttle_delay_us =100 , + .subvp_programming_delay_us =200 , + .subvp_prefetch_to_mall_delay_us =18 , + .drr_programming_delay_us =35 , + + .lock_timeout_us =5000 , + .recovery_timeout_us =5000 , + .flip_programming_delay_us =300 , + }, +}; +#endif
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/Makefile +3 -0
@@ -9,13 +9,16 @@ soc_and_ip_translator_rcflags := $(CC_FLAGS_NO_FPU) CFLAGS_$(AMDDALPATH)/dc/soc_and_ip_translator/dcn401/dcn401_soc_and_ip_translator.o := $(soc_and_ip_translator_ccflags) CFLAGS_$(AMDDALPATH)/dc/soc_and_ip_translator/dcn42/dcn42_soc_and_ip_translator.o := $(soc_and_ip_translator_ccflags) +CFLAGS_$(AMDDALPATH)/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.o := $(soc_and_ip_translator_ccflags) CFLAGS_REMOVE_$(AMDDALPATH)/dc/soc_and_ip_translator/dcn401/dcn401_soc_and_ip_translator.o := $(soc_and_ip_translator_rcflags) CFLAGS_REMOVE_$(AMDDALPATH)/dc/soc_and_ip_translator/dcn42/dcn42_soc_and_ip_translator.o := $(soc_and_ip_translator_rcflags) +CFLAGS_REMOVE_$(AMDDALPATH)/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.o := $(soc_and_ip_translator_rcflags) soc_and_ip_translator := soc_and_ip_translator.o soc_and_ip_translator += dcn401/dcn401_soc_and_ip_translator.o soc_and_ip_translator += dcn42/dcn42_soc_and_ip_translator.o +soc_and_ip_translator += dcn42b/dcn42b_soc_and_ip_translator.o AMD_DAL_soc_and_ip_translator := $(addprefix $(AMDDALPATH)/dc/soc_and_ip_translator/, $(soc_and_ip_translator))
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42/dcn42_soc_and_ip_translator.c +6 -12
@@ -5,22 +5,16 @@#include "dcn42_soc_and_ip_translator.h" #include "../dcn401/dcn401_soc_and_ip_translator.h" #include "bounding_boxes/dcn42_soc_bb.h" -#include "bounding_boxes/dcn42b_soc_bb.h" /* soc_and_ip_translator component used to get up-to-date values for bounding box. * Bounding box values are stored in several locations and locations can vary with DCN revision. * This component provides an interface to get DCN-specific bounding box values. */ -static void get_default_soc_bb (struct dml2_soc_bb *soc_bb,const struct dc *dc) +static void get_default_soc_bb (struct dml2_soc_bb *soc_bb) { -if (dc->ctx->dce_version ==DCN_VERSION_4_2B ) { -memcpy (soc_bb, &dml2_socbb_dcn42b,sizeof (struct dml2_soc_bb )); -memcpy (&soc_bb->qos_parameters, &dml_dcn42b_variant_a_soc_qos_params,sizeof (struct dml2_soc_qos_parameters )); - }else { -memcpy (soc_bb, &dml2_socbb_dcn42,sizeof (struct dml2_soc_bb )); -memcpy (&soc_bb->qos_parameters, &dml_dcn42_variant_a_soc_qos_params,sizeof (struct dml2_soc_qos_parameters )); - } +memcpy (soc_bb, &dml2_socbb_dcn42,sizeof (struct dml2_soc_bb )); +memcpy (&soc_bb->qos_parameters, &dml_dcn42_variant_a_soc_qos_params,sizeof (struct dml2_soc_qos_parameters )); }/*
@@ -165,7 +159,7 @@ static void dcn42_update_soc_bb_with_values_from_clk_mgr(struct dml2_soc_bb *soc } } -static void apply_soc_bb_updates (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config) +void dcn42_apply_soc_bb_updates (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config) { (void )config;/* Individual modification can be overwritten even if it was obtained by a previous function.
@@ -181,9 +175,9 @@ static void apply_soc_bb_updates(struct dml2_soc_bb *soc_bb, const struct dc *dcvoid dcn42_get_soc_bb (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config) {//get default soc_bb with static values -get_default_soc_bb (soc_bb, dc); +get_default_soc_bb (soc_bb);//update soc_bb values with more accurate values -apply_soc_bb_updates (soc_bb, dc, config); +dcn42_apply_soc_bb_updates (soc_bb, dc, config); }static void dcn42_get_ip_caps (struct dml2_ip_capabilities *ip_caps)
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42/dcn42_soc_and_ip_translator.h +1 -0
@@ -13,5 +13,6 @@void dcn42_construct_soc_and_ip_translator (struct soc_and_ip_translator *soc_and_ip_translator);void dcn42_get_soc_bb (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config); +void dcn42_apply_soc_bb_updates (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config);#endif /* _DCN42_SOC_AND_IP_TRANSLATOR_H_ */
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.c new file +42 -0
42 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.h new file +17 -0
@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +// +// Copyright 2026 Advanced Micro Devices, Inc. + +#ifndef _DCN42B_SOC_AND_IP_TRANSLATOR_H_ +#define _DCN42B_SOC_AND_IP_TRANSLATOR_H_ + +#include "core_types.h" +#include "dc.h" +#include "clk_mgr.h" +#include "dml_top_soc_parameter_types.h" +#include "soc_and_ip_translator.h" + +void dcn42b_construct_soc_and_ip_translator (struct soc_and_ip_translator *soc_and_ip_translator); +void dcn42b_get_soc_bb (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config); + +#endif /* _DCN42B_SOC_AND_IP_TRANSLATOR_H_ */
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c +4 -1
@@ -5,6 +5,7 @@#include "soc_and_ip_translator.h" #include "soc_and_ip_translator/dcn401/dcn401_soc_and_ip_translator.h" #include "soc_and_ip_translator/dcn42/dcn42_soc_and_ip_translator.h" +#include "soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.h" static void dc_construct_soc_and_ip_translator (struct soc_and_ip_translator *soc_and_ip_translator,enum dce_version dc_version)
@@ -14,9 +15,11 @@ static void dc_construct_soc_and_ip_translator(struct soc_and_ip_translator *socdcn401_construct_soc_and_ip_translator (soc_and_ip_translator);break ;case DCN_VERSION_4_2 : -case DCN_VERSION_4_2B :dcn42_construct_soc_and_ip_translator (soc_and_ip_translator);break ; +case DCN_VERSION_4_2B : +dcn42b_construct_soc_and_ip_translator (soc_and_ip_translator); +break ;default :break ; }
--
2.54.0
PATCH 2/24 drm/amd/display: Enable PSR and Replay on DCN4 variant and fix AUX instance
In reply to George ZhangFrom: Gabe Teeger <[email protected]>
[Why]
Enable PSR and Panel Replay on a DCN4 variant for display power savings. On links without native I2C (no DDC pin), the AUX channel must use aux_hw_inst to avoid NULL pointer access during PSR and Replay setup.
[How]
Enable PSR and Replay in the DCN4 variant panel config defaults. Add no_ddc_pin check in dp_setup_panel_replay(), edp_setup_freesync_replay(), and fsft_send_msg_to_fw() to use link->aux_hw_inst when dp_connector_no_native_i2c and no_ddc_pin are set.
--- .../display/dc/link/protocols/link_dp_panel_replay.c | 6 +++++- .../dc/link/protocols/link_edp_panel_control.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_replay.c +5 -1
@@ -119,7 +119,11 @@ static bool dp_setup_panel_replay(struct dc_link *link, const struct dc_stream_sif (!dp_pr_get_panel_inst (dc, link, &panel_inst))return false; - replay_context.aux_inst = link->ddc->ddc_pin->hw_info.ddc_channel; +if (dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) { + replay_context.aux_inst = (enum channel_id ) link->aux_hw_inst; + }else { + replay_context.aux_inst = link->ddc->ddc_pin->hw_info.ddc_channel; + } replay_context.digbe_inst = link->link_enc->transmitter; replay_context.digfe_inst = link->link_enc->preferred_engine;
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +8 -3
@@ -788,10 +788,11 @@ bool edp_setup_psr(struct dc_link *link, } } -if (dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) +if (dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) { psr_context->channel = (enum channel_id )link->aux_hw_inst; -else + }else { psr_context->channel = link->ddc->ddc_pin->hw_info.ddc_channel; + } psr_context->transmitterId = link->link_enc->transmitter; psr_context->engineId = link->link_enc->preferred_engine;
@@ -1024,7 +1025,11 @@ bool edp_setup_freesync_replay(struct dc_link *link, const struct dc_stream_statif (!dp_pr_get_panel_inst (dc, link, &panel_inst))return false; - replay_context.aux_inst = link->ddc->ddc_pin->hw_info.ddc_channel; +if (dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) { + replay_context.aux_inst = (enum channel_id ) link->aux_hw_inst; + }else { + replay_context.aux_inst = link->ddc->ddc_pin->hw_info.ddc_channel; + } replay_context.digbe_inst = link->link_enc->transmitter; replay_context.digfe_inst = link->link_enc->preferred_engine;
--
2.54.0
PATCH 3/24 drm/amd/display: Explicitly declare unsigned ints
In reply to George ZhangFrom: Piotr Maziarz <[email protected]>
[Why]
Some variables are expected to be, and used as unsigned.
[How]
Explicitly declare them as unsigned
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 +++++------ .../amd/display/dc/dml/dcn31/display_mode_vba_31.c | 2 +- .../amd/display/dc/dml/dcn314/display_mode_vba_314.c | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -6
@@ -4412,14 +4412,13 @@ enum dc_status dc_validate_with_context(struct dc *dc,struct dc_stream_state *unchanged_streams[MAX_PIPES ] = {0 };struct dc_stream_state *del_streams[MAX_PIPES ] = {0 };struct dc_stream_state *add_streams[MAX_PIPES ] = {0 }; -int old_stream_count = context->stream_count; +unsigned int old_stream_count = context->stream_count;enum dc_status res =DC_ERROR_UNEXPECTED ; -int unchanged_streams_count =0 ; -int del_streams_count =0 ; -int add_streams_count =0 ; +unsigned int unchanged_streams_count =0 ; +unsigned int del_streams_count =0 ; +unsigned int add_streams_count =0 ;bool found = false; -int i, j; -unsigned int k; +unsigned int i, j, k;DC_LOGGER_INIT (dc->ctx->logger);
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +1 -1
@@ -5337,7 +5337,7 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lfor (j =0 ; j <=1 ; ++j) {double VMDataOnlyReturnBWPerState;double HostVMInefficiencyFactor =1 ; -int NextPrefetchModeState = MinPrefetchMode; +unsigned int NextPrefetchModeState = MinPrefetchMode;bool UnboundedRequestEnabledThisState = false;unsigned int CompressedBufferSizeInkByteThisState =0 ;double dummy;
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +1 -1
@@ -5421,7 +5421,7 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_for (j =0 ; j <=1 ; ++j) {double VMDataOnlyReturnBWPerState;double HostVMInefficiencyFactor =1 ; -int NextPrefetchModeState = MinPrefetchMode; +unsigned int NextPrefetchModeState = MinPrefetchMode;bool UnboundedRequestEnabledThisState = false;unsigned int CompressedBufferSizeInkByteThisState =0 ;double dummy;
--
2.54.0
PATCH 4/24 drm/amd/display: Integrate power_helpers.c functionality into power.c.
In reply to George ZhangFrom: Lohita Mudimela <[email protected]>
[Why]
Reduces file fragmentation in the power module by consolidating power_helpers.c . The helper file contained minimal functionality (single utility function and shared includes) that didn't warrant a separate compilation unit, leading to increased build complexity and maintenance overhead.
[How]
Consolidated power_helpers.c content into the internal module implementation. Moved macro outside platform-specific conditional block for wider availability.
--- .../drm/amd/display/modules/power/Makefile | 2 +- .../gpu/drm/amd/display/modules/power/power.c | 5 +++ .../amd/display/modules/power/power_helpers.c | 39 ------------------- 3 files changed, 6 insertions(+), 40 deletions(-) delete mode 100644 drivers/gpu/drm/amd/display/modules/power/power_helpers.c
drivers/gpu/drm/amd/display/modules/power/Makefile +1 -1
@@ -23,7 +23,7 @@ # Makefile for the 'power' sub-module of DAL. # -MOD_POWER = power_helpers.o power.o power_abm.o power_psr.o power_replay.o +MOD_POWER = power.o power_abm.o power_psr.o power_replay.o AMD_DAL_MOD_POWER = $(addprefix $(AMDDALPATH)/modules/power/,$(MOD_POWER)) #$(info ************ DAL POWER MODULE MAKEFILE ************)
drivers/gpu/drm/amd/display/modules/power/power.c +5 -0
@@ -501,3 +501,8 @@ bool mod_power_notify_mode_change(struct mod_power *mod_power,return true; } + +bool mod_power_only_edp (const struct dc_state *context,const struct dc_stream_state *stream) +{ +return context && context->stream_count ==1 &&dc_is_embedded_signal (stream->signal); +}
drivers/gpu/drm/amd/display/modules/power/power_helpers.c deleted +0 -39
@@ -1,39 +0,0 @@ -/* Copyright 2018 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 -* -*/ - -#include "power_helpers.h" -#include "dc/inc/hw/dmcu.h" -#include "dc/inc/hw/abm.h" -#include "dc.h" -#include "core_types.h" -#include "dmub_cmd.h" - -#define DIV_ROUNDUP (a, b) (((a)+((b)/2))/(b)) -#define bswap16_based_on_endian (big_endian, value) \ - ((big_endian) ? cpu_to_be16(value) : cpu_to_le16(value)) - -bool mod_power_only_edp (const struct dc_state *context,const struct dc_stream_state *stream) -{ -return context && context->stream_count ==1 &&dc_is_embedded_signal (stream->signal); -}
--
2.54.0
PATCH 5/24 drm/amd/display: Add 12bpc Color Ramp Support
In reply to George ZhangFrom: Michael Strauss <[email protected]>
[WHY]
12bpc color ramp pattern was never implemented.
[HOW]
Add correct DPG_RAMP_CONTROL programming to match DP color ramp spec.
--- .../drm/amd/display/dc/opp/dcn20/dcn20_opp.c | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/opp/dcn20/dcn20_opp.c +25 -8
@@ -149,6 +149,9 @@ void opp2_set_disp_pattern_generator(case TEST_PATTERN_COLOR_FORMAT_BPC_10 : dst_bpc =10 ;break ; +case TEST_PATTERN_COLOR_FORMAT_BPC_12 : + dst_bpc =12 ; +break ;default : dst_bpc =8 ;break ;
@@ -192,22 +195,25 @@ void opp2_set_disp_pattern_generator(case CONTROLLER_DP_TEST_PATTERN_COLORRAMP : { - mode = (bit_depth == -TEST_PATTERN_COLOR_FORMAT_BPC_10 ? -TEST_PATTERN_MODE_DUALRAMP_RGB : -TEST_PATTERN_MODE_SINGLERAMP_RGB ); -switch (bit_depth) {case TEST_PATTERN_COLOR_FORMAT_BPC_6 : + mode =TEST_PATTERN_MODE_SINGLERAMP_RGB ; dst_bpc =6 ;break ;case TEST_PATTERN_COLOR_FORMAT_BPC_8 : + mode =TEST_PATTERN_MODE_SINGLERAMP_RGB ; dst_bpc =8 ;break ;case TEST_PATTERN_COLOR_FORMAT_BPC_10 : + mode =TEST_PATTERN_MODE_DUALRAMP_RGB ; dst_bpc =10 ;break ; +case TEST_PATTERN_COLOR_FORMAT_BPC_12 : + mode =TEST_PATTERN_MODE_DUALRAMP_RGB ; + dst_bpc =12 ; +break ;default : + mode =TEST_PATTERN_MODE_SINGLERAMP_RGB ; dst_bpc =8 ;break ; }
@@ -244,9 +250,20 @@ void opp2_set_disp_pattern_generator(case TEST_PATTERN_COLOR_FORMAT_BPC_10 : {REG_SET_3 (DPG_RAMP_CONTROL ,0 , -DPG_RAMP0_OFFSET ,384 <<6 , -DPG_INC0 , inc_base, -DPG_INC1 , inc_base +2 ); +DPG_RAMP0_OFFSET ,384 << inc_base,// 384 start point +DPG_INC0 , inc_base,// step size of 1 +DPG_INC1 , inc_base +2 );// step size of 4 (1 << 2) +REG_UPDATE_2 (DPG_CONTROL , +DPG_VRES ,5 , +DPG_HRES ,8 ); + } +break ; +case TEST_PATTERN_COLOR_FORMAT_BPC_12 : + { +REG_SET_3 (DPG_RAMP_CONTROL ,0 , +DPG_RAMP0_OFFSET ,1920 << inc_base,// 1920 start point +DPG_INC0 , inc_base,// step size of 1 +DPG_INC1 , inc_base +4 );// step size of 16 (1 << 4) REG_UPDATE_2 (DPG_CONTROL ,DPG_VRES ,5 ,DPG_HRES ,8 );
--
2.54.0
PATCH 6/24 drm/amd/display: Reintroduce "Force validation link training on all ASICs"
In reply to George ZhangFrom: Ivan Lipski <[email protected]>
[Why & How]
'skip_frl_pretraining' was introduced and enabled along w/ HDMI 2.1 initial upstream, but is causing HDMI validation link training to be s kipped on short hotplugs and compliance issues.
Remove this behaviour to force link training on all hotplugs for all ASICs.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 - drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + drivers/gpu/drm/amd/display/dc/link/link_detection.c | 2 +- drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c | 1 - .../gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c | 1 - .../gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c | 1 - drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c | 1 - .../gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c | 1 - .../gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c | 1 - drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 1 - .../gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c | 1 - drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 1 - .../gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c | 1 - drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c | 1 - 14 files changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -591,7 +591,6 @@ struct dc_config {bool enable_mipi_converter_optimization;bool enable_frl;bool force_hdmi21_frl_enc_enable; -bool skip_frl_pretraining;bool use_default_clock_table;bool force_bios_enable_lttpr;uint8_t force_bios_fixed_vs;
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
@@ -183,6 +183,7 @@ struct dc_panel_patch {unsigned int force_frl;unsigned int vsdb_rcc_wa;unsigned int delay_hdmi_link_training; +unsigned int skip_frl_pre_training;unsigned int skip_avmute;unsigned int skip_audio_sab_check;unsigned int mst_start_top_delay;
drivers/gpu/drm/amd/display/dc/link/link_detection.c +1 -1
@@ -933,7 +933,7 @@ static bool should_verify_link_capability_destructively(struct dc_link *link, destrictive = true;if (is_hdmi_frl_in_use (link)) { destrictive = false; - }else if (link->dc->config.skip_frl_pretraining) { + }else if (link->local_sink->edid_caps.panel_patch.skip_frl_pre_training) {for (i =0 ; i <MAX_PIPES ; i++) {if (pipes[i].stream !=NULL && pipes[i].stream->link == link) {
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +0 -1
@@ -2483,7 +2483,6 @@ static bool dcn30_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c +0 -1
@@ -1378,7 +1378,6 @@ static bool dcn302_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true; dc->caps.max_v_total = (1 <<15 ) -1 ;
drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c +0 -1
@@ -1322,7 +1322,6 @@ static bool dcn303_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true; dc->caps.max_v_total = (1 <<15 ) -1 ;
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +0 -1
@@ -2081,7 +2081,6 @@ static bool dcn31_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +0 -1
@@ -2057,7 +2057,6 @@ static bool dcn315_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c +0 -1
@@ -1931,7 +1931,6 @@ static bool dcn316_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +0 -1
@@ -2409,7 +2409,6 @@ static bool dcn32_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +0 -1
@@ -1901,7 +1901,6 @@ static bool dcn321_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +0 -1
@@ -2031,7 +2031,6 @@ static bool dcn35_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +0 -1
@@ -2004,7 +2004,6 @@ static bool dcn351_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true;
drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c +0 -1
@@ -2001,7 +2001,6 @@ static bool dcn36_resource_construct(if (dc->config.forceHBR2CP2520) dc->caps.force_dp_tps4_for_cp2520 = false; dc->caps.hdmi_hpo = true; - dc->config.skip_frl_pretraining = true; dc->caps.dp_hpo = true; dc->caps.dp_hdmi21_pcon_support = true;
--
2.54.0
PATCH 7/24 drm/amd/display: Fix DCN42 null registers & register masks
In reply to George ZhangFrom: Matthew Stewart <[email protected]>
[why]
The register lists used on DCN42 variants are different. Some reused codepaths are trying to access registers not used.
[how]
Add DISPCLK_FREQ_CHANGECNTL, HUBPREQ_DEBUG, and HDMISTREAMCLK_CNTL to the register lists.
--- drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.h +2 -2
@@ -46,6 +46,7 @@DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DCCG_FIFO_ERRDET_STATE , mask_sh),\DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DCCG_FIFO_ERRDET_OVR_EN , mask_sh),\DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DISPCLK_CHG_FWD_CORR_DISABLE , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,RESYNC_FIFO_LEVEL_ADJUST_EN , mask_sh),\DCCG_SF (DPPCLK0_DTO_PARAM ,DPPCLK0_DTO_PHASE , mask_sh),\DCCG_SF (DPPCLK0_DTO_PARAM ,DPPCLK0_DTO_MODULO , mask_sh),\ DCCG_SF(HDMICHARCLK0_CLOCK_CNTL, HDMICHARCLK0_EN, mask_sh),\
@@ -239,8 +240,7 @@DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_SRC_SEL , mask_sh),\DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_CLOCK_ENABLE , mask_sh),\DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_FE_EN , mask_sh),\ -DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_FE_SRC_SEL , mask_sh),\ - DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, RESYNC_FIFO_LEVEL_ADJUST_EN, mask_sh) + DCCG_SF(SYMCLKE_CLOCK_ENABLE, SYMCLKE_FE_SRC_SEL, mask_sh) void dccg42_otg_add_pixel(struct dccg *dccg,
--
2.54.0
PATCH 8/24 drm/amd/display: Rewrite dccg42_init
In reply to George ZhangFrom: Matthew Stewart <[email protected]>
[why]
DCN42 reuses dccg42_init, which causes problems due to undefined masks.
[how]
- Read res_pool to determine the quantities of the respective resources
- Remove the physymclk root_clock_optimization check, as it seems like it shouldn't do anything (defaults to disabled already).
--- .../amd/display/dc/dccg/dcn42/dcn42_dccg.c | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c +9 -20
@@ -269,37 +269,26 @@ void dccg42_trigger_dio_fifo_resync(struct dccg *dccg)static void dccg42_init (struct dccg *dccg) { -int otg_inst; -struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); +unsigned int i; +struct resource_pool *res_pool = dccg->ctx->dc->res_pool;/* Set HPO stream encoder to use refclk to avoid case where PHY is * disabled and SYMCLK32 for HPO SE is sourced from PHYD32CLK which * will cause DCN to hang. */ -for (otg_inst =0 ; otg_inst <4 ; otg_inst++) -dccg35_disable_symclk32_se (dccg, otg_inst); +for (i =0 ; i < res_pool->hpo_dp_stream_enc_count; i++) +dccg35_disable_symclk32_se (dccg, i);if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_le) { -dccg401_disable_symclk32_le (dccg,0 ); -dccg401_disable_symclk32_le (dccg,1 ); -dccg401_disable_symclk32_le (dccg,2 ); -dccg401_disable_symclk32_le (dccg,3 ); +for (i =0 ; i < res_pool->hpo_dp_link_enc_count; i++) +dccg401_disable_symclk32_le (dccg, i); }if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpstream) { -dccg401_disable_dpstreamclk (dccg,0 ); -dccg401_disable_dpstreamclk (dccg,1 ); -dccg401_disable_dpstreamclk (dccg,2 ); -dccg401_disable_dpstreamclk (dccg,3 ); - } -if (!dccg->ctx->dc->debug.root_clock_optimization.bits.physymclk) { -REG_UPDATE_5 (DCCG_GATE_DISABLE_CNTL2 , -PHYASYMCLK_ROOT_GATE_DISABLE ,1 , -PHYBSYMCLK_ROOT_GATE_DISABLE ,1 , -PHYCSYMCLK_ROOT_GATE_DISABLE ,1 , -PHYDSYMCLK_ROOT_GATE_DISABLE ,1 , -PHYESYMCLK_ROOT_GATE_DISABLE ,1 ); +for (i =0 ; i < res_pool->hpo_dp_stream_enc_count; i++) +dccg401_disable_dpstreamclk (dccg, i); } +dccg42_disable_hdmistreamclk (dccg);if (dccg->ctx->dc->debug.root_clock_optimization.bits.hdmichar)dccg42_disable_hdmicharclk (dccg,0 );
--
2.54.0
PATCH 9/24 drm/amd/display: Remove DCCG registers not needed in DCN42
In reply to George ZhangFrom: Matthew Stewart <[email protected]>
[why]
Some resources that exist in the DCN block are not needed and shouldn't be used.
[how]
Remove defines from register lists.
--- .../amd/display/dc/dccg/dcn42/dcn42_dccg.h | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.h +30 -32
@@ -57,34 +57,24 @@DCCG_SF (PHYBSYMCLK_CLOCK_CNTL ,PHYBSYMCLK_SRC_SEL , mask_sh),\DCCG_SF (PHYCSYMCLK_CLOCK_CNTL ,PHYCSYMCLK_EN , mask_sh),\DCCG_SF (PHYCSYMCLK_CLOCK_CNTL ,PHYCSYMCLK_SRC_SEL , mask_sh),\ -DCCG_SF (PHYDSYMCLK_CLOCK_CNTL ,PHYDSYMCLK_EN , mask_sh),\ -DCCG_SF (PHYDSYMCLK_CLOCK_CNTL ,PHYDSYMCLK_SRC_SEL , mask_sh),\DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK0_EN , mask_sh),\DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK1_EN , mask_sh),\DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK2_EN , mask_sh),\ -DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK3_EN , mask_sh),\DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK0_SRC_SEL , mask_sh),\DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK1_SRC_SEL , mask_sh),\DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK2_SRC_SEL , mask_sh),\ -DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK3_SRC_SEL , mask_sh),\DCCG_SF (HDMISTREAMCLK_CNTL ,HDMISTREAMCLK0_EN , mask_sh),\DCCG_SF (HDMISTREAMCLK_CNTL ,HDMISTREAMCLK0_SRC_SEL , mask_sh),\DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE0_SRC_SEL , mask_sh),\DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE1_SRC_SEL , mask_sh),\DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE2_SRC_SEL , mask_sh),\ -DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE3_SRC_SEL , mask_sh),\DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE0_EN , mask_sh),\DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE1_EN , mask_sh),\DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE2_EN , mask_sh),\ -DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE3_EN , mask_sh),\DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE0_SRC_SEL , mask_sh),\DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE1_SRC_SEL , mask_sh),\ -DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE2_SRC_SEL , mask_sh),\ -DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE3_SRC_SEL , mask_sh),\DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE0_EN , mask_sh),\DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE1_EN , mask_sh),\ -DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE2_EN , mask_sh),\ -DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE3_EN , mask_sh),\DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,PIPE ,DTO_SRC_SEL ,0 , mask_sh),\DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,PIPE ,DTO_SRC_SEL ,1 , mask_sh),\ DCCG_SFII(OTG, PIXEL_RATE_CNTL, PIPE, DTO_SRC_SEL, 2, mask_sh),\
@@ -122,7 +112,6 @@DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYASYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYBSYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYCSYMCLK_ROOT_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYDSYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GLOBAL_FGCG_REP_CNTL ,DCCG_GLOBAL_FGCG_REP_DIS , mask_sh),\DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,DP_DTO ,ENABLE ,0 , mask_sh),\ DCCG_SFII(OTG, PIXEL_RATE_CNTL, DP_DTO, ENABLE, 1, mask_sh),\
@@ -135,7 +124,6 @@DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK0_EN , mask_sh),\DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK1_EN , mask_sh),\DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK2_EN , mask_sh),\ -DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK3_EN , mask_sh),\DCCG_SF (DSCCLK0_DTO_PARAM ,DSCCLK0_DTO_PHASE , mask_sh),\DCCG_SF (DSCCLK0_DTO_PARAM ,DSCCLK0_DTO_MODULO , mask_sh),\ DCCG_SF(DSCCLK1_DTO_PARAM, DSCCLK1_DTO_PHASE, mask_sh),\
@@ -148,36 +136,26 @@DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKA_FE_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKB_FE_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKC_FE_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKD_FE_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKA_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKB_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKC_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKD_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYASYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYBSYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYCSYMCLK_ROOT_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYDSYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE1_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE2_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE3_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE1_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE2_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE3_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE1_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE2_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE3_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE1_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE2_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE3_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,HDMICHARCLK0_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,PHYA_REFCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,PHYB_REFCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,PHYC_REFCLK_ROOT_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,PHYD_REFCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DTBCLK_P0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DTBCLK_P1_GATE_DISABLE , mask_sh),\ DCCG_SF(DCCG_GATE_DISABLE_CNTL5, DTBCLK_P2_GATE_DISABLE, mask_sh),\
@@ -185,19 +163,15 @@DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKA_FE_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKB_FE_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKC_FE_ROOT_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKD_FE_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKA_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKB_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKC_ROOT_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKD_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK0_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK1_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK2_ROOT_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK3_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK1_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK2_GATE_DISABLE , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK3_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL6 ,DSCCLK0_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL6 ,DSCCLK1_ROOT_GATE_DISABLE , mask_sh),\ DCCG_SF(DCCG_GATE_DISABLE_CNTL6, DSCCLK2_ROOT_GATE_DISABLE, mask_sh),\
@@ -209,26 +183,38 @@DCCG_SF (SYMCLKA_CLOCK_ENABLE ,SYMCLKA_CLOCK_ENABLE , mask_sh),\DCCG_SF (SYMCLKB_CLOCK_ENABLE ,SYMCLKB_CLOCK_ENABLE , mask_sh),\DCCG_SF (SYMCLKC_CLOCK_ENABLE ,SYMCLKC_CLOCK_ENABLE , mask_sh),\ -DCCG_SF (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_CLOCK_ENABLE , mask_sh),\DCCG_SF (SYMCLKA_CLOCK_ENABLE ,SYMCLKA_FE_EN , mask_sh),\DCCG_SF (SYMCLKB_CLOCK_ENABLE ,SYMCLKB_FE_EN , mask_sh),\DCCG_SF (SYMCLKC_CLOCK_ENABLE ,SYMCLKC_FE_EN , mask_sh),\ -DCCG_SF (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_FE_EN , mask_sh),\DCCG_SF (SYMCLKA_CLOCK_ENABLE ,SYMCLKA_FE_SRC_SEL , mask_sh),\DCCG_SF (SYMCLKB_CLOCK_ENABLE ,SYMCLKB_FE_SRC_SEL , mask_sh),\ -DCCG_SF (SYMCLKC_CLOCK_ENABLE ,SYMCLKC_FE_SRC_SEL , mask_sh),\ - DCCG_SF(SYMCLKD_CLOCK_ENABLE, SYMCLKD_FE_SRC_SEL, mask_sh) + DCCG_SF(SYMCLKC_CLOCK_ENABLE, SYMCLKC_FE_SRC_SEL, mask_sh) #define DCCG_MASK_SH_LIST_DCN42(mask_sh) \DCCG_MASK_SH_LIST_DCN42_COMMON (mask_sh),\ +DCCG_SF (PHYDSYMCLK_CLOCK_CNTL ,PHYDSYMCLK_EN , mask_sh),\ +DCCG_SF (PHYDSYMCLK_CLOCK_CNTL ,PHYDSYMCLK_SRC_SEL , mask_sh),\DCCG_SF (PHYESYMCLK_CLOCK_CNTL ,PHYESYMCLK_EN , mask_sh),\DCCG_SF (PHYESYMCLK_CLOCK_CNTL ,PHYESYMCLK_SRC_SEL , mask_sh),\DCCG_SF (HDMISTREAMCLK0_DTO_PARAM ,HDMISTREAMCLK0_DTO_PHASE , mask_sh),\DCCG_SF (HDMISTREAMCLK0_DTO_PARAM ,HDMISTREAMCLK0_DTO_MODULO , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYDSYMCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYESYMCLK_ROOT_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKD_FE_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,SYMCLKD_GATE_DISABLE , mask_sh),\DCCG_SF (DSCCLK3_DTO_PARAM ,DSCCLK3_DTO_PHASE , mask_sh),\DCCG_SF (DSCCLK3_DTO_PARAM ,DSCCLK3_DTO_MODULO , mask_sh),\ -DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYESYMCLK_ROOT_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE3_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE2_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE3_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE3_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE2_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE3_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKD_FE_ROOT_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKD_ROOT_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK3_ROOT_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,DPSTREAMCLK3_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,PHYD_REFCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL4 ,PHYE_REFCLK_ROOT_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKE_FE_ROOT_GATE_DISABLE , mask_sh),\ DCCG_SF(DCCG_GATE_DISABLE_CNTL5, SYMCLKE_ROOT_GATE_DISABLE, mask_sh),\
@@ -237,10 +223,22 @@DCCG_SF (SYMCLKB_CLOCK_ENABLE ,SYMCLKB_SRC_SEL , mask_sh),\DCCG_SF (SYMCLKC_CLOCK_ENABLE ,SYMCLKC_SRC_SEL , mask_sh),\DCCG_SF (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_SRC_SEL , mask_sh),\ +DCCG_SF (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_CLOCK_ENABLE , mask_sh),\ +DCCG_SF (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_FE_EN , mask_sh),\ +DCCG_SF (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_FE_SRC_SEL , mask_sh),\DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_SRC_SEL , mask_sh),\DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_CLOCK_ENABLE , mask_sh),\DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_FE_EN , mask_sh),\ - DCCG_SF(SYMCLKE_CLOCK_ENABLE, SYMCLKE_FE_SRC_SEL, mask_sh) +DCCG_SF (SYMCLKE_CLOCK_ENABLE ,SYMCLKE_FE_SRC_SEL , mask_sh),\ +DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE3_SRC_SEL , mask_sh),\ +DCCG_SF (SYMCLK32_SE_CNTL ,SYMCLK32_SE3_EN , mask_sh),\ +DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE2_SRC_SEL , mask_sh),\ +DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE3_SRC_SEL , mask_sh),\ +DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE2_EN , mask_sh),\ +DCCG_SF (SYMCLK32_LE_CNTL ,SYMCLK32_LE3_EN , mask_sh),\ +DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK3_EN , mask_sh),\ +DCCG_SF (DPSTREAMCLK_CNTL ,DPSTREAMCLK3_SRC_SEL , mask_sh),\ + DCCG_SF(DSCCLK_DTO_CTRL, DSCCLK3_EN, mask_sh) void dccg42_otg_add_pixel(struct dccg *dccg,
--
2.54.0
PATCH 10/24 drm/amd/display: drop redundant colorop type and TF checks
In reply to George ZhangFrom: Harry Wentland <[email protected]>
DRM core builds the curve_1d_type enum property with only the supported TF values, so any curve_1d_type that reaches atomic_commit is already guaranteed to be in the supported set. The per-colorop type field is immutable — it cannot change between the loop that finds colorop_state and the if block that uses it, so re-checking colorop->type there is dead code.
Remove the redundant checks:
- colorop->type == DRM_COLOROP_1D_CURVE in the shaper TF if block
- colorop->type == DRM_COLOROP_1D_LUT in the shaper LUT if block
- colorop->type == DRM_COLOROP_1D_CURVE in the blend TF if block
- colorop->type == DRM_COLOROP_1D_LUT in the blend LUT if block
- BIT(colorop_state->curve_1d_type) & supported_blnd_tfs in the blend TF if block (already guaranteed by the loop filter)
- BIT(colorop_state->curve_1d_type) & supported_blnd_tfs in the blend LUT if block (nonsensical: a 1D_LUT colorop has no curve_1d_type)
No functional change.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +4 -6
@@ -1660,7 +1660,7 @@ __set_dm_plane_colorop_shaper(struct drm_plane_state *plane_state, } } -if (colorop_state && !colorop_state->bypass && colorop->type ==DRM_COLOROP_1D_CURVE ) { +if (colorop_state && !colorop_state->bypass) {drm_dbg (dev,"Shaper TF colorop with ID: %d\n" , colorop->base.id); tf->type =TF_TYPE_DISTRIBUTED_POINTS ; tf->tf = default_tf =amdgpu_colorop_tf_to_dc_tf (colorop_state->curve_1d_type);
@@ -1687,7 +1687,7 @@ __set_dm_plane_colorop_shaper(struct drm_plane_state *plane_state, } } -if (colorop_state && !colorop_state->bypass && colorop->type ==DRM_COLOROP_1D_LUT ) { +if (colorop_state && !colorop_state->bypass) {drm_dbg (dev,"Shaper LUT colorop with ID: %d\n" , colorop->base.id); tf->type =TF_TYPE_DISTRIBUTED_POINTS ; tf->tf = default_tf;
@@ -1833,8 +1833,7 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state, } } -if (colorop_state && !colorop_state->bypass && colorop->type ==DRM_COLOROP_1D_CURVE && - (BIT (colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) { +if (colorop_state && !colorop_state->bypass) {drm_dbg (dev,"Blend TF colorop with ID: %d\n" , colorop->base.id); tf->type =TF_TYPE_DISTRIBUTED_POINTS ; tf->tf = default_tf =amdgpu_colorop_tf_to_dc_tf (colorop_state->curve_1d_type);
@@ -1859,8 +1858,7 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state, } } -if (colorop_state && !colorop_state->bypass && colorop->type ==DRM_COLOROP_1D_LUT && - (BIT (colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) { +if (colorop_state && !colorop_state->bypass) {drm_dbg (dev,"Blend LUT colorop with ID: %d\n" , colorop->base.id); tf->type =TF_TYPE_DISTRIBUTED_POINTS ; tf->tf = default_tf;
--
2.54.0
PATCH 11/24 drm/amd/display: split TF/LUT colorop state lookups into separate upfront phases
In reply to George ZhangFrom: Harry Wentland <[email protected]>
In __set_dm_plane_colorop_shaper and __set_dm_plane_colorop_blend the single colorop_state variable was reused sequentially: first to capture the TF state, then (after mutating the colorop pointer) to capture the LUT state.
Split into separate tf_state / lut_state pointers and introduce a dedicated lut_colorop local. Resolve both pointers upfront before any computation begins. This separates the concern of "find the states" from "use the states" and makes the code easier to follow.
No functional change.
--- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 94 ++++++++++--------- 1 file changed, 48 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +48 -46
@@ -1640,8 +1640,10 @@ __set_dm_plane_colorop_shaper(struct drm_plane_state *plane_state, struct drm_colorop *colorop) {struct drm_colorop *old_colorop; -struct drm_colorop_state *colorop_state =NULL , *new_colorop_state; +struct drm_colorop_state *new_colorop_state; +struct drm_colorop_state *tf_state =NULL , *lut_state =NULL ;struct drm_atomic_state *state = plane_state->state; +struct drm_colorop *lut_colorop;enum dc_transfer_func_predefined default_tf =TRANSFER_FUNCTION_LINEAR ;struct dc_transfer_func *tf = &dc_plane_state->cm.shaper_func;const struct drm_color_lut32 *shaper_lut;
@@ -1650,53 +1652,52 @@ __set_dm_plane_colorop_shaper(struct drm_plane_state *plane_state,u32 shaper_size;int i =0 , ret =0 ; -/* 1D Curve - SHAPER TF */ +/* 1D Curve - SHAPER TF: find state */ old_colorop = colorop;for_each_new_colorop_in_state (state, colorop, new_colorop_state, i) {if (new_colorop_state->colorop == old_colorop && (BIT (new_colorop_state->curve_1d_type) & amdgpu_dm_supported_shaper_tfs)) { - colorop_state = new_colorop_state; + tf_state = new_colorop_state;break ; } } -if (colorop_state && !colorop_state->bypass) { -drm_dbg (dev,"Shaper TF colorop with ID: %d\n" , colorop->base.id); - tf->type =TF_TYPE_DISTRIBUTED_POINTS ; - tf->tf = default_tf =amdgpu_colorop_tf_to_dc_tf (colorop_state->curve_1d_type); - tf->sdr_ref_white_level =SDR_WHITE_LEVEL_INIT_VALUE ; - ret =__set_output_tf (tf,0 ,0 , false); -if (ret) -return ret; - enabled = true; - } - -/* 1D LUT - SHAPER LUT */ - colorop = old_colorop->next; -if (!colorop) { +/* 1D LUT - SHAPER LUT: find state */ + lut_colorop = old_colorop->next; +if (!lut_colorop) {drm_dbg (dev,"no Shaper LUT colorop found\n" );return -EINVAL ; } - old_colorop = colorop;for_each_new_colorop_in_state (state, colorop, new_colorop_state, i) { -if (new_colorop_state->colorop == old_colorop && +if (new_colorop_state->colorop == lut_colorop && new_colorop_state->colorop->type ==DRM_COLOROP_1D_LUT ) { - colorop_state = new_colorop_state; + lut_state = new_colorop_state;break ; } } -if (colorop_state && !colorop_state->bypass) { -drm_dbg (dev,"Shaper LUT colorop with ID: %d\n" , colorop->base.id); +if (tf_state && !tf_state->bypass) { +drm_dbg (dev,"Shaper TF colorop with ID: %d\n" , old_colorop->base.id); + tf->type =TF_TYPE_DISTRIBUTED_POINTS ; + tf->tf = default_tf =amdgpu_colorop_tf_to_dc_tf (tf_state->curve_1d_type); + tf->sdr_ref_white_level =SDR_WHITE_LEVEL_INIT_VALUE ; + ret =__set_output_tf (tf,0 ,0 , false); +if (ret) +return ret; + enabled = true; + } + +if (lut_state && !lut_state->bypass) { +drm_dbg (dev,"Shaper LUT colorop with ID: %d\n" , lut_colorop->base.id); tf->type =TF_TYPE_DISTRIBUTED_POINTS ; tf->tf = default_tf; tf->sdr_ref_white_level =SDR_WHITE_LEVEL_INIT_VALUE ; - shaper_lut =__extract_blob_lut32 (colorop_state->data, &shaper_size); + shaper_lut =__extract_blob_lut32 (lut_state->data, &shaper_size); shaper_size = shaper_lut !=NULL ? shaper_size :0 ;/* Custom LUT size must be the same as supported size */ -if (shaper_size == colorop->size) { +if (shaper_size == lut_colorop->size) { ret =__set_output_tf_32 (tf, shaper_lut, shaper_size, false);if (ret)return ret;
@@ -1812,8 +1813,10 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state, struct drm_colorop *colorop) {struct drm_colorop *old_colorop; -struct drm_colorop_state *colorop_state =NULL , *new_colorop_state; +struct drm_colorop_state *new_colorop_state; +struct drm_colorop_state *tf_state =NULL , *lut_state =NULL ;struct drm_atomic_state *state = plane_state->state; +struct drm_colorop *lut_colorop;enum dc_transfer_func_predefined default_tf =TRANSFER_FUNCTION_LINEAR ;struct dc_transfer_func *tf = &dc_plane_state->cm.blend_func;const struct drm_color_lut32 *blend_lut =NULL ;
@@ -1823,52 +1826,51 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state, dc_plane_state->cm.flags.bits.blend_enable =0 ; -/* 1D Curve - BLND TF */ +/* 1D Curve - BLND TF: find state */ old_colorop = colorop;for_each_new_colorop_in_state (state, colorop, new_colorop_state, i) {if (new_colorop_state->colorop == old_colorop && (BIT (new_colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) { - colorop_state = new_colorop_state; + tf_state = new_colorop_state;break ; } } -if (colorop_state && !colorop_state->bypass) { -drm_dbg (dev,"Blend TF colorop with ID: %d\n" , colorop->base.id); - tf->type =TF_TYPE_DISTRIBUTED_POINTS ; - tf->tf = default_tf =amdgpu_colorop_tf_to_dc_tf (colorop_state->curve_1d_type); - tf->sdr_ref_white_level =SDR_WHITE_LEVEL_INIT_VALUE ; - dc_plane_state->cm.flags.bits.blend_enable =1 ; -__set_input_tf_32 (NULL , tf, blend_lut, blend_size); - } - -/* 1D Curve - BLND LUT */ - colorop = old_colorop->next; -if (!colorop) { +/* 1D LUT - BLND LUT: find state */ + lut_colorop = old_colorop->next; +if (!lut_colorop) {drm_dbg (dev,"no Blend LUT colorop found\n" );return -EINVAL ; } - old_colorop = colorop;for_each_new_colorop_in_state (state, colorop, new_colorop_state, i) { -if (new_colorop_state->colorop == old_colorop && +if (new_colorop_state->colorop == lut_colorop && new_colorop_state->colorop->type ==DRM_COLOROP_1D_LUT ) { - colorop_state = new_colorop_state; + lut_state = new_colorop_state;break ; } } -if (colorop_state && !colorop_state->bypass) { -drm_dbg (dev,"Blend LUT colorop with ID: %d\n" , colorop->base.id); +if (tf_state && !tf_state->bypass) { +drm_dbg (dev,"Blend TF colorop with ID: %d\n" , old_colorop->base.id); + tf->type =TF_TYPE_DISTRIBUTED_POINTS ; + tf->tf = default_tf =amdgpu_colorop_tf_to_dc_tf (tf_state->curve_1d_type); + tf->sdr_ref_white_level =SDR_WHITE_LEVEL_INIT_VALUE ; + dc_plane_state->cm.flags.bits.blend_enable =1 ; +__set_input_tf_32 (NULL , tf, blend_lut, blend_size); + } + +if (lut_state && !lut_state->bypass) { +drm_dbg (dev,"Blend LUT colorop with ID: %d\n" , lut_colorop->base.id); tf->type =TF_TYPE_DISTRIBUTED_POINTS ; tf->tf = default_tf; tf->sdr_ref_white_level =SDR_WHITE_LEVEL_INIT_VALUE ; dc_plane_state->cm.flags.bits.blend_enable =1 ; - blend_lut =__extract_blob_lut32 (colorop_state->data, &blend_size); + blend_lut =__extract_blob_lut32 (lut_state->data, &blend_size); blend_size = blend_lut !=NULL ? blend_size :0 ;/* Custom LUT size must be the same as supported size */ -if (blend_size == colorop->size) +if (blend_size == lut_colorop->size)__set_input_tf_32 (NULL , tf, blend_lut, blend_size); }
--
2.54.0
PATCH 12/24 drm/amd/display: Disable DPPCLK RCG to fix cursor disappearing
In reply to George ZhangFrom: Karen Chen <[email protected]>
[Why & How]
DPP clock is gated when programming the cursor. This change disables DPPCLK RCG in dccg42_init before accessing DPP, ensuring cursor programming latches correctly.
--- drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c +6 -0
@@ -292,6 +292,12 @@ static void dccg42_init(struct dccg *dccg)dccg42_disable_hdmistreamclk (dccg);if (dccg->ctx->dc->debug.root_clock_optimization.bits.hdmichar)dccg42_disable_hdmicharclk (dccg,0 ); + +if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpp) { +for (i =0 ; i < res_pool->pipe_count; i++) { +dccg35_dpp_root_clock_control (dccg, i, true); + } + } }
--
2.54.0
PATCH 13/24 drm/amd/display: Allow Per-DPM De-rates Instead Of A Single Global Value
In reply to George ZhangFrom: Austin Zheng <[email protected]>
[Why]
Currently only a singular de-rate is used for all DPM levels.
The intent was to limit the bandwidth utilization at high DPMs
so the display requirements are not competing with other engines for bandwidth. At lower DPMs, the de-rates could be more lenient so more bandwidth can be utilized without the need to increase the DPM level and result in potential power savings. i.e. DPM0 could be achieved on certain display configs instead of DPM1
if de-rates were a couple percentage points higher
The system average de-rates can be adjusted as needed as only urgent de-rates are defined for the SOC.
[How]
Update QOS parameters to have a table of derates with a per-DPM granularity If the per-DPM value is provided, that will value be used. Otherwise use the global value if there is no DPM specific value.
--- .../dml21/inc/dml_top_soc_parameter_types.h | 13 ++++++ .../src/dml2_core/dml2_core_dcn4_calcs.c | 41 +++++++++++++------ 2 files changed, 41 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/dml_top_soc_parameter_types.h +13 -0
@@ -71,8 +71,21 @@ enum dml2_qos_param_type {dml2_qos_param_type_dcn4x }; +//Indicies mapped to DPM level +// Unpopulated indicies should fallback to the global derate value. +struct dml2_soc_derate_values_per_dpm { +unsigned int dram_derate_percent_pixel[DML_MAX_CLK_TABLE_SIZE ]; +unsigned int fclk_derate_percent[DML_MAX_CLK_TABLE_SIZE ]; +unsigned int dcfclk_derate_percent[DML_MAX_CLK_TABLE_SIZE ]; +}; + +struct dml2_soc_derates_per_dpm { +struct dml2_soc_derate_values_per_dpm system_active_derates_per_dpm; +}; +struct dml2_soc_qos_parameters {struct dml2_soc_derates derate_table; +struct dml2_soc_derates_per_dpm derate_table_per_dpm;struct {unsigned int base_latency_us;unsigned int scaling_factor_us;
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +28 -13
98 lines not on this page · raw message
--
2.54.0
PATCH 14/24 drm/amd/display: Fix intermittently CRC open failure during active rendering
In reply to George ZhangFrom: Chandana G B <[email protected]>
[Why]
Opening the CRC data file during active rendering can fail with -EINVAL.
Closing the CRC data file with ctrl+C (which will send SIGINT to the kernel and if the wait thread in sleep, kernel will send the -ERESTARTSYS to the wait_for_completion_interruptible_timeout)
resulting in intermittently getting -ERESTARTSYS. which will just do the clean up without releasing the vblank reference causing -EINVAL while opening the crc data file in the next iteration
[How]
Ignoring the ERESTARTSYS as this is a return value for the wait_for_completion_interruptible_timeout()
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1 -1
@@ -681,7 +681,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)*/ ret =wait_for_completion_interruptible_timeout ( &commit->hw_done,10 *HZ ); -if (ret <0 ) +if (ret <0 && ret != -ERESTARTSYS ) goto cleanup;if (ret ==0 ) {
--
2.54.0
PATCH 15/24 drm/amd/display: Add flag to disable dynamic expansion for 12bpc
In reply to George ZhangFrom: George Shen <[email protected]>
[Why]
Dynamic expansion is not needed when outputting 12bpc test patterns.
[How]
Add a debug flag to control disabling dynamic expansion in the case of 12bpc test patterns.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/opp/dcn20/dcn20_opp.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1288,6 +1288,7 @@ struct dc_debug_options {unsigned int force_odm2to1_for_edp_pixclk_mhz;bool enable_replay_esd_recovery;uint8_t iommu_mismatch_temp_wka; +bool disable_dynamic_expansion_for_test_pattern; };
drivers/gpu/drm/amd/display/dc/opp/dcn20/dcn20_opp.c +18 -0
@@ -89,6 +89,24 @@ void opp2_set_disp_pattern_generator(break ; } +if (opp->ctx->dc->debug.disable_dynamic_expansion_for_test_pattern) { +switch (test_pattern) { +case CONTROLLER_DP_TEST_PATTERN_COLORSQUARES : +case CONTROLLER_DP_TEST_PATTERN_COLORSQUARES_CEA : +case CONTROLLER_DP_TEST_PATTERN_VERTICALBARS : +case CONTROLLER_DP_TEST_PATTERN_HORIZONTALBARS : +case CONTROLLER_DP_TEST_PATTERN_COLORRAMP : +if (color_depth ==COLOR_DEPTH_121212 ) +REG_UPDATE (FMT_DYNAMIC_EXP_CNTL ,FMT_DYNAMIC_EXP_EN ,0 ); +break ; +case CONTROLLER_DP_TEST_PATTERN_VIDEOMODE : +REG_UPDATE (FMT_DYNAMIC_EXP_CNTL ,FMT_DYNAMIC_EXP_EN ,1 ); +break ; +default : +break ; + } + } +/* set DPG dimentions */ REG_SET_2(DPG_DIMENSIONS, 0, DPG_ACTIVE_WIDTH, width,
--
2.54.0
PATCH 16/24 drm/amd/display: Update LSDMA commands to explicitly handle DCC fields
In reply to George ZhangFrom: Alvin Lee <[email protected]>
[Description]
- Previously linear copy commands for LSDMA assumed no DCC
- Update so that there is explicit assignment for DCC related fields
- Caller can 0 out the fields if DCC is not used
- For linear copy command don't subtract 1 from the count - this will be done at a lower layer
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 29 ++++++++++++----- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 34 +++++++++++++++++--- 2 files changed, 51 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +21 -8
@@ -2125,9 +2125,7 @@ bool dmub_lsdma_init(struct dc_dmub_srv *dc_dmub_srv)bool dmub_lsdma_send_linear_copy_command (struct dc_dmub_srv *dc_dmub_srv, -uint64_t src_addr, -uint64_t dst_addr, -uint32_t count +struct lsdma_linear_copy_params copy_data ) {struct dc_context *dc_ctx = dc_dmub_srv->ctx;
@@ -2142,11 +2140,20 @@ bool dmub_lsdma_send_linear_copy_command( cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_LINEAR_COPY ; wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; - lsdma_data->u.linear_copy_data.count = count -1 ;// LSDMA controller expects bytes to copy -1 - lsdma_data->u.linear_copy_data.src_lo = src_addr &0xFFFFFFFF ; - lsdma_data->u.linear_copy_data.src_hi = (src_addr >>32 ) &0xFFFFFFFF ; - lsdma_data->u.linear_copy_data.dst_lo = dst_addr &0xFFFFFFFF ; - lsdma_data->u.linear_copy_data.dst_hi = (dst_addr >>32 ) &0xFFFFFFFF ; + lsdma_data->u.linear_copy_data.count = copy_data.count; + lsdma_data->u.linear_copy_data.src_lo = copy_data.src_lo; + lsdma_data->u.linear_copy_data.src_hi = copy_data.src_hi; + lsdma_data->u.linear_copy_data.dst_lo = copy_data.dst_lo; + lsdma_data->u.linear_copy_data.dst_hi = copy_data.dst_hi; + lsdma_data->u.linear_copy_data.tmz = copy_data.tmz; + lsdma_data->u.linear_copy_data.data_format = copy_data.data_format; + lsdma_data->u.linear_copy_data.num_type = copy_data.num_type; + lsdma_data->u.linear_copy_data.read_compress = copy_data.read_compress; + lsdma_data->u.linear_copy_data.write_compress = copy_data.write_compress; + lsdma_data->u.linear_copy_data.max_com = copy_data.max_com; + lsdma_data->u.linear_copy_data.max_uncom = copy_data.max_uncom; + lsdma_data->u.linear_copy_data.cache_policy_src = copy_data.cache_policy_src; + lsdma_data->u.linear_copy_data.cache_policy_dst = copy_data.cache_policy_dst; result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type);
@@ -2191,6 +2198,12 @@ bool dmub_lsdma_send_linear_sub_window_copy_command( lsdma_data->u.linear_sub_window_copy_data.rect_y = copy_data.rect_y; lsdma_data->u.linear_sub_window_copy_data.src_cache_policy = copy_data.src_cache_policy; lsdma_data->u.linear_sub_window_copy_data.dst_cache_policy = copy_data.dst_cache_policy; + lsdma_data->u.linear_sub_window_copy_data.data_format = copy_data.data_format; + lsdma_data->u.linear_sub_window_copy_data.num_type = copy_data.num_type; + lsdma_data->u.linear_sub_window_copy_data.read_compress = copy_data.read_compress; + lsdma_data->u.linear_sub_window_copy_data.write_compress = copy_data.write_compress; + lsdma_data->u.linear_sub_window_copy_data.max_com = copy_data.max_com; + lsdma_data->u.linear_sub_window_copy_data.max_uncom = copy_data.max_uncom; result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type);
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +30 -4
@@ -203,11 +203,31 @@ void dc_dmub_srv_fams2_passthrough_flip( int surface_count);bool dmub_lsdma_init (struct dc_dmub_srv *dc_dmub_srv); + +struct lsdma_linear_copy_params { +uint32_t src_lo; +uint32_t src_hi; + +uint32_t dst_lo; +uint32_t dst_hi; + +uint32_t count :30 ; +uint32_t read_compress :2 ; + +uint32_t tmz :4 ; +uint32_t cache_policy_src :3 ; +uint32_t cache_policy_dst :3 ; +uint32_t data_format :6 ; +uint32_t num_type :3 ; +uint32_t write_compress :2 ; +uint32_t max_com :2 ; +uint32_t max_uncom :1 ; +uint32_t reserved0 :8 ; +}; +bool dmub_lsdma_send_linear_copy_command (struct dc_dmub_srv *dc_dmub_srv, -uint64_t src_addr, -uint64_t dst_addr, -uint32_t count); +struct lsdma_linear_copy_params copy_data);struct lsdma_linear_sub_window_copy_params {uint32_t src_lo;
@@ -235,7 +255,13 @@ struct lsdma_linear_sub_window_copy_params { uint32_t element_size : 3; uint32_t src_cache_policy : 3; uint32_t dst_cache_policy : 3; - uint32_t padding : 19; + uint32_t data_format : 6; + uint32_t num_type : 3; + uint32_t read_compress : 2; + uint32_t write_compress : 2; + uint32_t max_com : 2; + uint32_t max_uncom : 1; + uint32_t reserved0 : 3; }; bool dmub_lsdma_send_linear_sub_window_copy_command(
--
2.54.0
PATCH 17/24 drm/amd/display: Update ONO PG Workaround for DCN42
In reply to George ZhangFrom: Leo Chen <[email protected]>
[Why & How]
There is an updated workaround for PG Repeater issue in DCN42. This PR is addressing the dynamic power gating use cases (Driver PG) to align with the new sequence.
--- .../amd/display/dc/dccg/dcn42/dcn42_dccg.c | 18 +++- .../amd/display/dc/dccg/dcn42/dcn42_dccg.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 1 + .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.c | 97 +++++++++++++------ .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.h | 22 ++++- 5 files changed, 99 insertions(+), 40 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c +14 -4
@@ -77,7 +77,7 @@ void dccg42_otg_drop_pixel(struct dccg *dccg, } } -void dccg42_enable_global_fgcg (struct dccg *dccg,bool value) +void dccg42_enable_global_fgcg (struct dccg *dccg,bool enable) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);
@@ -85,9 +85,18 @@ void dccg42_enable_global_fgcg(struct dccg *dccg, bool value)* Fine grain control via bit2 of debug flag. */ if (dccg->ctx->dc->debug.disable_clock_gate || (dccg->ctx->dc->debug.iommu_mismatch_temp_wka &0x4 )) - value = false; + enable = false; -REG_UPDATE (DCCG_GLOBAL_FGCG_REP_CNTL ,DCCG_GLOBAL_FGCG_REP_DIS , !value); +REG_UPDATE (DCCG_GLOBAL_FGCG_REP_CNTL ,DCCG_GLOBAL_FGCG_REP_DIS , !enable); +} + +bool dccg42_get_global_fgcg_status (struct dccg *dccg) +{ +struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); +uint32_t disabled =0 ; + +REG_GET (DCCG_GLOBAL_FGCG_REP_CNTL ,DCCG_GLOBAL_FGCG_REP_DIS , &disabled); +return disabled &0x1 ; } void dccg42_set_physymclk(
@@ -339,7 +348,8 @@ static const struct dccg_funcs dccg42_funcs = { .dccg_root_gate_disable_control = dccg35_root_gate_disable_control, .dccg_read_reg_state = dccg31_read_reg_state, .dccg_enable_global_fgcg = dccg42_enable_global_fgcg, - .allow_clock_gating = dccg2_allow_clock_gating + .allow_clock_gating = dccg2_allow_clock_gating, + .dccg_get_global_fgcg_status = dccg42_get_global_fgcg_status, }; struct dccg *dccg42_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.h +1 -0
@@ -247,6 +247,7 @@ void dccg42_otg_add_pixel(struct dccg *dccg,void dccg42_otg_drop_pixel (struct dccg *dccg,uint32_t otg_inst);void dccg42_enable_global_fgcg (struct dccg *dccg,bool value); +bool dccg42_get_global_fgcg_status (struct dccg *dccg); void dccg42_set_physymclk( struct dccg *dccg,
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +1 -0
@@ -348,6 +348,7 @@ struct dccg_funcs {void (*dccg_root_gate_disable_control)(struct dccg *dccg,uint32_t pipe_idx,uint32_t disable_clock_gating);void (*dccg_read_reg_state)(struct dccg *dccg,struct dcn_dccg_reg_state *dccg_reg_state);void (*dccg_enable_global_fgcg)(struct dccg *dccg,bool enable); + bool (*dccg_get_global_fgcg_status)(struct dccg *dccg); };#endif //__DAL_DCCG_H__
drivers/gpu/drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.c +65 -32
170 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.h +18 -4
@@ -34,7 +34,9 @@SR (DOMAIN24_PG_STATUS ), \SR (DOMAIN25_PG_STATUS ), \SR (DOMAIN26_PG_STATUS ), \ - SR(DC_IP_REQUEST_CNTL) +SR (DC_IP_REQUEST_CNTL ), \ +SR (DMU_CLK_CNTL ), \ + SR(AZ_CLOCK_CNTL)#define PG_CNTL_REG_LIST_DCN42B ()\ SR(DOMAIN0_PG_CONFIG), \
@@ -63,7 +65,9 @@SR (DOMAIN24_PG_STATUS ), \SR (DOMAIN25_PG_STATUS ), \SR (DOMAIN26_PG_STATUS ), \ - SR(DC_IP_REQUEST_CNTL) +SR (DC_IP_REQUEST_CNTL ), \ +SR (DMU_CLK_CNTL ), \ + SR(AZ_CLOCK_CNTL)#define PG_CNTL_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix
@@ -121,7 +125,9 @@PG_CNTL_SF (DOMAIN25_PG_STATUS ,DOMAIN_PGFSM_PWR_STATUS , mask_sh), \PG_CNTL_SF (DOMAIN26_PG_STATUS ,DOMAIN_DESIRED_PWR_STATE , mask_sh), \PG_CNTL_SF (DOMAIN26_PG_STATUS ,DOMAIN_PGFSM_PWR_STATUS , mask_sh), \ -PG_CNTL_SF (DC_IP_REQUEST_CNTL ,IP_REQUEST_EN , mask_sh) +PG_CNTL_SF (DC_IP_REQUEST_CNTL ,IP_REQUEST_EN , mask_sh), \ +PG_CNTL_SF (DMU_CLK_CNTL ,LONO_FGCG_REP_DIS , mask_sh), \ +PG_CNTL_SF (AZ_CLOCK_CNTL ,AZ_GLOBAL_FGCG_REP_DIS , mask_sh)/* Not in DCN42B: * PG_CNTL_SF(DOMAIN19_PG_CONFIG, DOMAIN_POWER_FORCEON, mask_sh),
@@ -178,7 +184,9 @@PG_CNTL_SF (DOMAIN25_PG_STATUS ,DOMAIN_PGFSM_PWR_STATUS , mask_sh), \PG_CNTL_SF (DOMAIN26_PG_STATUS ,DOMAIN_DESIRED_PWR_STATE , mask_sh), \PG_CNTL_SF (DOMAIN26_PG_STATUS ,DOMAIN_PGFSM_PWR_STATUS , mask_sh), \ - PG_CNTL_SF(DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh) +PG_CNTL_SF (DC_IP_REQUEST_CNTL ,IP_REQUEST_EN , mask_sh), \ +PG_CNTL_SF (DMU_CLK_CNTL ,LONO_FGCG_REP_DIS , mask_sh), \ + PG_CNTL_SF(AZ_CLOCK_CNTL, AZ_GLOBAL_FGCG_REP_DIS, mask_sh)struct pg_cntl_shift {uint8_t IP_REQUEST_EN;
@@ -186,6 +194,8 @@ struct pg_cntl_shift {uint8_t DOMAIN_POWER_GATE ;uint8_t DOMAIN_DESIRED_PWR_STATE ;uint8_t DOMAIN_PGFSM_PWR_STATUS ; +uint8_t LONO_FGCG_REP_DIS ; +uint8_t AZ_GLOBAL_FGCG_REP_DIS ; };struct pg_cntl_mask {uint32_t IP_REQUEST_EN;
@@ -193,6 +203,8 @@ struct pg_cntl_mask {uint32_t DOMAIN_POWER_GATE ;uint32_t DOMAIN_DESIRED_PWR_STATE ;uint32_t DOMAIN_PGFSM_PWR_STATUS ; +uint32_t LONO_FGCG_REP_DIS ; +uint32_t AZ_GLOBAL_FGCG_REP_DIS ; };struct pg_cntl_registers {
@@ -224,6 +236,8 @@ struct pg_cntl_registers {uint32_t DOMAIN24_PG_STATUS ;uint32_t DOMAIN25_PG_STATUS ;uint32_t DOMAIN26_PG_STATUS ; +uint32_t DMU_CLK_CNTL ; +uint32_t AZ_CLOCK_CNTL ; };struct dcn_pg_cntl {
--
2.54.0
PATCH 18/24 drm/amd/display: Remove unnecessary DSCCLK enable during DSC PG
In reply to George ZhangFrom: Leo Chen <[email protected]>
[Why & How]
DSCCLK is not required when power gating or ungating the DSC block. Remove the unnecessary DSCCLK enable sequence.
--- .../gpu/drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/gpu/drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.c +0 -11
@@ -96,11 +96,6 @@ void pg_cntl42_dsc_pg_control(struct pg_cntl *pg_cntl, unsigned int dsc_inst, bostruct dcn42_global_fgcg_rep_state fgcg_rep_state = {0 };bool block_enabled; -/*need to enable dscclk regardless DSC_PG*/ -if (pg_cntl->ctx->dc->res_pool->dccg->funcs->enable_dsc && power_on) - pg_cntl->ctx->dc->res_pool->dccg->funcs->enable_dsc ( - pg_cntl->ctx->dc->res_pool->dccg, dsc_inst); -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || pg_cntl->ctx->dc->debug.disable_dsc_power_gate || pg_cntl->ctx->dc->idle_optimizations_allowed;
@@ -167,12 +162,6 @@ void pg_cntl42_dsc_pg_control(struct pg_cntl *pg_cntl, unsigned int dsc_inst, boif (dsc_inst <MAX_PIPES ) pg_cntl->pg_pipe_res_enable[PG_DSC ][dsc_inst] = power_on; - -if (pg_cntl->ctx->dc->res_pool->dccg->funcs->disable_dsc && !power_on) { -/*this is to disable dscclk*/ - pg_cntl->ctx->dc->res_pool->dccg->funcs->disable_dsc ( - pg_cntl->ctx->dc->res_pool->dccg, dsc_inst); - } }static bool pg_cntl42_hubp_dpp_pg_status (struct pg_cntl *pg_cntl,unsigned int hubp_dpp_inst)
--
2.54.0
PATCH 19/24 drm/amd/display: Enable HUBP/DPP power gate for DCN42
In reply to George ZhangFrom: Leo Chen <[email protected]>
[Why & How]
Enable Driver PG for HUBP and DPP in DCN42.
--- .../gpu/drm/amd/display/dc/resource/dcn42/dcn42_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/resource/dcn42/dcn42_resource.c +2 -2
@@ -729,8 +729,8 @@ static const struct dc_debug_options debug_defaults_drv = { .clock_trace = true, .disable_pplib_clock_request = false, .ignore_pg = false, - .disable_dpp_power_gate = true, - .disable_hubp_power_gate = true, + .disable_dpp_power_gate = false, + .disable_hubp_power_gate = false, .disable_optc_power_gate = true, .disable_dsc_power_gate = false, .disable_dio_power_gate = true,
--
2.54.0
PATCH 20/24 drm/amd/display: Refactor Driver PG's skip PG logic
In reply to George ZhangFrom: Leo Chen <[email protected]>
[Why & How]
When driver allows idle optimization, no HW state should be modified further by DC. Refactor the skip PG logic in pg_cntl in DCN42.
--- .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.c | 150 +++++++----------- 1 file changed, 60 insertions(+), 90 deletions(-)
drivers/gpu/drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.c +60 -90
@@ -61,6 +61,21 @@ static void pg_cntl42_restore_global_fgcg_rep(struct pg_cntl *pg_cntl,REG_UPDATE (AZ_CLOCK_CNTL ,AZ_GLOBAL_FGCG_REP_DIS , state->az_rep_fgcg); } +static bool should_skip_pg_control (bool dc_in_idle_opt,bool power_on,bool block_enabled) +{ +if (dc_in_idle_opt) +return true; + +if (power_on && block_enabled) +return true; + +if (!power_on && !block_enabled) +return true; + +return false; +} + +static bool pg_cntl42_dsc_pg_status (struct pg_cntl *pg_cntl,unsigned int dsc_inst) {struct dcn_pg_cntl *pg_cntl_dcn =TO_DCN_PG_CNTL (pg_cntl);
@@ -94,23 +109,14 @@ void pg_cntl42_dsc_pg_control(struct pg_cntl *pg_cntl, unsigned int dsc_inst, bouint32_t pwr_status = power_on ?0 :2 ;uint32_t org_ip_request_cntl =0 ;struct dcn42_global_fgcg_rep_state fgcg_rep_state = {0 }; -bool block_enabled; - -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->debug.disable_dsc_power_gate || - pg_cntl->ctx->dc->idle_optimizations_allowed; +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || pg_cntl->ctx->dc->debug.disable_dsc_power_gate; -if (skip_pg && !power_on) +if (block_pg_disabled && !power_on)return ; - block_enabled =pg_cntl42_dsc_pg_status (pg_cntl, dsc_inst); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - } +bool block_enabled =pg_cntl42_dsc_pg_status (pg_cntl, dsc_inst); +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled)) +return ;REG_GET (DC_IP_REQUEST_CNTL ,IP_REQUEST_EN , &org_ip_request_cntl);if (org_ip_request_cntl ==0 )
@@ -201,23 +207,16 @@ void pg_cntl42_hubp_dpp_pg_control(struct pg_cntl *pg_cntl, unsigned int hubp_dpuint32_t pwr_status = power_on ?0 :2 ;uint32_t org_ip_request_cntl;struct dcn42_global_fgcg_rep_state fgcg_rep_state = {0 }; -bool block_enabled; -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->debug.disable_hubp_power_gate || - pg_cntl->ctx->dc->debug.disable_dpp_power_gate || - pg_cntl->ctx->dc->idle_optimizations_allowed; +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || + pg_cntl->ctx->dc->debug.disable_hubp_power_gate || + pg_cntl->ctx->dc->debug.disable_dpp_power_gate; -if (skip_pg && !power_on) +if (block_pg_disabled && !power_on)return ; - block_enabled =pg_cntl42_hubp_dpp_pg_status (pg_cntl, hubp_dpp_inst); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - } +bool block_enabled =pg_cntl42_hubp_dpp_pg_status (pg_cntl, hubp_dpp_inst); +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled)) +return ;REG_GET (DC_IP_REQUEST_CNTL ,IP_REQUEST_EN , &org_ip_request_cntl);if (org_ip_request_cntl ==0 )
@@ -283,22 +282,17 @@ void pg_cntl42_hpo_pg_control(struct pg_cntl *pg_cntl, bool power_on)uint32_t org_ip_request_cntl;uint32_t power_forceon;struct dcn42_global_fgcg_rep_state fgcg_rep_state = {0 }; -bool block_enabled; -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->debug.disable_hpo_power_gate || - pg_cntl->ctx->dc->idle_optimizations_allowed; +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || + pg_cntl->ctx->dc->debug.disable_hpo_power_gate; -if (skip_pg && !power_on) +if (block_pg_disabled && !power_on) +return ; + +bool block_enabled =pg_cntl42_hpo_pg_status (pg_cntl); + +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled))return ; - block_enabled =pg_cntl42_hpo_pg_status (pg_cntl); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - }REG_GET (DOMAIN25_PG_CONFIG ,DOMAIN_POWER_FORCEON , &power_forceon);if (power_forceon)
@@ -337,23 +331,17 @@ void pg_cntl42_io_clk_pg_control(struct pg_cntl *pg_cntl, bool power_on)uint32_t pwr_status = power_on ?0 :2 ;uint32_t org_ip_request_cntl;uint32_t power_forceon; -bool block_enabled; -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->idle_optimizations_allowed || +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || pg_cntl->ctx->dc->debug.disable_io_clk_power_gate; -if (skip_pg && !power_on) +if (block_pg_disabled && !power_on)return ; - block_enabled =pg_cntl42_io_clk_status (pg_cntl); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - } +bool block_enabled =pg_cntl42_io_clk_status (pg_cntl); + +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled)) +return ;REG_GET (DOMAIN22_PG_CONFIG ,DOMAIN_POWER_FORCEON , &power_forceon);if (power_forceon)
@@ -435,24 +423,16 @@ void pg_cntl42_mem_pg_control(struct pg_cntl *pg_cntl, bool power_on)uint32_t pwr_status = power_on ?0 :2 ;uint32_t org_ip_request_cntl;uint32_t power_forceon; -bool block_enabled; -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->idle_optimizations_allowed || +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || pg_cntl->ctx->dc->debug.disable_mem_power_gate; -if (skip_pg && !power_on) +if (block_pg_disabled && !power_on)return ; - block_enabled =pg_cntl42_mem_status (pg_cntl); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - } - +bool block_enabled =pg_cntl42_mem_status (pg_cntl); +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled)) +return ;REG_GET (DOMAIN23_PG_CONFIG ,DOMAIN_POWER_FORCEON , &power_forceon);if (power_forceon)return ;
@@ -490,22 +470,16 @@ void pg_cntl42_dio_pg_control(struct pg_cntl *pg_cntl, bool power_on)uint32_t pwr_status = power_on ?0 :2 ;uint32_t org_ip_request_cntl;struct dcn42_global_fgcg_rep_state fgcg_rep_state = {0 }; -bool block_enabled; -bool skip_pg = pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->idle_optimizations_allowed || +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || pg_cntl->ctx->dc->debug.disable_dio_power_gate; -if (skip_pg && !power_on) + +if (block_pg_disabled && !power_on)return ; - block_enabled =pg_cntl42_dio_pg_status (pg_cntl); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - } +bool block_enabled =pg_cntl42_dio_pg_status (pg_cntl); +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled)) +return ;REG_GET (DC_IP_REQUEST_CNTL ,IP_REQUEST_EN , &org_ip_request_cntl);if (org_ip_request_cntl ==0 )
@@ -531,23 +505,19 @@ void pg_cntl42_plane_otg_pg_control(struct pg_cntl *pg_cntl, bool power_on)uint32_t pwr_status = power_on ?0 :2 ;uint32_t org_ip_request_cntl;unsigned int i; -bool block_enabled;bool all_mpcc_disabled = true, all_opp_disabled = true;bool all_optc_disabled = true, all_stream_disabled = true; -if (pg_cntl->ctx->dc->debug.ignore_pg || - pg_cntl->ctx->dc->debug.disable_optc_power_gate || - pg_cntl->ctx->dc->idle_optimizations_allowed) +bool block_pg_disabled = pg_cntl->ctx->dc->debug.ignore_pg || + pg_cntl->ctx->dc->debug.disable_optc_power_gate; + +if (block_pg_disabled && !power_on)return ; - block_enabled =pg_cntl42_plane_otg_status (pg_cntl); -if (power_on) { -if (block_enabled) -return ; - }else { -if (!block_enabled) -return ; - } +bool block_enabled =pg_cntl42_plane_otg_status (pg_cntl); + +if (should_skip_pg_control (pg_cntl->ctx->dc->idle_optimizations_allowed, power_on, block_enabled)) +return ;for (i =0 ; i < pg_cntl->ctx->dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe_ctx = &pg_cntl->ctx->dc->current_state->res_ctx.pipe_ctx[i];
--
2.54.0
PATCH 21/24 Add Debug Option To Enable Per-DPM De-rate Usage
In reply to George ZhangFrom: Austin Zheng <[email protected]>
[Why]
DML has been updated to use per-DPM derates when provided but per-DPM de-rates have not been finalized. Need to validate to see what values should be stored in the bounding box.
[How]
Add debug options to set custom derates per DPM (starting at DPM0) and their values
Each entry in the custom derate expects the derates to be stored in the following format:
bits 0-7: dram_derate_percent_pixel
bits 8-15: fclk_derate_percent
bits 16-23: dcfclk_derate_percent
bits 24-31 are unused.
e.g. Using the value 0x414020 will set the following derates for DPM0
DPM0: 0x20, 0x40, 0x41 for dram, fclk, and dcfclk respectively
Note that global derate value will be used if the per-DPM derate is 0.
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ .../dcn401/dcn401_soc_and_ip_translator.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -1289,6 +1289,8 @@ struct dc_debug_options {bool enable_replay_esd_recovery;uint8_t iommu_mismatch_temp_wka;bool disable_dynamic_expansion_for_test_pattern; +uint32_t dml21_custom_derate_num_dpms; +uint32_t dml21_custom_derate_at_dpm[DML2_MAX_NUM_DPM_LVL ]; };
drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn401/dcn401_soc_and_ip_translator.c +16 -0
@@ -269,6 +269,22 @@ void dcn401_update_soc_bb_with_values_from_software_policy(struct dml2_soc_bb *sif (dc->bb_overrides.sr_enter_plus_exit_z8_time_ns) soc_bb->power_management_parameters.z8_stutter_enter_plus_exit_latency_us = dc->bb_overrides.sr_enter_plus_exit_z8_time_ns /1000.0 ; + +/* Override per-dpm derates based on a custom derate table. +* Global derate value will be used for derates that aren't populated +* 3 derates for a single DPM level: +* bits 0-7: dram_derate_percent_pixel +* bits 8-15: fclk_derate_percent +* bits 16-23: dcfclk_derate_percent +*/ +for (unsigned int i =0 ; i < dc->debug.dml21_custom_derate_num_dpms; i++) { + soc_bb->qos_parameters.derate_table_per_dpm.system_active_derates_per_dpm.dram_derate_percent_pixel[i] + = dc->debug.dml21_custom_derate_at_dpm[i] &0xFF ; + soc_bb->qos_parameters.derate_table_per_dpm.system_active_derates_per_dpm.fclk_derate_percent[i] + = (dc->debug.dml21_custom_derate_at_dpm[i] >>8 ) &0xFF ; + soc_bb->qos_parameters.derate_table_per_dpm.system_active_derates_per_dpm.dcfclk_derate_percent[i] + = (dc->debug.dml21_custom_derate_at_dpm[i] >>16 ) &0xFF ; + } }static void apply_soc_bb_updates (struct dml2_soc_bb *soc_bb,const struct dc *dc,const struct dml2_configuration_options *config)
--
2.54.0
PATCH 22/24 drm/amd/display: [FW Promotion] Release 0.1.64.0
In reply to George ZhangFrom: Taimur Hassan <[email protected]>
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 111 +++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +109 -2
@@ -246,14 +246,14 @@* OS/FW agnostic memcpy */ #ifndef dmub_memcpy -#define dmub_memcpy (dest, source, bytes) memcpy((dest), (source), (bytes)) +#define dmub_memcpy (dest, source, bytes) (void)memcpy((dest), (source), (bytes))#endif /** * OS/FW agnostic memset */ #ifndef dmub_memset -#define dmub_memset (dest, val, bytes) memset((dest), (val), (bytes)) +#define dmub_memset (dest, val, bytes) (void)memset((dest), (val), (bytes))#endif /**
@@ -1702,6 +1702,17 @@ enum dmub_gpint_command {* ARGS: 1 - Power off */ DMUB_GPINT__PANEL_POWER_OFF_SEQ =138 , +/** +* DESC: Gets panel polarity bias. +* ARGS: 0 - Get panel polarity bias +*/ +DMUB_GPINT__PANEL_POLARITY_GET_BIAS =139 , +/** +* DESC: Enables panel polarity. +* ARGS: 0 - Disable panel polarity +* 1 - Enable panel polarity +*/ + DMUB_GPINT__PANEL_POLARITY_DEBUG_ENABLE = 140, };/**
@@ -1956,6 +1967,11 @@ enum dmub_cmd_type {*/ DMUB_CMD__BOOT_TIME_CRC =96 , +/** +* Command type use for all Panel Polarity commands. +*/ + DMUB_CMD__PANEL_POLARITY = 97, +/** * Command type use for VBIOS shared commands. */
@@ -4365,6 +4381,15 @@ enum dmub_cmd_replay_type { DMUB_CMD__REPLAY_SET_GENERAL_CMD = 16, }; +/* +* Panel Polarity sub-types +*/ +enum dmub_cmd_panel_polarity_type { +DMUB_CMD__PANEL_POLARITY_ENABLE =0 , +DMUB_CMD__PANEL_POLARITY_GET_BIAS =1 , +DMUB_CMD__PANEL_POLARITY_RESET =2 , +}; +/* * Panel Replay sub-types */
@@ -7031,6 +7056,80 @@ struct dmub_cmd_pr_enable_data {uint8_t pad[2 ]; }; +struct dmub_cmd_panel_polarity_enable_data { +/** +* Panel Polarity enable or disable. +*/ +uint8_t enable; +/** +* OTG instance +*/ +uint8_t otg_inst; +/** +* @pad: Align structure to 4 byte boundary. +*/ +uint8_t pad[2 ]; +}; + +struct dmub_cmd_panel_polarity_reset_data { +/** +* OTG instance +*/ +uint8_t otg_inst; +/** +* @pad: Align structure to 4 byte boundary. +*/ +uint8_t pad[3 ]; +}; + +struct dmub_cmd_panel_polarity_get_bias_input { +/** +* OTG instance +*/ +uint8_t otg_inst; +uint8_t pad[3 ]; +}; + +struct dmub_cmd_panel_polarity_get_bias_output { +/** +* Accumulated Polarity Bias +*/ +int32_t accumulated_bias; +}; + +struct dmub_rb_cmd_panel_polarity_enable { +/** +* Command header. +*/ +struct dmub_cmd_header header; + +struct dmub_cmd_panel_polarity_enable_data data; +}; + + +struct dmub_rb_cmd_panel_polarity_get_bias { +/** +* Command header. +*/ +struct dmub_cmd_header header; + +union dmub_cmd_panel_polarity_get_bias_data { +struct dmub_cmd_panel_polarity_get_bias_input input;/**< Input */ +struct dmub_cmd_panel_polarity_get_bias_output output;/**< Output */ +uint32_t output_raw;/**< Raw data output */ + } data; +}; + +struct dmub_rb_cmd_panel_polarity_reset { +/** +* Command header. +*/ +struct dmub_cmd_header header; + +struct dmub_cmd_panel_polarity_reset_data data; +}; + +/** * Definition of a DMUB_CMD__PR_ENABLE command. * Panel Replay enable/disable is controlled using action in data.
@@ -7646,6 +7745,7 @@ union dmub_rb_cmd {struct dmub_rb_cmd_pr_update_state pr_update_state;struct dmub_rb_cmd_pr_general_cmd pr_general_cmd; +/** * Definition of a DMUB_CMD__IHC command. */
@@ -7654,6 +7754,13 @@ union dmub_rb_cmd {* Definition of a DMUB_CMD__BOOT_TIME_CRC_INIT command. */ struct dmub_rb_cmd_boot_time_crc_init boot_time_crc_init; + +/** +* Definition of a DMUB_CMD__PANEL_POLARITY_ENABLE command. +*/ +struct dmub_rb_cmd_panel_polarity_enable panel_polarity_enable; +struct dmub_rb_cmd_panel_polarity_get_bias panel_polarity_get_bias; +struct dmub_rb_cmd_panel_polarity_reset panel_polarity_reset; };/**
--
2.54.0
PATCH 23/24 drm/amd/display: Promote DC to 3.2.387
In reply to George ZhangFrom: Taimur Hassan <[email protected]>
This DC patchset brings improvements in multiple areas. In summary, we have:
* Fixes on DCN42, cursor, and others;
* Improvements on DPM, DCN4, DCC, and others;
* Code cleanup.
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -65,7 +65,7 @@ struct dcn_dsc_reg_state;struct dcn_optc_reg_state ;struct dcn_dccg_reg_state ; -#define DC_VER "3.2.386" +#define DC_VER "3.2.387"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
--
2.54.0
PATCH 24/24 drm/amd/display: Remove redundant IPS mode case for DCN 4.2
In reply to George ZhangFrom: Alex Hung <[email protected]>
[WHAT]
Remove the redundant IP_VERSION(4, 2, 0) case from dm_get_default_ips_mode() since it only reassigns the same DMUB_IPS_ENABLE value already set at initialization.
Also remove the corresponding KUnit test.
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 4 ---- .../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 18 ------------------ 2 files changed, 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c +0 -4
@@ -453,10 +453,6 @@ enum dmub_ips_disable_type dm_get_default_ips_mode(case IP_VERSION (3 ,5 ,1 ): ret =DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF ;break ; -case IP_VERSION (4 ,2 ,0 ): -case IP_VERSION (4 ,2 ,1 ): - ret =DMUB_IPS_ENABLE ; -break ;default :/* ASICs older than DCN35 do not have IPSs */ if (amdgpu_ip_version (adev,DCE_HWIP ,0 ) <IP_VERSION (3 ,5 ,0 ))
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c +0 -18
@@ -350,23 +350,6 @@ static void dm_test_get_default_ips_mode_dcn36(struct kunit *test) DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF); } -/** -* dm_test_get_default_ips_mode_dcn42 - Test Get default ips mode dcn42 -* @test: The KUnit test context -*/ -static void dm_test_get_default_ips_mode_dcn42 (struct kunit *test) -{ -struct amdgpu_device *adev; - - adev =kunit_kzalloc (test,sizeof (*adev),GFP_KERNEL ); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, adev); - - adev->ip_versions[DCE_HWIP ][0 ] =IP_VERSION (4 ,2 ,0 ); - -KUNIT_EXPECT_EQ (test,dm_get_default_ips_mode (adev), -DMUB_IPS_DISABLE_ALL ); -} -/** * dm_test_get_default_ips_mode_older_than_dcn35 - Test Get default ips mode older than dcn35 * @test: The KUnit test context
@@ -572,7 +555,6 @@ static struct kunit_case amdgpu_dm_dmub_tests[] = {KUNIT_CASE (dm_test_get_default_ips_mode_dcn35),KUNIT_CASE (dm_test_get_default_ips_mode_dcn351),KUNIT_CASE (dm_test_get_default_ips_mode_dcn36), -KUNIT_CASE (dm_test_get_default_ips_mode_dcn42),KUNIT_CASE (dm_test_get_default_ips_mode_older_than_dcn35), KUNIT_CASE(dm_test_get_default_ips_mode_newer_default),/* dm_dmub_hw_init() */
--
2.54.0
Public
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types. This week was also the last promotion test ran on Ubuntu 24.04. There won't be any testing this week as we had a holiday this past Monday, so the first test on Ubuntu 26.04 will begin next week.
APU
• Single Display eDP -> 1080p 60hz, 1920x1200 165hz, 3840x2400 60hz
• Single Display DP (SST DSC) -> 4k144hz, 4k240hz
• Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
• Thunderbolt -> LG Ultrafine 5k
• MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
• USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
• SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
• MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
• Single Display DP (SST DSC) -> 4k144hz, 4k240hz
• Multiple Display DP -> 4k240hz + 4k144hz
• MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
• MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
• Changing display configurations and settings
• Video/Audio playback
• Benchmark testing
• Suspend/Resume testing
• Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
• Script testing (scripts to automate some of the manual checks)
• IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
• Samsung G8 Neo 4k240hz
• Samsung QN55QN95B 4k 120hz
• Acer XV322QKKV 4k144hz
• HP U27 4k Wireless 4k60hz
• LG 27UD58B 4k60hz
• LG 32UN650WA 4k60hz
• LG Ultrafine 5k 5k60hz
• AU Optronics B140HAN01.1 1080p 60hz eDP
• AU Optronics B160UAN01.J 1920x1200 165hz eDP
• Samsung ATNA60YV02-0 3840x2400 60Hz OLED eDP
The patchset consists of the amd-staging-drm-next branch (Head commit -> c08a3dc2b7ba7b4a0dd930fa5e58f8f1aab068cc -> drm/amd/display: Add dcn42b_soc_and_ip_translator) with new patches added on top of it.
Tested on Ubuntu 26.04.4, on Wayland and X11, using Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: Zhang, George <[email protected]>
Sent: Friday, June 19, 2026 9:21 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>; Wu, Ray <[email protected]>; LIPSKI, IVAN <[email protected]>; Hung, Alex <[email protected]>; Lin, Ping Lei <[email protected]>; Chen, Chen-Yu <[email protected]>; Zhang, George <[email protected]>
Subject: [PATCH 00/24] DC Patches Jun 19, 2026
This DC patchset brings improvements in multiple areas. In summary, we have:
* Fixes on DCN4, cursor, and others;
* Improvements on DPM, DCN4, DCC, and others;
* Code cleanup.
Alex Hung (1):
drm/amd/display: Remove redundant IPS mode case for DCN 4.2
Alvin Lee (1):
drm/amd/display: Update LSDMA commands to explicitly handle DCC fields
Austin Zheng (2):
drm/amd/display: Allow Per-DPM De-rates Instead Of A Single Global
Value
Add Debug Option To Enable Per-DPM De-rate Usage
Chandana G B (1):
drm/amd/display: Fix intermittently CRC open failure during active
rendering
Gabe Teeger (1):
drm/amd/display: Enable PSR and Replay on DCN4 variant and fix AUX
instance
George Shen (1):
drm/amd/display: Add flag to disable dynamic expansion for 12bpc
Harry Wentland (2):
drm/amd/display: drop redundant colorop type and TF checks drm/amd/display: split TF/LUT colorop state lookups into separate
upfront phases
Ivan Lipski (1):
drm/amd/display: Reintroduce "Force validation link training on all
ASICs"
Karen Chen (1):
drm/amd/display: Disable DPPCLK RCG to fix cursor disappearing
Leo Chen (4):
drm/amd/display: Update ONO PG Workaround for DCN42 drm/amd/display: Remove unnecessary DSCCLK enable during DSC PG drm/amd/display: Enable HUBP/DPP power gate for DCN42 drm/amd/display: Refactor Driver PG's skip PG logic
Lohita Mudimela (1):
drm/amd/display: Integrate power_helpers.c functionality into power.c.
Matthew Stewart (4):
drm/amd/display: Add dcn42b_soc_and_ip_translator drm/amd/display: Fix DCN42 null registers & register masks drm/amd/display: Rewrite dccg42_init drm/amd/display: Remove DCCG registers not needed in DCN42
Michael Strauss (1):
drm/amd/display: Add 12bpc Color Ramp Support
Piotr Maziarz (1):
drm/amd/display: Explicitly declare unsigned ints
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.64.0 drm/amd/display: Promote DC to 3.2.387
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 96 +++---- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 4 - .../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 18 -- .../gpu/drm/amd/display/dc/core/dc_resource.c | 11 +- drivers/gpu/drm/amd/display/dc/dc.h | 6 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 29 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 34 ++- drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + .../amd/display/dc/dccg/dcn42/dcn42_dccg.c | 53 ++-- .../amd/display/dc/dccg/dcn42/dcn42_dccg.h | 63 +++-- .../dc/dml/dcn31/display_mode_vba_31.c | 2 +- .../dc/dml/dcn314/display_mode_vba_314.c | 2 +- .../dml21/inc/bounding_boxes/dcn42b_soc_bb.h | 38 +++ .../dml21/inc/dml_top_soc_parameter_types.h | 13 + .../src/dml2_core/dml2_core_dcn4_calcs.c | 41 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 1 + .../drm/amd/display/dc/link/link_detection.c | 2 +- .../dc/link/protocols/link_dp_panel_replay.c | 6 +- .../link/protocols/link_edp_panel_control.c | 11 +- .../drm/amd/display/dc/opp/dcn20/dcn20_opp.c | 51 +++- .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.c | 258 +++++++++--------- .../amd/display/dc/pg/dcn42/dcn42_pg_cntl.h | 22 +- .../dc/resource/dcn30/dcn30_resource.c | 1 - .../dc/resource/dcn302/dcn302_resource.c | 1 - .../dc/resource/dcn303/dcn303_resource.c | 1 - .../dc/resource/dcn31/dcn31_resource.c | 1 - .../dc/resource/dcn315/dcn315_resource.c | 1 - .../dc/resource/dcn316/dcn316_resource.c | 1 - .../dc/resource/dcn32/dcn32_resource.c | 1 - .../dc/resource/dcn321/dcn321_resource.c | 1 - .../dc/resource/dcn35/dcn35_resource.c | 1 - .../dc/resource/dcn351/dcn351_resource.c | 1 - .../dc/resource/dcn36/dcn36_resource.c | 1 - .../dc/resource/dcn42/dcn42_resource.c | 4 +- .../display/dc/soc_and_ip_translator/Makefile | 3 + .../dcn401/dcn401_soc_and_ip_translator.c | 16 ++ .../dcn42/dcn42_soc_and_ip_translator.c | 18 +- .../dcn42/dcn42_soc_and_ip_translator.h | 1 + .../dcn42b/dcn42b_soc_and_ip_translator.c | 42 +++ .../dcn42b/dcn42b_soc_and_ip_translator.h | 17 ++ .../soc_and_ip_translator.c | 5 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 111 +++++++- .../drm/amd/display/modules/power/Makefile | 2 +- .../gpu/drm/amd/display/modules/power/power.c | 5 + .../amd/display/modules/power/power_helpers.c | 39 --- 46 files changed, 658 insertions(+), 380 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.c create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.h delete mode 100644 drivers/gpu/drm/amd/display/modules/power/power_helpers.c
--
2.54.0