DC Patches Aug 08, 2018
cover DC Patches Aug 08, 2018
From: "Leo (Sunpeng) Li" <[email protected]>
Summary of change:
* Enable clock sharing b/w HDMI and single link DVI
* Fix possible null pointer deref when fetching CRC
Charlene Liu (2):
drm/amd/display: fix single link DVI has no display drm/amd/display: add retimer log for HWQ tuning use.
Dmytro Laktyushkin (2):
drm/amd/display: Add dprefclk value to dce_dccg drm/amd/display: fix dml handling of mono8/16 pixel formats
Gloria Li (1):
drm/amd/display: fix PIP bugs on Dal3
Jerry (Fangzhi) Zuo (1):
drm/amd/display: Fix warning observed in mode change on Vega
Leo (Sunpeng) Li (1):
drm/amd/display: Remove redundant non-zero and overflow check
Mikita Lipski (3):
drm/amd/display: Allow clock sharing b/w HDMI and DVI drm/amd/display: Check if clock source in use before disabling drm/amd/display: Pass connector id when executing VBIOS CT
Nicholas Kazlauskas (1):
drm/amd/display: Guard against null crtc in CRC IRQ
SivapiriyanKumarasamy (1):
drm/amd/display: Program gamut remap as part of stream update
Tony Cheng (2):
drm/amd/display: dc 3.1.61
drm/amd/display: dc 3.1.62
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 10 +++- drivers/gpu/drm/amd/display/dc/core/dc.c | 23 ++++++++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 61 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 ++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 59 ++++++++++++++------- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 - drivers/gpu/drm/amd/display/dc/dc.h | 7 ++- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 +++ drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h | 1 + .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 4 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +- .../display/dc/dce120/dce120_timing_generator.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 10 +++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 3 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 7 +++ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 18 ++++--- .../drm/amd/display/dc/dml/display_mode_enums.h | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 3 +- drivers/gpu/drm/amd/display/dc/inc/resource.h | 5 ++ drivers/gpu/drm/amd/display/include/logger_types.h | 3 +- 21 files changed, 200 insertions(+), 48 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1533739990-27502-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org
PATCH 1/14 drm/amd/display: dc 3.1.61
From: Tony Cheng <[email protected]>
--- 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
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.60" +#define DC_VER "3.1.61"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/14 drm/amd/display: fix PIP bugs on Dal3
In reply to a message not in the archiveFrom: Gloria Li <[email protected]>
[Why]
There are outstanding bugs for PIP in Dal3:
-Crash when toggling PIP visibility
-Global Alpha is not working, Adjusting global alpha
doesn’t have an effect
-Cursor is not working with pip plane and pipe splits -One flash occurs when cursor enters PIP plane from
top/bottom
-Crash when moving PIP plane off the screen
[How]
Resolve divide by 0 error
Implement global alpha
Program cursor on all pipes
Add dst rects' x and y offests into cursor position Disable cursor when it is beyond bottom/top edge
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 9 ++++++--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 -- drivers/gpu/drm/amd/display/dc/dc.h | 5 +++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 10 +++++++++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 3 ++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 7 +++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 18 ++++++++++++------ drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 3 ++- 9 files changed, 46 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -1093,6 +1093,9 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfaif (u->plane_info->per_pixel_alpha != u->surface->per_pixel_alpha) update_flags->bits.per_pixel_alpha_change =1 ; +if (u->plane_info->global_alpha_value != u->surface->global_alpha_value) + update_flags->bits.global_alpha_change =1 ; +if (u->plane_info->dcc.enable != u->surface->dcc.enable || u->plane_info->dcc.grph.independent_64b_blks != u->surface->dcc.grph.independent_64b_blks || u->plane_info->dcc.grph.meta_pitch != u->surface->dcc.grph.meta_pitch)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -3
@@ -571,8 +571,10 @@ static void calculate_viewport(struct pipe_ctx *pipe_ctx) data->viewport.width = (data->viewport.width +1 ) /2 ; data->viewport_c.width = (data->viewport_c.width +1 ) /2 ; }else if (pri_split) { - data->viewport.width /=2 ; - data->viewport_c.width /=2 ; +if (data->viewport.width >1 ) + data->viewport.width /=2 ; +if (data->viewport_c.width >1 ) + data->viewport_c.width /=2 ; } if (plane_state->rotation == ROTATION_ANGLE_90 ||
@@ -652,7 +654,8 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct rect *recout_full pipe_ctx->plane_res.scl_data.recout.width = (pipe_ctx->plane_res.scl_data.recout.width +1 ) /2 ; }else { - pipe_ctx->plane_res.scl_data.recout.width /=2 ; +if (pipe_ctx->plane_res.scl_data.recout.width >1 ) + pipe_ctx->plane_res.scl_data.recout.width /=2 ; } }/* Unclipped recout offset = stream dst offset + ((surf dst offset - stream surf_src offset)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +0 -2
@@ -205,8 +205,6 @@ bool dc_stream_set_cursor_attributes(if (pipe_ctx->stream != stream)continue ; -if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state) -continue ;if (!pipe_to_program) { pipe_to_program = pipe_ctx;
drivers/gpu/drm/amd/display/dc/dc.h +5 -0
@@ -442,6 +442,7 @@ union surface_update_flags { uint32_t color_space_change:1; uint32_t horizontal_mirror_change:1; uint32_t per_pixel_alpha_change:1; + uint32_t global_alpha_change:1; uint32_t rotation_change:1; uint32_t swizzle_change:1; uint32_t scaling_change:1;
@@ -496,6 +497,8 @@ struct dc_plane_state {bool is_tiling_rotated;bool per_pixel_alpha; +bool global_alpha; +int global_alpha_value;bool visible;bool flip_immediate;bool horizontal_mirror;
@@ -522,6 +525,8 @@ struct dc_plane_info {bool horizontal_mirror;bool visible;bool per_pixel_alpha; +bool global_alpha; +int global_alpha_value;bool input_csc_enabled; };
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +9 -1
@@ -444,10 +444,12 @@ void dpp1_set_cursor_position(struct dpp *dpp_base, const struct dc_cursor_position *pos, const struct dc_cursor_mi_param *param, - uint32_t width) + uint32_t width, + uint32_t height) { struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x; +int src_y_offset = pos->y - pos->y_hotspot - param->viewport.y;uint32_t cur_en = pos->enable ?1 :0 ;if (src_x_offset >= (int )param->viewport.width)
@@ -456,6 +458,12 @@ void dpp1_set_cursor_position(if (src_x_offset + (int )width <=0 ) cur_en =0 ;/* not visible beyond left edge*/ +if (src_y_offset >= (int )param->viewport.height) + cur_en =0 ;/* not visible beyond bottom edge*/ + +if (src_y_offset <0 ) + cur_en =0 ;/* not visible beyond top edge*/ +REG_UPDATE (CURSOR0_CONTROL ,CUR0_ENABLE , cur_en);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +2 -1
@@ -1374,7 +1374,8 @@ void dpp1_set_cursor_position(struct dpp *dpp_base, const struct dc_cursor_position *pos, const struct dc_cursor_mi_param *param, - uint32_t width); + uint32_t width, + uint32_t height); void dpp1_cnv_set_optional_cursor_attributes( struct dpp *dpp_base,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +7 -0
@@ -1084,6 +1084,7 @@ void hubp1_cursor_set_position( {struct dcn10_hubp *hubp1 =TO_DCN10_HUBP (hubp);int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x; +int src_y_offset = pos->y - pos->y_hotspot - param->viewport.y;int x_hotspot = pos->x_hotspot;int y_hotspot = pos->y_hotspot;uint32_t dst_x_offset;
@@ -1127,6 +1128,12 @@ void hubp1_cursor_set_position(if (src_x_offset + (int )hubp->curs_attr.width <=0 ) cur_en =0 ;/* not visible beyond left edge*/ +if (src_y_offset >= (int )param->viewport.height) + cur_en =0 ;/* not visible beyond bottom edge*/ + +if (src_y_offset <0 )//+ (int)hubp->curs_attr.height + cur_en =0 ;/* not visible beyond top edge*/ +if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 ) hubp->funcs->set_cursor_attributes (hubp, &hubp->curs_attr);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +12 -6
@@ -1947,9 +1947,13 @@ static void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx) blnd_cfg.alpha_mode =MPCC_ALPHA_BLEND_MODE_GLOBAL_ALPHA ; blnd_cfg.overlap_only = false; - blnd_cfg.global_alpha =0xff ; blnd_cfg.global_gain =0xff ; +if (pipe_ctx->plane_state->global_alpha) + blnd_cfg.global_alpha = pipe_ctx->plane_state->global_alpha_value; +else + blnd_cfg.global_alpha =0xff ; +/* DCN1.0 has output CM before MPC which seems to screw with * pre-multiplied alpha. */
@@ -2064,11 +2068,13 @@ static void update_dchubp_dpp(update_dpp (dpp, plane_state);if (plane_state->update_flags.bits.full_update || - plane_state->update_flags.bits.per_pixel_alpha_change) + plane_state->update_flags.bits.per_pixel_alpha_change || + plane_state->update_flags.bits.global_alpha_change) dc->hwss.update_mpcc (dc, pipe_ctx);if (plane_state->update_flags.bits.full_update || plane_state->update_flags.bits.per_pixel_alpha_change || + plane_state->update_flags.bits.global_alpha_change || plane_state->update_flags.bits.scaling_change || plane_state->update_flags.bits.position_change) {update_scaler (pipe_ctx);
@@ -2620,15 +2626,15 @@ static void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) .mirror = pipe_ctx->plane_state->horizontal_mirror }; + pos_cpy.x -= pipe_ctx->plane_state->dst_rect.x; + pos_cpy.y -= pipe_ctx->plane_state->dst_rect.y; +if (pipe_ctx->plane_state->address.type ==PLN_ADDR_TYPE_VIDEO_PROGRESSIVE ) pos_cpy.enable = false; -if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state) - pos_cpy.enable = false; - hubp->funcs->set_cursor_position (hubp, &pos_cpy, ¶m); - dpp->funcs->set_cursor_position (dpp, &pos_cpy, ¶m, hubp->curs_attr.width); + dpp->funcs->set_cursor_position (dpp, &pos_cpy, ¶m, hubp->curs_attr.width, hubp->curs_attr.height); }static void dcn10_set_cursor_attribute (struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +2 -1
@@ -147,7 +147,8 @@ struct dpp_funcs {struct dpp *dpp_base, const struct dc_cursor_position *pos, const struct dc_cursor_mi_param *param, - uint32_t width + uint32_t width, + uint32_t height ); void (*dpp_set_hdr_multiplier)( struct dpp *dpp_base,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/14 drm/amd/display: Add dprefclk value to dce_dccg
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
This allows us to avoid any vbios bugs when initializing clocks
--- drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +3 -1
@@ -196,7 +196,7 @@ static int dce12_get_dp_ref_freq_khz(struct dccg *clk) {struct dce_dccg *clk_dce =TO_DCE_CLOCKS (clk); -return dccg_adjust_dp_ref_freq_for_ss (clk_dce,600000 ); +return dccg_adjust_dp_ref_freq_for_ss (clk_dce, clk_dce->dprefclk_khz); } static enum dm_pp_clocks_state dce_get_required_clocks_state(
@@ -876,6 +876,7 @@ struct dccg *dce120_dccg_create(struct dc_context *ctx)dce_dccg_construct ( clk_dce, ctx,NULL ,NULL ,NULL ); + clk_dce->dprefclk_khz =600000 ; clk_dce->base.funcs = &dce120_funcs;return &clk_dce->base;
@@ -903,6 +904,7 @@ struct dccg *dcn1_dccg_create(struct dc_context *ctx) clk_dce->dprefclk_ss_divider =1000 ; clk_dce->ss_on_dprefclk = false; + clk_dce->dprefclk_khz =600000 ;if (bp->integrated_info) clk_dce->dentist_vco_freq_khz = bp->integrated_info->dentist_vco_freq;if (clk_dce->dentist_vco_freq_khz ==0 ) {
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h +1 -0
@@ -90,6 +90,7 @@ struct dce_dccg {int dprefclk_ss_percentage;/* DPREFCLK SS percentage Divider (100 or 1000) */ int dprefclk_ss_divider; +int dprefclk_khz; };
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/14 drm/amd/display: fix single link DVI has no display
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -0
@@ -1812,6 +1812,8 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)bool is_vga_mode = (stream->timing.h_addressable ==640 ) && (stream->timing.v_addressable ==480 ); +if (stream->phy_pix_clk ==0 ) + stream->phy_pix_clk = stream->timing.pix_clk_khz;if (stream->phy_pix_clk >340000 ) is_over_340mhz = true;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/14 drm/amd/display: fix dml handling of mono8/16 pixel formats
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
mono formats are treated exactly the same as equivallent bpp 444 formats. Dml validation however lacks 444 8 bit format while dml perf param calculation lacks mono format support
This change makes them equivallent as far as the enum is concerned to avoid having to update dml
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_enums.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_enums.h +2 -2
@@ -40,8 +40,8 @@ enum source_format_class { dm_422_8 =5 , dm_422_10 =6 , dm_444_8 =7 , - dm_mono_8, - dm_mono_16 + dm_mono_8 = dm_444_8, + dm_mono_16 = dm_444_16 };enum output_bpc_class { dm_out_6 = 0, dm_out_8 = 1, dm_out_10 = 2, dm_out_12 = 3, dm_out_16 = 4
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/14 drm/amd/display: Fix warning observed in mode change on Vega
In reply to a message not in the archiveFrom: "Jerry (Fangzhi) Zuo" <[email protected]>
[Why]DOUBLE_BUFFER_EN bit is getting cleared before enable blanking. That leads to CRTC_BLANK_DATA_EN is getting updated immediately.
[How]
Get DOUBLE_BUFFER_EN bit set, the same as DCE110.
--- drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c +1 -1
@@ -772,7 +772,7 @@ void dce120_tg_set_blank(struct timing_generator *tg,CRTC_REG_SET (CRTC0_CRTC_DOUBLE_BUFFER_CONTROL , -CRTC_BLANK_DATA_DOUBLE_BUFFER_EN ,0 ); +CRTC_BLANK_DATA_DOUBLE_BUFFER_EN ,1 );if (enable_blanking)CRTC_REG_SET (CRTC0_CRTC_BLANK_CONTROL ,CRTC_BLANK_DATA_EN ,1 );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/14 drm/amd/display: add retimer log for HWQ tuning use.
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 59 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/include/logger_types.h | 3 +- 2 files changed, 61 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +59 -0
@@ -54,6 +54,9 @@DC_LOG_HW_HOTPLUG ( \ __VA_ARGS__) +#define RETIMER_REDRIVER_INFO (...) \ + DC_LOG_RETIMER_REDRIVER( \ + __VA_ARGS__)/******************************************************************************* * Private structures ******************************************************************************/
@@ -1547,6 +1550,7 @@ static void write_i2c_retimer_setting(uint8_t value =0 ;int i =0 ;bool i2c_success = false; +DC_LOGGER_INIT (pipe_ctx->stream->ctx->logger);memset (&buffer,0 ,sizeof (buffer));
@@ -1560,6 +1564,9 @@ static void write_i2c_retimer_setting( buffer[1 ] = settings->reg_settings[i].i2c_reg_val; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_address = 0x%x,\ +offset = 0x%x, reg_val= 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */
@@ -1590,6 +1597,9 @@ static void write_i2c_retimer_setting( buffer[1 ] = value | apply_rx_tx_change; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_address = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1607,6 +1617,9 @@ static void write_i2c_retimer_setting( buffer[1 ] = settings->reg_settings_6g[i].i2c_reg_val; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("above 340Mhz: retimer write to slave_address = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */
@@ -1637,6 +1650,9 @@ static void write_i2c_retimer_setting( buffer[1 ] = value | apply_rx_tx_change; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_address = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1653,6 +1669,9 @@ static void write_i2c_retimer_setting( buffer[1 ] =0x01 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_address = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1662,6 +1681,9 @@ static void write_i2c_retimer_setting( buffer[1 ] =0x23 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_address = 0x%x,\ +offset = 0x%d, reg_val = 0x%d, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1671,6 +1693,9 @@ static void write_i2c_retimer_setting( buffer[1 ] =0x00 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_address = 0x%x,\ +offset = 0x%d, reg_val = 0x%d, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1686,6 +1711,7 @@ static void write_i2c_default_retimer_setting(uint8_t slave_address = (0xBA >>1 );uint8_t buffer[2 ];bool i2c_success = false; +DC_LOGGER_INIT (pipe_ctx->stream->ctx->logger);memset (&buffer,0 ,sizeof (buffer));
@@ -1695,6 +1721,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x13 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer writes default setting to slave_address = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1704,6 +1733,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x17 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1713,6 +1745,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] = is_over_340mhz ?0xDA :0xD8 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1722,6 +1757,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x17 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val= 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1731,6 +1769,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] = is_over_340mhz ?0x1D :0x91 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1740,6 +1781,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x17 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1753,6 +1797,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x01 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1762,6 +1809,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x23 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write to slave_addr = 0x%x,\ +offset = 0x%x, reg_val= 0x%x, i2c_success = %d\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1771,6 +1821,9 @@ static void write_i2c_default_retimer_setting( buffer[1 ] =0x00 ; i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("retimer write default setting to slave_addr = 0x%x,\ +offset = 0x%x, reg_val= 0x%x, i2c_success = %d end here\n" , + slave_address, buffer[0 ], buffer[1 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */ ASSERT (i2c_success);
@@ -1784,6 +1837,7 @@ static void write_i2c_redriver_setting(uint8_t slave_address = (0xF0 >>1 );uint8_t buffer[16 ];bool i2c_success = false; +DC_LOGGER_INIT (pipe_ctx->stream->ctx->logger);memset (&buffer,0 ,sizeof (buffer));
@@ -1795,6 +1849,11 @@ static void write_i2c_redriver_setting( i2c_success =i2c_write (pipe_ctx, slave_address, buffer,sizeof (buffer)); +RETIMER_REDRIVER_INFO ("redriver write 0 to all 16 reg offset expect following:\n\ +\t slave_addr = 0x%x, offset[3] = 0x%x, offset[4] = 0x%x,\ +offset[5] = 0x%x,offset[6] is_over_340mhz = 0x%x,\ +i2c_success = %d\n" , + slave_address, buffer[3 ], buffer[4 ], buffer[5 ], buffer[6 ], i2c_success?1 :0 );if (!i2c_success)/* Write failure */
drivers/gpu/drm/amd/display/include/logger_types.h +2 -1
@@ -62,6 +62,7 @@#define DC_LOG_EVENT_UNDERFLOW (...) DRM_DEBUG_KMS(__VA_ARGS__)#define DC_LOG_IF_TRACE (...) pr_debug("[IF_TRACE]:"__VA_ARGS__)#define DC_LOG_PERF_TRACE (...) DRM_DEBUG_KMS(__VA_ARGS__) +#define DC_LOG_RETIMER_REDRIVER (...) DRM_DEBUG_KMS(__VA_ARGS__)struct dal_logger ;
@@ -99,7 +100,7 @@ enum dc_log_type {LOG_IF_TRACE ,LOG_PERF_TRACE ,LOG_DISPLAYSTATS , - +LOG_HDMI_RETIMER_REDRIVER , LOG_SECTION_TOTAL_COUNT };
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/14 drm/amd/display: Remove redundant non-zero and overflow check
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
[Why]
Unsigned int is guaranteed to be >= 0, and read_channel_reply checks for overflows. read_channel_reply also returns -1 on error, which is what dc_link_aux_transfer is expected to return on error.
[How]
Remove the if-statement. Return result of read_channel_reply directly.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +3 -7
@@ -666,13 +666,9 @@ int dc_link_aux_transfer(struct ddc_service *ddc,switch (operation_result) {case AUX_CHANNEL_OPERATION_SUCCEEDED : - res = returned_bytes; - -if (res <= size && res >=0 ) - res = aux_engine->funcs->read_channel_reply (aux_engine, size, - buffer, reply, - &status); - + res = aux_engine->funcs->read_channel_reply (aux_engine, size, + buffer, reply, + &status);break ;case AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON : res =0 ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/14 drm/amd/display: Allow clock sharing b/w HDMI and DVI
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
[why]
HDMI and DVI share the same PHY clock and single link DVI and HDMI both use 4 lanes, so they should be allowed to be sharing the same clock source if all other parameters are satisfied.
[how]
Change a check for general DVI to Dual DVI.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -2
@@ -372,11 +372,11 @@ static bool is_sharable_clk_src(return false;if (dc_is_hdmi_signal (pipe_with_clk_src->stream->signal) - &&dc_is_dvi_signal (pipe->stream->signal)) + &&dc_is_dual_link_signal (pipe->stream->signal))return false;if (dc_is_hdmi_signal (pipe->stream->signal) - &&dc_is_dvi_signal (pipe_with_clk_src->stream->signal)) + &&dc_is_dual_link_signal (pipe_with_clk_src->stream->signal))return false; if (!resource_are_streams_timing_synchronizable(
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/14 drm/amd/display: Check if clock source in use before disabling
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
[why]
We are disabling clock source while other pipes are still using it, because we don't verify the number of pipes that share it.
[how]
- Adding a function in resources to return the number of pipes sharing the clock source.
- Checking that no one is sharing the clock source before disabling
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 46 +++++++++++++++------- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +- drivers/gpu/drm/amd/display/dc/inc/resource.h | 5 +++ 3 files changed, 40 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +32 -14
@@ -268,24 +268,30 @@ bool resource_construct(return true; } +static int find_matching_clock_source ( +const struct resource_pool *pool, +struct clock_source *clock_source) +{ + +int i; +for (i =0 ; i < pool->clk_src_count; i++) { +if (pool->clock_sources[i] == clock_source) +return i; + } +return -1 ; +}void resource_unreference_clock_source (struct resource_context *res_ctx,const struct resource_pool *pool,struct clock_source *clock_source) { -int i; - -for (i =0 ; i < pool->clk_src_count; i++) { -if (pool->clock_sources[i] != clock_source) -continue ; +int i =find_matching_clock_source (pool, clock_source); +if (i >-1 ) res_ctx->clock_source_ref_count[i]--; -break ; - } -if (pool->dp_clock_source == clock_source) res_ctx->dp_clock_source_ref_count--; }
@@ -295,19 +301,31 @@ void resource_reference_clock_source(const struct resource_pool *pool, struct clock_source *clock_source) { - int i; -for (i =0 ; i < pool->clk_src_count; i++) { -if (pool->clock_sources[i] != clock_source) -continue ; + int i = find_matching_clock_source(pool, clock_source); +if (i >-1 ) res_ctx->clock_source_ref_count[i]++; -break ; - }if (pool->dp_clock_source == clock_source) res_ctx->dp_clock_source_ref_count++; } +int resource_get_clock_source_reference ( +struct resource_context *res_ctx, +const struct resource_pool *pool, +struct clock_source *clock_source) +{ +int i =find_matching_clock_source (pool, clock_source); + +if (i >-1 ) +return res_ctx->clock_source_ref_count[i]; + +if (pool->dp_clock_source == clock_source) +return res_ctx->dp_clock_source_ref_count; + +return -1 ; +} +bool resource_are_streams_timing_synchronizable (struct dc_stream_state *stream1,struct dc_stream_state *stream2)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -1
@@ -1890,7 +1890,9 @@ static void dce110_reset_hw_ctx_wrap( pipe_ctx_old->plane_res.mi->funcs->free_mem_input ( pipe_ctx_old->plane_res.mi, dc->current_state->stream_count); -if (old_clk) +if (old_clk &&0 ==resource_get_clock_source_reference (&context->res_ctx, + dc->res_pool, + old_clk)) old_clk->funcs->cs_power_down (old_clk); dc->hwss.disable_plane (dc, pipe_ctx_old);
drivers/gpu/drm/amd/display/dc/inc/resource.h +5 -0
@@ -103,6 +103,11 @@ void resource_reference_clock_source(const struct resource_pool *pool, struct clock_source *clock_source); +int resource_get_clock_source_reference ( +struct resource_context *res_ctx, +const struct resource_pool *pool, +struct clock_source *clock_source); +bool resource_are_streams_timing_synchronizable (struct dc_stream_state *stream1,struct dc_stream_state *stream2);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/14 drm/amd/display: Pass connector id when executing VBIOS CT
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
[why]
Older ASICs require both phys_id and connector_id to execute bios command table. If we are not passing the right connector_id - it can lead to a black screen.
[how]
Set connector_obj_id when executing vbios command table
--- drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +2 -2
@@ -930,7 +930,7 @@ void dce110_link_encoder_enable_tmds_output(enum bp_result result;/* Enable the PHY */ - + cntl.connector_obj_id = enc110->base.connector; cntl.action =TRANSMITTER_CONTROL_ENABLE ; cntl.engine_id = enc->preferred_engine; cntl.transmitter = enc110->base.transmitter;
@@ -972,7 +972,7 @@ void dce110_link_encoder_enable_dp_output(* We need to set number of lanes manually. */ configure_encoder (enc110, link_settings); - + cntl.connector_obj_id = enc110->base.connector; cntl.action =TRANSMITTER_CONTROL_ENABLE ; cntl.engine_id = enc->preferred_engine; cntl.transmitter = enc110->base.transmitter;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/14 drm/amd/display: Guard against null crtc in CRC IRQ
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
A null pointer deference can occur if crtc is null in amdgpu_dm_crtc_handle_crc_irq. This can happen if get_crtc_by_otg_inst returns NULL during dm_crtc_high_irq, leading to a hang in some IGT test cases.
[How]
Check that CRTC is non-null before accessing its fields.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +8 -2
@@ -98,10 +98,16 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name,*/ void amdgpu_dm_crtc_handle_crc_irq (struct drm_crtc *crtc) { -struct dm_crtc_state *crtc_state =to_dm_crtc_state (crtc->state); -struct dc_stream_state *stream_state = crtc_state->stream; +struct dm_crtc_state *crtc_state; +struct dc_stream_state *stream_state;uint32_t crcs[3 ]; +if (crtc ==NULL ) +return ; + + crtc_state =to_dm_crtc_state (crtc->state); + stream_state = crtc_state->stream; +/* Early return if CRC capture is not enabled. */ if (!crtc_state->crc_enabled)return ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/14 drm/amd/display: dc 3.1.62
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- 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
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.61" +#define DC_VER "3.1.62"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/14 drm/amd/display: Program gamut remap as part of stream update
In reply to a message not in the archiveFrom: SivapiriyanKumarasamy <[email protected]>
Add gamut remap to dc_stream_update struct, and program if set when updating streams.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 20 ++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 ++++++++ 2 files changed, 28 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +20 -0
@@ -357,6 +357,23 @@ void dc_stream_set_dither_option(struct dc_stream_state *stream,opp_program_bit_depth_reduction (pipes->stream_res.opp, ¶ms); } +bool dc_stream_set_gamut_remap (struct dc *dc,const struct dc_stream_state *stream) +{ +int i =0 ; +bool ret = false; +struct pipe_ctx *pipes; + +for (i =0 ; i <MAX_PIPES ; i++) { +if (dc->current_state->res_ctx.pipe_ctx[i].stream == stream) { + pipes = &dc->current_state->res_ctx.pipe_ctx[i]; + dc->hwss.program_gamut_remap (pipes); + ret = true; + } + } + +return ret; +} + void dc_stream_set_static_screen_events(struct dc *dc, struct dc_stream_state **streams, int num_streams,
@@ -1353,6 +1370,9 @@ static void commit_planes_do_stream_update(struct dc *dc, dc->hwss.update_info_frame (pipe_ctx); } +if (stream_update->gamut_remap) +dc_stream_set_gamut_remap (dc, stream); +/* Full fe update*/ if (update_type ==UPDATE_TYPE_FAST )continue ;
drivers/gpu/drm/amd/display/dc/dc_stream.h +8 -0
@@ -132,6 +132,11 @@ struct dc_stream_update {struct dc_info_packet *vsc_infopacket;bool *dpms_off; + +struct colorspace_transform *gamut_remap; +enum dc_color_space *output_color_space; + + }; bool dc_is_stream_unchanged(
@@ -298,6 +303,9 @@ void dc_stream_set_static_screen_events(struct dc *dc,void dc_stream_set_dither_option (struct dc_stream_state *stream,enum dc_dither_option option); +bool dc_stream_set_gamut_remap (struct dc *dc, +const struct dc_stream_state *stream); + bool dc_stream_get_crtc_position(struct dc *dc, struct dc_stream_state **stream, int num_streams,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx