DC Patches February 14, 2025
cover DC Patches February 14, 2025
From: Roman Li <[email protected]>
Summary:
* Add support for disconnected eDP streams
* Add log for MALL entry on DCN32x
* Add DCC/Tiling reset helper for DCN and DCE
* Guard against setting dispclk low when active
* Other minor fixes
Alex Hung (1):
drm/amd/display: Print seamless boot message in
mark_seamless_boot_stream
Aurabindo Pillai (1):
drm/amd/display: Add log for MALL entry on DCN32x
George Shen (1):
drm/amd/display: Read LTTPR ALPM caps during link cap retrieval
Harry VanZyllDeJong (1):
drm/amd/display: Add support for disconnected eDP streams
Harry Wentland (1):
drm/amd/display: Don't treat wb connector as physical in
create_validate_stream_for_sink
Ilya Bakoulin (1):
drm/amd/display: Support BT2020 YCbCr fullrange
Leo Zeng (1):
Revert "drm/amd/display: Request HW cursor on DCN3.2 with SubVP"
Nicholas Kazlauskas (1):
drm/amd/display: Guard against setting dispclk low when active
Oleh Kuzhylnyi (1):
drm/amd/display: Add total_num_dpps_required field to informative
structure
Ovidiu Bunea (1):
drm/amd/display: Exit idle optimizations before accessing PHY
Peichen Huang (1):
drm/amd/display: dpia should avoid encoder used by dp2
Rodrigo Siqueira (4):
drm/amd/display: Add DCC/Tiling reset helper for DCN and DCE drm/amd/display: Rename panic function drm/amd/display: Add clear DCC and Tiling callback for DCN drm/amd/display: Add clear DCC and Tiling callback for DCE
Taimur Hassan (1):
drm/amd/display: 3.2.321
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 ++++++++++++------- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- .../gpu/drm/amd/display/dc/basics/dc_common.c | 3 +- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 13 +++++--- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +-- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 16 ++-------- .../gpu/drm/amd/display/dc/core/dc_resource.c | 8 +++-- .../gpu/drm/amd/display/dc/core/dc_surface.c | 31 +++--------------- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 12 +++++++ drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 ++- drivers/gpu/drm/amd/display/dc/dc_plane.h | 4 +-- .../amd/display/dc/dce/dce_stream_encoder.c | 3 +- .../amd/display/dc/dce60/dce60_hw_sequencer.c | 1 + .../dc/dio/dcn10/dcn10_stream_encoder.c | 3 +- .../dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 1 - .../display/dc/dml2/dml21/inc/dml_top_types.h | 4 +++ .../src/dml2_core/dml2_core_dcn4_calcs.c | 5 ++- .../hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 +- .../amd/display/dc/hwss/dce100/dce100_hwseq.c | 30 +++++++++++++++++ .../amd/display/dc/hwss/dce100/dce100_hwseq.h | 4 +++ .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 7 ++++ .../amd/display/dc/hwss/dce120/dce120_hwseq.c | 2 ++ .../amd/display/dc/hwss/dce80/dce80_hwseq.c | 1 + .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 29 +++++++++++++++++ .../amd/display/dc/hwss/dcn10/dcn10_hwseq.h | 4 +++ .../amd/display/dc/hwss/dcn10/dcn10_init.c | 1 + .../amd/display/dc/hwss/dcn20/dcn20_init.c | 1 + .../amd/display/dc/hwss/dcn201/dcn201_init.c | 1 + .../amd/display/dc/hwss/dcn21/dcn21_init.c | 1 + .../amd/display/dc/hwss/dcn30/dcn30_init.c | 1 + .../amd/display/dc/hwss/dcn301/dcn301_init.c | 1 + .../amd/display/dc/hwss/dcn31/dcn31_init.c | 1 + .../amd/display/dc/hwss/dcn314/dcn314_init.c | 1 + .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 ++ .../amd/display/dc/hwss/dcn32/dcn32_init.c | 1 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../amd/display/dc/hwss/dcn401/dcn401_init.c | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++- .../dc/link/protocols/link_dp_capability.c | 12 ++++--- .../display/modules/info_packet/info_packet.c | 4 +-- 47 files changed, 192 insertions(+), 87 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/16 drm/amd/display: Exit idle optimizations before accessing PHY
From: Ovidiu Bunea <[email protected]>
[why & how]
By default, DCN HW is in idle optimized state which does not allow access to PHY registers. If BIOS powers up the DCN, it is fine because they will power up everything. Only exit idle optimized state when not taking control from VBIOS.
--- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +5 -0
@@ -1891,6 +1891,7 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)bool can_apply_edp_fast_boot = false;bool can_apply_seamless_boot = false;bool keep_edp_vdd_on = false; +struct dc_bios *dcb = dc->ctx->dc_bios;DC_LOGGER_INIT ();
@@ -1967,6 +1968,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) hws->funcs.edp_backlight_control (edp_link_with_sink, false); }/*resume from S3, no vbios posting, no need to power down again*/ +if (dcb && dcb->funcs && !dcb->funcs->is_accelerated_mode (dcb)) +clk_mgr_exit_optimized_pwr_state (dc, dc->clk_mgr);power_down_all_hw_blocks (dc);
@@ -1979,6 +1982,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)disable_vga_and_power_gate_all_controllers (dc);if (edp_link_with_sink && !keep_edp_vdd_on) dc->hwss.edp_power_control (edp_link_with_sink, false); +if (dcb && dcb->funcs && !dcb->funcs->is_accelerated_mode (dcb)) +clk_mgr_optimize_pwr_state (dc, dc->clk_mgr); }bios_set_scratch_acc_mode_change (dc->ctx->dc_bios,1 ); }
Signature · 1 line
2.34.1
PATCH 2/16 drm/amd/display: Don't treat wb connector as physical in create_validate_stream_for_sink
In reply to [email protected]From: Harry Wentland <[email protected]>
Don't try to operate on a drm_wb_connector as an amdgpu_dm_connector. While dereferencing aconnector->base will "work" it's wrong and might lead to unknown bad things. Just... don't.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 ++++++++++++------- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 ++--- 3 files changed, 20 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +17 -9
@@ -7448,12 +7448,12 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc, }struct dc_stream_state * -create_validate_stream_for_sink (struct amdgpu_dm_connector *aconnector, +create_validate_stream_for_sink (struct drm_connector *connector,const struct drm_display_mode *drm_mode,const struct dm_connector_state *dm_state,const struct dc_stream_state *old_stream) { -struct drm_connector *connector = &aconnector->base; +struct amdgpu_dm_connector *aconnector =NULL ;struct amdgpu_device *adev =drm_to_adev (connector->dev);struct dc_stream_state *stream;const struct drm_connector_state *drm_state = dm_state ? &dm_state->base :NULL ;
@@ -7464,8 +7464,12 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,if (!dm_state)return NULL ; -if (aconnector->dc_link->connector_signal ==SIGNAL_TYPE_HDMI_TYPE_A || - aconnector->dc_link->dpcd_caps.dongle_type ==DISPLAY_DONGLE_DP_HDMI_CONVERTER ) +if (connector->connector_type !=DRM_MODE_CONNECTOR_WRITEBACK ) + aconnector =to_amdgpu_dm_connector (connector); + +if (aconnector && + (aconnector->dc_link->connector_signal ==SIGNAL_TYPE_HDMI_TYPE_A || + aconnector->dc_link->dpcd_caps.dongle_type ==DISPLAY_DONGLE_DP_HDMI_CONVERTER )) bpc_limit =8 ; do {
@@ -7477,10 +7481,11 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,break ; } -if (aconnector->base.connector_type ==DRM_MODE_CONNECTOR_WRITEBACK ) + dc_result =dc_validate_stream (adev->dm.dc, stream); + +if (!aconnector)/* writeback connector */ return stream; - dc_result =dc_validate_stream (adev->dm.dc, stream);if (dc_result ==DC_OK && stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) dc_result =dm_dp_mst_is_port_support_mode (aconnector, stream);
@@ -7510,7 +7515,7 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, __func__, __LINE__); aconnector->force_yuv420_output = true; - stream =create_validate_stream_for_sink (aconnector, drm_mode, + stream =create_validate_stream_for_sink (connector, drm_mode, dm_state, old_stream); aconnector->force_yuv420_output = false; }
@@ -7525,6 +7530,9 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connecstruct dc_sink *dc_sink;/* TODO: Unhardcode stream count */ struct dc_stream_state *stream; +/* we always have an amdgpu_dm_connector here since we got +* here via the amdgpu_dm_connector_helper_funcs +*/ struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (connector); if ((mode->flags & DRM_MODE_FLAG_INTERLACE) ||
@@ -7549,7 +7557,7 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connecdrm_mode_set_crtcinfo (mode,0 ); - stream =create_validate_stream_for_sink (aconnector, mode, + stream =create_validate_stream_for_sink (connector, mode,to_dm_connector_state (connector->state),NULL );if (stream) {
@@ -10600,7 +10608,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) goto skip_modeset; - new_stream =create_validate_stream_for_sink (aconnector, + new_stream =create_validate_stream_for_sink (connector, &new_crtc_state->mode, dm_new_conn_state, dm_old_crtc_state->stream);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -1
@@ -996,7 +996,7 @@ int amdgpu_dm_process_dmub_set_config_sync(struct dc_context *ctx, unsigned int struct set_config_cmd_payload *payload, enum set_config_status *operation_result);struct dc_stream_state * -create_validate_stream_for_sink (struct amdgpu_dm_connector *aconnector, +create_validate_stream_for_sink (struct drm_connector *connector,const struct drm_display_mode *drm_mode,const struct dm_connector_state *dm_state,const struct dc_stream_state *old_stream);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +2 -4
@@ -1624,7 +1624,6 @@ int pre_validate_dsc(struct drm_atomic_state *state,if (ind >=0 ) {struct drm_connector *connector; -struct amdgpu_dm_connector *aconnector;struct drm_connector_state *drm_new_conn_state;struct dm_connector_state *dm_new_conn_state;struct dm_crtc_state *dm_old_crtc_state;
@@ -1632,15 +1631,14 @@ int pre_validate_dsc(struct drm_atomic_state *state, connector =amdgpu_dm_find_first_crtc_matching_connector (state, state->crtcs[ind].ptr); - aconnector =to_amdgpu_dm_connector (connector); drm_new_conn_state =drm_atomic_get_new_connector_state (state, - &aconnector->base); + connector); dm_new_conn_state =to_dm_connector_state (drm_new_conn_state); dm_old_crtc_state =to_dm_crtc_state (state->crtcs[ind].old_state); local_dc_state->streams[i] = -create_validate_stream_for_sink (aconnector, +create_validate_stream_for_sink (connector, &state->crtcs[ind].new_state->mode, dm_new_conn_state, dm_old_crtc_state->stream);
Signature · 1 line
2.34.1
PATCH 3/16 Revert "drm/amd/display: Request HW cursor on DCN3.2 with SubVP"
In reply to [email protected]From: Leo Zeng <[email protected]>
This reverts commit aaa44ed6cd8af2089d2bf6a2e66a0436fef9791f.
Reason to revert: idle power regression found in testing.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +0 -1
@@ -626,7 +626,6 @@ static bool dcn32_assign_subvp_pipe(struct dc *dc,* - Not TMZ surface */ if (pipe->plane_state && !pipe->top_pipe && !pipe->prev_odm_pipe && !dcn32_is_center_timing(pipe) && - !pipe->stream->hw_cursor_req && !(pipe->stream->timing.pix_clk_100hz / 10000 > DCN3_2_MAX_SUBVP_PIXEL_RATE_MHZ) && (!dcn32_is_psr_capable(pipe) || (context->stream_count == 1 && dc->caps.dmub_caps.subvp_psr)) && dc_state_get_pipe_subvp_type(context, pipe) == SUBVP_NONE &&
Signature · 1 line
2.34.1
PATCH 4/16 drm/amd/display: Add DCC/Tiling reset helper for DCN and DCE
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
This commit introduces a function helper for resetting DCN/DCE DCC and tiling. Those functions are generic for their respective DCN/DCE, so they were added to the oldest version of each architecture.
--- .../amd/display/dc/hwss/dce100/dce100_hwseq.c | 29 +++++++++++++++++++ .../amd/display/dc/hwss/dce100/dce100_hwseq.h | 4 +++ .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 29 +++++++++++++++++++ .../amd/display/dc/hwss/dcn10/dcn10_hwseq.h | 4 +++ 4 files changed, 66 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dce100/dce100_hwseq.c +29 -0
@@ -140,3 +140,32 @@ void dce100_hw_sequencer_construct(struct dc *dc) dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth; } +/** +* dce100_reset_surface_dcc_and_tiling - Set DCC and tiling in DCE to their disable mode. +* +* @pipe_ctx: Pointer to the pipe context structure. +* @plane_state: Surface state +* @clear_tiling: If true set tiling to Linear, otherwise does not change tiling +* +* This function is responsible for call the HUBP block to disable DCC and set +* tiling to the linear mode. +*/ +void dce100_reset_surface_dcc_and_tiling (struct pipe_ctx *pipe_ctx, +struct dc_plane_state *plane_state, +bool clear_tiling) +{ +struct mem_input *mi = pipe_ctx->plane_res.mi; + +if (!mi) +return ; + +/* if framebuffer is tiled, disable tiling */ +if (clear_tiling && mi->funcs->mem_input_clear_tiling) + mi->funcs->mem_input_clear_tiling (mi); + +/* force page flip to see the new content of the framebuffer */ + mi->funcs->mem_input_program_surface_flip_and_addr (mi, + &plane_state->address, + true); +} +
drivers/gpu/drm/amd/display/dc/hwss/dce100/dce100_hwseq.h +4 -0
@@ -46,5 +46,9 @@ bool dce100_enable_display_power_gating(struct dc *dc, uint8_t controller_id,struct dc_bios *dcb, enum pipe_gating_control power_gating); +void dce100_reset_surface_dcc_and_tiling (struct pipe_ctx *pipe_ctx, +struct dc_plane_state *plane_state, +bool clear_tiling); +#endif /* __DC_HWSS_DCE100_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +29 -0
@@ -3920,3 +3920,32 @@ void dcn10_get_dcc_en_bits(struct dc *dc, int *dcc_en_bits) dcc_en_bits[i] = s->dcc_en ?1 :0 ; } } + +/** +* dcn10_reset_surface_dcc_and_tiling - Set DCC and tiling in DCN to their disable mode. +* +* @pipe_ctx: Pointer to the pipe context structure. +* @plane_state: Surface state +* @clear_tiling: If true set tiling to Linear, otherwise does not change tiling +* +* This function is responsible for call the HUBP block to disable DCC and set +* tiling to the linear mode. +*/ +void dcn10_reset_surface_dcc_and_tiling (struct pipe_ctx *pipe_ctx, +struct dc_plane_state *plane_state, +bool clear_tiling) +{ +struct hubp *hubp = pipe_ctx->plane_res.hubp; + +if (!hubp) +return ; + +/* if framebuffer is tiled, disable tiling */ +if (clear_tiling && hubp->funcs->hubp_clear_tiling) + hubp->funcs->hubp_clear_tiling (hubp); + +/* force page flip to see the new content of the framebuffer */ + hubp->funcs->hubp_program_surface_flip_and_addr (hubp, + &plane_state->address, + true); +}
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.h +4 -0
@@ -207,4 +207,8 @@ void dcn10_update_visual_confirm_color(struct pipe_ctx *pipe_ctx, int mpcc_id); +void dcn10_reset_surface_dcc_and_tiling (struct pipe_ctx *pipe_ctx, +struct dc_plane_state *plane_state, +bool clear_tiling); +#endif /* __DC_HWSS_DCN10_H__ */
Signature · 1 line
2.34.1
PATCH 5/16 drm/amd/display: Rename panic function
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
Rename dc_plane_force_update_for_panic to dc_plane_force_dcc_and_tiling_disable to describe the function operation in the name. Also, this function might be used in other contexts, and a more generic name can be helpful for this purpose.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_plane.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +1 -1
@@ -1430,7 +1430,7 @@ static void amdgpu_dm_plane_panic_flush(struct drm_plane *plane) dc_plane_state = dm_plane_state->dc_state; -dc_plane_force_update_for_panic (dc_plane_state, fb->modifier ? true : false); +dc_plane_force_dcc_and_tiling_disable (dc_plane_state, fb->modifier ? true : false); }static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +2 -2
@@ -270,8 +270,8 @@ void dc_3dlut_func_retain(struct dc_3dlut *lut)kref_get (&lut->refcount); } -void dc_plane_force_update_for_panic (struct dc_plane_state *plane_state, -bool clear_tiling) +void dc_plane_force_dcc_and_tiling_disable (struct dc_plane_state *plane_state, +bool clear_tiling) {struct dc *dc;int i;
drivers/gpu/drm/amd/display/dc/dc_plane.h +2 -2
@@ -34,7 +34,7 @@ const struct dc_plane_status *dc_plane_get_status(void dc_plane_state_retain (struct dc_plane_state *plane_state);void dc_plane_state_release (struct dc_plane_state *plane_state); -void dc_plane_force_update_for_panic (struct dc_plane_state *plane_state, -bool clear_tiling); +void dc_plane_force_dcc_and_tiling_disable (struct dc_plane_state *plane_state, +bool clear_tiling);#endif /* _DC_PLANE_H_ */
Signature · 1 line
2.34.1
PATCH 6/16 drm/amd/display: Add clear DCC and Tiling callback for DCN
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
Introduce the DCC and Tiling reset callback to all DCN versions that can call it.
--- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 13 ++----------- .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_init.c | 1 + .../gpu/drm/amd/display/dc/hwss/dcn20/dcn20_init.c | 1 + .../drm/amd/display/dc/hwss/dcn201/dcn201_init.c | 1 + .../gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c | 1 + .../gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c | 1 + .../drm/amd/display/dc/hwss/dcn301/dcn301_init.c | 1 + .../gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c | 1 + .../drm/amd/display/dc/hwss/dcn314/dcn314_init.c | 1 + .../gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c | 1 + .../gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../drm/amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../drm/amd/display/dc/hwss/dcn401/dcn401_init.c | 1 + drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h | 1 + 14 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +2 -11
@@ -291,17 +291,8 @@ void dc_plane_force_dcc_and_tiling_disable(struct dc_plane_state *plane_state,continue ;if (dc->ctx->dce_version >=DCE_VERSION_MAX ) { -struct hubp *hubp = pipe_ctx->plane_res.hubp; -if (!hubp) -continue ; -/* if framebuffer is tiled, disable tiling */ -if (clear_tiling && hubp->funcs->hubp_clear_tiling) - hubp->funcs->hubp_clear_tiling (hubp); - -/* force page flip to see the new content of the framebuffer */ - hubp->funcs->hubp_program_surface_flip_and_addr (hubp, - &plane_state->address, - true); +if (dc->hwss.clear_surface_dcc_and_tiling) + dc->hwss.clear_surface_dcc_and_tiling (pipe_ctx, plane_state, clear_tiling); }else {struct mem_input *mi = pipe_ctx->plane_res.mi;if (!mi)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_init.c +1 -0
@@ -40,6 +40,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .update_plane_addr = dcn10_update_plane_addr, .update_dchub = dcn10_update_dchub, .update_pending_status = dcn10_update_pending_status, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .program_output_csc = dcn10_program_output_csc, .enable_accelerated_mode = dce110_enable_accelerated_mode, .enable_timing_synchronization = dcn10_enable_timing_synchronization,
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_init.c +1 -0
@@ -36,6 +36,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_init.c +1 -0
@@ -36,6 +36,7 @@ static const struct hw_sequencer_funcs dcn201_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn10_post_unlock_program_front_end, .update_plane_addr = dcn201_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c +1 -0
@@ -37,6 +37,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c +1 -0
@@ -37,6 +37,7 @@ static const struct hw_sequencer_funcs dcn30_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c +1 -0
@@ -39,6 +39,7 @@ static const struct hw_sequencer_funcs dcn301_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c +1 -0
@@ -40,6 +40,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c +1 -0
@@ -42,6 +42,7 @@ static const struct hw_sequencer_funcs dcn314_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c +1 -0
@@ -39,6 +39,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 -0
@@ -44,6 +44,7 @@ static const struct hw_sequencer_funcs dcn35_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1 -0
@@ -43,6 +43,7 @@ static const struct hw_sequencer_funcs dcn351_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn20_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn20_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_init.c +1 -0
@@ -18,6 +18,7 @@ static const struct hw_sequencer_funcs dcn401_funcs = { .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = NULL, .program_front_end_for_ctx = dcn401_program_front_end_for_ctx, + .clear_surface_dcc_and_tiling = dcn10_reset_surface_dcc_and_tiling, .wait_for_pending_cleared = dcn10_wait_for_pending_cleared, .post_unlock_program_front_end = dcn401_post_unlock_program_front_end, .update_plane_addr = dcn20_update_plane_addr,
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +1 -0
@@ -240,6 +240,7 @@ struct hw_sequencer_funcs { struct pipe_ctx *pipe_ctx, bool enableTripleBuffer);void (*update_pending_status)(struct pipe_ctx *pipe_ctx);void (*update_dsc_pg)(struct dc *dc,struct dc_state *context,bool safe_to_disable); +void (*clear_surface_dcc_and_tiling)(struct pipe_ctx *pipe_ctx,struct dc_plane_state *plane_state,bool clear_tiling);/* Pipe Lock Related */ void (*pipe_control_lock)(struct dc *dc,
Signature · 1 line
2.34.1
PATCH 7/16 drm/amd/display: Add clear DCC and Tiling callback for DCE
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
Introduce the DCC and Tiling reset callback to all DCE versions that can call it.
--- .../gpu/drm/amd/display/dc/core/dc_surface.c | 18 ++---------------- .../amd/display/dc/dce60/dce60_hw_sequencer.c | 1 + .../amd/display/dc/hwss/dce100/dce100_hwseq.c | 1 + .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 ++ .../amd/display/dc/hwss/dce120/dce120_hwseq.c | 2 ++ .../amd/display/dc/hwss/dce80/dce80_hwseq.c | 1 + 6 files changed, 9 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +2 -16
@@ -290,21 +290,7 @@ void dc_plane_force_dcc_and_tiling_disable(struct dc_plane_state *plane_state,if (!pipe_ctx)continue ; -if (dc->ctx->dce_version >=DCE_VERSION_MAX ) { -if (dc->hwss.clear_surface_dcc_and_tiling) - dc->hwss.clear_surface_dcc_and_tiling (pipe_ctx, plane_state, clear_tiling); - }else { -struct mem_input *mi = pipe_ctx->plane_res.mi; -if (!mi) -continue ; -/* if framebuffer is tiled, disable tiling */ -if (clear_tiling && mi->funcs->mem_input_clear_tiling) - mi->funcs->mem_input_clear_tiling (mi); - -/* force page flip to see the new content of the framebuffer */ - mi->funcs->mem_input_program_surface_flip_and_addr (mi, - &plane_state->address, - true); - } +if (dc->hwss.clear_surface_dcc_and_tiling) + dc->hwss.clear_surface_dcc_and_tiling (pipe_ctx, plane_state, clear_tiling); } }
drivers/gpu/drm/amd/display/dc/dce60/dce60_hw_sequencer.c +1 -0
@@ -428,5 +428,6 @@ void dce60_hw_sequencer_construct(struct dc *dc) dc->hwss.pipe_control_lock = dce60_pipe_control_lock; dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth; dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth; + dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling; }
drivers/gpu/drm/amd/display/dc/hwss/dce100/dce100_hwseq.c +1 -0
@@ -138,6 +138,7 @@ void dce100_hw_sequencer_construct(struct dc *dc) dc->hwseq->funcs.enable_display_power_gating = dce100_enable_display_power_gating; dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth; dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth; + dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling; }/**
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 -0
@@ -33,6 +33,7 @@#include "dce110_hwseq.h" #include "dce110/dce110_timing_generator.h" #include "dce/dce_hwseq.h" +#include "dce100/dce100_hwseq.h" #include "gpio_service_interface.h" #include "dce110/dce110_compressor.h"
@@ -3332,6 +3333,7 @@ static const struct hw_sequencer_funcs dce110_funcs = { .post_unlock_program_front_end = dce110_post_unlock_program_front_end, .update_plane_addr = update_plane_addr, .update_pending_status = dce110_update_pending_status, + .clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling, .enable_accelerated_mode = dce110_enable_accelerated_mode, .enable_timing_synchronization = dce110_enable_timing_synchronization, .enable_per_frame_crtc_position_reset = dce110_enable_per_frame_crtc_position_reset,
drivers/gpu/drm/amd/display/dc/hwss/dce120/dce120_hwseq.c +2 -0
@@ -29,6 +29,7 @@#include "dce120_hwseq.h" #include "dce/dce_hwseq.h" +#include "dce100/dce100_hwseq.h" #include "dce110/dce110_hwseq.h" #include "dce/dce_12_0_offset.h"
@@ -264,5 +265,6 @@ void dce120_hw_sequencer_construct(struct dc *dc)dce110_hw_sequencer_construct (dc); dc->hwseq->funcs.enable_display_power_gating = dce120_enable_display_power_gating; dc->hwss.update_dchub = dce120_update_dchub; + dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling; }
drivers/gpu/drm/amd/display/dc/hwss/dce80/dce80_hwseq.c +1 -0
@@ -50,5 +50,6 @@ void dce80_hw_sequencer_construct(struct dc *dc) dc->hwss.pipe_control_lock = dce_pipe_control_lock; dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth; dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth; + dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling; }
Signature · 1 line
2.34.1
PATCH 8/16 drm/amd/display: Print seamless boot message in mark_seamless_boot_stream
In reply to [email protected]From: Alex Hung <[email protected]>
[WHAT & HOW]
Add a message so users know the stream will be used for seamless boot.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -1
@@ -3764,6 +3764,8 @@ static void mark_seamless_boot_stream(const struct dc *dc, {struct dc_bios *dcb = dc->ctx->dc_bios; +DC_LOGGER_INIT (dc->ctx->logger); +if (stream->apply_seamless_boot_optimization)return ;if (!dc->config.allow_seamless_boot_optimization)
@@ -3772,7 +3774,7 @@ static void mark_seamless_boot_stream(const struct dc *dc,return ;if (dc_validate_boot_timing (dc, stream->sink, &stream->timing)) { stream->apply_seamless_boot_optimization = true; -DC_LOG_INFO ("Marked stream for seamless boot optimization\n" ); +DC_LOG_DC ("Marked stream for seamless boot optimization\n" ); } }
Signature · 1 line
2.34.1
PATCH 9/16 drm/amd/display: Read LTTPR ALPM caps during link cap retrieval
In reply to [email protected]From: George Shen <[email protected]>
[Why]
The latest DP spec requires the DP TX to read DPCD F0000h through F0009h when detecting LTTPR capabilities for the first time.
[How]
Update LTTPR cap retrieval to read up to F0009h (two more bytes than the previous F0007h), and store the LTTPR ALPM capabilities.
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 12 ++++++++++++ .../display/dc/link/protocols/link_dp_capability.c | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +12 -0
@@ -959,6 +959,14 @@ union dp_128b_132b_supported_lttpr_link_rates {uint8_t raw; }; +union dp_alpm_lttpr_cap { +struct { +uint8_t AUX_LESS_ALPM_SUPPORTED :1 ; +uint8_t RESERVED :7 ; + } bits; +uint8_t raw; +}; +union dp_sink_video_fallback_formats {struct {uint8_t dp_1024x768_60Hz_24bpp_support :1 ;
@@ -1118,6 +1126,7 @@ struct dc_lttpr_caps {uint8_t max_ext_timeout;union dp_main_link_channel_coding_lttpr_cap main_link_channel_coding;union dp_128b_132b_supported_lttpr_link_rates supported_128b_132b_rates; +union dp_alpm_lttpr_cap alpm;uint8_t aux_rd_interval[MAX_REPEATER_CNT -1 ]; };
@@ -1370,6 +1379,9 @@ struct dp_trace {#ifndef DPCD_MAX_UNCOMPRESSED_PIXEL_RATE_CAP #define DPCD_MAX_UNCOMPRESSED_PIXEL_RATE_CAP 0x221c#endif +#ifndef DP_LTTPR_ALPM_CAPABILITIES +#define DP_LTTPR_ALPM_CAPABILITIES 0xF0009 +#endif #ifndef DP_REPEATER_CONFIGURATION_AND_STATUS_SIZE #define DP_REPEATER_CONFIGURATION_AND_STATUS_SIZE 0x50#endif
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +5 -1
@@ -1502,7 +1502,7 @@ static bool dpcd_read_sink_ext_caps(struct dc_link *link)enum dc_status dp_retrieve_lttpr_cap (struct dc_link *link) { -uint8_t lttpr_dpcd_data[8 ] = {0 }; +uint8_t lttpr_dpcd_data[10 ] = {0 };enum dc_status status;bool is_lttpr_present;
@@ -1552,6 +1552,10 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link) lttpr_dpcd_data[DP_PHY_REPEATER_128B132B_RATES -DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV ]; + link->dpcd_caps.lttpr_caps.alpm.raw = + lttpr_dpcd_data[DP_LTTPR_ALPM_CAPABILITIES - +DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV ]; +/* If this chip cap is set, at least one retimer must exist in the chain * Override count to 1 if we receive a known bad count (0 or an invalid value) */ if (((link->chip_caps & AMD_EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK) == AMD_EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN) &&
Signature · 1 line
2.34.1
PATCH 10/16 drm/amd/display: Add total_num_dpps_required field to informative structure
In reply to [email protected]From: Oleh Kuzhylnyi <[email protected]>
[Why]
The informative structure needs to be extended by the total number of DPPs required per each active plane.
The new informative field is going to be used as a statistical indicator.
[How]
The dml2_core_calcs_get_informative() routine must count a total number of DPPs.
--- .../gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h | 4 ++++ .../dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +4 -0
@@ -453,6 +453,10 @@ struct dml2_display_cfg_programming {unsigned int meta_row_height_plane1; } plane_info[DML2_MAX_PLANES ]; +struct { +unsigned int total_num_dpps_required; + } dpp; +struct {unsigned long long total_surface_size_in_mall_bytes;unsigned int subviewport_lines_needed_in_mall[DML2_MAX_PLANES ];
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +4 -1
@@ -13147,8 +13147,11 @@ void dml2_core_calcs_get_informative(const struct dml2_core_internal_display_mod out->informative.watermarks.temp_read_or_ppt_watermark_us =dml_get_wm_temp_read_or_ppt (mode_lib); out->informative.mall.total_surface_size_in_mall_bytes =0 ; -for (k =0 ; k < out->display_config.num_planes; ++k) + out->informative.dpp.total_num_dpps_required =0 ; +for (k =0 ; k < out->display_config.num_planes; ++k) { out->informative.mall.total_surface_size_in_mall_bytes += mode_lib->mp.SurfaceSizeInTheMALL[k]; + out->informative.dpp.total_num_dpps_required += mode_lib->mp.NoOfDPP[k]; + } out->informative.qos.min_return_latency_in_dcfclk = mode_lib->mp.min_return_latency_in_dcfclk; out->informative.qos.urgent_latency_us =dml_get_urgent_latency (mode_lib);
Signature · 1 line
2.34.1
PATCH 11/16 drm/amd/display: Add log for MALL entry on DCN32x
In reply to [email protected]From: Aurabindo Pillai <[email protected]>
[Why&How]
Add a dyndbg log entry to check whether the driver requested scanout from MALL cache to PMFW via DMCUB
--- drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +2 -0
@@ -316,10 +316,12 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.cab_alloc_ways = (uint8_t )ways;dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +DC_LOG_MALL ("enable scanout from MALL" );return true; } +DC_LOG_MALL ("surface cannot fit in CAB, disabling scanout from MALL\n" );return false; }
Signature · 1 line
2.34.1
PATCH 12/16 drm/amd/display: Support BT2020 YCbCr fullrange
In reply to [email protected]From: Ilya Bakoulin <[email protected]>
[Why/How]
Need to add support for full-range quantization for YCbCr in BT2020 color space.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dc_common.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 ++- .../amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++++- .../gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 12 files changed, 29 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -3
@@ -5616,9 +5616,9 @@ fill_plane_color_attributes(const struct drm_plane_state *plane_state,case DRM_COLOR_YCBCR_BT2020 :if (full_range) - *color_space =COLOR_SPACE_2020_YCBCR ; + *color_space =COLOR_SPACE_2020_YCBCR_FULL ;else -return -EINVAL ; + *color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;default :
@@ -6114,7 +6114,7 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing,if (dc_crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) color_space =COLOR_SPACE_2020_RGB_FULLRANGE ;else - color_space =COLOR_SPACE_2020_YCBCR ; + color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;case DRM_MODE_COLORIMETRY_DEFAULT :// ITU601 default :
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1 -1
@@ -1169,7 +1169,7 @@ static int amdgpu_current_colorspace_show(struct seq_file *m, void *data)case COLOR_SPACE_2020_RGB_FULLRANGE :seq_puts (m,"BT2020_RGB" );break ; -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :seq_puts (m,"BT2020_YCC" );break ;default :
drivers/gpu/drm/amd/display/dc/basics/dc_common.c +2 -1
@@ -40,7 +40,8 @@ bool is_rgb_cspace(enum dc_color_space output_color_space)case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL :return false;default :/* Add a case to switch */
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +3 -2
@@ -176,7 +176,7 @@ static bool is_ycbcr2020_type( {bool ret = false; -if (color_space ==COLOR_SPACE_2020_YCBCR ) +if (color_space ==COLOR_SPACE_2020_YCBCR_LIMITED || color_space ==COLOR_SPACE_2020_YCBCR_FULL ) ret = true;return ret; }
@@ -247,7 +247,8 @@ void color_space_to_black_color(case COLOR_SPACE_YCBCR709_BLACK :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL : *black_color = black_color_format[BLACK_COLOR_FORMAT_YUV_CV ];break ;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -2
@@ -4488,7 +4488,7 @@ static void set_avi_info_frame(break ;case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : hdmi_info.bits.EC0_EC2 =COLORIMETRYEX_BT2020RGBYCBCR ; hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ;break ;
@@ -4502,7 +4502,7 @@ static void set_avi_info_frame(break ; } -if (pixel_encoding && color_space ==COLOR_SPACE_2020_YCBCR && +if (pixel_encoding && color_space ==COLOR_SPACE_2020_YCBCR_LIMITED && stream->out_transfer_func.tf ==TRANSFER_FUNCTION_GAMMA22 ) { hdmi_info.bits.EC0_EC2 =0 ; hdmi_info.bits.C0_C1 =COLORIMETRY_ITU709 ;
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +3 -1
@@ -653,7 +653,8 @@ enum dc_color_space {COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE , -COLOR_SPACE_2020_YCBCR , +COLOR_SPACE_2020_YCBCR_LIMITED , +COLOR_SPACE_2020_YCBCR_FULL ,COLOR_SPACE_ADOBERGB ,COLOR_SPACE_DCIP3 , COLOR_SPACE_DISPLAYNATIVE,
@@ -661,6 +662,7 @@ enum dc_color_space {COLOR_SPACE_APPCTRL ,COLOR_SPACE_CUSTOMPOINTS ,COLOR_SPACE_YCBCR709_BLACK , + COLOR_SPACE_2020_YCBCR = COLOR_SPACE_2020_YCBCR_LIMITED, }; enum dc_dither_option {
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2 -1
@@ -418,7 +418,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute( dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :
@@ -430,6 +430,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_APPCTRL :case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN : +default :/* do nothing */ break ; }
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2 -1
@@ -391,7 +391,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :
@@ -404,6 +404,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }
drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c +2 -1
@@ -632,7 +632,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :
@@ -645,6 +645,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }
drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c +2 -1
@@ -323,7 +323,7 @@ static void dcn31_hpo_dp_stream_enc_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :
@@ -336,6 +336,7 @@ static void dcn31_hpo_dp_stream_enc_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +5 -1
@@ -119,10 +119,14 @@ static const struct dpp_input_csc_matrix __maybe_unused dpp_input_csc_matrix[] = {0x39a6 ,0x2568 ,0 ,0xe0d6 ,0xeedd ,0x2568 ,0xf925 ,0x9a8 , 0, 0x2568, 0x43ee, 0xdbb2 } }, - { COLOR_SPACE_2020_YCBCR, + { COLOR_SPACE_2020_YCBCR_FULL, { 0x2F30, 0x2000, 0, 0xE869,0xEDB7 ,0x2000 ,0xFABC ,0xBC6 , 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_YCBCR_LIMITED, + { 0x35B9, 0x2543, 0, 0xE2B2, +0xEB2F ,0x2543 ,0xFA01 ,0x0B1F , + 0, 0x2543, 0x4489, 0xDB42 } }, { COLOR_SPACE_2020_RGB_LIMITEDRANGE, { 0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E,
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +2 -2
@@ -383,10 +383,10 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, colorimetryFormat = ColorimetryYCC_DP_ITU709; else if (cs == COLOR_SPACE_ADOBERGB) colorimetryFormat = ColorimetryYCC_DP_AdobeYCC; - else if (cs == COLOR_SPACE_2020_YCBCR) + else if (cs == COLOR_SPACE_2020_YCBCR_LIMITED) colorimetryFormat = ColorimetryYCC_DP_ITU2020YCbCr; -if (cs ==COLOR_SPACE_2020_YCBCR && tf ==TRANSFER_FUNC_GAMMA_22 ) +if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED && tf ==TRANSFER_FUNC_GAMMA_22 ) colorimetryFormat = ColorimetryYCC_DP_ITU709;break ;
Signature · 1 line
2.34.1
Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrange
Thanks a lot for the patch!
Small commit title nit, sorry for spotting this earlier: this commit adds BT2020 *limited* range - full range was already supported, see the changes in amdgpu_dm.c and dpp.h.
Quoted 265 lines · On 14.02.25 16:00, [email protected] wrote:
From: Ilya Bakoulin <[email protected]>
[Why/How]
Need to add support for full-range quantization for YCbCr in BT2020 color space.Reviewed-by Krunoslav Kovac <[email protected]>Signed-off-by Ilya Bakoulin <[email protected]>Signed-off-by Roman Li <[email protected]>Tested-by Robert Mader <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dc_common.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 ++- .../amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++++- .../gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 12 files changed, 29 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-3@@ -5616,9 +5616,9 @@ fill_plane_color_attributes(const struct drm_plane_state *plane_state,case DRM_COLOR_YCBCR_BT2020 :if (full_range) - *color_space =COLOR_SPACE_2020_YCBCR ; + *color_space =COLOR_SPACE_2020_YCBCR_FULL ;else -return -EINVAL ; + *color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;default :@@ -6114,7 +6114,7 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing,if (dc_crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) color_space =COLOR_SPACE_2020_RGB_FULLRANGE ;else - color_space =COLOR_SPACE_2020_YCBCR ; + color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;case DRM_MODE_COLORIMETRY_DEFAULT :// ITU601 default :drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1
-1@@ -1169,7 +1169,7 @@ static int amdgpu_current_colorspace_show(struct seq_file *m, void *data)case COLOR_SPACE_2020_RGB_FULLRANGE :seq_puts (m,"BT2020_RGB" );break ; -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :seq_puts (m,"BT2020_YCC" );break ;default :drivers/gpu/drm/amd/display/dc/basics/dc_common.c +2
-1@@ -40,7 +40,8 @@ bool is_rgb_cspace(enum dc_color_space output_color_space)case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL :return false;default :/* Add a case to switch */ drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +3
-2@@ -176,7 +176,7 @@ static bool is_ycbcr2020_type( {bool ret = false; -if (color_space ==COLOR_SPACE_2020_YCBCR ) +if (color_space ==COLOR_SPACE_2020_YCBCR_LIMITED || color_space ==COLOR_SPACE_2020_YCBCR_FULL ) ret = true;return ret; }@@ -247,7 +247,8 @@ void color_space_to_black_color(case COLOR_SPACE_YCBCR709_BLACK :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL : *black_color = black_color_format[BLACK_COLOR_FORMAT_YUV_CV ];break ;drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2
-2@@ -4488,7 +4488,7 @@ static void set_avi_info_frame(break ;case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : hdmi_info.bits.EC0_EC2 =COLORIMETRYEX_BT2020RGBYCBCR ; hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ;break ;@@ -4502,7 +4502,7 @@ static void set_avi_info_frame(break ; } -if (pixel_encoding && color_space ==COLOR_SPACE_2020_YCBCR && +if (pixel_encoding && color_space ==COLOR_SPACE_2020_YCBCR_LIMITED && stream->out_transfer_func.tf ==TRANSFER_FUNCTION_GAMMA22 ) { hdmi_info.bits.EC0_EC2 =0 ; hdmi_info.bits.C0_C1 =COLORIMETRY_ITU709 ;drivers/gpu/drm/amd/display/dc/dc_hw_types.h +3
-1@@ -653,7 +653,8 @@ enum dc_color_space {COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE , -COLOR_SPACE_2020_YCBCR , +COLOR_SPACE_2020_YCBCR_LIMITED , +COLOR_SPACE_2020_YCBCR_FULL ,COLOR_SPACE_ADOBERGB ,COLOR_SPACE_DCIP3 , COLOR_SPACE_DISPLAYNATIVE,@@ -661,6 +662,7 @@ enum dc_color_space {COLOR_SPACE_APPCTRL ,COLOR_SPACE_CUSTOMPOINTS ,COLOR_SPACE_YCBCR709_BLACK , + COLOR_SPACE_2020_YCBCR = COLOR_SPACE_2020_YCBCR_LIMITED, }; enum dc_dither_option {drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2
-1@@ -418,7 +418,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute( dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -430,6 +430,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_APPCTRL :case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2
-1@@ -391,7 +391,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -404,6 +404,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c +2
-1@@ -632,7 +632,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -645,6 +645,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c +2
-1@@ -323,7 +323,7 @@ static void dcn31_hpo_dp_stream_enc_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -336,6 +336,7 @@ static void dcn31_hpo_dp_stream_enc_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +5
-1@@ -119,10 +119,14 @@ static const struct dpp_input_csc_matrix __maybe_unused dpp_input_csc_matrix[] = {0x39a6 ,0x2568 ,0 ,0xe0d6 ,0xeedd ,0x2568 ,0xf925 ,0x9a8 , 0, 0x2568, 0x43ee, 0xdbb2 } }, - { COLOR_SPACE_2020_YCBCR, + { COLOR_SPACE_2020_YCBCR_FULL, { 0x2F30, 0x2000, 0, 0xE869,0xEDB7 ,0x2000 ,0xFABC ,0xBC6 , 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_YCBCR_LIMITED, + { 0x35B9, 0x2543, 0, 0xE2B2, +0xEB2F ,0x2543 ,0xFA01 ,0x0B1F , + 0, 0x2543, 0x4489, 0xDB42 } }, { COLOR_SPACE_2020_RGB_LIMITEDRANGE, { 0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E,drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +2
-2@@ -383,10 +383,10 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, colorimetryFormat = ColorimetryYCC_DP_ITU709; else if (cs == COLOR_SPACE_ADOBERGB) colorimetryFormat = ColorimetryYCC_DP_AdobeYCC; - else if (cs == COLOR_SPACE_2020_YCBCR) + else if (cs == COLOR_SPACE_2020_YCBCR_LIMITED) colorimetryFormat = ColorimetryYCC_DP_ITU2020YCbCr; -if (cs ==COLOR_SPACE_2020_YCBCR && tf ==TRANSFER_FUNC_GAMMA_22 ) +if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED && tf ==TRANSFER_FUNC_GAMMA_22 ) colorimetryFormat = ColorimetryYCC_DP_ITU709;break ;
RE: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrange
[Public]
Hi Robert, thank you for the feedback.
What about this version of commit message:
Fix BT2020 YCbCr limited/full range input
[Why]
BT2020 YCbCr input is not handled properly when full range quantization is used and limited range is not supported at all.
[How]
- Add enums for BT2020 YCbCr limited/full range
- Add limited range CSC matrix
Thanks,
Roman
Quoted 332 lines
-----Original Message-----
From: Robert Mader <[email protected]>
Sent: Friday, February 14, 2025 4:24 PM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Bakoulin, Ilya <[email protected]>; Kovac, Krunoslav <[email protected]>; Robert Mader <[email protected]>
Subject: Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrangeThanks a lot for the patch!
Small commit title nit, sorry for spotting this earlier: this commit adds BT2020 *limited* range - full range was already supported, see the changes in
amdgpu_dm.canddpp.h.drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c get_output_color_space(const struct dc_crtc_timing
Quoted 44 lines · On 14.02.25 16:00, [email protected] wrote:
From: Ilya Bakoulin <[email protected]>
[Why/How]
Need to add support for full-range quantization for YCbCr in BT2020 color space.Reviewed-by Krunoslav Kovac <[email protected]>Signed-off-by Ilya Bakoulin <[email protected]>Signed-off-by Roman Li <[email protected]>Tested-by Robert Mader <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dc_common.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 ++- .../amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++++- .../gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 12 files changed, 29 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-2@@ -5616,9 +5616,9 @@ fill_plane_color_attributes(const structdrm_plane_state *plane_state, case DRM_COLOR_YCBCR_BT2020: if (full_range) - *color_space = COLOR_SPACE_2020_YCBCR; + *color_space = COLOR_SPACE_2020_YCBCR_FULL; else - return -EINVAL; + *color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;default:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -6114,7 +6114,7 @@ get_output_color_space(const struct dc_crtc_timing
*dc_crtc_timing,drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c static int amdgpu_current_colorspace_show(struct
Quoted 14 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1if (dc_crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) color_space =COLOR_SPACE_2020_RGB_FULLRANGE ;else - color_space =COLOR_SPACE_2020_YCBCR ; + color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;case DRM_MODE_COLORIMETRY_DEFAULT :// ITU601 default :drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +0
-0@@ -1169,7 +1169,7 @@ static int amdgpu_current_colorspace_show(struct
seq_file*m, void *data)drivers/gpu/drm/amd/display/dc/basics/dc_common.c bool is_rgb_cspace(enum dc_color_space
Quoted 14 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1
-1case COLOR_SPACE_2020_RGB_FULLRANGE :seq_puts (m,"BT2020_RGB" );break ; -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :seq_puts (m,"BT2020_YCC" );break ;default :drivers/gpu/drm/amd/display/dc/basics/dc_common.c +0
-0@@ -40,7 +40,8 @@ bool is_rgb_cspace(enum dc_color_space
output_color_space)Quoted 15 lines
drivers/gpu/drm/amd/display/dc/basics/dc_common.c +2
-1case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL :return false;default :/* Add a case to switch */ drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0
-0drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c static bool is_ycbcr2020_type( · line 179
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1
-1@@ -176,7 +176,7 @@ static bool is_ycbcr2020_type( {bool ret = false; -if (color_space ==COLOR_SPACE_2020_YCBCR ) + if (color_space == COLOR_SPACE_2020_YCBCR_LIMITED || color_space==
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c void color_space_to_black_color( · line 252
Quoted 12 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +3
-1+COLOR_SPACE_2020_YCBCR_FULL) ret = true;return ret; }@@ -247,7 +247,8 @@ void color_space_to_black_color(case COLOR_SPACE_YCBCR709_BLACK :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL : *black_color =black_color_format[BLACK_COLOR_FORMAT_YUV_CV];
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0
-0break ;drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0
-0drivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4492
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-1@@ -4488,7 +4488,7 @@ static void set_avi_info_frame(break ;case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : hdmi_info.bits.EC0_EC2 =
COLORIMETRYEX_BT2020RGBYCBCR;drivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4505
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-1hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ;break ;@@ -4502,7 +4502,7 @@ static void set_avi_info_frame(break ; } - if (pixel_encoding && color_space == COLOR_SPACE_2020_YCBCR && + if (pixel_encoding && color_space ==
COLOR_SPACE_2020_YCBCR_LIMITEDdrivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4507
Quoted 2 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-0+&& stream->out_transfer_func.tf ==
TRANSFER_FUNCTION_GAMMA22) {Quoted 18 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0
-0hdmi_info.bits.EC0_EC2 =0 ; hdmi_info.bits.C0_C1 = COLORIMETRY_ITU709; diff --git
a/drivers/gpu/drm/amd/display/dc/dc_hw_types.hb/drivers/gpu/drm/amd/display/dc/dc_hw_types.hindex5ac55601a6da..9f3dd8824ed5100644drivers/gpu/drm/amd/display/dc/dc_hw_types.h +2
-1@@ -653,7 +653,8 @@ enum dc_color_space {COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE , -COLOR_SPACE_2020_YCBCR , +COLOR_SPACE_2020_YCBCR_LIMITED , +COLOR_SPACE_2020_YCBCR_FULL ,COLOR_SPACE_ADOBERGB ,COLOR_SPACE_DCIP3 , COLOR_SPACE_DISPLAYNATIVE,drivers/gpu/drm/amd/display/dc/dc_hw_types.h enum dc_color_space { · line 665
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1
-0@@ -661,6 +662,7 @@ enum dc_color_space {COLOR_SPACE_APPCTRL ,COLOR_SPACE_CUSTOMPOINTS ,COLOR_SPACE_YCBCR709_BLACK , + COLOR_SPACE_2020_YCBCR =
COLOR_SPACE_2020_YCBCR_LIMITED,drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0
-0};enum dc_dither_option {drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +0
-0@@ -418,7 +418,7 @@ static voiddce110_stream_encoder_dp_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-1dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -430,6 +430,7 @@ static voiddce110_stream_encoder_dp_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c static void
Quoted 68 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-0case COLOR_SPACE_APPCTRL :case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN : +default :/* do nothing */ break ; }diff --git
a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.cb/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.cindexd01a8b8f9595..22e66b375a7f100644drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2
-1@@ -391,7 +391,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -404,6 +404,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c index
334fb5e2c003..4bab180e1938100644
---
a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_enco +++der.cdrivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2
-1@@ -632,7 +632,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -645,6 +645,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }diff --git a/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder .c b/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder .c index
678db949cfe3..759b453385c4100644
---
a/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder .c
+++ b/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_enc +++oder.cdrivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +0
-0@@ -323,7 +323,7 @@ static voiddcn31_hpo_dp_stream_enc_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +1
-1break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -336,6 +336,7 @@ static voiddcn31_hpo_dp_stream_enc_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h static const struct dpp_input_csc_matrix
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +1
-0case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +0
-0@@ -119,10 +119,14 @@ static const struct dpp_input_csc_matrix
__maybe_unuseddpp_input_csc_matrix[] =drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct
Quoted 22 lines
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +5
-1{0x39a6 ,0x2568 ,0 ,0xe0d6 ,0xeedd ,0x2568 ,0xf925 ,0x9a8 , 0, 0x2568, 0x43ee, 0xdbb2 } }, - { COLOR_SPACE_2020_YCBCR, + { COLOR_SPACE_2020_YCBCR_FULL, { 0x2F30, 0x2000, 0, 0xE869,0xEDB7 ,0x2000 ,0xFABC ,0xBC6 , 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_YCBCR_LIMITED, + { 0x35B9, 0x2543, 0, 0xE2B2, +0xEB2F ,0x2543 ,0xFA01 ,0x0B1F , + 0, 0x2543, 0x4489, 0xDB42 } }, { COLOR_SPACE_2020_RGB_LIMITEDRANGE, { 0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E,diff --git
a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.cb/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.cindexa344e2e49b0e..b3d55cac3569100644drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-0@@ -383,10 +383,10 @@ void mod_build_vsc_infopacket(const struct
dc_stream_state*stream,drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
Quoted 3 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-0colorimetryFormat = ColorimetryYCC_DP_ITU709; else if (cs == COLOR_SPACE_ADOBERGB) colorimetryFormat =
ColorimetryYCC_DP_AdobeYCC;drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
Quoted 3 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +1
-1-else if (cs ==COLOR_SPACE_2020_YCBCR ) +else if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED ) colorimetryFormat =
ColorimetryYCC_DP_ITU2020YCbCr;drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct · line 388
Quoted 2 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-1- if (cs == COLOR_SPACE_2020_YCBCR && tf ==
TRANSFER_FUNC_GAMMA_22)Quoted 5 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +2
-0+if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED && tf == +TRANSFER_FUNC_GAMMA_22 ) colorimetryFormat = ColorimetryYCC_DP_ITU709;break ;
Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrange
Hi Roman,
Quoted 1 line
not handled properly when full range quantization is used
I wasn't aware that there was something wrong with the full range handling and it's also not clear from the [How] section what that was - can you shortly elaborate on that? Apart from that it looks good to me, thanks!
Quoted 350 lines · Roman
[Public]
Hi Robert, thank you for the feedback.
What about this version of commit message:Fix BT2020 YCbCr limited/full range input
[Why]
BT2020 YCbCr input is not handled properly when full range quantization is used and limited range is not supported at all.[How]
- Add enums for BT2020 YCbCr limited/full range
- Add limited range CSC matrixThanks,
RomanQuoted 331 lines
-----Original Message-----
From: Robert Mader <[email protected]>
Sent: Friday, February 14, 2025 4:24 PM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Bakoulin, Ilya <[email protected]>; Kovac, Krunoslav <[email protected]>; Robert Mader <[email protected]>
Subject: Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrangeThanks a lot for the patch!
Small commit title nit, sorry for spotting this earlier: this commit adds BT2020 *limited* range - full range was already supported, see the changes in
amdgpu_dm.canddpp.h.drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c get_output_color_space(const struct dc_crtc_timing
Quoted 44 lines · On 14.02.25 16:00, [email protected] wrote:
From: Ilya Bakoulin <[email protected]>
[Why/How]
Need to add support for full-range quantization for YCbCr in BT2020 color space.Reviewed-by Krunoslav Kovac <[email protected]>Signed-off-by Ilya Bakoulin <[email protected]>Signed-off-by Roman Li <[email protected]>Tested-by Robert Mader <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dc_common.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 ++- .../amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++++- .../gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 12 files changed, 29 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-2@@ -5616,9 +5616,9 @@ fill_plane_color_attributes(const structdrm_plane_state *plane_state, case DRM_COLOR_YCBCR_BT2020: if (full_range) - *color_space = COLOR_SPACE_2020_YCBCR; + *color_space = COLOR_SPACE_2020_YCBCR_FULL; else - return -EINVAL; + *color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;default:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -6114,7 +6114,7 @@ get_output_color_space(const struct dc_crtc_timing
*dc_crtc_timing,drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c static int amdgpu_current_colorspace_show(struct
Quoted 14 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1if (dc_crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) color_space =COLOR_SPACE_2020_RGB_FULLRANGE ;else - color_space =COLOR_SPACE_2020_YCBCR ; + color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;case DRM_MODE_COLORIMETRY_DEFAULT :// ITU601 default :drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +0
-0@@ -1169,7 +1169,7 @@ static int amdgpu_current_colorspace_show(struct
seq_file*m, void *data)drivers/gpu/drm/amd/display/dc/basics/dc_common.c bool is_rgb_cspace(enum dc_color_space
Quoted 14 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1
-1case COLOR_SPACE_2020_RGB_FULLRANGE :seq_puts (m,"BT2020_RGB" );break ; -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :seq_puts (m,"BT2020_YCC" );break ;default :drivers/gpu/drm/amd/display/dc/basics/dc_common.c +0
-0@@ -40,7 +40,8 @@ bool is_rgb_cspace(enum dc_color_space
output_color_space)Quoted 15 lines
drivers/gpu/drm/amd/display/dc/basics/dc_common.c +2
-1case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL :return false;default :/* Add a case to switch */ drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0
-0drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c static bool is_ycbcr2020_type( · line 179
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1
-1@@ -176,7 +176,7 @@ static bool is_ycbcr2020_type( {bool ret = false; -if (color_space ==COLOR_SPACE_2020_YCBCR ) + if (color_space == COLOR_SPACE_2020_YCBCR_LIMITED || color_space==
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c void color_space_to_black_color( · line 252
Quoted 12 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +3
-1+COLOR_SPACE_2020_YCBCR_FULL) ret = true;return ret; }@@ -247,7 +247,8 @@ void color_space_to_black_color(case COLOR_SPACE_YCBCR709_BLACK :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL : *black_color =black_color_format[BLACK_COLOR_FORMAT_YUV_CV];
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0
-0break ;drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0
-0drivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4492
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-1@@ -4488,7 +4488,7 @@ static void set_avi_info_frame(break ;case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : hdmi_info.bits.EC0_EC2 =
COLORIMETRYEX_BT2020RGBYCBCR;drivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4505
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-1hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ;break ;@@ -4502,7 +4502,7 @@ static void set_avi_info_frame(break ; } - if (pixel_encoding && color_space == COLOR_SPACE_2020_YCBCR && + if (pixel_encoding && color_space ==
COLOR_SPACE_2020_YCBCR_LIMITEDdrivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4507
Quoted 2 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-0+&& stream->out_transfer_func.tf ==
TRANSFER_FUNCTION_GAMMA22) {Quoted 18 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0
-0hdmi_info.bits.EC0_EC2 =0 ; hdmi_info.bits.C0_C1 = COLORIMETRY_ITU709; diff --git
a/drivers/gpu/drm/amd/display/dc/dc_hw_types.hb/drivers/gpu/drm/amd/display/dc/dc_hw_types.hindex5ac55601a6da..9f3dd8824ed5100644drivers/gpu/drm/amd/display/dc/dc_hw_types.h +2
-1@@ -653,7 +653,8 @@ enum dc_color_space {COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE , -COLOR_SPACE_2020_YCBCR , +COLOR_SPACE_2020_YCBCR_LIMITED , +COLOR_SPACE_2020_YCBCR_FULL ,COLOR_SPACE_ADOBERGB ,COLOR_SPACE_DCIP3 , COLOR_SPACE_DISPLAYNATIVE,drivers/gpu/drm/amd/display/dc/dc_hw_types.h enum dc_color_space { · line 665
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1
-0@@ -661,6 +662,7 @@ enum dc_color_space {COLOR_SPACE_APPCTRL ,COLOR_SPACE_CUSTOMPOINTS ,COLOR_SPACE_YCBCR709_BLACK , + COLOR_SPACE_2020_YCBCR =
COLOR_SPACE_2020_YCBCR_LIMITED,drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0
-0};enum dc_dither_option {drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +0
-0@@ -418,7 +418,7 @@ static voiddce110_stream_encoder_dp_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-1dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -430,6 +430,7 @@ static voiddce110_stream_encoder_dp_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c static void
Quoted 68 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-0case COLOR_SPACE_APPCTRL :case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN : +default :/* do nothing */ break ; }diff --git
a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.cb/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.cindexd01a8b8f9595..22e66b375a7f100644drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2
-1@@ -391,7 +391,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -404,6 +404,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c index
334fb5e2c003..4bab180e1938100644
---
a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_enco +++der.cdrivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2
-1@@ -632,7 +632,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -645,6 +645,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }diff --git a/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder .c b/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder .c index
678db949cfe3..759b453385c4100644
---
a/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder .c
+++ b/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_enc +++oder.cdrivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +0
-0@@ -323,7 +323,7 @@ static voiddcn31_hpo_dp_stream_enc_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +1
-1break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -336,6 +336,7 @@ static voiddcn31_hpo_dp_stream_enc_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h static const struct dpp_input_csc_matrix
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +1
-0case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +0
-0@@ -119,10 +119,14 @@ static const struct dpp_input_csc_matrix
__maybe_unuseddpp_input_csc_matrix[] =drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct
Quoted 22 lines
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +5
-1{0x39a6 ,0x2568 ,0 ,0xe0d6 ,0xeedd ,0x2568 ,0xf925 ,0x9a8 , 0, 0x2568, 0x43ee, 0xdbb2 } }, - { COLOR_SPACE_2020_YCBCR, + { COLOR_SPACE_2020_YCBCR_FULL, { 0x2F30, 0x2000, 0, 0xE869,0xEDB7 ,0x2000 ,0xFABC ,0xBC6 , 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_YCBCR_LIMITED, + { 0x35B9, 0x2543, 0, 0xE2B2, +0xEB2F ,0x2543 ,0xFA01 ,0x0B1F , + 0, 0x2543, 0x4489, 0xDB42 } }, { COLOR_SPACE_2020_RGB_LIMITEDRANGE, { 0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E,diff --git
a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.cb/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.cindexa344e2e49b0e..b3d55cac3569100644drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-0@@ -383,10 +383,10 @@ void mod_build_vsc_infopacket(const struct
dc_stream_state*stream,drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
Quoted 3 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-0colorimetryFormat = ColorimetryYCC_DP_ITU709; else if (cs == COLOR_SPACE_ADOBERGB) colorimetryFormat =
ColorimetryYCC_DP_AdobeYCC;drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
Quoted 3 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +1
-1-else if (cs ==COLOR_SPACE_2020_YCBCR ) +else if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED ) colorimetryFormat =
ColorimetryYCC_DP_ITU2020YCbCr;drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct · line 388
Quoted 1 line
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-1- if (cs == COLOR_SPACE_2020_YCBCR && tf ==
TRANSFER_FUNC_GAMMA_22)Quoted 5 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +2
-0+if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED && tf == +TRANSFER_FUNC_GAMMA_22 ) colorimetryFormat = ColorimetryYCC_DP_ITU709;break ;
RE: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrange
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Robert,
We only had one enum: COLOR_SPACE_2020_YCBCR.
On the output side this assumed limited range.
On the input side this apparently assumed full range given the dpp matrix. Now we split it into two enums to distinguish them and add limited range yuv->rgb matrix.
Roman, maybe we can reword it a little bit further?
Thanks,
Kruno
-----Original Message-----
From: Robert Mader <[email protected]>
Sent: February 14, 2025 17:06
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Bakoulin, Ilya <[email protected]>; Kovac, Krunoslav <[email protected]>
Subject: Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrange
Hi Roman,
Quoted 1 line
not handled properly when full range quantization is used
I wasn't aware that there was something wrong with the full range handling and it's also not clear from the [How] section what that was - can you shortly elaborate on that? Apart from that it looks good to me, thanks!
Quoted 361 lines · Roman
[Public]
Hi Robert, thank you for the feedback.
What about this version of commit message:Fix BT2020 YCbCr limited/full range input
[Why]
BT2020 YCbCr input is not handled properly when full range quantization is used and limited range is not supported at all.[How]
- Add enums for BT2020 YCbCr limited/full range
- Add limited range CSC matrixThanks,
RomanQuoted 342 lines
-----Original Message-----
From: Robert Mader <[email protected]>
Sent: Friday, February 14, 2025 4:24 PM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Bakoulin, Ilya <[email protected]>; Kovac, Krunoslav <[email protected]>; Robert Mader <[email protected]>
Subject: Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrangeThanks a lot for the patch!
Small commit title nit, sorry for spotting this earlier: this commit adds BT2020
*limited* range - full range was already supported, see the changes inamdgpu_dm.canddpp.h.Quoted 44 lines · On 14.02.25 16:00, [email protected] wrote:
From: Ilya Bakoulin <[email protected]>
[Why/How]
Need to add support for full-range quantization for YCbCr in BT2020 color space.Reviewed-by Krunoslav Kovac <[email protected]>Signed-off-by Ilya Bakoulin <[email protected]>Signed-off-by Roman Li <[email protected]>Tested-by Robert Mader <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dc_common.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 ++- .../amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++++- .../gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 12 files changed, 29 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-2@@ -5616,9 +5616,9 @@ fill_plane_color_attributes(const structdrm_plane_state *plane_state, case DRM_COLOR_YCBCR_BT2020: if (full_range) - *color_space = COLOR_SPACE_2020_YCBCR; + *color_space = COLOR_SPACE_2020_YCBCR_FULL; else - return -EINVAL; + *color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;default:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -6114,7 +6114,7 @@ get_output_color_space(const structQuoted 1 line
dc_crtc_timing
*dc_crtc_timing,Quoted 15 lines
if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB) color_space = COLOR_SPACE_2020_RGB_FULLRANGE; elsedrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1- color_space =COLOR_SPACE_2020_YCBCR ; + color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;case DRM_MODE_COLORIMETRY_DEFAULT :// ITU601 default :diff --git
a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.cb/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.cindex049046c60462..c7d13e743e6c100644drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +0
-0@@ -1169,7 +1169,7 @@ static intQuoted 1 line
amdgpu_current_colorspace_show(struct
seq_file*m, void *data)drivers/gpu/drm/amd/display/dc/basics/dc_common.c bool is_rgb_cspace(enum dc_color_space
Quoted 14 lines
case COLOR_SPACE_2020_RGB_FULLRANGE: seq_puts(m, "BT2020_RGB"); break;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1
-1-case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :seq_puts (m,"BT2020_YCC" );break ;default :drivers/gpu/drm/amd/display/dc/basics/dc_common.c +0
-0@@ -40,7 +40,8 @@ bool is_rgb_cspace(enum dc_color_space
output_color_space)Quoted 15 lines
drivers/gpu/drm/amd/display/dc/basics/dc_common.c +2
-1case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL :return false;default : /* Add a case to switch */ diff --git
a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.cb/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.cindex6eb9bae3af91..6b514fd03f16100644drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c static bool is_ycbcr2020_type( · line 179
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1
-1@@ -176,7 +176,7 @@ static bool is_ycbcr2020_type( {bool ret = false; -if (color_space ==COLOR_SPACE_2020_YCBCR ) + if (color_space == COLOR_SPACE_2020_YCBCR_LIMITED || color_space==
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c void color_space_to_black_color( · line 252
Quoted 12 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +3
-1+COLOR_SPACE_2020_YCBCR_FULL) ret = true;return ret; }@@ -247,7 +247,8 @@ void color_space_to_black_color(case COLOR_SPACE_YCBCR709_BLACK :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL : *black_color =black_color_format[BLACK_COLOR_FORMAT_YUV_CV];
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0
-0break ;drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0
-0drivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4492
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-1@@ -4488,7 +4488,7 @@ static void set_avi_info_frame(break ;case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : hdmi_info.bits.EC0_EC2 =
COLORIMETRYEX_BT2020RGBYCBCR;drivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4505
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-1hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ;break ;@@ -4502,7 +4502,7 @@ static void set_avi_info_frame(break ; } - if (pixel_encoding && color_space == COLOR_SPACE_2020_YCBCR && + if (pixel_encoding && color_space ==
COLOR_SPACE_2020_YCBCR_LIMITEDdrivers/gpu/drm/amd/display/dc/core/dc_resource.c static void set_avi_info_frame( · line 4507
Quoted 2 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1
-0+&& stream->out_transfer_func.tf ==
TRANSFER_FUNCTION_GAMMA22) {Quoted 18 lines
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0
-0hdmi_info.bits.EC0_EC2 =0 ; hdmi_info.bits.C0_C1 = COLORIMETRY_ITU709; diff --git
a/drivers/gpu/drm/amd/display/dc/dc_hw_types.hb/drivers/gpu/drm/amd/display/dc/dc_hw_types.hindex5ac55601a6da..9f3dd8824ed5100644drivers/gpu/drm/amd/display/dc/dc_hw_types.h +2
-1@@ -653,7 +653,8 @@ enum dc_color_space {COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE , -COLOR_SPACE_2020_YCBCR , +COLOR_SPACE_2020_YCBCR_LIMITED , +COLOR_SPACE_2020_YCBCR_FULL ,COLOR_SPACE_ADOBERGB ,COLOR_SPACE_DCIP3 , COLOR_SPACE_DISPLAYNATIVE,drivers/gpu/drm/amd/display/dc/dc_hw_types.h enum dc_color_space { · line 665
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1
-0@@ -661,6 +662,7 @@ enum dc_color_space {COLOR_SPACE_APPCTRL ,COLOR_SPACE_CUSTOMPOINTS ,COLOR_SPACE_YCBCR709_BLACK , + COLOR_SPACE_2020_YCBCR =
COLOR_SPACE_2020_YCBCR_LIMITED,drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0
-0};enum dc_dither_option {drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +0
-0@@ -418,7 +418,7 @@ static voiddce110_stream_encoder_dp_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-1dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -430,6 +430,7 @@ static voiddce110_stream_encoder_dp_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 74 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-0case COLOR_SPACE_APPCTRL :case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN : +default :/* do nothing */ break ; }diff --git
a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.cb/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.cindexd01a8b8f9595..22e66b375a7f100644
---a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder. +++ cdrivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2
-1@@ -391,7 +391,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -404,6 +404,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c index
334fb5e2c003..4bab180e1938100644
---
a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder. c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_en +++ co
+++der.cdrivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2
-1@@ -632,7 +632,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -645,6 +645,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }diff --git a/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encod er
.c b/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encod er .c index678db949cfe3..759b453385c4100644
---
a/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encod er
.c
+++ b/drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_e +++ nc
+++oder.cdrivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +0
-0@@ -323,7 +323,7 @@ static voiddcn31_hpo_dp_stream_enc_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c static void
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-1break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -336,6 +336,7 @@ static voiddcn31_hpo_dp_stream_enc_set_stream_attribute(
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h static const struct dpp_input_csc_matrix
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1
-0case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +0
-0@@ -119,10 +119,14 @@ static const struct dpp_input_csc_matrix
__maybe_unuseddpp_input_csc_matrix[] =drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct
Quoted 21 lines
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +5
-1{0x39a6 ,0x2568 ,0 ,0xe0d6 ,0xeedd ,0x2568 ,0xf925 ,0x9a8 , 0, 0x2568, 0x43ee, 0xdbb2 } }, - { COLOR_SPACE_2020_YCBCR, + { COLOR_SPACE_2020_YCBCR_FULL, { 0x2F30, 0x2000, 0, 0xE869,0xEDB7 ,0x2000 ,0xFABC ,0xBC6 , 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_YCBCR_LIMITED, + { 0x35B9, 0x2543, 0, 0xE2B2, +0xEB2F ,0x2543 ,0xFA01 ,0x0B1F , + 0, 0x2543, 0x4489, 0xDB42 } }, { COLOR_SPACE_2020_RGB_LIMITEDRANGE, { 0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E, diff --git
a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.cb/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.cindexa344e2e49b0e..b3d55cac3569100644drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-0@@ -383,10 +383,10 @@ void mod_build_vsc_infopacket(const struct
dc_stream_state*stream,drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
Quoted 3 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-0colorimetryFormat = ColorimetryYCC_DP_ITU709; else if (cs == COLOR_SPACE_ADOBERGB) colorimetryFormat =
ColorimetryYCC_DP_AdobeYCC;drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
Quoted 3 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +1
-1-else if (cs ==COLOR_SPACE_2020_YCBCR ) +else if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED ) colorimetryFormat =
ColorimetryYCC_DP_ITU2020YCbCr;drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c void mod_build_vsc_infopacket(const struct · line 388
Quoted 1 line
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +0
-1- if (cs == COLOR_SPACE_2020_YCBCR && tf ==
TRANSFER_FUNC_GAMMA_22)Quoted 6 lines
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +3
-0+if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED && tf +== +TRANSFER_FUNC_GAMMA_22 ) colorimetryFormat = ColorimetryYCC_DP_ITU709;break ;
Re: [PATCH 12/16] drm/amd/display: Support BT2020 YCbCr fullrange
In reply to [email protected]Thanks a lot for the patch!
Small commit title nit, sorry for spotting this earlier: this commit adds BT2020 *limited* range - full range was already supported, see the changes in amdgpu_dm.c and dpp.h.
Quoted 265 lines · On 14.02.25 16:00, [email protected] wrote:
From: Ilya Bakoulin <[email protected]>
[Why/How]
Need to add support for full-range quantization for YCbCr in BT2020 color space.Reviewed-by Krunoslav Kovac <[email protected]>Signed-off-by Ilya Bakoulin <[email protected]>Signed-off-by Roman Li <[email protected]>Tested-by Robert Mader <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dc_common.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 +++- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 ++- .../amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++++- .../gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 12 files changed, 29 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-3@@ -5616,9 +5616,9 @@ fill_plane_color_attributes(const struct drm_plane_state *plane_state,case DRM_COLOR_YCBCR_BT2020 :if (full_range) - *color_space =COLOR_SPACE_2020_YCBCR ; + *color_space =COLOR_SPACE_2020_YCBCR_FULL ;else -return -EINVAL ; + *color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;default :@@ -6114,7 +6114,7 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing,if (dc_crtc_timing->pixel_encoding ==PIXEL_ENCODING_RGB ) color_space =COLOR_SPACE_2020_RGB_FULLRANGE ;else - color_space =COLOR_SPACE_2020_YCBCR ; + color_space =COLOR_SPACE_2020_YCBCR_LIMITED ;break ;case DRM_MODE_COLORIMETRY_DEFAULT :// ITU601 default :drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1
-1@@ -1169,7 +1169,7 @@ static int amdgpu_current_colorspace_show(struct seq_file *m, void *data)case COLOR_SPACE_2020_RGB_FULLRANGE :seq_puts (m,"BT2020_RGB" );break ; -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :seq_puts (m,"BT2020_YCC" );break ;default :drivers/gpu/drm/amd/display/dc/basics/dc_common.c +2
-1@@ -40,7 +40,8 @@ bool is_rgb_cspace(enum dc_color_space output_color_space)case COLOR_SPACE_YCBCR709 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL :return false;default :/* Add a case to switch */ drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +3
-2@@ -176,7 +176,7 @@ static bool is_ycbcr2020_type( {bool ret = false; -if (color_space ==COLOR_SPACE_2020_YCBCR ) +if (color_space ==COLOR_SPACE_2020_YCBCR_LIMITED || color_space ==COLOR_SPACE_2020_YCBCR_FULL ) ret = true;return ret; }@@ -247,7 +247,8 @@ void color_space_to_black_color(case COLOR_SPACE_YCBCR709_BLACK :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : +case COLOR_SPACE_2020_YCBCR_FULL : *black_color = black_color_format[BLACK_COLOR_FORMAT_YUV_CV ];break ;drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2
-2@@ -4488,7 +4488,7 @@ static void set_avi_info_frame(break ;case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED : hdmi_info.bits.EC0_EC2 =COLORIMETRYEX_BT2020RGBYCBCR ; hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ;break ;@@ -4502,7 +4502,7 @@ static void set_avi_info_frame(break ; } -if (pixel_encoding && color_space ==COLOR_SPACE_2020_YCBCR && +if (pixel_encoding && color_space ==COLOR_SPACE_2020_YCBCR_LIMITED && stream->out_transfer_func.tf ==TRANSFER_FUNCTION_GAMMA22 ) { hdmi_info.bits.EC0_EC2 =0 ; hdmi_info.bits.C0_C1 =COLORIMETRY_ITU709 ;drivers/gpu/drm/amd/display/dc/dc_hw_types.h +3
-1@@ -653,7 +653,8 @@ enum dc_color_space {COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE , -COLOR_SPACE_2020_YCBCR , +COLOR_SPACE_2020_YCBCR_LIMITED , +COLOR_SPACE_2020_YCBCR_FULL ,COLOR_SPACE_ADOBERGB ,COLOR_SPACE_DCIP3 , COLOR_SPACE_DISPLAYNATIVE,@@ -661,6 +662,7 @@ enum dc_color_space {COLOR_SPACE_APPCTRL ,COLOR_SPACE_CUSTOMPOINTS ,COLOR_SPACE_YCBCR709_BLACK , + COLOR_SPACE_2020_YCBCR = COLOR_SPACE_2020_YCBCR_LIMITED, }; enum dc_dither_option {drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2
-1@@ -418,7 +418,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute( dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -430,6 +430,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_APPCTRL :case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +2
-1@@ -391,7 +391,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -404,6 +404,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c +2
-1@@ -632,7 +632,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -645,6 +645,7 @@ void enc401_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.c +2
-1@@ -323,7 +323,7 @@ static void dcn31_hpo_dp_stream_enc_set_stream_attribute(break ;case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_RGB_FULLRANGE : -case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_2020_YCBCR_LIMITED :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB :@@ -336,6 +336,7 @@ static void dcn31_hpo_dp_stream_enc_set_stream_attribute(case COLOR_SPACE_CUSTOMPOINTS :case COLOR_SPACE_UNKNOWN :case COLOR_SPACE_YCBCR709_BLACK : +default :/* do nothing */ break ; }drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +5
-1@@ -119,10 +119,14 @@ static const struct dpp_input_csc_matrix __maybe_unused dpp_input_csc_matrix[] = {0x39a6 ,0x2568 ,0 ,0xe0d6 ,0xeedd ,0x2568 ,0xf925 ,0x9a8 , 0, 0x2568, 0x43ee, 0xdbb2 } }, - { COLOR_SPACE_2020_YCBCR, + { COLOR_SPACE_2020_YCBCR_FULL, { 0x2F30, 0x2000, 0, 0xE869,0xEDB7 ,0x2000 ,0xFABC ,0xBC6 , 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_YCBCR_LIMITED, + { 0x35B9, 0x2543, 0, 0xE2B2, +0xEB2F ,0x2543 ,0xFA01 ,0x0B1F , + 0, 0x2543, 0x4489, 0xDB42 } }, { COLOR_SPACE_2020_RGB_LIMITEDRANGE, { 0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E,drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +2
-2@@ -383,10 +383,10 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, colorimetryFormat = ColorimetryYCC_DP_ITU709; else if (cs == COLOR_SPACE_ADOBERGB) colorimetryFormat = ColorimetryYCC_DP_AdobeYCC; - else if (cs == COLOR_SPACE_2020_YCBCR) + else if (cs == COLOR_SPACE_2020_YCBCR_LIMITED) colorimetryFormat = ColorimetryYCC_DP_ITU2020YCbCr; -if (cs ==COLOR_SPACE_2020_YCBCR && tf ==TRANSFER_FUNC_GAMMA_22 ) +if (cs ==COLOR_SPACE_2020_YCBCR_LIMITED && tf ==TRANSFER_FUNC_GAMMA_22 ) colorimetryFormat = ColorimetryYCC_DP_ITU709;break ;
PATCH 13/16 drm/amd/display: Guard against setting dispclk low when active
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
We should never apply a minimum dispclk value while in prepare_bandwidth or while displays are active. This is always an optimization for when all displays are disabled.
[How]
Defer dispclk optimization until safe_to_lower = true and display_count reaches 0.
Since 0 has a special value in this logic (ie. no dispclk required) we also need adjust the logic that clamps it for the actual request to PMFW.
--- .../amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +9 -4
@@ -467,14 +467,19 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base, update_dppclk = true; } -if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { +if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) && + (new_clocks->dispclk_khz >0 || (safe_to_lower && display_count ==0 ))) { +int requested_dispclk_khz = new_clocks->dispclk_khz; +dcn35_disable_otg_wa (clk_mgr_base, context, safe_to_lower, true); -if (dc->debug.min_disp_clk_khz >0 && new_clocks->dispclk_khz < dc->debug.min_disp_clk_khz) - new_clocks->dispclk_khz = dc->debug.min_disp_clk_khz; +/* Clamp the requested clock to PMFW based on their limit. */ +if (dc->debug.min_disp_clk_khz >0 && requested_dispclk_khz < dc->debug.min_disp_clk_khz) + requested_dispclk_khz = dc->debug.min_disp_clk_khz; +dcn35_smu_set_dispclk (clk_mgr, requested_dispclk_khz); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz; -dcn35_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); +dcn35_disable_otg_wa (clk_mgr_base, context, safe_to_lower, false); update_dispclk = true;
Signature · 1 line
2.34.1
PATCH 14/16 drm/amd/display: dpia should avoid encoder used by dp2
In reply to [email protected]From: Peichen Huang <[email protected]>
[WHY]
In current HPO DP2 implementation, driver would enable/disable DIG encoder when configuring HPO DP2. Therefore, usb4 dp tunnelling should not use the DIG encoder if the corresponded phy is used by a HPO DP2 stream.
[HOW]
A DP2 stream is treated as a dig stream.
--- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +2 -14
@@ -44,20 +44,8 @@ static bool is_dig_link_enc_stream(struct dc_stream_state *stream)* yet match. */ if (link_enc && ((uint32_t )stream->link->connector_signal & link_enc->output_signals)) { -if (dc_is_dp_signal (stream->signal)) { -/* DIGs do not support DP2.0 streams with 128b/132b encoding. */ -struct dc_link_settings link_settings = {0 }; - - stream->ctx->dc->link_srv->dp_decide_link_settings (stream, &link_settings); -if ((link_settings.link_rate >=LINK_RATE_LOW ) && - link_settings.link_rate <=LINK_RATE_HIGH3 ) { - is_dig_stream = true; -break ; - } - }else { - is_dig_stream = true; -break ; - } + is_dig_stream = true; +break ; } } }
Signature · 1 line
2.34.1
PATCH 15/16 drm/amd/display: Add support for disconnected eDP streams
In reply to [email protected]From: Harry VanZyllDeJong <[email protected]>
[Why]
eDP may not be connected to the GPU on driver start causing fail enumeration.
[How]
Move the virtual signal type check before the eDP connector signal check.
--- .../drm/amd/display/dc/link/protocols/link_dp_capability.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +3 -3
@@ -945,6 +945,9 @@ bool link_decide_link_settings(struct dc_stream_state *stream,* TODO: add MST specific link training routine */ decide_mst_link_settings (link, link_setting); + }else if (stream->signal ==SIGNAL_TYPE_VIRTUAL ) { + link_setting->lane_count =LANE_COUNT_FOUR ; + link_setting->link_rate =LINK_RATE_HIGH3 ; }else if (link->connector_signal ==SIGNAL_TYPE_EDP ) {/* enable edp link optimization for DSC eDP case */ if (stream->timing.flags.DSC) {
@@ -967,9 +970,6 @@ bool link_decide_link_settings(struct dc_stream_state *stream, }else {edp_decide_link_settings (link, link_setting, req_bw); } - }else if (stream->signal ==SIGNAL_TYPE_VIRTUAL ) { - link_setting->lane_count =LANE_COUNT_FOUR ; - link_setting->link_rate =LINK_RATE_HIGH3 ; }else {decide_dp_link_settings (link, link_setting, req_bw); }
Signature · 1 line
2.34.1
PATCH 16/16 drm/amd/display: 3.2.321
In reply to [email protected]From: Taimur Hassan <[email protected]>
Summary:
* Add support for disconnected eDP streams
* Add log for MALL entry on DCN32x
* Add DCC/Tiling reset helper for DCN and DCE
* Guard against setting dispclk low when active
* Other minor fixes
--- 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
@@ -53,7 +53,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.320" +#define DC_VER "3.2.321"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.34.1
[Public]
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
* Single Display eDP -> 1080p 60hz, 2560x1600 120hz, 1920x1200 165hz
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
* SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
* MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
* AU Optronics B160QAN02.L 2560x1600 120hz eDP
The patchset consists of the amd-staging-drm-next branch (Head commit - 6621ee40ced88ecf6b9901e26a11ed1b56e9e9f5 -> drm/amd/display: 3.2.320) with new patches added on top of it.
Tested on Ubuntu 24.04.1, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, February 14, 2025 10:00 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Li, Roman <[email protected]>
Subject: [PATCH 00/16] DC Patches February 14, 2025
From: Roman Li <[email protected]>
Summary:
* Add support for disconnected eDP streams
* Add log for MALL entry on DCN32x
* Add DCC/Tiling reset helper for DCN and DCE
* Guard against setting dispclk low when active
* Other minor fixes
Alex Hung (1):
drm/amd/display: Print seamless boot message in
mark_seamless_boot_stream
Aurabindo Pillai (1):
drm/amd/display: Add log for MALL entry on DCN32x
George Shen (1):
drm/amd/display: Read LTTPR ALPM caps during link cap retrieval
Harry VanZyllDeJong (1):
drm/amd/display: Add support for disconnected eDP streams
Harry Wentland (1):
drm/amd/display: Don't treat wb connector as physical in
create_validate_stream_for_sink
Ilya Bakoulin (1):
drm/amd/display: Support BT2020 YCbCr fullrange
Leo Zeng (1):
Revert "drm/amd/display: Request HW cursor on DCN3.2 with SubVP"
Nicholas Kazlauskas (1):
drm/amd/display: Guard against setting dispclk low when active
Oleh Kuzhylnyi (1):
drm/amd/display: Add total_num_dpps_required field to informative
structure
Ovidiu Bunea (1):
drm/amd/display: Exit idle optimizations before accessing PHY
Peichen Huang (1):
drm/amd/display: dpia should avoid encoder used by dp2
Rodrigo Siqueira (4):
drm/amd/display: Add DCC/Tiling reset helper for DCN and DCE drm/amd/display: Rename panic function drm/amd/display: Add clear DCC and Tiling callback for DCN drm/amd/display: Add clear DCC and Tiling callback for DCE
Taimur Hassan (1):
drm/amd/display: 3.2.321
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 ++++++++++++------- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- .../gpu/drm/amd/display/dc/basics/dc_common.c | 3 +- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 13 +++++--- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 5 +-- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 16 ++-------- .../gpu/drm/amd/display/dc/core/dc_resource.c | 8 +++-- .../gpu/drm/amd/display/dc/core/dc_surface.c | 31 +++--------------- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 12 +++++++ drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 4 ++- drivers/gpu/drm/amd/display/dc/dc_plane.h | 4 +-- .../amd/display/dc/dce/dce_stream_encoder.c | 3 +- .../amd/display/dc/dce60/dce60_hw_sequencer.c | 1 + .../dc/dio/dcn10/dcn10_stream_encoder.c | 3 +- .../dc/dio/dcn401/dcn401_dio_stream_encoder.c | 3 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 1 - .../display/dc/dml2/dml21/inc/dml_top_types.h | 4 +++ .../src/dml2_core/dml2_core_dcn4_calcs.c | 5 ++- .../hpo/dcn31/dcn31_hpo_dp_stream_encoder.c | 3 +- .../amd/display/dc/hwss/dce100/dce100_hwseq.c | 30 +++++++++++++++++ .../amd/display/dc/hwss/dce100/dce100_hwseq.h | 4 +++ .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 7 ++++ .../amd/display/dc/hwss/dce120/dce120_hwseq.c | 2 ++ .../amd/display/dc/hwss/dce80/dce80_hwseq.c | 1 + .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 29 +++++++++++++++++ .../amd/display/dc/hwss/dcn10/dcn10_hwseq.h | 4 +++ .../amd/display/dc/hwss/dcn10/dcn10_init.c | 1 + .../amd/display/dc/hwss/dcn20/dcn20_init.c | 1 + .../amd/display/dc/hwss/dcn201/dcn201_init.c | 1 + .../amd/display/dc/hwss/dcn21/dcn21_init.c | 1 + .../amd/display/dc/hwss/dcn30/dcn30_init.c | 1 + .../amd/display/dc/hwss/dcn301/dcn301_init.c | 1 + .../amd/display/dc/hwss/dcn31/dcn31_init.c | 1 + .../amd/display/dc/hwss/dcn314/dcn314_init.c | 1 + .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 ++ .../amd/display/dc/hwss/dcn32/dcn32_init.c | 1 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../amd/display/dc/hwss/dcn401/dcn401_init.c | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 6 +++- .../dc/link/protocols/link_dp_capability.c | 12 ++++--- .../display/modules/info_packet/info_packet.c | 4 +-- 47 files changed, 192 insertions(+), 87 deletions(-)
--
2.34.1