DC Patches Sep 26, 2018
Subsystems (3)
cover DC Patches Sep 26, 2018
From: Leo Li <[email protected]>
Summary of change:
* Edid emulation fix
* S3 resume fix on Vega10
* Add build types for internal tracking
* Fix screen corruption on polaris
* Interlace video timing fix
Bhawanpreet Lakha (1):
drm/amd/display: Fix Edid emulation for linux
Charlene Liu (2):
drm/amd/display: fix 4K stereo screen flash issue drm/amd/display: fix Interlace video timing.
Eric Yang (2):
drm/amd/display: block DP YCbCr420 modes
drm/amd/display: clean up encoding checks
Eryk Brol (1):
drm/amd/display: Add function to fetch clock requirements
Jun Lei (2):
drm/amd/display: Add DC build_id to determine build type drm/amd/display: fix memory leak in resource pools
Leo Li (1):
drm/amd/display: Flatten irq handler data struct
Murton Liu (1):
drm/amd/display: HLK Periodic Frame Notification test failed
Nicholas Kazlauskas (1):
drm/amd/display: Raise dispclk value for dce_update_clocks
Nikola Cornij (1):
drm/amd/display: Add a check-function for virtual signal type
Roman Li (1):
drm/amd/display: Fix Vega10 lightup on S3 resume
Su Sung Chung (1):
drm/amd/display: Calculate swizzle mode using bpp during validation
Tony Cheng (1):
drm/amd/display: dc 3.1.68
Yongqiang Sun (1):
drm/amd/display: WA for DF keeps awake after S0i3.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 139 ++++++++++++++++++++- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 37 +++--- drivers/gpu/drm/amd/display/dc/core/dc.c | 46 +++---- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 40 ++++++ drivers/gpu/drm/amd/display/dc/dc.h | 8 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 + drivers/gpu/drm/amd/display/dc/dc_types.h | 12 ++ drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | 5 + .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 17 +-- .../drm/amd/display/dc/dce100/dce100_resource.c | 5 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +- .../amd/display/dc/dce110/dce110_hw_sequencer.h | 5 - .../drm/amd/display/dc/dce110/dce110_resource.c | 5 +- .../drm/amd/display/dc/dce112/dce112_resource.c | 11 +- .../amd/display/dc/dce120/dce120_hw_sequencer.c | 12 -- .../drm/amd/display/dc/dce120/dce120_resource.c | 3 +- .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 5 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 17 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 4 + .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +++ .../drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 18 +-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 34 ++--- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 26 +++- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 3 + .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 1 - drivers/gpu/drm/amd/display/dc/inc/resource.h | 3 + drivers/gpu/drm/amd/display/include/signal_types.h | 5 + 29 files changed, 335 insertions(+), 150 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): 1537983737-17773-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org
PATCH 1/16 drm/amd/display: Add DC build_id to determine build type
From: Jun Lei <[email protected]>
[why]
Sometimes there are indications that the incorrect driver is being loaded in automated tests. This change adds the ability for builds to be tagged with a string, and picked up by the test infrastructure.
[how]dc.c will allocate const for build id, which is init-ed with default value, indicating production build. For test builds, build server will find/replace this value. The test machine will then verify this value.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -60,6 +60,7 @@#define DC_LOGGER \ dc->ctx->logger +const static char DC_BUILD_ID [] ="production-build" ;/******************************************************************************* * Private functions
@@ -758,6 +759,8 @@ struct dc *dc_create(const struct dc_init_data *init_params) dc->config = init_params->flags; + dc->build_id =DC_BUILD_ID ; +DC_LOG_DC ("Display Core initialized\n" );
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -315,6 +315,8 @@ struct dc {struct compressor *fbc_compressor;struct dc_debug_data debug_data; + +const char *build_id; };enum frame_buffer_mode {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/16 drm/amd/display: fix 4K stereo screen flash issue
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
[Why]HDMI_scramber is not enabled for pixel rate >340Mhz. [How]
Calculate the phy clock to include the Hw frame packing factor.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
@@ -1975,6 +1975,9 @@ static void calculate_phy_pix_clks(struct dc_stream_state *stream)else stream->phy_pix_clk = stream->timing.pix_clk_khz; + +if (stream->timing.timing_3d_format ==TIMING_3D_FORMAT_HW_FRAME_PACKING ) + stream->phy_pix_clk *=2 ; } enum dc_status resource_map_pool_resources(
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/16 drm/amd/display: Add a check-function for virtual signal type
In reply to a message not in the archiveFrom: Nikola Cornij <[email protected]>
[why]
Same functions exist for all other signal types.
[how]
Add a function that checks against virtual signal type.
--- drivers/gpu/drm/amd/display/include/signal_types.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/include/signal_types.h +5 -0
@@ -102,4 +102,9 @@ static inline bool dc_is_audio_capable_signal(enum signal_type signal) dc_is_hdmi_signal(signal)); } +static inline bool dc_is_virtual_signal (enum signal_type signal) +{ +return (signal ==SIGNAL_TYPE_VIRTUAL ); +} +#endif
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/16 drm/amd/display: Calculate swizzle mode using bpp during validation
In reply to a message not in the archiveFrom: Su Sung Chung <[email protected]>
[Why]
Previously bandwidth validation was failing because swizzle mode was not initialized during plane_state allocation. The swizzle mode was calculated using pixed format which is how swizzle mode is initially calculated in addrlib.
[How]
* Set default swizzle mode for validation to DC_SW_UNKNOWN
* Created new function in dcn10_assign_swizzle_mode which sets the plane swizzle mode based on selected pixed format
* Added the call of assign_swizzle_mode into dc_validate_global_state
* Set failsafe swizzle mode back to DC_SW_LINEAR
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 30 ++---------------- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 37 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 3 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 21 +++++++++++- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 3 ++ drivers/gpu/drm/amd/display/dc/inc/resource.h | 3 ++ 6 files changed, 67 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -28
@@ -1113,32 +1113,6 @@ static bool is_surface_in_context(return false; } -static unsigned int pixel_format_to_bpp (enum surface_pixel_format format) -{ -switch (format) { -case SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr: -case SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb: -return 12 ; -case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555 : -case SURFACE_PIXEL_FORMAT_GRPH_RGB565 : -case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr: -case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb: -return 16 ; -case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888 : -case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888 : -case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010 : -case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010 : -return 32 ; -case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 : -case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616F : -case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616F : -return 64 ; -default : -ASSERT_CRITICAL (false); -return -1 ; - } -} -static enum surface_update_type get_plane_info_update_type (const struct dc_surface_update *u) {union surface_update_flags *update_flags = &u->surface->update_flags;
@@ -1172,8 +1146,8 @@ static enum surface_update_type get_plane_info_update_type(const struct dc_surfa || u->plane_info->dcc.grph.meta_pitch != u->surface->dcc.grph.meta_pitch) update_flags->bits.dcc_change =1 ; -if (pixel_format_to_bpp (u->plane_info->format) != -pixel_format_to_bpp (u->surface->format)) +if (resource_pixel_format_to_bpp (u->plane_info->format) != +resource_pixel_format_to_bpp (u->surface->format))/* different bytes per element will require full bandwidth * and DML calculation */
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +37 -0
@@ -2099,6 +2099,14 @@ enum dc_status dc_validate_global_state(if (pipe_ctx->stream != stream)continue ; +if (dc->res_pool->funcs->get_default_swizzle_mode && + pipe_ctx->plane_state && + pipe_ctx->plane_state->tiling_info.gfx9.swizzle ==DC_SW_UNKNOWN ) { + result = dc->res_pool->funcs->get_default_swizzle_mode (pipe_ctx->plane_state); +if (result !=DC_OK ) +return result; + } +/* Switch to dp clock source only if there is * no non dp stream that shares the same timing * with the dp stream.
@@ -2888,3 +2896,32 @@ enum dc_status dc_validate_plane(struct dc *dc, const struct dc_plane_state *plareturn res; } + +unsigned int resource_pixel_format_to_bpp (enum surface_pixel_format format) +{ +switch (format) { +case SURFACE_PIXEL_FORMAT_GRPH_PALETA_256_COLORS : +return 8 ; +case SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr: +case SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb: +return 12 ; +case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555 : +case SURFACE_PIXEL_FORMAT_GRPH_RGB565 : +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr: +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb: +return 16 ; +case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888 : +case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888 : +case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010 : +case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010 : +case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010_XR_BIAS : +return 32 ; +case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 : +case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616F : +case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616F : +return 64 ; +default : +ASSERT_CRITICAL (false); +return -1 ; + } +}
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +2 -1
@@ -289,7 +289,8 @@ enum swizzle_mode_values {DC_SW_VAR_S_X =29 ,DC_SW_VAR_D_X =30 ,DC_SW_VAR_R_X =31 , -DC_SW_MAX +DC_SW_MAX =32 , +DC_SW_UNKNOWN =DC_SW_MAX }; union dc_tiling_info {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +20 -1
@@ -1119,6 +1119,24 @@ static enum dc_status dcn10_validate_plane(const struct dc_plane_state *plane_streturn DC_OK ; } +static enum dc_status dcn10_get_default_swizzle_mode (struct dc_plane_state *plane_state) +{ +enum dc_status result =DC_OK ; + +enum surface_pixel_format surf_pix_format = plane_state->format; +unsigned int bpp =resource_pixel_format_to_bpp (surf_pix_format); + +enum swizzle_mode_values swizzle =DC_SW_LINEAR ; + +if (bpp ==64 ) + swizzle =DC_SW_64KB_D ; +else + swizzle =DC_SW_64KB_S ; + + plane_state->tiling_info.gfx9.swizzle = swizzle; +return result; +} +static const struct dc_cap_funcs cap_funcs = { .get_dcc_compression_cap = dcn10_get_dcc_compression_cap };
@@ -1129,7 +1147,8 @@ static const struct resource_funcs dcn10_res_pool_funcs = { .validate_bandwidth = dcn_validate_bandwidth, .acquire_idle_pipe_for_layer = dcn10_acquire_idle_pipe_for_layer, .validate_plane = dcn10_validate_plane, - .add_stream_to_ctx = dcn10_add_stream_to_ctx + .add_stream_to_ctx = dcn10_add_stream_to_ctx, + .get_default_swizzle_mode = dcn10_get_default_swizzle_mode };static uint32_t read_pipe_fuses (struct dc_context *ctx)
drivers/gpu/drm/amd/display/dc/inc/core_types.h +3 -0
@@ -120,6 +120,9 @@ struct resource_funcs {struct dc *dc, struct dc_state *new_ctx, struct dc_stream_state *stream); +enum dc_status (*get_default_swizzle_mode)( +struct dc_plane_state *plane_state); + };struct audio_support {
drivers/gpu/drm/amd/display/dc/inc/resource.h +3 -0
@@ -172,4 +172,7 @@ void update_audio_usage(const struct resource_pool *pool, struct audio *audio, bool acquired); + +unsigned int resource_pixel_format_to_bpp (enum surface_pixel_format format); +#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/16 drm/amd/display: Add function to fetch clock requirements
In reply to a message not in the archiveFrom: Eryk Brol <[email protected]>
Also add dram clock to clocks struct, for systems that uses them.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 4 +++- drivers/gpu/drm/amd/display/dc/dc_types.h | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -0
@@ -1836,3 +1836,16 @@ void dc_link_remove_remote_sink(struct dc_link *link, struct dc_sink *sink) } } } + +void get_clock_requirements_for_state (struct dc_state *state,struct AsicStateEx *info) +{ + info->displayClock = (unsigned int )state->bw.dcn.clk.dispclk_khz; + info->engineClock = (unsigned int )state->bw.dcn.clk.dcfclk_khz; + info->memoryClock = (unsigned int )state->bw.dcn.clk.dramclk_khz; + info->maxSupportedDppClock = (unsigned int )state->bw.dcn.clk.max_supported_dppclk_khz; + info->dppClock = (unsigned int )state->bw.dcn.clk.dppclk_khz; + info->socClock = (unsigned int )state->bw.dcn.clk.socclk_khz; + info->dcfClockDeepSleep = (unsigned int )state->bw.dcn.clk.dcfclk_deep_sleep_khz; + info->fClock = (unsigned int )state->bw.dcn.clk.fclk_khz; + info->phyClock = (unsigned int )state->bw.dcn.clk.phyclk_khz; +}
drivers/gpu/drm/amd/display/dc/dc.h +3 -1
@@ -44,7 +44,6 @@#define MAX_STREAMS 6#define MAX_SINKS_PER_LINK 4 -/******************************************************************************* * Display Core Interfaces ******************************************************************************/
@@ -208,6 +207,7 @@ struct dc_clocks {int dcfclk_deep_sleep_khz;int fclk_khz;int phyclk_khz; +int dramclk_khz; };struct dc_debug_options {
@@ -601,6 +601,8 @@ struct dc_validation_set {enum dc_status dc_validate_plane (struct dc *dc,const struct dc_plane_state *plane_state); +void get_clock_requirements_for_state (struct dc_state *state,struct AsicStateEx *info); +enum dc_status dc_validate_global_state (struct dc *dc,struct dc_state *new_ctx);
drivers/gpu/drm/amd/display/dc/dc_types.h +12 -0
@@ -659,4 +659,16 @@ enum i2c_mot_mode {I2C_MOT_FALSE }; +struct AsicStateEx { +unsigned int memoryClock; +unsigned int displayClock; +unsigned int engineClock; +unsigned int maxSupportedDppClock; +unsigned int dppClock; +unsigned int socClock; +unsigned int dcfClockDeepSleep; +unsigned int fClock; +unsigned int phyClock; +}; +#endif /* DC_TYPES_H_ */
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): 1537983737-17773-6-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 05/16] drm/amd/display: Add function to fetch clock requirements
Quoted 69 lines · On 2018-09-26 01:42 PM, [email protected] wrote:
From: Eryk Brol <[email protected]>
Also add dram clock to clocks struct, for systems that uses them.
Signed-off-by Eryk Brol <[email protected]>Reviewed-by Jun Lei <[email protected]>Acked-by Leo Li <[email protected]>--- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 4 +++- drivers/gpu/drm/amd/display/dc/dc_types.h | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/core/dc.c +13
-0@@ -1836,3 +1836,16 @@ void dc_link_remove_remote_sink(struct dc_link *link, struct dc_sink *sink) } } } + +void get_clock_requirements_for_state (struct dc_state *state,struct AsicStateEx *info) +{ + info->displayClock = (unsigned int )state->bw.dcn.clk.dispclk_khz; + info->engineClock = (unsigned int )state->bw.dcn.clk.dcfclk_khz; + info->memoryClock = (unsigned int )state->bw.dcn.clk.dramclk_khz; + info->maxSupportedDppClock = (unsigned int )state->bw.dcn.clk.max_supported_dppclk_khz; + info->dppClock = (unsigned int )state->bw.dcn.clk.dppclk_khz; + info->socClock = (unsigned int )state->bw.dcn.clk.socclk_khz; + info->dcfClockDeepSleep = (unsigned int )state->bw.dcn.clk.dcfclk_deep_sleep_khz; + info->fClock = (unsigned int )state->bw.dcn.clk.fclk_khz; + info->phyClock = (unsigned int )state->bw.dcn.clk.phyclk_khz; +}drivers/gpu/drm/amd/display/dc/dc.h +3
-1@@ -44,7 +44,6 @@#define MAX_STREAMS 6#define MAX_SINKS_PER_LINK 4 -/******************************************************************************* * Display Core Interfaces ******************************************************************************/ @@ -208,6 +207,7 @@ struct dc_clocks {int dcfclk_deep_sleep_khz;int fclk_khz;int phyclk_khz; +int dramclk_khz; };struct dc_debug_options {@@ -601,6 +601,8 @@ struct dc_validation_set {enum dc_status dc_validate_plane (struct dc *dc,const struct dc_plane_state *plane_state); +void get_clock_requirements_for_state (struct dc_state *state,struct AsicStateEx *info); +enum dc_status dc_validate_global_state (struct dc *dc,struct dc_state *new_ctx);drivers/gpu/drm/amd/display/dc/dc_types.h +0
-0
drivers/gpu/drm/amd/display/dc/dc_types.h enum i2c_mot_mode { · line 662
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dc_types.h +1
-0@@ -659,4 +659,16 @@ enum i2c_mot_mode {I2C_MOT_FALSE }; +struct AsicStateEx {
Please no camel case in the kernel. Follow the format we use in the rest of dc, so: asic_state (no need for Ex here).
Harry
drivers/gpu/drm/amd/display/dc/dc_types.h enum i2c_mot_mode { · line 674
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/dc_types.h +11
-0+unsigned int memoryClock; +unsigned int displayClock; +unsigned int engineClock; +unsigned int maxSupportedDppClock; +unsigned int dppClock; +unsigned int socClock; +unsigned int dcfClockDeepSleep; +unsigned int fClock; + unsigned int phyClock; +}; +#endif /* DC_TYPES_H_ */
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/16 drm/amd/display: block DP YCbCr420 modes
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
[why]
Currently not supported, will black screen when set.
[How]
Fail validate timing helper for those modes.
--- drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 3 +++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +3 -0
@@ -662,6 +662,9 @@ bool dce110_link_encoder_validate_dp_output( const struct dce110_link_encoder *enc110, const struct dc_crtc_timing *crtc_timing) { + if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) + return false; +/* default RGB only */ if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB )return true;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +3 -0
@@ -606,6 +606,9 @@ bool dcn10_link_encoder_validate_dp_output( const struct dcn10_link_encoder *enc10, const struct dc_crtc_timing *crtc_timing) { + if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) + return false; +/* default RGB only */ if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB )return true;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/16 drm/amd/display: clean up encoding checks
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
[Why]
All ASICS we support has YCbCr support, so the check is unnecessary, the currently logic in validate output also returns true all the time, so the unneccessary logic is removed
--- drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 16 +--------------- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 3 +-- drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 3 +-- drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 3 +-- drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 1 - drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c | 3 +-- .../gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 17 +---------------- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 3 +-- drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 1 - 9 files changed, 7 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +1 -15
@@ -665,21 +665,7 @@ bool dce110_link_encoder_validate_dp_output(if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 )return false; -/* default RGB only */ -if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) -return true; - -if (enc110->base.features.flags.bits.IS_YCBCR_CAPABLE) -return true; - -/* for DCE 8.x or later DP Y-only feature, -* we need ASIC cap + FeatureSupportDPYonly, not support 666 */ -if (crtc_timing->flags.Y_ONLY && - enc110->base.features.flags.bits.IS_YCBCR_CAPABLE && - crtc_timing->display_color_depth !=COLOR_DEPTH_666 ) -return true; - -return false; +return true; } void dce110_link_encoder_construct(
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +1 -2
@@ -551,8 +551,7 @@ static const struct encoder_feature_support link_enc_feature = { .max_hdmi_deep_color = COLOR_DEPTH_121212, .max_hdmi_pixel_clock = 300000, .flags.bits.IS_HBR2_CAPABLE = true, - .flags.bits.IS_TPS3_CAPABLE = true, - .flags.bits.IS_YCBCR_CAPABLE = true + .flags.bits.IS_TPS3_CAPABLE = true }; struct link_encoder *dce100_link_encoder_create(
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +1 -2
@@ -570,8 +570,7 @@ static const struct encoder_feature_support link_enc_feature = { .max_hdmi_deep_color = COLOR_DEPTH_121212, .max_hdmi_pixel_clock = 594000, .flags.bits.IS_HBR2_CAPABLE = true, - .flags.bits.IS_TPS3_CAPABLE = true, - .flags.bits.IS_YCBCR_CAPABLE = true + .flags.bits.IS_TPS3_CAPABLE = true }; static struct link_encoder *dce110_link_encoder_create(
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +1 -2
@@ -555,8 +555,7 @@ static const struct encoder_feature_support link_enc_feature = { .flags.bits.IS_HBR2_CAPABLE = true, .flags.bits.IS_HBR3_CAPABLE = true, .flags.bits.IS_TPS3_CAPABLE = true, - .flags.bits.IS_TPS4_CAPABLE = true, - .flags.bits.IS_YCBCR_CAPABLE = true + .flags.bits.IS_TPS4_CAPABLE = true }; struct link_encoder *dce112_link_encoder_create(
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +0 -1
@@ -609,7 +609,6 @@ static const struct encoder_feature_support link_enc_feature = { .flags.bits.IS_HBR3_CAPABLE = true, .flags.bits.IS_TPS3_CAPABLE = true, .flags.bits.IS_TPS4_CAPABLE = true, - .flags.bits.IS_YCBCR_CAPABLE = true }; static struct link_encoder *dce120_link_encoder_create(
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +1 -2
@@ -650,8 +650,7 @@ static const struct encoder_feature_support link_enc_feature = { .max_hdmi_deep_color = COLOR_DEPTH_121212, .max_hdmi_pixel_clock = 297000, .flags.bits.IS_HBR2_CAPABLE = true, - .flags.bits.IS_TPS3_CAPABLE = true, - .flags.bits.IS_YCBCR_CAPABLE = true + .flags.bits.IS_TPS3_CAPABLE = true }; struct link_encoder *dce80_link_encoder_create(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +1 -16
@@ -609,22 +609,7 @@ bool dcn10_link_encoder_validate_dp_output(if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 )return false; -/* default RGB only */ -if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) -return true; - -if (enc10->base.features.flags.bits.IS_YCBCR_CAPABLE) -return true; - -/* for DCE 8.x or later DP Y-only feature, -* we need ASIC cap + FeatureSupportDPYonly, not support 666 -*/ -if (crtc_timing->flags.Y_ONLY && - enc10->base.features.flags.bits.IS_YCBCR_CAPABLE && - crtc_timing->display_color_depth !=COLOR_DEPTH_666 ) -return true; - -return false; +return true; } void dcn10_link_encoder_construct(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -2
@@ -711,8 +711,7 @@ static const struct encoder_feature_support link_enc_feature = { .flags.bits.IS_HBR2_CAPABLE = true, .flags.bits.IS_HBR3_CAPABLE = true, .flags.bits.IS_TPS3_CAPABLE = true, - .flags.bits.IS_TPS4_CAPABLE = true, - .flags.bits.IS_YCBCR_CAPABLE = true + .flags.bits.IS_TPS4_CAPABLE = true }; struct link_encoder *dcn10_link_encoder_create(
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +0 -1
@@ -58,7 +58,6 @@ struct encoder_feature_support { uint32_t IS_HBR3_CAPABLE:1; uint32_t IS_TPS3_CAPABLE:1; uint32_t IS_TPS4_CAPABLE:1; - uint32_t IS_YCBCR_CAPABLE:1; uint32_t HDMI_6GB_EN:1; } bits;uint32_t raw;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/16 drm/amd/display: WA for DF keeps awake after S0i3.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
[Why]
DF keeps awake after S0i3 resume due to DRAM_STATE_CNTL is set by bios command table during dcn init_hw.
[How]
As a work around, check STATE_CNTL status before init_hw, if it is 0 before init_hw and set to 1 after init_hw, change it to 0.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 17 +++++++++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 4 ++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 ++++++++++++++ 3 files changed, 35 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +17 -0
@@ -87,6 +87,23 @@ void hubbub1_wm_read_state(struct hubbub *hubbub, s->dram_clk_chanage =REG_READ (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D ); } +void hubbub1_disable_allow_self_refresh (struct hubbub *hubbub) +{ +REG_UPDATE (DCHUBBUB_ARB_DRAM_STATE_CNTL , +DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE ,0 ); +} + +bool hububu1_is_allow_self_refresh_enabled (struct hubbub *hubbub) +{ +uint32_t enable =0 ; + +REG_GET (DCHUBBUB_ARB_DRAM_STATE_CNTL , +DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE , &enable); + +return true ? false : enable; +} + +bool hubbub1_verify_allow_pstate_change_high (struct hubbub *hubbub) {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h +4 -0
@@ -203,6 +203,10 @@ void hubbub1_program_watermarks(unsigned int refclk_mhz, bool safe_to_lower); +void hubbub1_disable_allow_self_refresh (struct hubbub *hubbub); + +bool hububu1_is_allow_self_refresh_enabled (struct hubbub *hubub); +void hubbub1_toggle_watermark_change_req (struct hubbub *hubbub);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +14 -0
@@ -997,7 +997,21 @@ static void dcn10_init_hw(struct dc *dc) }else {if (!dcb->funcs->is_accelerated_mode (dcb)) { +bool allow_self_fresh_force_enable = +hububu1_is_allow_self_refresh_enabled (dc->res_pool->hubbub); +bios_golden_init (dc); + +/* WA for making DF sleep when idle after resume from S0i3. +* DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE is set to 1 by +* command table, if DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE = 0 +* before calling command table and it changed to 1 after, +* it should be set back to 0. +*/ +if (allow_self_fresh_force_enable == false && +hububu1_is_allow_self_refresh_enabled (dc->res_pool->hubbub)) +hubbub1_disable_allow_self_refresh (dc->res_pool->hubbub); +disable_vga (dc->hwseq); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/16 drm/amd/display: Fix Edid emulation for linux
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
[Why]
EDID emulation didn't work properly for linux, as we stop programming if nothing is connected physically.
[How]
We get a flag from DRM when we want to do edid emulation. We check if this flag is true and nothing is connected physically, if so we only program the front end using VIRTUAL_SIGNAL.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 139 +++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 + 3 files changed, 137 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +134 -5
@@ -718,6 +718,87 @@ amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state,return NULL ; } +static void emulated_link_detect (struct dc_link *link) +{ +struct dc_sink_init_data sink_init_data = {0 }; +struct display_sink_capability sink_caps = {0 }; +enum dc_edid_status edid_status; +struct dc_context *dc_ctx = link->ctx; +struct dc_sink *sink =NULL ; +struct dc_sink *prev_sink =NULL ; + + link->type = dc_connection_none; + prev_sink = link->local_sink; + +if (prev_sink !=NULL ) +dc_sink_retain (prev_sink); + +switch (link->connector_signal) { +case SIGNAL_TYPE_HDMI_TYPE_A : { + sink_caps.transaction_type =DDC_TRANSACTION_TYPE_I2C ; + sink_caps.signal =SIGNAL_TYPE_HDMI_TYPE_A ; +break ; + } + +case SIGNAL_TYPE_DVI_SINGLE_LINK : { + sink_caps.transaction_type =DDC_TRANSACTION_TYPE_I2C ; + sink_caps.signal =SIGNAL_TYPE_DVI_SINGLE_LINK ; +break ; + } + +case SIGNAL_TYPE_DVI_DUAL_LINK : { + sink_caps.transaction_type =DDC_TRANSACTION_TYPE_I2C ; + sink_caps.signal =SIGNAL_TYPE_DVI_DUAL_LINK ; +break ; + } + +case SIGNAL_TYPE_LVDS : { + sink_caps.transaction_type =DDC_TRANSACTION_TYPE_I2C ; + sink_caps.signal =SIGNAL_TYPE_LVDS ; +break ; + } + +case SIGNAL_TYPE_EDP : { + sink_caps.transaction_type = +DDC_TRANSACTION_TYPE_I2C_OVER_AUX ; + sink_caps.signal =SIGNAL_TYPE_EDP ; +break ; + } + +case SIGNAL_TYPE_DISPLAY_PORT : { + sink_caps.transaction_type = +DDC_TRANSACTION_TYPE_I2C_OVER_AUX ; + sink_caps.signal =SIGNAL_TYPE_VIRTUAL ; +break ; + } + +default : +DC_ERROR ("Invalid connector type! signal:%d\n" , + link->connector_signal); +return ; + } + + sink_init_data.link = link; + sink_init_data.sink_signal = sink_caps.signal; + + sink =dc_sink_create (&sink_init_data); +if (!sink) { +DC_ERROR ("Failed to create sink!\n" ); +return ; + } + + link->local_sink = sink; + + edid_status =dm_helpers_read_local_edid ( + link->ctx, + link, + sink); + +if (edid_status !=EDID_OK ) +DC_ERROR ("Failed to read EDID" ); + +} +static int dm_resume (void *handle) {struct amdgpu_device *adev = handle;
@@ -731,6 +812,7 @@ static int dm_resume(void *handle)struct drm_plane *plane;struct drm_plane_state *new_plane_state;struct dm_plane_state *dm_new_plane_state; +enum dc_connection_type new_connection_type = dc_connection_none;int ret;int i;
@@ -761,7 +843,13 @@ static int dm_resume(void *handle)continue ;mutex_lock (&aconnector->hpd_lock); -dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD ); +if (!dc_link_detect_sink (aconnector->dc_link, &new_connection_type)) +DRM_ERROR ("KMS: Failed to detect connector\n" ); + +if (aconnector->base.force && new_connection_type == dc_connection_none) +emulated_link_detect (aconnector->dc_link); +else +dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD );if (aconnector->fake_enable && aconnector->dc_link->local_sink) aconnector->fake_enable = false;
@@ -1006,6 +1094,7 @@ static void handle_hpd_irq(void *param)struct amdgpu_dm_connector *aconnector = (struct amdgpu_dm_connector *)param;struct drm_connector *connector = &aconnector->base;struct drm_device *dev = connector->dev; +enum dc_connection_type new_connection_type = dc_connection_none;/* * In case of failure or MST no need to update connector status or notify the OS
@@ -1016,7 +1105,21 @@ static void handle_hpd_irq(void *param)if (aconnector->fake_enable) aconnector->fake_enable = false; -if (dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD )) { +if (!dc_link_detect_sink (aconnector->dc_link, &new_connection_type)) +DRM_ERROR ("KMS: Failed to detect connector\n" ); + +if (aconnector->base.force && new_connection_type == dc_connection_none) { +emulated_link_detect (aconnector->dc_link); + + +drm_modeset_lock_all (dev); +dm_restore_drm_connector_state (dev, connector); +drm_modeset_unlock_all (dev); + +if (aconnector->base.force ==DRM_FORCE_UNSPECIFIED ) +drm_kms_helper_hotplug_event (dev); + + }else if (dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD )) {amdgpu_dm_update_connector_after_detect (aconnector);
@@ -1116,6 +1219,7 @@ static void handle_hpd_rx_irq(void *param)struct drm_device *dev = connector->dev;struct dc_link *dc_link = aconnector->dc_link;bool is_mst_root_connector = aconnector->mst_mgr.mst_state; +enum dc_connection_type new_connection_type = dc_connection_none;/* * TODO:Temporary add mutex to protect hpd interrupt not have a gpio
@@ -1128,7 +1232,24 @@ static void handle_hpd_rx_irq(void *param)if (dc_link_handle_hpd_rx_irq (dc_link,NULL ,NULL ) && !is_mst_root_connector) {/* Downstream Port status changed. */ -if (dc_link_detect (dc_link,DETECT_REASON_HPDRX )) { +if (!dc_link_detect_sink (dc_link, &new_connection_type)) +DRM_ERROR ("KMS: Failed to detect connector\n" ); + +if (aconnector->base.force && new_connection_type == dc_connection_none) { +emulated_link_detect (dc_link); + +if (aconnector->fake_enable) + aconnector->fake_enable = false; + +amdgpu_dm_update_connector_after_detect (aconnector); + + +drm_modeset_lock_all (dev); +dm_restore_drm_connector_state (dev, connector); +drm_modeset_unlock_all (dev); + +drm_kms_helper_hotplug_event (dev); + }else if (dc_link_detect (dc_link,DETECT_REASON_HPDRX )) {if (aconnector->fake_enable) aconnector->fake_enable = false;
@@ -1523,6 +1644,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)struct amdgpu_mode_info *mode_info = &adev->mode_info;uint32_t link_cnt;int32_t total_overlay_planes, total_primary_planes; +enum dc_connection_type new_connection_type = dc_connection_none; link_cnt = dm->dc->caps.max_links;if (amdgpu_dm_mode_config_init (dm->adev)) {
@@ -1589,7 +1711,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) link =dc_get_link_at_index (dm->dc, i); -if (dc_link_detect (link,DETECT_REASON_BOOT )) { +if (!dc_link_detect_sink (link, &new_connection_type)) +DRM_ERROR ("KMS: Failed to detect connector\n" ); + +if (aconnector->base.force && new_connection_type == dc_connection_none) { +emulated_link_detect (link); +amdgpu_dm_update_connector_after_detect (aconnector); + + }else if (dc_link_detect (link,DETECT_REASON_BOOT )) {amdgpu_dm_update_connector_after_detect (aconnector);register_backlight_device (dm, link); }
@@ -2636,7 +2765,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,if (dm_state && dm_state->freesync_capable) stream->ignore_msa_timing_param = true; finish: -if (sink && sink->sink_signal ==SIGNAL_TYPE_VIRTUAL ) +if (sink && sink->sink_signal ==SIGNAL_TYPE_VIRTUAL && aconnector->base.force !=DRM_FORCE_ON )dc_sink_release (sink);return stream;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
@@ -198,7 +198,7 @@ static bool program_hpd_filter(return result; } -static bool detect_sink (struct dc_link *link,enum dc_connection_type *type) +bool dc_link_detect_sink (struct dc_link *link,enum dc_connection_type *type) {uint32_t is_hpd_high =0 ;struct gpio *hpd_pin;
@@ -612,7 +612,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)if (link->connector_signal ==SIGNAL_TYPE_VIRTUAL )return false; -if (false ==detect_sink (link, &new_connection_type)) { +if (false ==dc_link_detect_sink (link, &new_connection_type)) {BREAK_TO_DEBUGGER ();return false; }
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -0
@@ -216,6 +216,7 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable);bool dc_link_is_dp_sink_present (struct dc_link *link); +bool dc_link_detect_sink (struct dc_link *link,enum dc_connection_type *type);/* * DPCD access interfaces */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/16 drm/amd/display: dc 3.1.68
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.67" +#define DC_VER "3.1.68"#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 11/16 drm/amd/display: fix memory leak in resource pools
In reply to a message not in the archiveFrom: Jun Lei <[email protected]>
[why]
ddc engines were recently changed to be independently tracked from pipe count. the change was reflected in resource constructor but not in destructor. this manifests as a memory leak when pipe harvesting is enabled, since not all constructed ddc engines are freed
[how]
make destructor symmetric with constructor for all dcX_resource
--- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 2 ++ drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 2 ++ drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 8 +++++--- drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 2 ++ drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c | 2 ++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 2 ++ 6 files changed, 15 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +2 -0
@@ -689,7 +689,9 @@ static void destruct(struct dce110_resource_pool *pool)kfree (DCE110TG_FROM_TG (pool->base.timing_generators[i])); pool->base.timing_generators[i] =NULL ; } + } +for (i =0 ; i < pool->base.res_cap->num_ddc; i++) {if (pool->base.engines[i] !=NULL )dce110_engine_destroy (&pool->base.engines[i]);if (pool->base.hw_i2cs[i] !=NULL ) {
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +2 -0
@@ -719,7 +719,9 @@ static void destruct(struct dce110_resource_pool *pool)kfree (DCE110TG_FROM_TG (pool->base.timing_generators[i])); pool->base.timing_generators[i] =NULL ; } + } +for (i =0 ; i < pool->base.res_cap->num_ddc; i++) {if (pool->base.engines[i] !=NULL )dce110_engine_destroy (&pool->base.engines[i]);if (pool->base.hw_i2cs[i] !=NULL ) {
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +5 -3
@@ -693,9 +693,6 @@ static void destruct(struct dce110_resource_pool *pool)if (pool->base.opps[i] !=NULL )dce110_opp_destroy (&pool->base.opps[i]); -if (pool->base.engines[i] !=NULL ) -dce110_engine_destroy (&pool->base.engines[i]); -if (pool->base.transforms[i] !=NULL )dce112_transform_destroy (&pool->base.transforms[i]);
@@ -711,6 +708,11 @@ static void destruct(struct dce110_resource_pool *pool)kfree (DCE110TG_FROM_TG (pool->base.timing_generators[i])); pool->base.timing_generators[i] =NULL ; } + } + +for (i =0 ; i < pool->base.res_cap->num_ddc; i++) { +if (pool->base.engines[i] !=NULL ) +dce110_engine_destroy (&pool->base.engines[i]);if (pool->base.hw_i2cs[i] !=NULL ) {kfree (pool->base.hw_i2cs[i]); pool->base.hw_i2cs[i] =NULL ;
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +2 -0
@@ -533,7 +533,9 @@ static void destruct(struct dce110_resource_pool *pool)kfree (DCE110TG_FROM_TG (pool->base.timing_generators[i])); pool->base.timing_generators[i] =NULL ; } + } +for (i =0 ; i < pool->base.res_cap->num_ddc; i++) {if (pool->base.engines[i] !=NULL )dce110_engine_destroy (&pool->base.engines[i]);if (pool->base.hw_i2cs[i] !=NULL ) {
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +2 -0
@@ -738,7 +738,9 @@ static void destruct(struct dce110_resource_pool *pool)kfree (DCE110TG_FROM_TG (pool->base.timing_generators[i])); pool->base.timing_generators[i] =NULL ; } + } +for (i =0 ; i < pool->base.res_cap->num_ddc; i++) {if (pool->base.engines[i] !=NULL )dce110_engine_destroy (&pool->base.engines[i]);if (pool->base.hw_i2cs[i] !=NULL ) {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 -0
@@ -896,7 +896,9 @@ static void destruct(struct dcn10_resource_pool *pool)kfree (DCN10TG_FROM_TG (pool->base.timing_generators[i])); pool->base.timing_generators[i] =NULL ; } + } +for (i =0 ; i < pool->base.res_cap->num_ddc; i++) {if (pool->base.engines[i] !=NULL ) pool->base.engines[i]->funcs->destroy_engine (&pool->base.engines[i]);if (pool->base.hw_i2cs[i] !=NULL ) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/16 drm/amd/display: Flatten irq handler data struct
In reply to a message not in the archiveFrom: Leo Li <[email protected]>
[Why]
There is no reason why the common data needs to be kept separate.
[How]
Flatten the struct by moving common data into the DM IRQ struct.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 37 ++++++++-------------- 1 file changed, 14 insertions(+), 23 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +14 -23
@@ -36,17 +36,13 @@* Private declarations. *****************************************************************************/ -struct handler_common_data { +struct amdgpu_dm_irq_handler_data {struct list_head list;interrupt_handler handler;void *handler_arg;/* DM which this handler belongs to */ struct amdgpu_display_manager *dm; -}; - -struct amdgpu_dm_irq_handler_data { -struct handler_common_data hcd;/* DAL irq source which registered for this interrupt. */ enum dc_irq_source irq_source; };
@@ -61,7 +57,7 @@ struct amdgpu_dm_irq_handler_data {* Private functions. *****************************************************************************/ -static void init_handler_common_data (struct handler_common_data *hcd, +static void init_handler_common_data (struct amdgpu_dm_irq_handler_data *hcd,void (*ih)(void *),void *args,struct amdgpu_display_manager *dm)
@@ -85,11 +81,9 @@ static void dm_irq_work_func(struct work_struct *work)struct amdgpu_dm_irq_handler_data *handler_data;list_for_each (entry, handler_list) { - handler_data = -list_entry ( - entry, - struct amdgpu_dm_irq_handler_data, - hcd.list); + handler_data =list_entry (entry, + struct amdgpu_dm_irq_handler_data, + list);DRM_DEBUG_KMS ("DM_IRQ: work_func: for dal_src=%d\n" , handler_data->irq_source);
@@ -97,7 +91,7 @@ static void dm_irq_work_func(struct work_struct *work)DRM_DEBUG_KMS ("DM_IRQ: schedule_work: for dal_src=%d\n" , handler_data->irq_source); - handler_data->hcd.handler (handler_data->hcd.handler_arg); + handler_data->handler (handler_data->handler_arg); }/* Call a DAL subcomponent which registered for interrupt notification
@@ -137,11 +131,11 @@ static struct list_head *remove_irq_handler(struct amdgpu_device *adev,list_for_each_safe (entry, tmp, hnd_list) { handler = list_entry(entry, struct amdgpu_dm_irq_handler_data, - hcd.list); + list);if (ih == handler) {/* Found our handler. Remove it from the list. */ -list_del (&handler->hcd.list); +list_del (&handler->list); handler_removed = true;break ; }
@@ -230,8 +224,7 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,memset (handler_data,0 ,sizeof (*handler_data)); -init_handler_common_data (&handler_data->hcd, ih, handler_args, - &adev->dm); +init_handler_common_data (handler_data, ih, handler_args, &adev->dm); irq_source = int_params->irq_source;
@@ -250,7 +243,7 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,break ; } -list_add_tail (&handler_data->hcd.list, hnd_list); +list_add_tail (&handler_data->list, hnd_list);DM_IRQ_TABLE_UNLOCK (adev, irq_table_flags);
@@ -462,15 +455,13 @@ static void amdgpu_dm_irq_immediate_work(struct amdgpu_device *adev, entry, &adev->dm.irq_handler_list_high_tab[irq_source]) { - handler_data = -list_entry ( - entry, - struct amdgpu_dm_irq_handler_data, - hcd.list); + handler_data =list_entry (entry, + struct amdgpu_dm_irq_handler_data, + list);/* Call a subcomponent which registered for immediate * interrupt notification */ - handler_data->hcd.handler (handler_data->hcd.handler_arg); + handler_data->handler (handler_data->handler_arg); }DM_IRQ_TABLE_UNLOCK (adev, irq_table_flags);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/16 drm/amd/display: fix Interlace video timing.
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
[Description] interlace mode shows wrong vertical timing. Interface timing in Edid is half vertical timing as progressive timing. driver doubled the vertical timing in edid_paser,
no need to double in optc again.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 32 +++++------------------ 1 file changed, 7 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +7 -25
@@ -98,7 +98,6 @@ static uint32_t get_start_vline(struct timing_generator *optc, const struct dc_cstruct dc_crtc_timing patched_crtc_timing;int vesa_sync_start;int asic_blank_end; -int interlace_factor;int vertical_line_start; patched_crtc_timing = *dc_crtc_timing;
@@ -112,16 +111,13 @@ static uint32_t get_start_vline(struct timing_generator *optc, const struct dc_c vesa_sync_start - patched_crtc_timing.h_border_left; - interlace_factor = patched_crtc_timing.flags.INTERLACE ?2 :1 ; - vesa_sync_start = patched_crtc_timing.v_addressable + patched_crtc_timing.v_border_bottom + patched_crtc_timing.v_front_porch; asic_blank_end = (patched_crtc_timing.v_total - vesa_sync_start - - patched_crtc_timing.v_border_top) - * interlace_factor; + patched_crtc_timing.v_border_top); vertical_line_start = asic_blank_end - optc->dlg_otg_param.vstartup_start +1 ;if (vertical_line_start <0 ) {
@@ -186,7 +182,6 @@ void optc1_program_timing(uint32_t v_sync_end;uint32_t v_init, v_fp2;uint32_t h_sync_polarity, v_sync_polarity; -uint32_t interlace_factor;uint32_t start_point =0 ;uint32_t field_num =0 ;uint32_t h_div_2;
@@ -237,16 +232,8 @@ void optc1_program_timing(REG_UPDATE (OTG_H_SYNC_A_CNTL ,OTG_H_SYNC_A_POL , h_sync_polarity); -/* Load vertical timing */ + v_total = patched_crtc_timing.v_total -1 ; -/* CRTC_V_TOTAL = v_total - 1 */ -if (patched_crtc_timing.flags.INTERLACE) { - interlace_factor =2 ; - v_total =2 * patched_crtc_timing.v_total; - }else { - interlace_factor =1 ; - v_total = patched_crtc_timing.v_total -1 ; - }REG_SET (OTG_V_TOTAL ,0 ,OTG_V_TOTAL , v_total);
@@ -259,7 +246,7 @@ void optc1_program_timing( OTG_V_TOTAL_MIN, v_total);/* v_sync_start = 0, v_sync_end = v_sync_width */ - v_sync_end = patched_crtc_timing.v_sync_width * interlace_factor; + v_sync_end = patched_crtc_timing.v_sync_width; REG_UPDATE_2(OTG_V_SYNC_A, OTG_V_SYNC_A_START, 0,
@@ -271,15 +258,13 @@ void optc1_program_timing( asic_blank_end = (patched_crtc_timing.v_total - vesa_sync_start - - patched_crtc_timing.v_border_top) - * interlace_factor; + patched_crtc_timing.v_border_top);/* v_blank_start = v_blank_end + v_active */ asic_blank_start = asic_blank_end + (patched_crtc_timing.v_border_top + patched_crtc_timing.v_addressable + - patched_crtc_timing.v_border_bottom) - * interlace_factor; + patched_crtc_timing.v_border_bottom); REG_UPDATE_2(OTG_V_BLANK_START_END, OTG_V_BLANK_START, asic_blank_start,
@@ -301,7 +286,7 @@ void optc1_program_timing( 0 : 1;REG_UPDATE (OTG_V_SYNC_A_CNTL , -OTG_V_SYNC_A_POL , v_sync_polarity); +OTG_V_SYNC_A_POL , v_sync_polarity); v_init = asic_blank_start; if (optc->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT ||
@@ -532,7 +517,6 @@ bool optc1_validate_timing(struct timing_generator *optc, const struct dc_crtc_timing *timing) { - uint32_t interlace_factor; uint32_t v_blank;uint32_t h_blank;uint32_t min_v_blank;
@@ -540,10 +524,8 @@ bool optc1_validate_timing(ASSERT (timing !=NULL ); - interlace_factor = timing->flags.INTERLACE ?2 :1 ; v_blank = (timing->v_total - timing->v_addressable - - timing->v_border_top - timing->v_border_bottom) * - interlace_factor; + timing->v_border_top - timing->v_border_bottom); h_blank = (timing->h_total - timing->h_addressable - timing->h_border_right -
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/16 drm/amd/display: HLK Periodic Frame Notification test failed
In reply to a message not in the archiveFrom: Murton Liu <[email protected]>
[Why]
Due to a small pre-fetch window, the active vline timing is a couple of lines off when compared to what it should be.
[How]
Changed the calculation for the start vline to account for this window.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +1 -1
@@ -150,7 +150,7 @@ void optc1_program_vline_interrupt( req_delta_lines--;if (req_delta_lines > vsync_line) - start_line = dc_crtc_timing->v_total - (req_delta_lines - vsync_line) -1 ; + start_line = dc_crtc_timing->v_total - (req_delta_lines - vsync_line) +2 ;else start_line = vsync_line - req_delta_lines;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/16 drm/amd/display: Fix Vega10 lightup on S3 resume
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
[Why]
There have been a few reports of Vega10 display remaining blank after S3 resume. The regression is caused by workaround for mode change on Vega10 - skip set_bandwidth if stream count is 0. As a result we skipped dispclk reset on suspend, thus on resume we may skip the clock update assuming it hasn't been changed. On some systems it causes display blank or 'out of range'.
[How]
Revert "drm/amd/display: Fix Vega10 black screen after mode change" Verified that it hadn't cause mode change regression.
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h | 5 ----- drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c | 12 ------------ 3 files changed, 1 insertion(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
@@ -2537,7 +2537,7 @@ static void pplib_apply_display_requirements( dc->prev_display_config = *pp_display_cfg; } -void dce110_set_bandwidth ( +static void dce110_set_bandwidth (struct dc *dc,struct dc_state *context,bool decrease_allowed)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +0 -5
@@ -68,11 +68,6 @@ void dce110_fill_display_configs(const struct dc_state *context, struct dm_pp_display_configuration *pp_display_cfg); -void dce110_set_bandwidth ( -struct dc *dc, -struct dc_state *context, -bool decrease_allowed); -uint32_t dce110_get_min_vblank_time_us (const struct dc_state *context);void dp_receiver_power_ctrl (struct dc_link *link,bool on);
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c +0 -12
@@ -244,17 +244,6 @@ static void dce120_update_dchub( dh_data->dchub_info_valid = false; } -static void dce120_set_bandwidth ( -struct dc *dc, -struct dc_state *context, -bool decrease_allowed) -{ -if (context->stream_count <=0 ) -return ; - -dce110_set_bandwidth (dc, context, decrease_allowed); -} -void dce120_hw_sequencer_construct (struct dc *dc) {/* All registers used by dce11.2 match those in dce11 in offset and
@@ -263,6 +252,5 @@ void dce120_hw_sequencer_construct(struct dc *dc)dce110_hw_sequencer_construct (dc); dc->hwss.enable_display_power_gating = dce120_enable_display_power_gating; dc->hwss.update_dchub = dce120_update_dchub; - dc->hwss.set_bandwidth = dce120_set_bandwidth; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/16 drm/amd/display: Raise dispclk value for dce_update_clocks
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The DISPCLK value was previously requested to be 15% higher for all ASICS that went through the dce110 bandwidth code path. As part of a refactoring of dce_clocks and dce110 set_bandwidth this was removed for power saving considerations.
This changed caused corruption under certain display configurations. Originally thought to be Vega specific, it was also observed on Polaris.
[How]
The 15% is brought back but its placement differs from the original patch. This boost should only be enable while DFS bypass is inactive.
This (like the Vega patch) is also a workaround that should be removed after the root cause is identified.
--- drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +5 -0
@@ -664,6 +664,11 @@ static void dce_update_clocks(struct dccg *dccg, bool safe_to_lower) {struct dm_pp_power_level_change_request level_change_req; +struct dce_dccg *clk_dce =TO_DCE_CLOCKS (dccg); + +/* TODO: Investigate why this is needed to fix display corruption. */ +if (!clk_dce->dfs_bypass_active) + new_clocks->dispclk_khz = new_clocks->dispclk_khz *115 /100 ; level_change_req.power_level =dce_get_required_clocks_state (dccg, new_clocks);/* get max clock state from PPLIB */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx