DC Patches Jan 31, 2017
Subsystems (3)
cover DC Patches Jan 31, 2017
* warning fixes
* DMCU loader
* some cleanup
* some fixes
Anthony Koo (5):
drm/amd/display: Fix compile warnings drm/amd/display: DMCU Compile and Load drm/amd/display: Move backlight from encoder to ABM drm/amd/display: Support ABM without PPlib drm/amd/display: Debug option to force enable ABM
Charlene Liu (1):
drm/amd/display: remove CV-specific timing standard
Dmytro Laktyushkin (2):
drm/amd/display: Make new pixel clock more obvious drm/amd/display: add dcfclk reporting to pplib
Leon Elazar (2):
drm/amd/display: DP compliance automation test fixes drm/amd/display: surface validation on dce100
Yongqiang Sun (3):
drm/amd/display: Expose hw sequencer gamma function drm/amd/display: Change power gating off sequence to fix hang drm/amd/display: Changes for enable dcc mode.
drivers/gpu/drm/amd/display/dc/core/dc.c | 101 +---- .../gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 - drivers/gpu/drm/amd/display/dc/core/dc_link.c | 75 ++-- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 19 +- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 4 + drivers/gpu/drm/amd/display/dc/dc.h | 10 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 - drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 448 +++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_abm.h | 184 +++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 127 ++++++ drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h | 91 +++++ .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 298 +------------- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 24 -- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 4 - .../drm/amd/display/dc/dce100/dce100_resource.c | 4 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 10 +- .../amd/display/dc/dce110/dce110_hw_sequencer.h | 3 + .../drm/amd/display/dc/dce110/dce110_opp_csc_v.c | 5 - .../drm/amd/display/dc/dce110/dce110_resource.c | 52 +++ .../drm/amd/display/dc/dce112/dce112_resource.c | 51 +++ drivers/gpu/drm/amd/display/dc/inc/core_types.h | 4 + drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 45 +++ drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h | 42 ++ .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 6 - drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 4 - .../amd/display/dc/virtual/virtual_link_encoder.c | 13 - .../drm/amd/display/modules/freesync/freesync.c | 7 +- 29 files changed, 1121 insertions(+), 522 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_abm.h create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/abm.h create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170131182420.14926-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
PATCH 1/13 drm/amd/display: Fix compile warnings
From: Anthony Koo <[email protected]>
1. Fix init of integer
2. Fix mixed declarations
--- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +3 -4
@@ -208,6 +208,8 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,struct core_stream *core_stream =NULL ;struct core_dc *core_dc =NULL ;struct core_freesync *core_freesync =NULL ; +int persistent_freesync_enable =0 ; +struct persistent_data_flag flag;if (mod_freesync ==NULL )return false;
@@ -216,9 +218,6 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync, core_stream =DC_STREAM_TO_CORE (stream); core_dc =DC_TO_CORE (core_freesync->dc); -int persistent_freesync_enable =0 ; -struct persistent_data_flag flag; - flag.save_per_edid = true; flag.save_per_link = false;
@@ -779,7 +778,7 @@ bool mod_freesync_get_state(struct mod_freesync *mod_freesync,const struct dc_stream *stream, struct mod_freesync_params *freesync_params) { - unsigned int index = NULL; + unsigned int index = 0;struct core_freesync *core_freesync =NULL ;if (mod_freesync ==NULL )
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/13 drm/amd/display: Expose hw sequencer gamma function
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
@@ -578,7 +578,7 @@ static bool convert_to_custom_float(return true; } -static bool dce110_translate_regamma_to_hw_format (const struct dc_transfer_func +bool dce110_translate_regamma_to_hw_format (const struct dc_transfer_func *output_tf,struct pwl_params *regamma_params) {struct curve_points *arr_points;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +3 -0
@@ -58,5 +58,8 @@ void dce110_power_down(struct core_dc *dc);void dce110_update_pending_status (struct pipe_ctx *pipe_ctx); +bool dce110_translate_regamma_to_hw_format (const struct dc_transfer_func + *output_tf,struct pwl_params *regamma_params); +#endif /* __DC_HWSS_DCE110_H__ */
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/13 drm/amd/display: DP compliance automation test fixes
In reply to a message not in the archiveFrom: Leon Elazar <[email protected]>
Fixes:
1. Removing pending flag since we are executing teh entire flow without context switches
2. Adding stream enablment - connection between DIG BE to DIG FE during test link training
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 19 +------------------ drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 3 +-- 3 files changed, 6 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -18
@@ -1738,8 +1738,7 @@ static void handle_automated_test(struct core_link *link) }if (test_request.bits.LINK_TEST_PATTRN) {dp_test_send_link_test_pattern (link); - link->public.compliance_test_state.bits. - SET_TEST_PATTERN_PENDING =1 ; + test_response.bits.ACK =1 ; }if (test_request.bits.PHY_TEST_PATTERN) {dp_test_send_phy_test_pattern (link);
@@ -2308,11 +2307,9 @@ bool dc_link_dp_set_test_pattern(unsigned int i;unsigned char link_qual_pattern[LANE_COUNT_DP_MAX ] = {0 };union dpcd_training_pattern training_pattern; -union test_response test_response;enum dpcd_phy_test_patterns pattern;memset (&training_pattern,0 ,sizeof (training_pattern)); -memset (&test_response,0 ,sizeof (test_response));for (i =0 ; i <MAX_PIPES ; i++) {if (pipes[i].stream->sink->link == core_link) {
@@ -2442,20 +2439,6 @@ bool dc_link_dp_set_test_pattern(set_crtc_test_pattern (core_link, &pipe_ctx, test_pattern);/* Set Test Pattern state */ core_link->public.test_pattern_enabled = true; - -/* If this is called because of compliance test request, -* we respond ack here. -*/ -if (core_link->public.compliance_test_state.bits. - SET_TEST_PATTERN_PENDING ==1 ) { - core_link->public.compliance_test_state.bits. - SET_TEST_PATTERN_PENDING =0 ; - test_response.bits.ACK =1 ; -core_link_write_dpcd (core_link, -DP_TEST_RESPONSE , - &test_response.raw, -sizeof (test_response)); - } }return true;
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +4 -0
@@ -251,6 +251,8 @@ void dp_retrain_link_dp_test(struct core_link *link,dp_receiver_power_ctrl (link, false); + link->dc->hwss.disable_stream (&pipes[i]); + link->link_enc->funcs->disable_output ( link->link_enc,SIGNAL_TYPE_DISPLAY_PORT );
@@ -273,6 +275,8 @@ void dp_retrain_link_dp_test(struct core_link *link, link->public.cur_link_settings = *link_setting; + link->dc->hwss.enable_stream (&pipes[i]); + link->dc->hwss.unblank_stream (&pipes[i], link_setting); }
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +1 -2
@@ -432,8 +432,7 @@ union phy_test_pattern {union compliance_test_state {struct {unsigned char STEREO_3D_RUNNING :1 ; -unsigned char SET_TEST_PATTERN_PENDING :1 ; -unsigned char RESERVED :6 ; +unsigned char RESERVED :7 ; } bits;unsigned char raw; };
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/13 drm/amd/display: Change power gating off sequence to fix hang
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
Power off plane clear all the reg values includes cursor. When OS call set cursor position, cursor address reg is cleared, results in system hard hang.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +5 -2
@@ -1254,9 +1254,12 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)post_surface_trace (dc);for (i =0 ; i < core_dc->current_context->res_ctx.pool->pipe_count; i++) -if (core_dc->current_context->res_ctx.pipe_ctx[i].stream ==NULL ) +if (core_dc->current_context->res_ctx.pipe_ctx[i].stream ==NULL ) { + core_dc->current_context->res_ctx.pipe_ctx[i].pipe_idx = i; core_dc->hwss.power_down_front_end ( - core_dc, &core_dc->current_context->res_ctx.pipe_ctx[i]); + core_dc, &core_dc->current_context->res_ctx.pipe_ctx[i]); + } +if (core_dc->res_pool->funcs->validate_bandwidth (core_dc, core_dc->current_context) !=DC_OK ) {
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/13 drm/amd/display: DMCU Compile and Load
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 16 -- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 12 -- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 214 +++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_abm.h | 157 +++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 127 ++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h | 91 +++++++++ .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 40 +--- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 6 + .../drm/amd/display/dc/dce110/dce110_resource.c | 52 +++++ .../drm/amd/display/dc/dce112/dce112_resource.c | 51 +++++ drivers/gpu/drm/amd/display/dc/inc/core_types.h | 3 + drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 40 ++++ drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h | 42 ++++ .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 1 - 16 files changed, 788 insertions(+), 70 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_abm.h create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/abm.h create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -16
@@ -268,19 +268,6 @@ static bool init_dmcu_backlight_settings(struct dc *dc)return true; } - -static bool set_abm_level (struct dc *dc,unsigned int abm_level) -{ -struct core_dc *core_dc =DC_TO_CORE (dc); -int i; - -for (i =0 ; i < core_dc->link_count; i++) -dc_link_set_abm_level (&core_dc->links[i]->public, - abm_level); - -return true; -} -static bool set_psr_enable (struct dc *dc,bool enable) {struct core_dc *core_dc =DC_TO_CORE (dc);
@@ -409,9 +396,6 @@ static void allocate_dc_stream_funcs(struct core_dc *core_dc) core_dc->public.stream_funcs.init_dmcu_backlight_settings = init_dmcu_backlight_settings; - core_dc->public.stream_funcs.set_abm_level = - set_abm_level; - core_dc->public.stream_funcs.set_psr_enable = set_psr_enable;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -12
@@ -1432,18 +1432,6 @@ bool dc_link_init_dmcu_backlight_settings(const struct dc_link *dc_link)return true; } -bool dc_link_set_abm_level (const struct dc_link *dc_link,uint32_t level) -{ -struct core_link *link =DC_LINK_TO_CORE (dc_link); -struct dc_context *ctx = link->ctx; - -dm_logger_write (ctx->logger,LOG_BACKLIGHT , -"New abm level: %d (0x%X)\n" , level, level); - - link->link_enc->funcs->set_dmcu_abm_level (link->link_enc, level); -return true; -} -bool dc_link_set_psr_enable (const struct dc_link *dc_link,bool enable) {struct core_link *link =DC_LINK_TO_CORE (dc_link);
drivers/gpu/drm/amd/display/dc/dc.h +1 -3
@@ -103,7 +103,6 @@ struct dc_stream_funcs {bool (*set_backlight)(struct dc *dc,unsigned int backlight_level,unsigned int frame_ramp,const struct dc_stream *stream);bool (*init_dmcu_backlight_settings)(struct dc *dc); -bool (*set_abm_level)(struct dc *dc,unsigned int abm_level);bool (*set_psr_enable)(struct dc *dc,bool enable);bool (*setup_psr)(struct dc *dc,const struct dc_stream *stream); };
@@ -575,8 +574,6 @@ bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,bool dc_link_init_dmcu_backlight_settings (const struct dc_link *dc_link); -bool dc_link_set_abm_level (const struct dc_link *dc_link,uint32_t level); -bool dc_link_set_psr_enable (const struct dc_link *dc_link,bool enable); bool dc_link_setup_psr(const struct dc_link *dc_link,
@@ -730,4 +727,5 @@ bool dc_submit_i2c(uint32_t link_index, struct i2c_command *cmd); +#endif /* DC_INTERFACE_H_ */
drivers/gpu/drm/amd/display/dc/dce/Makefile +1 -1
@@ -7,7 +7,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_clocks.o dce_opp.o +dce_clocks.o dce_opp.o dce_dmcu.o dce_abm.o AMD_DAL_DCE = $(addprefix $(AMDDALPATH)/dc/dce/,$(DCE))
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c new file +214 -0
214 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_abm.h new file +157 -0
157 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c new file +127 -0
127 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h new file +91 -0
91 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +3 -37
@@ -142,7 +142,6 @@ static const struct link_encoder_funcs dce110_lnk_enc_funcs = { dce110_link_encoder_set_dmcu_backlight_level, .init_dmcu_backlight_settings = dce110_link_encoder_init_dmcu_backlight_settings, - .set_dmcu_abm_level = dce110_link_encoder_set_dmcu_abm_level, .set_dmcu_psr_enable = dce110_link_encoder_set_dmcu_psr_enable, .setup_dmcu_psr = dce110_link_encoder_setup_dmcu_psr, .backlight_control = dce110_link_encoder_edp_backlight_control,
@@ -1769,8 +1768,7 @@ void dce110_link_encoder_init_dmcu_backlight_settings(* Bios bug w/a - period resets to zero, * restoring to cache values which is always correct */ -REG_GET (BL_PWM_CNTL , -BL_ACTIVE_INT_FRAC_CNT , &value); +REG_GET (BL_PWM_CNTL ,BL_ACTIVE_INT_FRAC_CNT , &value);if (value ==0 || bl_pwm_cntl ==1 ) {if (stored_backlight_registers.vBL_PWM_CNTL !=0 ) { pwmCntl = stored_backlight_registers.vBL_PWM_CNTL;
@@ -1810,36 +1808,6 @@ void dce110_link_encoder_init_dmcu_backlight_settings(/* Enable the backlight output */ REG_UPDATE (BL_PWM_CNTL ,BL_PWM_EN ,1 ); - -} - -void dce110_link_encoder_set_dmcu_abm_level ( -struct link_encoder *enc,uint32_t level) -{ -struct dce110_link_encoder *enc110 =TO_DCE110_LINK_ENC (enc); -struct dc_context *ctx = enc110->base.ctx; - -unsigned int dmcu_max_retry_on_wait_reg_ready =801 ; -unsigned int dmcu_wait_reg_ready_interval =100 ; -unsigned int regValue; - -/* waitDMCUReadyForCmd */ -do { -dm_delay_in_microseconds (ctx, dmcu_wait_reg_ready_interval); - regValue =REG_READ (MASTER_COMM_CNTL_REG ); - dmcu_max_retry_on_wait_reg_ready--; - }while -/* expected value is 0, loop while not 0*/ - ((MASTER_COMM_CNTL_REG__MASTER_COMM_INTERRUPT_MASK & regValue) && - dmcu_max_retry_on_wait_reg_ready >0 ); - -/* setDMCUParam_ABMLevel */ -REG_UPDATE_2 (MASTER_COMM_CMD_REG , -MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_LEVEL_SET , -MASTER_COMM_CMD_REG_BYTE2 , level); - -/* notifyDMCUMsg */ -REG_UPDATE (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,1 ); }static void get_dmcu_psr_state (struct link_encoder *enc,uint32_t *psr_state)
@@ -1856,10 +1824,8 @@ static void get_dmcu_psr_state(struct link_encoder *enc, uint32_t *psr_state)do {dm_delay_in_microseconds (ctx,2 ); -REG_GET (DCI_MEM_PWR_STATUS , -DMCU_IRAM_MEM_PWR_STATE , &value); - }while - (value !=0 && count++ <10 ); +REG_GET (DCI_MEM_PWR_STATUS ,DMCU_IRAM_MEM_PWR_STATE , &value); + }while (value !=0 && count++ <10 );/* Write address to IRAM_RD_ADDR in DMCU_IRAM_RD_CTRL */ REG_WRITE (DMCU_IRAM_RD_CTRL , psrStateOffset);
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 -0
@@ -42,6 +42,7 @@#include "stream_encoder.h" #include "link_encoder.h" #include "clock_source.h" +#include "abm.h" #include "audio.h" #include "dce/dce_hwseq.h"
@@ -2166,6 +2167,7 @@ static void init_hw(struct core_dc *dc)int i;struct dc_bios *bp;struct transform *xfm; +struct abm *abm; bp = dc->ctx->dc_bios;for (i =0 ; i < dc->res_pool->pipe_count; i++) {
@@ -2210,6 +2212,10 @@ static void init_hw(struct core_dc *dc)struct audio *audio = dc->res_pool->audios[i]; audio->funcs->hw_init (audio); } + + abm = dc->res_pool->abm; +if (abm !=NULL ) + abm->funcs->abm_init (abm); }/* TODO: move this to apply_ctx_tohw some how?*/
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +52 -0
76 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +51 -0
75 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/core_types.h +3 -0
@@ -259,6 +259,9 @@ struct resource_pool {struct display_clock *display_clock;struct irq_service *irqs; +struct abm *abm; +struct dmcu *dmcu; +const struct resource_funcs *funcs;const struct resource_caps *res_cap; };
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h new file +40 -0
@@ -0,0 +1,40 @@ +/* Copyright 2012-15 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Authors: AMD +* +*/ + +#ifndef __DC_ABM_H__ +#define __DC_ABM_H__ + +#include "dm_services_types.h" + +struct abm { +struct dc_context *ctx; +const struct abm_funcs *funcs; +}; + +struct abm_funcs { +void (*abm_init)(struct abm *abm); +bool (*set_abm_level)(struct abm *abm,unsigned int abm_level); +}; + +#endif
drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h new file +42 -0
42 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +0 -1
@@ -225,7 +225,6 @@ struct link_encoder_funcs {void (*set_dmcu_backlight_level)(struct link_encoder *enc,uint32_t level,uint32_t frame_ramp,uint32_t controller_id);void (*init_dmcu_backlight_settings)(struct link_encoder *enc); -void (*set_dmcu_abm_level)(struct link_encoder *enc,uint32_t level);void (*set_dmcu_psr_enable)(struct link_encoder *enc,bool enable);void (*setup_dmcu_psr)(struct link_encoder *enc,struct psr_dmcu_context *psr_context);
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/13 drm/amd/display: Move backlight from encoder to ABM
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 34 --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 63 +++-- drivers/gpu/drm/amd/display/dc/dc.h | 5 - drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 264 +++++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dce/dce_abm.h | 35 ++- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 260 -------------------- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 24 -- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 5 + .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 5 - drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 4 - .../amd/display/dc/virtual/virtual_link_encoder.c | 13 - 12 files changed, 316 insertions(+), 400 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -34
@@ -240,34 +240,6 @@ static void stream_update_scaling( } } -static bool set_backlight (struct dc *dc,unsigned int backlight_level, -unsigned int frame_ramp,const struct dc_stream *stream) -{ -struct core_dc *core_dc =DC_TO_CORE (dc); -int i; - -if (stream->sink->sink_signal ==SIGNAL_TYPE_EDP ) { -for (i =0 ; i < core_dc->link_count; i++) -dc_link_set_backlight_level (&core_dc->links[i]->public, - backlight_level, frame_ramp, stream); - } - -return true; - -} - -static bool init_dmcu_backlight_settings (struct dc *dc) -{ -struct core_dc *core_dc =DC_TO_CORE (dc); -int i; - -for (i =0 ; i < core_dc->link_count; i++) -dc_link_init_dmcu_backlight_settings - (&core_dc->links[i]->public); - -return true; -} -static bool set_psr_enable (struct dc *dc,bool enable) {struct core_dc *core_dc =DC_TO_CORE (dc);
@@ -390,12 +362,6 @@ static void allocate_dc_stream_funcs(struct core_dc *core_dc) core_dc->public.stream_funcs.set_gamut_remap = set_gamut_remap; - core_dc->public.stream_funcs.set_backlight = - set_backlight; - - core_dc->public.stream_funcs.init_dmcu_backlight_settings = - init_dmcu_backlight_settings; - core_dc->public.stream_funcs.set_psr_enable = set_psr_enable;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +28 -35
82 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +0 -5
@@ -100,9 +100,6 @@ struct dc_stream_funcs { const struct rect *dst);bool (*set_gamut_remap)(struct dc *dc,const struct dc_stream **stream,int num_streams); -bool (*set_backlight)(struct dc *dc,unsigned int backlight_level, -unsigned int frame_ramp,const struct dc_stream *stream); -bool (*init_dmcu_backlight_settings)(struct dc *dc);bool (*set_psr_enable)(struct dc *dc,bool enable);bool (*setup_psr)(struct dc *dc,const struct dc_stream *stream); };
@@ -572,8 +569,6 @@ const struct graphics_object_id dc_get_link_id_at_index(bool dc_link_set_backlight_level (const struct dc_link *dc_link,uint32_t level,uint32_t frame_ramp,const struct dc_stream *stream); -bool dc_link_init_dmcu_backlight_settings (const struct dc_link *dc_link); -bool dc_link_set_psr_enable (const struct dc_link *dc_link,bool enable); bool dc_link_setup_psr(const struct dc_link *dc_link,
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +249 -15
301 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_abm.h +31 -4
@@ -32,8 +32,13 @@#define ABM_COMMON_REG_LIST_DCE_BASE () \ SR(BL_PWM_PERIOD_CNTL), \ SR(BL_PWM_CNTL), \ + SR(BL_PWM_CNTL2), \ + SR(BL_PWM_GRP1_REG_LOCK), \ + SR(LVTMA_PWRSEQ_REF_DIV), \ SR(MASTER_COMM_CNTL_REG), \ - SR(MASTER_COMM_CMD_REG) + SR(MASTER_COMM_CMD_REG), \ + SR(MASTER_COMM_DATA_REG1), \ + SR(DMCU_STATUS)#define ABM_DCE110_COMMON_REG_LIST () \ ABM_COMMON_REG_LIST_DCE_BASE(), \
@@ -46,7 +51,8 @@SR (BL1_PWM_TARGET_ABM_LEVEL ), \SR (BL1_PWM_USER_LEVEL ), \SR (DC_ABM1_LS_MIN_MAX_PIXEL_VALUE_THRES ), \ - SR(DC_ABM1_HGLS_REG_READ_PROGRESS) +SR (DC_ABM1_HGLS_REG_READ_PROGRESS ), \ + SR(BIOS_SCRATCH_2)#define ABM_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix
@@ -56,9 +62,16 @@ABM_SF (BL_PWM_PERIOD_CNTL ,BL_PWM_PERIOD_BITCNT , mask_sh), \ABM_SF (BL_PWM_CNTL ,BL_ACTIVE_INT_FRAC_CNT , mask_sh), \ABM_SF (BL_PWM_CNTL ,BL_PWM_FRACTIONAL_EN , mask_sh), \ +ABM_SF (BL_PWM_CNTL ,BL_PWM_EN , mask_sh), \ +ABM_SF (BL_PWM_GRP1_REG_LOCK ,BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN , mask_sh), \ +ABM_SF (BL_PWM_GRP1_REG_LOCK ,BL_PWM_GRP1_REG_LOCK , mask_sh), \ +ABM_SF (BL_PWM_GRP1_REG_LOCK ,BL_PWM_GRP1_REG_UPDATE_PENDING , mask_sh), \ +ABM_SF (LVTMA_PWRSEQ_REF_DIV ,BL_PWM_REF_DIV , mask_sh), \ABM_SF (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT , mask_sh), \ABM_SF (MASTER_COMM_CMD_REG ,MASTER_COMM_CMD_REG_BYTE0 , mask_sh), \ - ABM_SF(MASTER_COMM_CMD_REG, MASTER_COMM_CMD_REG_BYTE2, mask_sh) +ABM_SF (MASTER_COMM_CMD_REG ,MASTER_COMM_CMD_REG_BYTE1 , mask_sh), \ +ABM_SF (MASTER_COMM_CMD_REG ,MASTER_COMM_CMD_REG_BYTE2 , mask_sh), \ + ABM_SF(DMCU_STATUS, UC_IN_RESET, mask_sh) #define ABM_MASK_SH_LIST_DCE110(mask_sh) \ ABM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh), \
@@ -91,6 +104,7 @@ABM_SF (DC_ABM1_HGLS_REG_READ_PROGRESS , \ ABM1_BL_REG_READ_MISSED_FRAME_CLEAR, mask_sh) +#define ABM_REG_FIELD_LIST (type) \ type ABM1_HG_NUM_OF_BINS_SEL; \ type ABM1_HG_VMAX_SEL; \
@@ -112,7 +126,14 @@type BL_PWM_FRACTIONAL_EN ; \type MASTER_COMM_INTERRUPT ; \type MASTER_COMM_CMD_REG_BYTE0 ; \ - type MASTER_COMM_CMD_REG_BYTE2 +type MASTER_COMM_CMD_REG_BYTE1 ; \ +type MASTER_COMM_CMD_REG_BYTE2 ; \ +type BL_PWM_REF_DIV ; \ +type BL_PWM_EN ; \ +type UC_IN_RESET ; \ +type BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN ; \ +type BL_PWM_GRP1_REG_LOCK ; \ + type BL_PWM_GRP1_REG_UPDATE_PENDINGstruct dce_abm_shift {ABM_REG_FIELD_LIST (uint8_t );
@@ -125,6 +146,8 @@ struct dce_abm_mask {struct dce_abm_registers {uint32_t BL_PWM_PERIOD_CNTL;uint32_t BL_PWM_CNTL; +uint32_t BL_PWM_CNTL2; +uint32_t LVTMA_PWRSEQ_REF_DIV;uint32_t DC_ABM1_HG_SAMPLE_RATE;uint32_t DC_ABM1_LS_SAMPLE_RATE;uint32_t BL1_PWM_BL_UPDATE_SAMPLE_RATE;
@@ -137,6 +160,10 @@ struct dce_abm_registers {uint32_t DC_ABM1_HGLS_REG_READ_PROGRESS ;uint32_t MASTER_COMM_CNTL_REG ;uint32_t MASTER_COMM_CMD_REG ; +uint32_t MASTER_COMM_DATA_REG1 ; +uint32_t BIOS_SCRATCH_2 ; +uint32_t DMCU_STATUS ; +uint32_t BL_PWM_GRP1_REG_LOCK ; };struct dce_abm {
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +0 -260
290 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +0 -24
@@ -226,13 +226,6 @@ union dce110_dmcu_psr_config_data_reg3 {unsigned int u32All; }; -struct dce110_abm_backlight_registers { -unsigned int vBL_PWM_CNTL; -unsigned int vBL_PWM_CNTL2; -unsigned int vBL_PWM_PERIOD_CNTL; -unsigned int vLVTMA_PWRSEQ_REF_DIV_BL_PWM_REF_DIV; -}; - bool dce110_link_encoder_construct( struct dce110_link_encoder *enc110, const struct encoder_init_data *init_data,
@@ -317,23 +310,6 @@ void dce110_link_encoder_update_mst_stream_allocation_table(struct link_encoder *enc, const struct link_mst_stream_allocation_table *table); -void dce110_link_encoder_set_lcd_backlight_level ( -struct link_encoder *enc, -uint32_t level); - -void dce110_link_encoder_set_dmcu_backlight_level ( -struct link_encoder *enc, -uint32_t level, -uint32_t frame_ramp, -uint32_t controller_id); - -void dce110_link_encoder_init_dmcu_backlight_settings ( -struct link_encoder *enc); - -void dce110_link_encoder_set_dmcu_abm_level ( -struct link_encoder *enc, -uint32_t level); -void dce110_link_encoder_set_dmcu_psr_enable (struct link_encoder *enc,bool enable);
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -1
@@ -2214,8 +2214,10 @@ static void init_hw(struct core_dc *dc) } abm = dc->res_pool->abm; -if (abm !=NULL ) +if (abm !=NULL ) { + abm->funcs->init_backlight (abm); abm->funcs->abm_init (abm); + } }/* TODO: move this to apply_ctx_tohw some how?*/
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h +5 -0
@@ -35,6 +35,11 @@ struct abm {struct abm_funcs {void (*abm_init)(struct abm *abm);bool (*set_abm_level)(struct abm *abm,unsigned int abm_level); +bool (*init_backlight)(struct abm *abm); +bool (*set_backlight_level)(struct abm *abm, +unsigned int backlight_level, +unsigned int frame_ramp, +unsigned int controller_id); };#endif
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +0 -5
@@ -220,11 +220,6 @@ struct link_encoder_funcs {void (*update_mst_stream_allocation_table)(struct link_encoder *enc,const struct link_mst_stream_allocation_table *table); -void (*set_lcd_backlight_level) (struct link_encoder *enc, -uint32_t level); -void (*set_dmcu_backlight_level)(struct link_encoder *enc, -uint32_t level,uint32_t frame_ramp,uint32_t controller_id); -void (*init_dmcu_backlight_settings)(struct link_encoder *enc);void (*set_dmcu_psr_enable)(struct link_encoder *enc,bool enable);void (*setup_dmcu_psr)(struct link_encoder *enc,struct psr_dmcu_context *psr_context);
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +0 -4
@@ -94,10 +94,6 @@ struct hw_sequencer_funcs {int group_size, struct pipe_ctx *grouped_pipes[]); -/* backlight control */ -void (*encoder_set_lcd_backlight_level)( -struct link_encoder *enc,uint32_t level); -void (*enable_display_pipe_clock_gating)(struct dc_context *ctx,bool clock_gating);
drivers/gpu/drm/amd/display/dc/virtual/virtual_link_encoder.c +0 -13
@@ -72,16 +72,6 @@ static void virtual_link_encoder_update_mst_stream_allocation_table( struct link_encoder *enc, const struct link_mst_stream_allocation_table *table) {} -static void virtual_link_encoder_set_lcd_backlight_level ( -struct link_encoder *enc, -uint32_t level) {} - -static void virtual_link_encoder_set_dmcu_backlight_level ( -struct link_encoder *enc, -uint32_t level, -uint32_t frame_ramp, -uint32_t controller_id) {} -static void virtual_link_encoder_edp_backlight_control (struct link_encoder *enc,bool enable) {}
@@ -115,9 +105,6 @@ static const struct link_encoder_funcs virtual_lnk_enc_funcs = { .dp_set_phy_pattern = virtual_link_encoder_dp_set_phy_pattern, .update_mst_stream_allocation_table = virtual_link_encoder_update_mst_stream_allocation_table, - .set_lcd_backlight_level = virtual_link_encoder_set_lcd_backlight_level, - .set_dmcu_backlight_level = - virtual_link_encoder_set_dmcu_backlight_level, .backlight_control = virtual_link_encoder_edp_backlight_control, .power_control = virtual_link_encoder_edp_power_control, .connect_dig_be_to_fe = virtual_link_encoder_connect_dig_be_to_fe,
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/13 drm/amd/display: Make new pixel clock more obvious
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -1066,6 +1066,7 @@ bool dc_pre_update_surfaces_to_stream(int i, j;struct core_dc *core_dc =DC_TO_CORE (dc);uint32_t prev_disp_clk = core_dc->current_context->bw_results.dispclk_khz; +int new_disp_clk;struct dc_stream_status *stream_status =NULL ;struct validate_context *context;struct validate_context *temp_context;
@@ -1150,6 +1151,7 @@ bool dc_pre_update_surfaces_to_stream( ret = false; goto unexpected_fail; } + new_disp_clk = context->bw_results.dispclk_khz;if (core_dc->res_pool->funcs->apply_clk_constraints) { temp_context = core_dc->res_pool->funcs->apply_clk_constraints(
@@ -1166,7 +1168,7 @@ bool dc_pre_update_surfaces_to_stream( context = temp_context; } -if (prev_disp_clk < context->bw_results.dispclk_khz) { +if (prev_disp_clk < new_disp_clk) {pplib_apply_display_requirements (core_dc, context, &context->pp_display_cfg); context->res_ctx.pool->display_clock->funcs->set_clock(
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/13 drm/amd/display: Support ABM without PPlib
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
Fix problem with loading IRAM
--- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h | 7 +++++- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 26 +++------------------- 2 files changed, 9 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h +6 -1
@@ -30,6 +30,7 @@#include "dmcu.h" #define DMCU_COMMON_REG_LIST_DCE_BASE () \ + SR(DMCU_CTRL), \ SR(DMCU_RAM_ACCESS_CTRL), \ SR(DMCU_IRAM_WR_CTRL), \ SR(DMCU_IRAM_WR_DATA)
@@ -42,6 +43,8 @@ .field_name = reg_name ## __ ## field_name ## post_fix#define DMCU_COMMON_MASK_SH_LIST_DCE_COMMON_BASE (mask_sh) \ + DMCU_SF(DMCU_CTRL, \ + DMCU_ENABLE, mask_sh), \ DMCU_SF(DMCU_RAM_ACCESS_CTRL, \ IRAM_HOST_ACCESS_EN, mask_sh), \ DMCU_SF(DMCU_RAM_ACCESS_CTRL, \
@@ -55,7 +58,8 @@#define DMCU_REG_FIELD_LIST (type) \ type DMCU_IRAM_MEM_PWR_STATE; \ type IRAM_HOST_ACCESS_EN; \ - type IRAM_WR_ADDR_AUTO_INC + type IRAM_WR_ADDR_AUTO_INC; \ + type DMCU_ENABLEstruct dce_dmcu_shift {DMCU_REG_FIELD_LIST (uint8_t );
@@ -66,6 +70,7 @@ struct dce_dmcu_mask { };struct dce_dmcu_registers { +uint32_t DMCU_CTRL;uint32_t DMCU_RAM_ACCESS_CTRL;uint32_t DCI_MEM_PWR_STATUS;uint32_t DMU_MEM_PWR_CNTL;
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +3 -23
@@ -39,18 +39,13 @@ SRI(DC_HPD_CONTROL, HPD, id)#define LE_COMMON_REG_LIST_BASE (id) \ - SR(BL_PWM_CNTL), \ - SR(BL_PWM_GRP1_REG_LOCK), \ - SR(BL_PWM_PERIOD_CNTL), \ - SR(LVTMA_PWRSEQ_CNTL), \ - SR(LVTMA_PWRSEQ_STATE), \ - SR(BL_PWM_CNTL2), \ - SR(LVTMA_PWRSEQ_REF_DIV), \ SR(MASTER_COMM_DATA_REG1), \ SR(MASTER_COMM_DATA_REG2), \ SR(MASTER_COMM_DATA_REG3), \ SR(MASTER_COMM_CMD_REG), \ SR(MASTER_COMM_CNTL_REG), \ + SR(LVTMA_PWRSEQ_CNTL), \ + SR(LVTMA_PWRSEQ_STATE), \ SR(DMCU_RAM_ACCESS_CTRL), \ SR(DMCU_IRAM_RD_CTRL), \ SR(DMCU_IRAM_RD_DATA), \
@@ -81,22 +76,16 @@LE_COMMON_REG_LIST_BASE (id), \SRI (DP_DPHY_BS_SR_SWAP_CNTL ,DP , id), \SRI (DP_DPHY_INTERNAL_CTRL ,DP , id), \ -SR (BIOS_SCRATCH_2 ), \ -SR (BL1_PWM_USER_LEVEL ), \ SR(DCI_MEM_PWR_STATUS)#define LE_DCE110_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - SR(BIOS_SCRATCH_2), \ - SR(BL1_PWM_USER_LEVEL), \ SR(DCI_MEM_PWR_STATUS)#define LE_DCE80_REG_LIST (id)\ - SR(BIOS_SCRATCH_2), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - SR(BL1_PWM_USER_LEVEL), \ LE_COMMON_REG_LIST_BASE(id)
@@ -110,24 +99,16 @@ struct dce110_link_enc_hpd_registers { };struct dce110_link_enc_registers { -/* BL registers */ -uint32_t BL_PWM_CNTL; -uint32_t BL_PWM_GRP1_REG_LOCK; -uint32_t BL_PWM_PERIOD_CNTL; +/* Backlight registers */ uint32_t LVTMA_PWRSEQ_CNTL;uint32_t LVTMA_PWRSEQ_STATE; -uint32_t BL_PWM_CNTL2; -uint32_t LVTMA_PWRSEQ_REF_DIV;/* DMCU registers */ -uint32_t BL1_PWM_USER_LEVEL; -uint32_t ABM0_BL1_PWM_USER_LEVEL;uint32_t MASTER_COMM_DATA_REG1;uint32_t MASTER_COMM_DATA_REG2;uint32_t MASTER_COMM_DATA_REG3;uint32_t MASTER_COMM_CMD_REG;uint32_t MASTER_COMM_CNTL_REG; -uint32_t BIOS_SCRATCH_2;uint32_t DMCU_RAM_ACCESS_CTRL;uint32_t DCI_MEM_PWR_STATUS;uint32_t DMU_MEM_PWR_CNTL;
@@ -136,7 +117,6 @@ struct dce110_link_enc_registers {uint32_t DMCU_INTERRUPT_TO_UC_EN_MASK ;uint32_t SMU_INTERRUPT_CONTROL ; -/* Common DP registers */ uint32_t DIG_BE_CNTL ;uint32_t DIG_BE_EN_CNTL ;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/13 drm/amd/display: Changes for enable dcc mode.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h | 7 +----- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 26 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h +1 -6
@@ -30,7 +30,6 @@#include "dmcu.h" #define DMCU_COMMON_REG_LIST_DCE_BASE () \ - SR(DMCU_CTRL), \ SR(DMCU_RAM_ACCESS_CTRL), \ SR(DMCU_IRAM_WR_CTRL), \ SR(DMCU_IRAM_WR_DATA)
@@ -43,8 +42,6 @@ .field_name = reg_name ## __ ## field_name ## post_fix#define DMCU_COMMON_MASK_SH_LIST_DCE_COMMON_BASE (mask_sh) \ - DMCU_SF(DMCU_CTRL, \ - DMCU_ENABLE, mask_sh), \ DMCU_SF(DMCU_RAM_ACCESS_CTRL, \ IRAM_HOST_ACCESS_EN, mask_sh), \ DMCU_SF(DMCU_RAM_ACCESS_CTRL, \
@@ -58,8 +55,7 @@#define DMCU_REG_FIELD_LIST (type) \ type DMCU_IRAM_MEM_PWR_STATE; \ type IRAM_HOST_ACCESS_EN; \ - type IRAM_WR_ADDR_AUTO_INC; \ - type DMCU_ENABLE + type IRAM_WR_ADDR_AUTO_INCstruct dce_dmcu_shift {DMCU_REG_FIELD_LIST (uint8_t );
@@ -70,7 +66,6 @@ struct dce_dmcu_mask { };struct dce_dmcu_registers { -uint32_t DMCU_CTRL;uint32_t DMCU_RAM_ACCESS_CTRL;uint32_t DCI_MEM_PWR_STATUS;uint32_t DMU_MEM_PWR_CNTL;
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +23 -3
@@ -39,13 +39,18 @@ SRI(DC_HPD_CONTROL, HPD, id)#define LE_COMMON_REG_LIST_BASE (id) \ + SR(BL_PWM_CNTL), \ + SR(BL_PWM_GRP1_REG_LOCK), \ + SR(BL_PWM_PERIOD_CNTL), \ + SR(LVTMA_PWRSEQ_CNTL), \ + SR(LVTMA_PWRSEQ_STATE), \ + SR(BL_PWM_CNTL2), \ + SR(LVTMA_PWRSEQ_REF_DIV), \ SR(MASTER_COMM_DATA_REG1), \ SR(MASTER_COMM_DATA_REG2), \ SR(MASTER_COMM_DATA_REG3), \ SR(MASTER_COMM_CMD_REG), \ SR(MASTER_COMM_CNTL_REG), \ - SR(LVTMA_PWRSEQ_CNTL), \ - SR(LVTMA_PWRSEQ_STATE), \ SR(DMCU_RAM_ACCESS_CTRL), \ SR(DMCU_IRAM_RD_CTRL), \ SR(DMCU_IRAM_RD_DATA), \
@@ -76,16 +81,22 @@LE_COMMON_REG_LIST_BASE (id), \SRI (DP_DPHY_BS_SR_SWAP_CNTL ,DP ,id ), \SRI (DP_DPHY_INTERNAL_CTRL ,DP ,id ), \ +SR (BIOS_SCRATCH_2 ), \ +SR (BL1_PWM_USER_LEVEL ), \ SR(DCI_MEM_PWR_STATUS)#define LE_DCE110_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ + SR(BIOS_SCRATCH_2), \ + SR(BL1_PWM_USER_LEVEL), \ SR(DCI_MEM_PWR_STATUS)#define LE_DCE80_REG_LIST (id)\ + SR(BIOS_SCRATCH_2), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ + SR(BL1_PWM_USER_LEVEL), \ LE_COMMON_REG_LIST_BASE(id)
@@ -99,16 +110,24 @@ struct dce110_link_enc_hpd_registers { };struct dce110_link_enc_registers { -/* Backlight registers */ +/* BL registers */ +uint32_t BL_PWM_CNTL; +uint32_t BL_PWM_GRP1_REG_LOCK; +uint32_t BL_PWM_PERIOD_CNTL;uint32_t LVTMA_PWRSEQ_CNTL;uint32_t LVTMA_PWRSEQ_STATE; +uint32_t BL_PWM_CNTL2; +uint32_t LVTMA_PWRSEQ_REF_DIV;/* DMCU registers */ +uint32_t BL1_PWM_USER_LEVEL; +uint32_t ABM0_BL1_PWM_USER_LEVEL;uint32_t MASTER_COMM_DATA_REG1;uint32_t MASTER_COMM_DATA_REG2;uint32_t MASTER_COMM_DATA_REG3;uint32_t MASTER_COMM_CMD_REG;uint32_t MASTER_COMM_CNTL_REG; +uint32_t BIOS_SCRATCH_2;uint32_t DMCU_RAM_ACCESS_CTRL;uint32_t DCI_MEM_PWR_STATUS;uint32_t DMU_MEM_PWR_CNTL;
@@ -117,6 +136,7 @@ struct dce110_link_enc_registers {uint32_t DMCU_INTERRUPT_TO_UC_EN_MASK ;uint32_t SMU_INTERRUPT_CONTROL ; +/* Common DP registers */ uint32_t DIG_BE_CNTL ;uint32_t DIG_BE_EN_CNTL ;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/13 drm/amd/display: Debug option to force enable ABM
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -143,6 +143,7 @@ struct dc_debug {bool disable_dfs_bypass;bool disable_clock_gate;bool disable_dmcu; +bool force_abm_enable; };struct dc {
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/13 drm/amd/display: add dcfclk reporting to pplib
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 48 +++++++++---------------- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 + 2 files changed, 18 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +17 -31
@@ -1065,7 +1065,7 @@ bool dc_pre_update_surfaces_to_stream( {int i, j;struct core_dc *core_dc =DC_TO_CORE (dc); -uint32_t prev_disp_clk = core_dc->current_context->bw_results.dispclk_khz; +int prev_disp_clk = core_dc->current_context->bw_results.dispclk_khz;int new_disp_clk;struct dc_stream_status *stream_status =NULL ;struct validate_context *context;
@@ -1146,36 +1146,23 @@ bool dc_pre_update_surfaces_to_stream( } } -if (core_dc->res_pool->funcs->validate_bandwidth (core_dc, context) !=DC_OK ) { -BREAK_TO_DEBUGGER (); - ret = false; - goto unexpected_fail; - } - new_disp_clk = context->bw_results.dispclk_khz; - -if (core_dc->res_pool->funcs->apply_clk_constraints) { - temp_context = core_dc->res_pool->funcs->apply_clk_constraints ( - core_dc, - context); -if (!temp_context) { -dm_error ("%s:failed apply clk constraints\n" , __func__); +if (core_dc->res_pool->funcs->validate_bandwidth) +if (core_dc->res_pool->funcs->validate_bandwidth (core_dc, context) !=DC_OK ) { +BREAK_TO_DEBUGGER (); ret = false; goto unexpected_fail; } -resource_validate_ctx_destruct (context); -ASSERT (core_dc->scratch_val_ctx == temp_context); - core_dc->scratch_val_ctx = context; - context = temp_context; - } + new_disp_clk = context->bw_results.dispclk_khz; -if (prev_disp_clk < new_disp_clk) { +if (!IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment) + && prev_disp_clk < new_disp_clk) {pplib_apply_display_requirements (core_dc, context, &context->pp_display_cfg); context->res_ctx.pool->display_clock->funcs->set_clock ( context->res_ctx.pool->display_clock, - context->bw_results.dispclk_khz *115 /100 ); - core_dc->current_context->bw_results.dispclk_khz = - context->bw_results.dispclk_khz; + new_disp_clk *115 /100 ); + core_dc->current_context->bw_results.dispclk_khz = new_disp_clk; + core_dc->current_context->dispclk_khz = new_disp_clk; }for (i =0 ; i < new_surface_count; i++)
@@ -1209,15 +1196,14 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)if (core_dc->current_context->res_ctx.pipe_ctx[i].stream ==NULL ) { core_dc->current_context->res_ctx.pipe_ctx[i].pipe_idx = i; core_dc->hwss.power_down_front_end ( - core_dc, &core_dc->current_context->res_ctx.pipe_ctx[i]); + core_dc, &core_dc->current_context->res_ctx.pipe_ctx[i]); + } +if (core_dc->res_pool->funcs->validate_bandwidth) +if (core_dc->res_pool->funcs->validate_bandwidth ( + core_dc, core_dc->current_context) !=DC_OK ) { +BREAK_TO_DEBUGGER (); +return false; } - - -if (core_dc->res_pool->funcs->validate_bandwidth (core_dc, core_dc->current_context) - !=DC_OK ) { -BREAK_TO_DEBUGGER (); -return false; - } core_dc->hwss.set_bandwidth (core_dc);
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -0
@@ -316,6 +316,7 @@ struct validate_context {struct bw_calcs_output bw_results;/* Note: these are big structures, do *not* put on stack! */ struct dm_pp_display_configuration pp_display_cfg; + int dispclk_khz; };#endif /* _CORE_TYPES_H_ */
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/13 drm/amd/display: surface validation on dce100
In reply to a message not in the archiveFrom: Leon Elazar <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +2 -2
@@ -789,9 +789,9 @@ static bool dce100_validate_surface_sets(return false;if (set[i].surfaces[0 ]->clip_rect.width - != set[i].stream->src.width + < set[i].stream->src.width || set[i].surfaces[0 ]->clip_rect.height - != set[i].stream->src.height) + < set[i].stream->src.height)return false;if (set[i].surfaces[0 ]->format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN )
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/13 drm/amd/display: remove CV-specific timing standard
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 ----- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 4 ---- drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c | 5 ----- 4 files changed, 16 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0 -5
@@ -66,11 +66,6 @@ void color_space_to_black_color( }switch (colorspace) { -case COLOR_SPACE_YPBPR601 : - *black_color = black_color_format[BLACK_COLOR_FORMAT_YUV_TV ]; -break ; - -case COLOR_SPACE_YPBPR709 :case COLOR_SPACE_YCBCR601 :case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0 -2
@@ -435,8 +435,6 @@ enum dc_color_space {COLOR_SPACE_UNKNOWN ,COLOR_SPACE_SRGB ,COLOR_SPACE_SRGB_LIMITED , -COLOR_SPACE_YPBPR601 , -COLOR_SPACE_YPBPR709 ,COLOR_SPACE_YCBCR601 ,COLOR_SPACE_YCBCR709 , COLOR_SPACE_YCBCR601_LIMITED,
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +0 -4
@@ -827,14 +827,12 @@ static bool configure_graphics_mode( OUTPUT_CSC_GRPH_MODE, 1);break ;case COLOR_SPACE_YCBCR601 : -case COLOR_SPACE_YPBPR601 :case COLOR_SPACE_YCBCR601_LIMITED :/* YCbCr601 */ REG_SET (OUTPUT_CSC_CONTROL ,0 ,OUTPUT_CSC_GRPH_MODE ,2 );break ;case COLOR_SPACE_YCBCR709 : -case COLOR_SPACE_YPBPR709 :case COLOR_SPACE_YCBCR709_LIMITED :/* YCbCr709 */ REG_SET(OUTPUT_CSC_CONTROL, 0,
@@ -858,14 +856,12 @@ static bool configure_graphics_mode( OUTPUT_CSC_GRPH_MODE, 1);break ;case COLOR_SPACE_YCBCR601 : -case COLOR_SPACE_YPBPR601 :case COLOR_SPACE_YCBCR601_LIMITED :/* YCbCr601 */ REG_SET (OUTPUT_CSC_CONTROL ,0 ,OUTPUT_CSC_GRPH_MODE ,2 );break ;case COLOR_SPACE_YCBCR709 : -case COLOR_SPACE_YPBPR709 :case COLOR_SPACE_YCBCR709_LIMITED :/* YCbCr709 */ REG_SET(OUTPUT_CSC_CONTROL, 0,
drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c +0 -5
@@ -383,8 +383,6 @@ static bool configure_graphics_mode_v(/* not supported for underlay on CZ */ return false; -case COLOR_SPACE_YCBCR601 : -case COLOR_SPACE_YPBPR601 :case COLOR_SPACE_YCBCR601_LIMITED :/* YCbCr601 */ set_reg_field_value(
@@ -394,7 +392,6 @@ static bool configure_graphics_mode_v( OUTPUT_CSC_MODE);break ;case COLOR_SPACE_YCBCR709 : -case COLOR_SPACE_YPBPR709 :case COLOR_SPACE_YCBCR709_LIMITED :/* YCbCr709 */ set_reg_field_value(
@@ -421,7 +418,6 @@ static bool configure_graphics_mode_v(/* not supported for underlay on CZ */ return false;case COLOR_SPACE_YCBCR601 : -case COLOR_SPACE_YPBPR601 :case COLOR_SPACE_YCBCR601_LIMITED :/* YCbCr601 */ set_reg_field_value(
@@ -431,7 +427,6 @@ static bool configure_graphics_mode_v( OUTPUT_CSC_MODE);break ;case COLOR_SPACE_YCBCR709 : -case COLOR_SPACE_YPBPR709 :case COLOR_SPACE_YCBCR709_LIMITED :/* YCbCr709 */ set_reg_field_value(
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx