DC Patches Feb 26th, 2021
cover DC Patches Feb 26th, 2021
DC version 3.2.125 brings improvements in multiple areas. In summary, we highlight:
- DSC fixes
- Firmware relase 0.0.54
- eDP interface refactor for multiple eDP
Best Regards
Siqueira
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.54
Aric Cyr (1):
drm/amd/display: 3.2.125
Dillon Varone (1):
drm/amd/display: Fix HSplit causing increase in DSC Slice Count
Eryk Brol (1):
drm/amd/display: Add max bpc debugfs
Hugo Hu (1):
drm/amd/display: treat memory as a single-channel for asymmetric
memory
Jake Wang (1):
drm/amd/display: Refactored DC interfaces to support multiple eDP
Jimmy Kizito (1):
drm/amd/display: Update link encoder object creation
Max.Tseng (1):
drm/amd/display: Add flag for building infopacket
Meenakshikumar Somasundaram (1):
drm/amd/display: Support for DMUB AUX
Wyatt Wood (1):
drm/amd/display: Return invalid state if GPINT times out
Yongqiang Sun (1):
drm/amd/display: Implement dmub trace event
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 153 +++++++++++++++++- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 +- drivers/gpu/drm/amd/display/dc/Makefile | 2 +- .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 17 +- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 48 +++++- drivers/gpu/drm/amd/display/dc/core/dc.c | 112 ++++++++++++- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 14 +- .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 3 +- drivers/gpu/drm/amd/display/dc/core/dc_stat.c | 64 ++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 17 +- drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 10 -- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 16 ++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 6 + drivers/gpu/drm/amd/display/dc/dc_link.h | 19 ++- drivers/gpu/drm/amd/display/dc/dc_stat.h | 42 +++++ drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 40 ++--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | 3 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 60 +++++++ .../gpu/drm/amd/display/dc/dce/dmub_outbox.h | 33 ++++ drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 16 +- .../display/dc/dce110/dce110_hw_sequencer.c | 72 ++++++--- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 34 ++-- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 31 ++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 + .../dc/dml/dcn30/display_mode_vba_30.c | 2 +- .../drm/amd/display/dc/dml/display_mode_vba.c | 3 - .../gpu/drm/amd/display/dc/inc/core_types.h | 13 ++ .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h | 3 +- .../drm/amd/display/dc/inc/hw/aux_engine.h | 4 +- .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 1 + drivers/gpu/drm/amd/display/dc/inc/resource.h | 1 + drivers/gpu/drm/amd/display/dc/irq_types.h | 3 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 55 +++++++ .../gpu/drm/amd/display/dmub/dmub_srv_stat.h | 41 +++++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 7 +- .../amd/display/dmub/inc/dmub_trace_buffer.h | 3 +- drivers/gpu/drm/amd/display/dmub/src/Makefile | 2 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 50 ++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 28 +++- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 77 ++++++++- .../drm/amd/display/dmub/src/dmub_srv_stat.c | 105 ++++++++++++ .../amd/display/modules/freesync/freesync.c | 28 +++- .../amd/display/modules/inc/mod_freesync.h | 3 +- 46 files changed, 1135 insertions(+), 137 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/core/dc_stat.c create mode 100644 drivers/gpu/drm/amd/display/dc/dc_stat.h create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.h create mode 100644 drivers/gpu/drm/amd/display/dmub/dmub_srv_stat.h create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/11 drm/amd/display: Support for DMUB AUX
From: Meenakshikumar Somasundaram <[email protected]>
[WHY]
To process AUX transactions with DMUB using inbox1 and outbox1 mail boxes.
[HOW]
1) Added inbox1 command DMUB_CMD__DP_AUX_ACCESS to issue AUX commands to DMUB in dc_process_dmub_aux_transfer_async(). DMUB processes AUX cmd with DCN and sends reply back in an outbox1 message triggering an outbox1 interrupt to driver.
2) In existing driver implementation, AUX commands are processed synchronously by configuring DCN reg. But in DMUB AUX, driver sends an inbox1 message and waits for a conditional variable (CV) which will be signaled by outbox1 ISR.
3) As the driver holds dal and dc locks while waiting for CV, the outbox1 ISR is registered with noMutexWait set to true, which allows ISR to run and signal CV. This sets a constraint on ISR to not modify variables such as dc, dmub, etc.
4) Created dmub_outbox.c with dmub_enable_outbox_notification() to enable outbox1 mailbox.
5) New mailbox address ranges allocated for outbox1 of size DMUB_RB_SIZE. Created dmub functions for Outbox1: dmub_dcn20_setup_out_mailbox(), dmub_dcn20_get_outbox1_wptr() and dmub_dcn20_set_outbox1_rptr().
6) Added functions dc_stat_get_dmub_notification() and dmub_srv_stat_get_notification() to retrieve Outbox1 message.
7) Currently, DMUB doesn't opens DDC in AUX mode before issuing AUX transaction. A workaround is added in dce_aux_transfer_dmub_raw() to open in DDC in AUX mode for every AUX transaction.
8) Added dc debug option enable_dmub_aux_for_legacy_ddc enable/disable DMUB AUX. This debug option is checked dce_aux_transfer_with_retries() to select the method to process AUX transactions.
--- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 +-- drivers/gpu/drm/amd/display/dc/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 94 ++++++++++++++++ .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 3 +- drivers/gpu/drm/amd/display/dc/core/dc_stat.c | 64 +++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 12 ++ drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 10 -- drivers/gpu/drm/amd/display/dc/dc_stat.h | 42 +++++++ drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 40 ++++--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | 3 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 60 ++++++++++ .../gpu/drm/amd/display/dc/dce/dmub_outbox.h | 33 ++++++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 5 + .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h | 3 +- .../drm/amd/display/dc/inc/hw/aux_engine.h | 4 +- drivers/gpu/drm/amd/display/dc/irq_types.h | 2 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 41 +++++++ .../gpu/drm/amd/display/dmub/dmub_srv_stat.h | 41 +++++++ drivers/gpu/drm/amd/display/dmub/src/Makefile | 2 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 32 ++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 11 ++ .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 31 +++++- .../drm/amd/display/dmub/src/dmub_srv_stat.c | 105 ++++++++++++++++++ 24 files changed, 612 insertions(+), 47 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/core/dc_stat.c create mode 100644 drivers/gpu/drm/amd/display/dc/dc_stat.h create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.h create mode 100644 drivers/gpu/drm/amd/display/dmub/dmub_srv_stat.h create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +10 -7
@@ -37,6 +37,7 @@#include "dc_link_ddc.h" #include "i2caux_interface.h" +#include "dmub_cmd.h" #if defined(CONFIG_DEBUG_FS )#include "amdgpu_dm_debugfs.h" #endif
@@ -50,7 +51,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, {ssize_t result =0 ;struct aux_payload payload; -enum aux_channel_operation_result operation_result; +enum aux_return_code_type operation_result;if (WARN_ON (msg->size >16 ))return -E2BIG ;
@@ -72,17 +73,19 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,if (result <0 )switch (operation_result) { -case AUX_CHANNEL_OPERATION_SUCCEEDED : +case AUX_RET_SUCCESS :break ; -case AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON : -case AUX_CHANNEL_OPERATION_FAILED_REASON_UNKNOWN : +case AUX_RET_ERROR_HPD_DISCON : +case AUX_RET_ERROR_UNKNOWN : +case AUX_RET_ERROR_INVALID_OPERATION : +case AUX_RET_ERROR_PROTOCOL_ERROR : result = -EIO ;break ; -case AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY : -case AUX_CHANNEL_OPERATION_FAILED_ENGINE_ACQUIRE : +case AUX_RET_ERROR_INVALID_REPLY : +case AUX_RET_ERROR_ENGINE_ACQUIRE : result = -EBUSY ;break ; -case AUX_CHANNEL_OPERATION_FAILED_TIMEOUT : +case AUX_RET_ERROR_TIMEOUT : result = -ETIMEDOUT ;break ; }
drivers/gpu/drm/amd/display/dc/Makefile +1 -1
@@ -54,7 +54,7 @@ AMD_DC = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/dc/,$(DC_LI include $(AMD_DC) -DISPLAY_CORE = dc.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_sink.o \ +DISPLAY_CORE = dc.o dc_stat.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_sink.o \ dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o dc_debug.o dc_stream.o ifdef CONFIG_DRM_AMD_DC_DCN
drivers/gpu/drm/amd/display/dc/core/dc.c +94 -0
103 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +2 -1
@@ -36,6 +36,7 @@#include "core_types.h" #include "dc_link_ddc.h" #include "dce/dce_aux.h" +#include "dmub/inc/dmub_cmd.h" #define DC_LOGGER_INIT (logger)
@@ -655,7 +656,7 @@ bool dal_ddc_submit_aux_command(struct ddc_service *ddc,*/ int dc_link_aux_transfer_raw (struct ddc_service *ddc,struct aux_payload *payload, -enum aux_channel_operation_result *operation_result) +enum aux_return_code_type *operation_result) {return dce_aux_transfer_raw (ddc, payload, operation_result); }
drivers/gpu/drm/amd/display/dc/core/dc_stat.c new file +64 -0
64 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +12 -0
@@ -42,6 +42,9 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" +/* forward declaration */ +struct aux_payload ; +#define DC_VER "3.2.124"#define MAX_SURFACES 3
@@ -531,6 +534,9 @@ struct dc_debug_options {bool enable_dram_clock_change_one_display_vactive;union mem_low_power_enable_options enable_mem_low_power;bool force_vblank_alignment; + +/* Enable dmub aux for legacy ddc */ +bool enable_dmub_aux_for_legacy_ddc; };struct dc_debug_data {
@@ -1293,6 +1299,12 @@ void dc_hardware_release(struct dc *dc);bool dc_set_psr_allow_active (struct dc *dc,bool enable); +bool dc_enable_dmub_notifications (struct dc *dc); + +bool dc_process_dmub_aux_transfer_async (struct dc *dc, +uint32_t link_index, +struct aux_payload *payload); +/******************************************************************************* * DSC Interfaces ******************************************************************************/
drivers/gpu/drm/amd/display/dc/dc_ddc_types.h +0 -10
@@ -44,16 +44,6 @@ enum i2caux_transaction_action {I2CAUX_TRANSACTION_ACTION_DP_READ =0x90 }; -enum aux_channel_operation_result { -AUX_CHANNEL_OPERATION_SUCCEEDED , -AUX_CHANNEL_OPERATION_FAILED_REASON_UNKNOWN , -AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY , -AUX_CHANNEL_OPERATION_FAILED_TIMEOUT , -AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON , -AUX_CHANNEL_OPERATION_FAILED_ENGINE_ACQUIRE -}; - -struct aux_request_transaction_data {enum aux_transaction_type type;enum i2caux_transaction_action action;
drivers/gpu/drm/amd/display/dc/dc_stat.h new file +42 -0
42 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/Makefile +1 -1
@@ -30,7 +30,7 @@ DCE = dce_audio.o dce_stream_encoder.o dce_link_encoder.o dce_hwseq.o \ dce_mem_input.o dce_clock_source.o dce_scl_filters.o dce_transform.o \ dce_opp.o dce_dmcu.o dce_abm.o dce_ipp.o dce_aux.o \ dce_i2c.o dce_i2c_hw.o dce_i2c_sw.o dmub_psr.o dmub_abm.o dce_panel_cntl.o \ -dmub_hw_lock_mgr.o +dmub_hw_lock_mgr.o dmub_outbox.o AMD_DAL_DCE = $(addprefix $(AMDDALPATH)/dc/dce/,$(DCE))
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +22 -18
@@ -31,6 +31,8 @@#include "dce_aux.h" #include "dce/dce_11_0_sh_mask.h" #include "dm_event_log.h" +#include "dm_helpers.h" +#include "dmub/inc/dmub_cmd.h" #define CTX \ aux110->base.ctx
@@ -324,7 +326,7 @@ static int read_channel_reply(struct dce_aux *engine, uint32_t size,return 0 ; } -static enum aux_channel_operation_result get_channel_status ( +static enum aux_return_code_type get_channel_status (struct dce_aux *engine,uint8_t *returned_bytes) {
@@ -335,7 +337,7 @@ static enum aux_channel_operation_result get_channel_status(if (returned_bytes ==NULL ) {/*caller pass NULL pointer*/ ASSERT_CRITICAL (false); -return AUX_CHANNEL_OPERATION_FAILED_REASON_UNKNOWN ; +return AUX_RET_ERROR_UNKNOWN ; } *returned_bytes =0 ;
@@ -346,7 +348,7 @@ static enum aux_channel_operation_result get_channel_status( value =REG_READ (AUX_SW_STATUS );/* in case HPD is LOW, exit AUX transaction */ if ((value &AUX_SW_STATUS__AUX_SW_HPD_DISCON_MASK )) -return AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON ; +return AUX_RET_ERROR_HPD_DISCON ;/* Note that the following bits are set in 'status.bits' * during CTS 4.2.1.2 (FW 3.3.1):
@@ -359,14 +361,14 @@ static enum aux_channel_operation_result get_channel_status(if (value &AUX_SW_STATUS__AUX_SW_DONE_MASK ) {if ((value &AUX_SW_STATUS__AUX_SW_RX_TIMEOUT_STATE_MASK ) || (value &AUX_SW_STATUS__AUX_SW_RX_TIMEOUT_MASK )) -return AUX_CHANNEL_OPERATION_FAILED_TIMEOUT ; +return AUX_RET_ERROR_TIMEOUT ;else if ((value &AUX_SW_STATUS__AUX_SW_RX_INVALID_STOP_MASK ) || (value &AUX_SW_STATUS__AUX_SW_RX_RECV_NO_DET_MASK ) || (value &AUX_SW_STATUS__AUX_SW_RX_RECV_INVALID_H_MASK ) || (value &AUX_SW_STATUS__AUX_SW_RX_RECV_INVALID_L_MASK )) -return AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY ; +return AUX_RET_ERROR_INVALID_REPLY ; *returned_bytes = get_reg_field_value(value, AUX_SW_STATUS,
@@ -374,17 +376,17 @@ static enum aux_channel_operation_result get_channel_status(if (*returned_bytes ==0 )return -AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY ; +AUX_RET_ERROR_INVALID_REPLY ;else { *returned_bytes -=1 ; -return AUX_CHANNEL_OPERATION_SUCCEEDED ; +return AUX_RET_SUCCESS ; } }else {/*time_elapsed >= aux_engine->timeout_period * AUX_SW_STATUS__AUX_SW_HPD_DISCON = at this point */ ASSERT_CRITICAL (false); -return AUX_CHANNEL_OPERATION_FAILED_TIMEOUT ; +return AUX_RET_ERROR_TIMEOUT ; } }
@@ -541,7 +543,7 @@ static enum i2caux_transaction_action i2caux_action_from_payload(struct aux_paylint dce_aux_transfer_raw (struct ddc_service *ddc,struct aux_payload *payload, -enum aux_channel_operation_result *operation_result) +enum aux_return_code_type *operation_result) {struct ddc *ddc_pin = ddc->ddc_pin;struct dce_aux *aux_engine;
@@ -556,7 +558,7 @@ int dce_aux_transfer_raw(struct ddc_service *ddc, aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];if (!acquire (aux_engine, ddc_pin)) { - *operation_result =AUX_CHANNEL_OPERATION_FAILED_ENGINE_ACQUIRE ; + *operation_result =AUX_RET_ERROR_ENGINE_ACQUIRE ;return -1 ; }
@@ -575,8 +577,9 @@ int dce_aux_transfer_raw(struct ddc_service *ddc,submit_channel_request (aux_engine, &aux_req); *operation_result =get_channel_status (aux_engine, &returned_bytes); -if (*operation_result ==AUX_CHANNEL_OPERATION_SUCCEEDED ) { +if (*operation_result ==AUX_RET_SUCCESS ) {int __maybe_unused bytes_replied =0 ; + bytes_replied =read_channel_reply (aux_engine, payload->length, payload->data, payload->reply, &status);
@@ -604,7 +607,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,int i, ret =0 ;uint8_t reply;bool payload_reply = true; -enum aux_channel_operation_result operation_result; +enum aux_return_code_type operation_result;bool retry_on_defer = false; int aux_ack_retries = 0,
@@ -620,8 +623,9 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,for (i =0 ; i <AUX_MAX_RETRIES ; i++) { ret =dce_aux_transfer_raw (ddc, payload, &operation_result); +switch (operation_result) { -case AUX_CHANNEL_OPERATION_SUCCEEDED : +case AUX_RET_SUCCESS : aux_timeout_retries =0 ; aux_invalid_reply_retries =0 ;
@@ -667,14 +671,14 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc, }break ; -case AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY : +case AUX_RET_ERROR_INVALID_REPLY :if (++aux_invalid_reply_retries >=AUX_MAX_INVALID_REPLY_RETRIES ) goto fail;else udelay (400 );break ; -case AUX_CHANNEL_OPERATION_FAILED_TIMEOUT : +case AUX_RET_ERROR_TIMEOUT :// Check whether a DEFER had occurred before the timeout. // If so, treat timeout as a DEFER. if (retry_on_defer) {
@@ -696,9 +700,9 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc, }break ; -case AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON : -case AUX_CHANNEL_OPERATION_FAILED_ENGINE_ACQUIRE : -case AUX_CHANNEL_OPERATION_FAILED_REASON_UNKNOWN : +case AUX_RET_ERROR_HPD_DISCON : +case AUX_RET_ERROR_ENGINE_ACQUIRE : +case AUX_RET_ERROR_UNKNOWN :default : goto fail; }
drivers/gpu/drm/amd/display/dc/dce/dce_aux.h +2 -1
@@ -29,6 +29,7 @@#include "i2caux_interface.h" #include "inc/hw/aux_engine.h" +enum aux_return_code_type ;#define AUX_COMMON_REG_LIST0 (id)\ SRI(AUX_CONTROL, DP_AUX, id), \
@@ -302,7 +303,7 @@ bool dce110_aux_engine_acquire(int dce_aux_transfer_raw (struct ddc_service *ddc,struct aux_payload *cmd, -enum aux_channel_operation_result *operation_result); +enum aux_return_code_type *operation_result);bool dce_aux_transfer_with_retries (struct ddc_service *ddc,struct aux_payload *cmd);
drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.c new file +60 -0
60 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright 2020 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Authors: AMD +* +*/ + +#ifndef _DMUB_OUTBOX_H_ +#define _DMUB_OUTBOX_H_ + +#include "dc.h" + +void dmub_enable_outbox_notification (struct dc *dc); + +#endif /* _DMUB_OUTBOX_H_ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -0
@@ -53,6 +53,7 @@#include "dsc.h" #include "dce/dmub_hw_lock_mgr.h" #include "dc_trace.h" +#include "dce/dmub_outbox.h" #define DC_LOGGER_INIT (logger)
@@ -1355,6 +1356,10 @@ void dcn10_init_hw(struct dc *dc) hws->funcs.dsc_pg_control (hws, res_pool->dscs[i]->inst, false); } +/* Enable outbox notification feature of dmub */ +if (dc->debug.enable_dmub_aux_for_legacy_ddc) +dmub_enable_outbox_notification (dc); +/* we want to turn off all dp displays before doing detection */ if (dc->config.power_down_display_on_boot) {uint8_t dpcd_power_state ='\0' ;
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +2 -1
@@ -56,6 +56,7 @@ struct dp_receiver_id_info;struct i2c_payloads ;struct aux_payloads ; +enum aux_return_code_type ; void dal_ddc_i2c_payloads_add( struct i2c_payloads *payloads,
@@ -100,7 +101,7 @@ bool dal_ddc_submit_aux_command(struct ddc_service *ddc,int dc_link_aux_transfer_raw (struct ddc_service *ddc,struct aux_payload *payload, -enum aux_channel_operation_result *operation_result); +enum aux_return_code_type *operation_result);bool dc_link_aux_transfer_with_retries (struct ddc_service *ddc,struct aux_payload *payload);
drivers/gpu/drm/amd/display/dc/inc/hw/aux_engine.h +3 -1
@@ -29,6 +29,8 @@#include "dc_ddc_types.h" #include "include/i2caux_interface.h" +enum aux_return_code_type ; +enum i2caux_transaction_operation {I2CAUX_TRANSACTION_READ ,I2CAUX_TRANSACTION_WRITE
@@ -162,7 +164,7 @@ struct aux_engine_funcs {uint8_t *buffer, uint8_t *reply_result, uint32_t *sw_status); -enum aux_channel_operation_result (*get_channel_status)( +enum aux_return_code_type (*get_channel_status)(struct aux_engine *engine,uint8_t *returned_bytes);bool (*is_engine_available)(struct aux_engine *engine);
drivers/gpu/drm/amd/display/dc/irq_types.h +1 -1
@@ -150,7 +150,7 @@ enum dc_irq_source {DC_IRQ_SOURCE_DC4_VLINE1 ,DC_IRQ_SOURCE_DC5_VLINE1 ,DC_IRQ_SOURCE_DC6_VLINE1 , - +DC_IRQ_DMCUB_OUTBOX1 , DAL_IRQ_SOURCES_NUMBER };
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +41 -0
65 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/dmub_srv_stat.h new file +41 -0
41 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/src/Makefile +1 -1
@@ -20,7 +20,7 @@ # OTHER DEALINGS IN THE SOFTWARE. # -DMUB = dmub_srv.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o +DMUB = dmub_srv.o dmub_srv_stat.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o DMUB += dmub_dcn30.o dmub_dcn301.o DMUB += dmub_dcn302.o
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +32 -0
@@ -135,6 +135,8 @@ void dmub_dcn20_reset(struct dmub_srv *dmub)REG_UPDATE (MMHUBBUB_SOFT_RESET ,DMUIF_SOFT_RESET ,1 );REG_WRITE (DMCUB_INBOX1_RPTR ,0 );REG_WRITE (DMCUB_INBOX1_WPTR ,0 ); +REG_WRITE (DMCUB_OUTBOX1_RPTR ,0 ); +REG_WRITE (DMCUB_OUTBOX1_WPTR ,0 );REG_WRITE (DMCUB_SCRATCH0 ,0 ); }
@@ -287,6 +289,36 @@ void dmub_dcn20_set_inbox1_wptr(struct dmub_srv *dmub, uint32_t wptr_offset)REG_WRITE (DMCUB_INBOX1_WPTR , wptr_offset); } +void dmub_dcn20_setup_out_mailbox (struct dmub_srv *dmub, +const struct dmub_region *outbox1) +{ +/* New firmware can support CW4 for the outbox. */ +if (dmub_dcn20_use_cached_inbox (dmub)) +REG_WRITE (DMCUB_OUTBOX1_BASE_ADDRESS , outbox1->base); +else +REG_WRITE (DMCUB_OUTBOX1_BASE_ADDRESS ,0x80002000 ); + +REG_WRITE (DMCUB_OUTBOX1_SIZE , outbox1->top - outbox1->base); +} + +uint32_t dmub_dcn20_get_outbox1_wptr (struct dmub_srv *dmub) +{ +/** +* outbox1 wptr register is accessed without locks (dal & dc) +* and to be called only by dmub_srv_stat_get_notification() +*/ +return REG_READ (DMCUB_OUTBOX1_WPTR ); +} + +void dmub_dcn20_set_outbox1_rptr (struct dmub_srv *dmub,uint32_t rptr_offset) +{ +/** +* outbox1 rptr register is accessed without locks (dal & dc) +* and to be called only by dmub_srv_stat_get_notification() +*/ +REG_WRITE (DMCUB_OUTBOX1_RPTR , rptr_offset); +} +bool dmub_dcn20_is_hw_init (struct dmub_srv *dmub) {uint32_t is_hw_init;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h +11 -0
@@ -40,6 +40,10 @@ struct dmub_srv; DMUB_SR(DMCUB_INBOX1_SIZE) \ DMUB_SR(DMCUB_INBOX1_RPTR) \ DMUB_SR(DMCUB_INBOX1_WPTR) \ + DMUB_SR(DMCUB_OUTBOX1_BASE_ADDRESS) \ + DMUB_SR(DMCUB_OUTBOX1_SIZE) \ + DMUB_SR(DMCUB_OUTBOX1_RPTR) \ + DMUB_SR(DMCUB_OUTBOX1_WPTR) \ DMUB_SR(DMCUB_REGION3_CW0_OFFSET) \ DMUB_SR(DMCUB_REGION3_CW1_OFFSET) \ DMUB_SR(DMCUB_REGION3_CW2_OFFSET) \
@@ -185,6 +189,13 @@ uint32_t dmub_dcn20_get_inbox1_rptr(struct dmub_srv *dmub);void dmub_dcn20_set_inbox1_wptr (struct dmub_srv *dmub,uint32_t wptr_offset); +void dmub_dcn20_setup_out_mailbox (struct dmub_srv *dmub, +const struct dmub_region *outbox1); + +uint32_t dmub_dcn20_get_outbox1_wptr (struct dmub_srv *dmub); + +void dmub_dcn20_set_outbox1_rptr (struct dmub_srv *dmub,uint32_t rptr_offset); +bool dmub_dcn20_is_hw_init (struct dmub_srv *dmub);bool dmub_dcn20_is_supported (struct dmub_srv *dmub);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +27 -4
@@ -46,8 +46,8 @@/* Context size. */ #define DMUB_CONTEXT_SIZE (512 * 1024) -/* Mailbox size */ -#define DMUB_MAILBOX_SIZE (DMUB_RB_SIZE) +/* Mailbox size : Ring buffers are required for both inbox and outbox */ +#define DMUB_MAILBOX_SIZE ((2 * DMUB_RB_SIZE))/* Default state size if meta is absent. */ #define DMUB_FW_STATE_SIZE (64 * 1024)
@@ -157,6 +157,11 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic) funcs->enable_dmub_boot_options = dmub_dcn20_enable_dmub_boot_options; funcs->skip_dmub_panel_power_sequence = dmub_dcn20_skip_dmub_panel_power_sequence; +// Out mailbox register access functions for RN and above + funcs->setup_out_mailbox = dmub_dcn20_setup_out_mailbox; + funcs->get_outbox1_wptr = dmub_dcn20_get_outbox1_wptr; + funcs->set_outbox1_rptr = dmub_dcn20_set_outbox1_rptr; +if (asic ==DMUB_ASIC_DCN21 ) { dmub->regs = &dmub_srv_dcn21_regs;
@@ -397,7 +402,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,struct dmub_rb_init_params rb_params;struct dmub_window cw0, cw1, cw2, cw3, cw4, cw5, cw6; -struct dmub_region inbox1; +struct dmub_region inbox1, outbox1;if (!dmub->sw_init)return DMUB_STATUS_INVALID ;
@@ -444,8 +449,17 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, cw4.region.base =DMUB_CW4_BASE ; cw4.region.top = cw4.region.base + mail_fb->size; +/** +* Doubled the mailbox region to accomodate inbox and outbox. +* Note: Currently, currently total mailbox size is 16KB. It is split +* equally into 8KB between inbox and outbox. If this config is +* changed, then uncached base address configuration of outbox1 +* has to be updated in funcs->setup_out_mailbox. +*/ inbox1.base = cw4.region.base; - inbox1.top = cw4.region.top; + inbox1.top = cw4.region.base +DMUB_RB_SIZE ; + outbox1.base = inbox1.top; + outbox1.top = cw4.region.top; cw5.offset.quad_part = tracebuff_fb->gpu_addr; cw5.region.base =DMUB_CW5_BASE ;
@@ -465,6 +479,8 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,if (dmub->hw_funcs.setup_mailbox) dmub->hw_funcs.setup_mailbox (dmub, &inbox1); +if (dmub->hw_funcs.setup_out_mailbox) + dmub->hw_funcs.setup_out_mailbox (dmub, &outbox1); }if (mail_fb) {
@@ -474,6 +490,13 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, rb_params.capacity =DMUB_RB_SIZE ;dmub_rb_init (&dmub->inbox1_rb, &rb_params); + +// Initialize outbox1 ring buffer + rb_params.ctx = dmub; + rb_params.base_address = (void *) ((uint64_t ) (mail_fb->cpu_addr) +DMUB_RB_SIZE ); + rb_params.capacity =DMUB_RB_SIZE ; +dmub_rb_init (&dmub->outbox1_rb, &rb_params); + }if (dmub->hw_funcs.reset_release)
drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c new file +105 -0
105 lines not on this page · raw message
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/11 drm/amd/display: Update link encoder object creation
In reply to Rodrigo SiqueiraFrom: Jimmy Kizito <[email protected]>
[Why]
Currently the creation of link encoder objects is tightly coupled to the creation of link objects. Decoupling link encoder object creation is a preliminary step in the process of allowing link encoders to be dynamically assigned to links.
[How]
Add "minimal" link encoder objects which are not associated with any link until required.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 14 +++++++++++++- drivers/gpu/drm/amd/display/dc/dc_link.h | 4 ++++ drivers/gpu/drm/amd/display/dc/inc/core_types.h | 13 +++++++++++++ drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 1 + drivers/gpu/drm/amd/display/dc/inc/resource.h | 1 + 5 files changed, 32 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +13 -1
@@ -91,8 +91,14 @@ static void dc_link_destruct(struct dc_link *link)if (link->panel_cntl) link->panel_cntl->funcs->destroy (&link->panel_cntl); -if (link->link_enc) +if (link->link_enc) { +/* Update link encoder tracking variables. These are used for the dynamic +* assignment of link encoders to streams. +*/ + link->dc->res_pool->link_encoders[link->link_enc->preferred_engine] =NULL ; + link->dc->res_pool->dig_link_enc_count--; link->link_enc->funcs->destroy (&link->link_enc); + }if (link->local_sink)dc_sink_release (link->local_sink);
@@ -1532,6 +1538,12 @@ static bool dc_link_construct(struct dc_link *link,DC_LOG_DC ("BIOS object table - DP_IS_USB_C: %d" , link->link_enc->features.flags.bits.DP_IS_USB_C); +/* Update link encoder tracking variables. These are used for the dynamic +* assignment of link encoders to streams. +*/ + link->dc->res_pool->link_encoders[link->link_enc->preferred_engine] = link->link_enc; + link->dc->res_pool->dig_link_enc_count++; + link->link_enc_hw_inst = link->link_enc->transmitter;for (i =0 ; i <4 ; i++) {
drivers/gpu/drm/amd/display/dc/dc_link.h +4 -0
@@ -103,6 +103,10 @@ struct dc_link {bool lttpr_non_transparent_mode;bool is_internal_display; +/* TODO: Rename. Flag an endpoint as having a programmable mapping to a +* DIG encoder. */ +bool is_dig_mapping_flexible; +bool edp_sink_present;/* caps is the same as reported_link_cap. link_traing use
drivers/gpu/drm/amd/display/dc/inc/core_types.h +13 -0
@@ -97,6 +97,10 @@ struct resource_funcs { const struct panel_cntl_init_data *panel_cntl_init_data);struct link_encoder *(*link_enc_create)(const struct encoder_init_data *init); +/* Create a minimal link encoder object with no dc_link object +* associated with it. */ +struct link_encoder *(*link_enc_create_minimal)(struct dc_context *ctx,enum engine_id eng_id); + bool (*validate_bandwidth)( struct dc *dc, struct dc_state *context,
@@ -210,6 +214,15 @@ struct resource_pool {unsigned int underlay_pipe_index;unsigned int stream_enc_count; +/* An array for accessing the link encoder objects that have been created. +* Index in array corresponds to engine ID - viz. 0: ENGINE_ID_DIGA +*/ +struct link_encoder *link_encoders[MAX_DIG_LINK_ENCODERS ]; +/* Number of DIG link encoder objects created - i.e. number of valid +* entries in link_encoders array. +*/ +unsigned int dig_link_enc_count; +#if defined(CONFIG_DRM_AMD_DC_DCN )struct dc_3dlut *mpc_lut[MAX_PIPES ];struct dc_transfer_func *mpc_shaper[MAX_PIPES ];
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +1 -0
@@ -36,6 +36,7 @@#define MAX_AUDIOS 7#define MAX_PIPES 6 +#define MAX_DIG_LINK_ENCODERS 7#define MAX_DWB_PIPES 1struct gamma_curve {
drivers/gpu/drm/amd/display/dc/inc/resource.h +1 -0
@@ -48,6 +48,7 @@ struct resource_caps {int num_ddc;int num_vmid;int num_dsc; +unsigned int num_dig_link_enc;// Total number of DIGs (digital encoders) in DIO (Display Input/Output). int num_mpc_3dlut; };
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/11 drm/amd/display: Add flag for building infopacket
In reply to Rodrigo SiqueiraFrom: "Max.Tseng" <[email protected]>
[why]
Add flag to build infopacket in SDP v1.3 format
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++- .../amd/display/modules/freesync/freesync.c | 28 +++++++++++++++++-- .../amd/display/modules/inc/mod_freesync.h | 3 +- 3 files changed, 31 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -1
@@ -7852,6 +7852,7 @@ static void update_freesync_state_on_stream(struct amdgpu_device *adev = dm->adev;struct amdgpu_crtc *acrtc =to_amdgpu_crtc (new_crtc_state->base.crtc);unsigned long flags; +bool pack_sdp_v1_3 = false;if (!new_stream)return ;
@@ -7893,7 +7894,8 @@ static void update_freesync_state_on_stream( &vrr_params,PACKET_TYPE_VRR ,TRANSFER_FUNC_UNKNOWN , - &vrr_infopacket); + &vrr_infopacket, + pack_sdp_v1_3); new_crtc_state->freesync_timing_changed |= (memcmp(&acrtc->dm_irq_params.vrr_params.adjust,
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +26 -2
@@ -903,12 +903,31 @@ static void build_vrr_infopacket_v3(enum signal_type signal, infopacket->valid = true; } +static void build_vrr_infopacket_sdp_v1_3 (enum vrr_packet_type packet_type, +struct dc_info_packet *infopacket) +{ +uint8_t idx =0 , size =0 ; + + size = ((packet_type ==PACKET_TYPE_FS_V1 ) ?0x08 : + (packet_type ==PACKET_TYPE_FS_V3 ) ?0x10 : +0x09 ); + +for (idx = infopacket->hb2; idx >1 ; idx--)// Data Byte Count: 0x1B + infopacket->sb[idx] = infopacket->sb[idx-1 ]; + + infopacket->sb[1 ] = size;// Length + infopacket->sb[0 ] = (infopacket->hb3 >>2 ) &0x3F ;//Version + infopacket->hb3 = (0x13 <<2 );// Header,SDP 1.3 + infopacket->hb2 =0x1D ; +} +void mod_freesync_build_vrr_infopacket (struct mod_freesync *mod_freesync,const struct dc_stream_state *stream,const struct mod_vrr_params *vrr,enum vrr_packet_type packet_type,enum color_transfer_func app_tf, -struct dc_info_packet *infopacket) +struct dc_info_packet *infopacket, +bool pack_sdp_v1_3) {/* SPD info packet for FreeSync * VTEM info packet for HdmiVRR
@@ -941,6 +960,12 @@ void mod_freesync_build_vrr_infopacket(struct mod_freesync *mod_freesync,default :build_vrr_infopacket_v1 (stream->signal, vrr, infopacket); } + +if (true == pack_sdp_v1_3 && + true ==dc_is_dp_signal (stream->signal) && + packet_type !=PACKET_TYPE_VRR && + packet_type !=PACKET_TYPE_VTEM ) +build_vrr_infopacket_sdp_v1_3 (packet_type, infopacket); } void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
@@ -1304,4 +1329,3 @@ bool mod_freesync_is_valid_range(uint32_t min_refresh_cap_in_uhz,return true; } -
drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h +2 -1
@@ -150,7 +150,8 @@ void mod_freesync_build_vrr_infopacket(struct mod_freesync *mod_freesync,const struct mod_vrr_params *vrr, enum vrr_packet_type packet_type, enum color_transfer_func app_tf, - struct dc_info_packet *infopacket); + struct dc_info_packet *infopacket, + bool pack_sdp_v1_3); void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, const struct dc_stream_state *stream,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/11 drm/amd/display: Add max bpc debugfs
In reply to Rodrigo SiqueiraFrom: Eryk Brol <[email protected]>
[Why]
Useful for testing when setting a max bpc value higher than the default is required
[How]
Allow for reading/writing of the max_requested_bpc property of the connector
--- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 153 +++++++++++++++++- 1 file changed, 152 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +152 -1
@@ -2152,6 +2152,149 @@ static ssize_t dp_dsc_slice_bpg_offset_read(struct file *f, char __user *buf,return result; } + +/* +* function description: Read max_requested_bpc property from the connector +* +* Access it with the following command: +* +* cat /sys/kernel/debug/dri/0/DP-X/max_bpc +* +*/ +static ssize_t dp_max_bpc_read (struct file *f,char __user *buf, +size_t size,loff_t *pos) +{ +struct amdgpu_dm_connector *aconnector =file_inode (f)->i_private; +struct drm_connector *connector = &aconnector->base; +struct drm_device *dev = connector->dev; +struct dm_connector_state *state; +ssize_t result =0 ; +char *rd_buf =NULL ; +char *rd_buf_ptr =NULL ; +const uint32_t rd_buf_size =10 ; +int r; + + rd_buf =kcalloc (rd_buf_size,sizeof (char ),GFP_KERNEL ); + +if (!rd_buf) +return -ENOMEM ; + +mutex_lock (&dev->mode_config.mutex); +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); + +if (connector->state ==NULL ) + goto unlock; + + state =to_dm_connector_state (connector->state); + + rd_buf_ptr = rd_buf; +snprintf (rd_buf_ptr, rd_buf_size, +"%u\n" , + state->base.max_requested_bpc); + +while (size) { +if (*pos >= rd_buf_size) +break ; + + r =put_user (*(rd_buf + result), buf); +if (r) { + result = r;/* r = -EFAULT */ + goto unlock; + } + buf +=1 ; + size -=1 ; + *pos +=1 ; + result +=1 ; + } +unlock: +drm_modeset_unlock (&dev->mode_config.connection_mutex); +mutex_unlock (&dev->mode_config.mutex); +kfree (rd_buf); +return result; +} + + +/* +* function description: Set max_requested_bpc property on the connector +* +* This function will not force the input BPC on connector, it will only +* change the max value. This is equivalent to setting max_bpc through +* xrandr. +* +* The BPC value written must be >= 6 and <= 16. Values outside of this +* range will result in errors. +* +* BPC values: +* 0x6 - 6 BPC +* 0x8 - 8 BPC +* 0xa - 10 BPC +* 0xc - 12 BPC +* 0x10 - 16 BPC +* +* Write the max_bpc in the following way: +* +* echo 0x6 > /sys/kernel/debug/dri/0/DP-X/max_bpc +* +*/ +static ssize_t dp_max_bpc_write (struct file *f,const char __user *buf, +size_t size,loff_t *pos) +{ +struct amdgpu_dm_connector *aconnector =file_inode (f)->i_private; +struct drm_connector *connector = &aconnector->base; +struct dm_connector_state *state; +struct drm_device *dev = connector->dev; +char *wr_buf =NULL ; +uint32_t wr_buf_size =42 ; +int max_param_num =1 ; +long param[1 ] = {0 }; +uint8_t param_nums =0 ; + +if (size ==0 ) +return -EINVAL ; + + wr_buf =kcalloc (wr_buf_size,sizeof (char ),GFP_KERNEL ); + +if (!wr_buf) { +DRM_DEBUG_DRIVER ("no memory to allocate write buffer\n" ); +return -ENOSPC ; + } + +if (parse_write_buffer_into_params (wr_buf, size, + (long *)param, buf, + max_param_num, + ¶m_nums)) { +kfree (wr_buf); +return -EINVAL ; + } + +if (param_nums <=0 ) { +DRM_DEBUG_DRIVER ("user data not be read\n" ); +kfree (wr_buf); +return -EINVAL ; + } + +if (param[0 ] <6 || param[0 ] >16 ) { +DRM_DEBUG_DRIVER ("bad max_bpc value\n" ); +kfree (wr_buf); +return -EINVAL ; + } + +mutex_lock (&dev->mode_config.mutex); +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); + +if (connector->state ==NULL ) + goto unlock; + + state =to_dm_connector_state (connector->state); + state->base.max_requested_bpc = param[0 ]; +unlock: +drm_modeset_unlock (&dev->mode_config.connection_mutex); +mutex_unlock (&dev->mode_config.mutex); + +kfree (wr_buf); +return size; +} +DEFINE_SHOW_ATTRIBUTE (dp_dsc_fec_support);DEFINE_SHOW_ATTRIBUTE (dmub_fw_state);DEFINE_SHOW_ATTRIBUTE (dmub_tracebuffer);
@@ -2263,6 +2406,13 @@ static const struct file_operations dp_dpcd_data_debugfs_fops = { .llseek = default_llseek }; +static const struct file_operations dp_max_bpc_debugfs_fops = { + .owner =THIS_MODULE , + .read = dp_max_bpc_read, + .write = dp_max_bpc_write, + .llseek = default_llseek +}; + static const struct { char *name; const struct file_operations *fops;
@@ -2285,7 +2435,8 @@ static const struct { {"dsc_pic_height", &dp_dsc_pic_height_debugfs_fops}, {"dsc_chunk_size", &dp_dsc_chunk_size_debugfs_fops}, {"dsc_slice_bpg", &dp_dsc_slice_bpg_offset_debugfs_fops}, - {"dp_dsc_fec_support", &dp_dsc_fec_support_fops} + {"dp_dsc_fec_support", &dp_dsc_fec_support_fops}, + {"max_bpc", &dp_max_bpc_debugfs_fops} };#ifdef CONFIG_DRM_AMD_DC_HDCP
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/11 drm/amd/display: Refactored DC interfaces to support multiple eDP
In reply to Rodrigo SiqueiraFrom: Jake Wang <[email protected]>
[Why & How]
Some existing DC interfaces are optimized to return a single eDP link/stream. Refactored those DC interfaces to support multiple eDP.
--- .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 17 +++-- drivers/gpu/drm/amd/display/dc/core/dc.c | 18 +++-- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_link.h | 15 ++-- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 1 + .../display/dc/dce110/dce110_hw_sequencer.c | 72 ++++++++++++------- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 29 +++++--- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 31 ++++---- 8 files changed, 119 insertions(+), 65 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c +13 -4
@@ -87,12 +87,16 @@ int clk_mgr_helper_get_active_plane_cnt(void clk_mgr_exit_optimized_pwr_state (const struct dc *dc,struct clk_mgr *clk_mgr) { -struct dc_link *edp_link =get_edp_link (dc); +struct dc_link *edp_links[MAX_NUM_EDP ]; +struct dc_link *edp_link =NULL ; +int edp_num; +get_edp_links (dc, edp_links, &edp_num);if (dc->hwss.exit_optimized_pwr_state) dc->hwss.exit_optimized_pwr_state (dc, dc->current_state); -if (edp_link) { +if (edp_num) { + edp_link = edp_links[0 ]; clk_mgr->psr_allow_active_cache = edp_link->psr_settings.psr_allow_active;dc_link_set_psr_allow_active (edp_link, false, false, false); }
@@ -101,11 +105,16 @@ void clk_mgr_exit_optimized_pwr_state(const struct dc *dc, struct clk_mgr *clk_mvoid clk_mgr_optimize_pwr_state (const struct dc *dc,struct clk_mgr *clk_mgr) { -struct dc_link *edp_link =get_edp_link (dc); +struct dc_link *edp_links[MAX_NUM_EDP ]; +struct dc_link *edp_link =NULL ; +int edp_num; -if (edp_link) +get_edp_links (dc, edp_links, &edp_num); +if (edp_num) { + edp_link = edp_links[0 ];dc_link_set_psr_allow_active (edp_link, clk_mgr->psr_allow_active_cache, false, false); + }if (dc->hwss.optimize_pwr_state) dc->hwss.optimize_pwr_state (dc, dc->current_state);
drivers/gpu/drm/amd/display/dc/core/dc.c +11 -7
@@ -1012,22 +1012,26 @@ struct dc *dc_create(const struct dc_init_data *init_params)static void detect_edp_presence (struct dc *dc) { -struct dc_link *edp_link =get_edp_link (dc); +struct dc_link *edp_links[MAX_NUM_EDP ]; +struct dc_link *edp_link =NULL ; +int i; +int edp_num;bool edp_sink_present = true; -if (!edp_link) +get_edp_links (dc, edp_links, &edp_num); +if (!edp_num)return ;if (dc->config.edp_not_connected) { edp_sink_present = false; }else {enum dc_connection_type type; -dc_link_detect_sink (edp_link, &type); -if (type == dc_connection_none) - edp_sink_present = false; +for (i =0 ; i < edp_num; i++) { + edp_link = edp_links[i]; +dc_link_detect_sink (edp_link, &type); + edp_link->edp_sink_present = (type != dc_connection_none); + } } - - edp_link->edp_sink_present = edp_sink_present; }void dc_hardware_init (struct dc *dc)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -52,6 +52,7 @@ struct aux_payload;#define MAX_STREAMS 6#define MAX_SINKS_PER_LINK 4#define MIN_VIEWPORT_SIZE 12 +#define MAX_NUM_EDP 2/******************************************************************************* * Display Core Interfaces
drivers/gpu/drm/amd/display/dc/dc_link.h +10 -5
@@ -187,16 +187,21 @@ static inline struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_return dc->links[link_index]; } -static inline struct dc_link *get_edp_link (const struct dc *dc) +static inline void get_edp_links (const struct dc *dc, +struct dc_link **edp_links, +int *edp_num) {int i; -// report any eDP links, even unconnected DDI's + *edp_num =0 ;for (i =0 ; i < dc->link_count; i++) { -if (dc->links[i]->connector_signal ==SIGNAL_TYPE_EDP ) -return dc->links[i]; +// report any eDP links, even unconnected DDI's +if (dc->links[i]->connector_signal ==SIGNAL_TYPE_EDP ) { + edp_links[*edp_num] = dc->links[i]; +if (++(*edp_num) ==MAX_NUM_EDP ) +return ; + } } -return NULL ; }/* Set backlight level of an embedded panel (eDP, LVDS).
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +1 -0
@@ -216,6 +216,7 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub, res_ctx->pipe_ctx[i].stream->link == link && res_ctx->pipe_ctx[i].stream->link->connector_signal == SIGNAL_TYPE_EDP) { pipe_ctx = &res_ctx->pipe_ctx[i]; +//TODO: refactor for multi edp support break ; } }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +46 -26
122 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +18 -11
@@ -1462,19 +1462,26 @@ void dcn10_init_hw(struct dc *dc)*/ void dcn10_power_down_on_boot (struct dc *dc) { -int i =0 ; +struct dc_link *edp_links[MAX_NUM_EDP ];struct dc_link *edp_link; +int edp_num; +int i =0 ; - edp_link =get_edp_link (dc); -if (edp_link && - edp_link->link_enc->funcs->is_dig_enabled && - edp_link->link_enc->funcs->is_dig_enabled (edp_link->link_enc) && - dc->hwseq->funcs.edp_backlight_control && - dc->hwss.power_down && - dc->hwss.edp_power_control) { - dc->hwseq->funcs.edp_backlight_control (edp_link, false); - dc->hwss.power_down (dc); - dc->hwss.edp_power_control (edp_link, false); +get_edp_links (dc, edp_links, &edp_num); + +if (edp_num) { +for (i =0 ; i < edp_num; i++) { + edp_link = edp_links[i]; +if (edp_link->link_enc->funcs->is_dig_enabled && + edp_link->link_enc->funcs->is_dig_enabled (edp_link->link_enc) && + dc->hwseq->funcs.edp_backlight_control && + dc->hwss.power_down && + dc->hwss.edp_power_control) { + dc->hwseq->funcs.edp_backlight_control (edp_link, false); + dc->hwss.power_down (dc); + dc->hwss.edp_power_control (edp_link, false); + } + } }else {for (i =0 ; i < dc->link_count; i++) {struct dc_link *link = dc->links[i];
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +19 -12
@@ -421,11 +421,12 @@ void dcn30_program_all_writeback_pipes_in_tree(void dcn30_init_hw (struct dc *dc) { -int i, j;struct abm **abms = dc->res_pool->multiple_abms;struct dce_hwseq *hws = dc->hwseq;struct dc_bios *dcb = dc->ctx->dc_bios;struct resource_pool *res_pool = dc->res_pool; +int i, j; +int edp_num;uint32_t backlight =MAX_BACKLIGHT_LEVEL ;if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks)
@@ -574,17 +575,23 @@ void dcn30_init_hw(struct dc *dc)* if DIG is turned on and seamless boot not enabled */ if (dc->config.power_down_display_on_boot) { -struct dc_link *edp_link =get_edp_link (dc); - -if (edp_link && - edp_link->link_enc->funcs->is_dig_enabled && - edp_link->link_enc->funcs->is_dig_enabled (edp_link->link_enc) && - dc->hwss.edp_backlight_control && - dc->hwss.power_down && - dc->hwss.edp_power_control) { - dc->hwss.edp_backlight_control (edp_link, false); - dc->hwss.power_down (dc); - dc->hwss.edp_power_control (edp_link, false); +struct dc_link *edp_links[MAX_NUM_EDP ]; +struct dc_link *edp_link; + +get_edp_links (dc, edp_links, &edp_num); +if (edp_num) { +for (i =0 ; i < edp_num; i++) { + edp_link = edp_links[i]; +if (edp_link->link_enc->funcs->is_dig_enabled && + edp_link->link_enc->funcs->is_dig_enabled (edp_link->link_enc) && + dc->hwss.edp_backlight_control && + dc->hwss.power_down && + dc->hwss.edp_power_control) { + dc->hwss.edp_backlight_control (edp_link, false); + dc->hwss.power_down (dc); + dc->hwss.edp_power_control (edp_link, false); + } + } }else {for (i =0 ; i < dc->link_count; i++) {struct dc_link *link = dc->links[i];
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/11 drm/amd/display: Return invalid state if GPINT times out
In reply to Rodrigo SiqueiraFrom: Wyatt Wood <[email protected]>
[Why]
GPINT timeout is causing PSR_STATE_0 to be returned when it shouldn't. We must guarantee that PSR is fully disabled before doing hw programming on driver-side.
[How]
Return invalid state if GPINT command times out. Let existing retry logic send the GPINT until successful.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +10 -5
@@ -81,13 +81,18 @@ static void dmub_psr_get_state(struct dmub_psr *dmub, enum dc_psr_state *state) {struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;uint32_t raw_state; +enum dmub_status status =DMUB_STATUS_INVALID ;// Send gpint command and wait for ack -dmub_srv_send_gpint_command (srv,DMUB_GPINT__GET_PSR_STATE ,0 ,30 ); - -dmub_srv_get_gpint_response (srv, &raw_state); - - *state =convert_psr_state (raw_state); + status =dmub_srv_send_gpint_command (srv,DMUB_GPINT__GET_PSR_STATE ,0 ,30 ); + +if (status ==DMUB_STATUS_OK ) { +// GPINT was executed, get response +dmub_srv_get_gpint_response (srv, &raw_state); + *state =convert_psr_state (raw_state); + }else +// Return invalid state when GPINT times out + *state =0xFF ; }/*
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/11 drm/amd/display: Implement dmub trace event
In reply to Rodrigo SiqueiraFrom: Yongqiang Sun <[email protected]>
[Why & How]
DMUB FW send trace event via outbox0 interrupt. Driver will handle it.
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 +++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 16 +++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 6 +++ drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 + drivers/gpu/drm/amd/display/dc/irq_types.h | 1 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 14 ++++++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 3 ++ .../amd/display/dmub/inc/dmub_trace_buffer.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 18 +++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 17 ++++++- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 48 ++++++++++++++++++- 11 files changed, 128 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +6 -0
@@ -663,3 +663,9 @@ void dm_helpers_free_gpu_mem( {// TODO } + +bool dm_helpes_dmub_outbox0_interrupt_control (struct dc_context *ctx,bool enable) +{ +// TODO +return true; +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +16 -0
@@ -26,6 +26,7 @@#include "dc.h" #include "dc_dmub_srv.h" #include "../dmub/dmub_srv.h" +#include "dm_helpers.h" #define CTX dc_dmub_srv->ctx#define DC_LOGGER CTX->logger
@@ -170,3 +171,18 @@ bool dc_dmub_srv_notify_stream_mask(struct dc_dmub_srv *dc_dmub_srv, dmub,DMUB_GPINT__IDLE_OPT_NOTIFY_STREAM_MASK , stream_mask, timeout) == DMUB_STATUS_OK; } + +enum dmub_status dc_dmub_srv_get_dmub_outbox0_msg (const struct dc *dc,struct dmcub_trace_buf_entry *entry) +{ +struct dmub_srv *dmub = dc->ctx->dmub_srv->dmub; +enum dmub_status status; + + status =dmub_srv_get_outbox0_msg (dmub, entry); + +return status; +} + +void dc_dmub_trace_event_control (struct dc *dc,bool enable) +{ +dm_helpes_dmub_outbox0_interrupt_control (dc->ctx, enable); +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +6 -0
@@ -30,6 +30,7 @@#include "dmub/dmub_srv.h" struct dmub_srv ; +struct dc ;struct dc_reg_helper_state {bool gather_in_progress;
@@ -60,4 +61,9 @@ bool dc_dmub_srv_cmd_with_reply_data(struct dc_dmub_srv *dc_dmub_srv, union dmubbool dc_dmub_srv_notify_stream_mask (struct dc_dmub_srv *dc_dmub_srv,unsigned int stream_mask); + +enum dmub_status dc_dmub_srv_get_dmub_outbox0_msg (const struct dc *dc,struct dmcub_trace_buf_entry *entry); + +void dc_dmub_trace_event_control (struct dc *dc,bool enable); +#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/dm_helpers.h +2 -0
@@ -156,4 +156,6 @@ void dm_set_dcn_clocks(struct dc_context *ctx, struct dc_clocks *clks); +bool dm_helpes_dmub_outbox0_interrupt_control (struct dc_context *ctx,bool enable); +#endif /* __DM_HELPERS__ */
drivers/gpu/drm/amd/display/dc/irq_types.h +1 -0
@@ -151,6 +151,7 @@ enum dc_irq_source {DC_IRQ_SOURCE_DC5_VLINE1 ,DC_IRQ_SOURCE_DC6_VLINE1 ,DC_IRQ_DMCUB_OUTBOX1 , +DC_IRQ_SOURCE_DMCUB_OUTBOX0 , DAL_IRQ_SOURCES_NUMBER };
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +14 -0
@@ -74,6 +74,8 @@ extern "C" {struct dmub_srv ;struct dmub_srv_common_regs ; +struct dmcub_trace_buf_entry ; +/* enum dmub_status - return code for dmcub functions */ enum dmub_status {DMUB_STATUS_OK =0 ,
@@ -272,6 +274,13 @@ struct dmub_srv_hw_funcs {void (*set_outbox1_rptr)(struct dmub_srv *dmub,uint32_t rptr_offset); +void (*setup_outbox0)(struct dmub_srv *dmub, +const struct dmub_region *outbox0); + +uint32_t (*get_outbox0_wptr)(struct dmub_srv *dmub); + +void (*set_outbox0_rptr)(struct dmub_srv *dmub,uint32_t rptr_offset); +uint32_t (*emul_get_inbox1_rptr)(struct dmub_srv *dmub);void (*emul_set_inbox1_wptr)(struct dmub_srv *dmub,uint32_t wptr_offset);
@@ -295,6 +304,7 @@ struct dmub_srv_hw_funcs { union dmub_gpint_data_register reg);uint32_t (*get_gpint_response)(struct dmub_srv *dmub); + };/**
@@ -360,6 +370,8 @@ struct dmub_srv {*/ struct dmub_rb outbox1_rb; +struct dmub_rb outbox0_rb; +bool sw_init;bool hw_init;
@@ -655,6 +667,8 @@ enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub,enum dmub_status dmub_srv_cmd_with_reply_data (struct dmub_srv *dmub,union dmub_rb_cmd *cmd); +enum dmub_status dmub_srv_get_outbox0_msg (struct dmub_srv *dmub,struct dmcub_trace_buf_entry *entry); +#if defined(__cplusplus) }#endif
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +3 -0
@@ -79,6 +79,9 @@/* Maximum number of planes on any ASIC. */ #define DMUB_MAX_PLANES 6 +/* Trace buffer offset for entry */ +#define TRACE_BUFFER_ENTRY_OFFSET 16 +#ifndef PHYSICAL_ADDRESS_LOC #define PHYSICAL_ADDRESS_LOC union large_integer#endif
drivers/gpu/drm/amd/display/dmub/inc/dmub_trace_buffer.h +1 -2
@@ -25,7 +25,7 @@#ifndef _DMUB_TRACE_BUFFER_H_#define _DMUB_TRACE_BUFFER_H_ -#include "dmub_types.h" +#include "dmub_cmd.h" #define LOAD_DMCU_FW 1#define LOAD_PHY_FW 2
@@ -65,5 +65,4 @@ struct dmcub_trace_buf { struct dmcub_trace_buf_entry entries[PERF_TRACE_MAX_ENTRY]; }; -#endif /* _DMUB_TRACE_BUFFER_H_ */
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +18 -0
@@ -319,6 +319,24 @@ void dmub_dcn20_set_outbox1_rptr(struct dmub_srv *dmub, uint32_t rptr_offset)REG_WRITE (DMCUB_OUTBOX1_RPTR , rptr_offset); } +void dmub_dcn20_setup_outbox0 (struct dmub_srv *dmub, +const struct dmub_region *outbox0) +{ +REG_WRITE (DMCUB_OUTBOX0_BASE_ADDRESS , outbox0->base); + +REG_WRITE (DMCUB_OUTBOX0_SIZE , outbox0->top - outbox0->base); +} + +uint32_t dmub_dcn20_get_outbox0_wptr (struct dmub_srv *dmub) +{ +return REG_READ (DMCUB_OUTBOX0_WPTR ); +} + +void dmub_dcn20_set_outbox0_rptr (struct dmub_srv *dmub,uint32_t rptr_offset) +{ +REG_WRITE (DMCUB_OUTBOX0_RPTR , rptr_offset); +} +bool dmub_dcn20_is_hw_init (struct dmub_srv *dmub) {uint32_t is_hw_init;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h +15 -2
@@ -40,6 +40,10 @@ struct dmub_srv; DMUB_SR(DMCUB_INBOX1_SIZE) \ DMUB_SR(DMCUB_INBOX1_RPTR) \ DMUB_SR(DMCUB_INBOX1_WPTR) \ + DMUB_SR(DMCUB_OUTBOX0_BASE_ADDRESS) \ + DMUB_SR(DMCUB_OUTBOX0_SIZE) \ + DMUB_SR(DMCUB_OUTBOX0_RPTR) \ + DMUB_SR(DMCUB_OUTBOX0_WPTR) \ DMUB_SR(DMCUB_OUTBOX1_BASE_ADDRESS) \ DMUB_SR(DMCUB_OUTBOX1_SIZE) \ DMUB_SR(DMCUB_OUTBOX1_RPTR) \
@@ -102,7 +106,8 @@ struct dmub_srv; DMUB_SR(CC_DC_PIPE_DIS) \ DMUB_SR(MMHUBBUB_SOFT_RESET) \ DMUB_SR(DCN_VM_FB_LOCATION_BASE) \ - DMUB_SR(DCN_VM_FB_OFFSET) + DMUB_SR(DCN_VM_FB_OFFSET) \ + DMUB_SR(DMCUB_INTERRUPT_ACK) #define DMUB_COMMON_FIELDS() \ DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \
@@ -135,7 +140,8 @@ struct dmub_srv; DMUB_SF(CC_DC_PIPE_DIS, DC_DMCUB_ENABLE) \ DMUB_SF(MMHUBBUB_SOFT_RESET, DMUIF_SOFT_RESET) \ DMUB_SF(DCN_VM_FB_LOCATION_BASE, FB_BASE) \ - DMUB_SF(DCN_VM_FB_OFFSET, FB_OFFSET) + DMUB_SF(DCN_VM_FB_OFFSET, FB_OFFSET) \ + DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_OUTBOX0_READY_INT_ACK)struct dmub_srv_common_reg_offset {#define DMUB_SR (reg) uint32_t reg;
@@ -196,6 +202,13 @@ uint32_t dmub_dcn20_get_outbox1_wptr(struct dmub_srv *dmub);void dmub_dcn20_set_outbox1_rptr (struct dmub_srv *dmub,uint32_t rptr_offset); +void dmub_dcn20_setup_outbox0 (struct dmub_srv *dmub, +const struct dmub_region *outbox0); + +uint32_t dmub_dcn20_get_outbox0_wptr (struct dmub_srv *dmub); + +void dmub_dcn20_set_outbox0_rptr (struct dmub_srv *dmub,uint32_t rptr_offset); +bool dmub_dcn20_is_hw_init (struct dmub_srv *dmub);bool dmub_dcn20_is_supported (struct dmub_srv *dmub);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +46 -2
100 lines not on this page · raw message
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/11 drm/amd/display: [FW Promotion] Release 0.0.54
In reply to Rodrigo SiqueiraFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -2
@@ -47,10 +47,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x3ac600697 +#define DMUB_FW_VERSION_GIT_HASH 0x22538c5e3#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 53 +#define DMUB_FW_VERSION_REVISION 54#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/11 drm/amd/display: 3.2.125
In reply to Rodrigo SiqueiraFrom: Aric Cyr <[email protected]>
DC version 3.2.125 brings improvements in multiple areas. In summary, we highlight:
- DSC fixes
- Enable ASSR
- Firmware relase 0.0.54
- eDP interface refactor for multiple eDP
--- 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
@@ -45,7 +45,7 @@/* forward declaration */ struct aux_payload ; -#define DC_VER "3.2.124" +#define DC_VER "3.2.125"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/11 drm/amd/display: treat memory as a single-channel for asymmetric memory
In reply to Rodrigo SiqueiraFrom: Hugo Hu <[email protected]>
[Why]
1. Driver use umachannelnumber to calculate watermarks for stutter. In asymmetric memory config, the actual bandwidth is less than dual-channel. The bandwidth should be the same as single-channel.
2. We found single rank dimm need additional delay time for stutter.
[How]
Get information from each DIMM. Treat memory config as a single-channel for asymmetric memory in bandwidth calculating. Add additional delay time for single rank dimm.
--- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 48 ++++++++++++++++++- drivers/gpu/drm/amd/display/dc/dc.h | 2 + 2 files changed, 48 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +46 -2
@@ -761,6 +761,43 @@ static struct wm_table ddr4_wm_table_rn = { } }; +static struct wm_table ddr4_1R_wm_table_rn = { + .entries = { + { + .wm_inst =WM_A , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =13.90 , + .sr_enter_plus_exit_time_us =14.80 , + .valid = true, + }, + { + .wm_inst =WM_B , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =13.90 , + .sr_enter_plus_exit_time_us =14.80 , + .valid = true, + }, + { + .wm_inst =WM_C , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =13.90 , + .sr_enter_plus_exit_time_us =14.80 , + .valid = true, + }, + { + .wm_inst =WM_D , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =13.90 , + .sr_enter_plus_exit_time_us =14.80 , + .valid = true, + }, + } +}; +static struct wm_table lpddr4_wm_table_rn = { .entries = { {
@@ -932,8 +969,12 @@ void rn_clk_mgr_construct( }else {if (is_green_sardine) rn_bw_params.wm_table = ddr4_wm_table_gs; -else - rn_bw_params.wm_table = ddr4_wm_table_rn; +else { +if (ctx->dc->config.is_single_rank_dimm) + rn_bw_params.wm_table = ddr4_1R_wm_table_rn; +else + rn_bw_params.wm_table = ddr4_wm_table_rn; + } }/* Saved clocks configured at boot for debug purposes */ rn_dump_clk_registers (&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info);
@@ -951,6 +992,9 @@ void rn_clk_mgr_construct(if (status ==PP_SMU_RESULT_OK && ctx->dc_bios && ctx->dc_bios->integrated_info) {rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, ctx->dc_bios->integrated_info); +/* treat memory config as single channel if memory is asymmetrics. */ +if (ctx->dc->config.is_asymmetric_memory) + clk_mgr->base.bw_params->num_channels =1 ; } }
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -307,6 +307,8 @@ struct dc_config {#endif uint64_t vblank_alignment_dto_params;uint8_t vblank_alignment_max_frame_time_diff; +bool is_asymmetric_memory; +bool is_single_rank_dimm; };enum visual_confirm {
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/11 drm/amd/display: Fix HSplit causing increase in DSC Slice Count
In reply to Rodrigo SiqueiraFrom: Dillon Varone <[email protected]>
[Why?]
HSplit should not affect DSC slice count. Can cause improper timings to be applied for certain modes.
[How?]
No longer change DSC Slice count based on HSplit.
--- drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +1 -1
@@ -4050,7 +4050,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l v->RequiredDPPCLK[i][j][NumberOfNonSplitPlaneOfMaximumBandwidth] = v->MinDPPCLKUsingSingleDPP[NumberOfNonSplitPlaneOfMaximumBandwidth] * (1 + v->DISPCLKDPPCLKDSCCLKDownSpreading /100 ) /2 ; v->TotalNumberOfActiveDPP[i][j] = v->TotalNumberOfActiveDPP[i][j] +1 ; - v->TotalNumberOfSingleDPPPlanes[i][j] = v->TotalNumberOfSingleDPPPlanes[i][j] +1 ; + v->TotalNumberOfSingleDPPPlanes[i][j] = v->TotalNumberOfSingleDPPPlanes[i][j] -1 ; } }if (v->TotalNumberOfActiveDPP[i][j] > v->MaxNumDPP) {
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +0 -3
@@ -599,7 +599,6 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib)for (k = j +1 ; k < mode_lib->vba.cache_num_pipes; ++k) {display_pipe_source_params_st *src_k = &pipes[k].pipe.src;display_pipe_dest_params_st *dst_k = &pipes[k].pipe.dest; -display_output_params_st *dout_k = &pipes[j].dout;if (src_k->is_hsplit && !visited[k] && src->hsplit_grp == src_k->hsplit_grp) {
@@ -620,8 +619,6 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.ViewportHeightChroma[mode_lib->vba.NumberOfActivePlanes] += src_k->viewport_height_c; } - mode_lib->vba.NumberOfDSCSlices[mode_lib->vba.NumberOfActivePlanes] += - dout_k->dsc_slices; visited[k] = true; }
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Hi all,
This week this patchset was tested on a HP Envy 360, with Ryzen 5 4500U, on the following display types (via usb-c to dp/dvi/hdmi/vga):
4k 60z, 1440p 144hz, 1680*1050 60hz, internal eDP 1080p 60hz
Tested on a Sapphire Pulse RX5700XT on the following display types (via DP):
4k60 60hz, 1440p 144hz, 1680x1050 60hz.
Also tested on a Reference AMD RX6800 on the following display types (via DP):
4k60 60hz, 1440p 144hz.
Also using a MST hub at 2x 4k 30hz on all systems.
Thank you,
Dan Wheeler
Technologist | AMD
SW Display
O +(1) 905-882-2600 ext. 74665
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook<https://www.facebook.com/AMD> | Twitter<https://twitter.com/AMD> | amd.com<http://www.amd.com/>
[cid:5f8f9fda-f3f5-49c8-a572-1d161100be13]
________________________________
From: Siqueira, Rodrigo <[email protected]>
Sent: February 26, 2021 5:36 PM
To: [email protected] <[email protected]>
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing <[email protected]>; Brol, Eryk <[email protected]>; R, Bindu <[email protected]>; Li, Roman <[email protected]>; Jacob, Anson <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/11] DC Patches Feb 26th, 2021
DC version 3.2.125 brings improvements in multiple areas. In summary, we highlight:
- DSC fixes
- Firmware relase 0.0.54
- eDP interface refactor for multiple eDP
Best Regards
Siqueira
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.54
Aric Cyr (1):
drm/amd/display: 3.2.125
Dillon Varone (1):
drm/amd/display: Fix HSplit causing increase in DSC Slice Count
Eryk Brol (1):
drm/amd/display: Add max bpc debugfs
Hugo Hu (1):
drm/amd/display: treat memory as a single-channel for asymmetric
memory
Jake Wang (1):
drm/amd/display: Refactored DC interfaces to support multiple eDP
Jimmy Kizito (1):
drm/amd/display: Update link encoder object creation
Max.Tseng (1):
drm/amd/display: Add flag for building infopacket
Meenakshikumar Somasundaram (1):
drm/amd/display: Support for DMUB AUX
Wyatt Wood (1):
drm/amd/display: Return invalid state if GPINT times out
Yongqiang Sun (1):
drm/amd/display: Implement dmub trace event
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 153 +++++++++++++++++- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 +- drivers/gpu/drm/amd/display/dc/Makefile | 2 +- .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 17 +- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 48 +++++- drivers/gpu/drm/amd/display/dc/core/dc.c | 112 ++++++++++++- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 14 +- .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 3 +- drivers/gpu/drm/amd/display/dc/core/dc_stat.c | 64 ++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 17 +- drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 10 -- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 16 ++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 6 + drivers/gpu/drm/amd/display/dc/dc_link.h | 19 ++- drivers/gpu/drm/amd/display/dc/dc_stat.h | 42 +++++ drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 40 ++--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | 3 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 60 +++++++ .../gpu/drm/amd/display/dc/dce/dmub_outbox.h | 33 ++++ drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 16 +- .../display/dc/dce110/dce110_hw_sequencer.c | 72 ++++++--- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 34 ++-- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 31 ++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 + .../dc/dml/dcn30/display_mode_vba_30.c | 2 +- .../drm/amd/display/dc/dml/display_mode_vba.c | 3 - .../gpu/drm/amd/display/dc/inc/core_types.h | 13 ++ .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h | 3 +- .../drm/amd/display/dc/inc/hw/aux_engine.h | 4 +- .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 1 + drivers/gpu/drm/amd/display/dc/inc/resource.h | 1 + drivers/gpu/drm/amd/display/dc/irq_types.h | 3 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 55 +++++++ .../gpu/drm/amd/display/dmub/dmub_srv_stat.h | 41 +++++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 7 +- .../amd/display/dmub/inc/dmub_trace_buffer.h | 3 +- drivers/gpu/drm/amd/display/dmub/src/Makefile | 2 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 50 ++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 28 +++- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 77 ++++++++- .../drm/amd/display/dmub/src/dmub_srv_stat.c | 105 ++++++++++++ .../amd/display/modules/freesync/freesync.c | 28 +++- .../amd/display/modules/inc/mod_freesync.h | 3 +- 46 files changed, 1135 insertions(+), 137 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/core/dc_stat.c create mode 100644 drivers/gpu/drm/amd/display/dc/dc_stat.h create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.h create mode 100644 drivers/gpu/drm/amd/display/dmub/dmub_srv_stat.h create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx