DC Patches Oct 10, 2017
cover DC Patches Oct 10, 2017
It's been a while, which means there's about a month of stuff here. Been busy with getting stuff prepped for the DC pull request, XDC, and a bunch of other things.
For major fixes we have:
* Hang on hotplug fix
drm/amd/display: fix multi-display on CZ
* Hotplug not working after S3 drm/amd/display: Fix hotplug after s3 resume. drm/amd/display: Fix irq enable/disable on resume.
Other than that we have
* Bunch of work from Raven enablement, including
* HW object refactor
* Updated DML code (gcc-parseable HW gospel)
* Corrected audio assignment
* An FBC config option (for CZ/ST)
Andrew Jiang (5):
drm/amd/display: Force always scale chroma, set always_scaled to false drm/amd/display: power_down_Hw need signal type to turnoff backlight drm/amd/display: Move power control from link encoder to hwsequencer drm/amd/display: Add missing newlines in pstate wait debug messages drm/amd/display: Fix up plane_states add/remove logic
Bhawanpreet Lakha (5):
drm/amd/display: Refactor dc_update_planes_and_stream. drm/amd/display: fix re-enabling stutter for raven drm/amd/display: increase pstate wait timeout drm/amd/display: Fix underscan not using proper scaling drm/amd/display: change when to set tap_hardcode_coeff
Charlene Liu (9):
drm/amd/display: make sure BL off to mainlink off has enough time drm/amd/display: add hubp/dpp pg debug key drm/amd/display: temp disable DCC on high res. drm/amd/display: soc_bound_box -update DML based on HW. drm/amd/display: audio dynamic resource acquired related drm/amd/display: arbitration find the matching dig-az first. drm/amd/display: Add stereo_support debug flag drm/amd/display: Add debug flag for VSR support drm/amd/display: reject 3D mode based on static debug flag.
Dmytro Laktyushkin (8):
drm/amd/display: Restructuring and cleaning up DML drm/amd/display: add mode support check to dml vba code drm/amd/display: extract global sync params from vba drm/amd/display: change dml vba cursor count define to correct one drm/amd/display: block video planes >4k on dcn10 drm/amd/display: add max_video_width cap to dc drm/amd/display: add performance trace macro to dc drm/amd/display: Set addressable region as active + border
Eric Bernstein (6):
drm/amd/display: update mpc add/remove functions drm/amd/display: update blending mode and set output denorm drm/amd/display: clean up dcn10 dpp after HW review drm/amd/display: group DCN watermark registers drm/amd/display: Add DPP capabilities drm/amd/display: Expose some MPC functions for reuse
Eric Yang (6):
drm/amd/display: fix usb-c dongle regression drm/amd/display: add back removed hack for mpcc add drm/amd/display: Use active + border for bw validation drm/amd/display: Add override for reporting wm ranges drm/amd/display: Handle case when stream not found in set_dpms drm/amd/display: fix null dereference in reset hw ctx
Harry Wentland (2):
drm/amd/display: Don't report fake sink as connected drm/amd/display: Ignore wrong tautological warning
Hersen Wu (4):
drm/amd/display: Driver message to SMU to indicate display off drm/amd/display: screen flickers when connected to ext monitor in
clone
drm/amd/display: add dpms state to DC
drm/amd/display: add dpms state to DC follow up
Jerry Zuo (8):
drm/amd/display: Exclude MST from fake sink drm/amd/display: Fix NULL pointer on MST chained mode drm/amd/display: Fix MST daisy chain SST not light up drm/amd/display: Fix ref_count messed up issue drm/amd/display: Do not access fbdev helper members drm/amd/display: Remove drm_modeset_lock in MST code drm/amd/display: Fix a logic defect in cursor move drm/amd/display: Remove a false-positive error message
Ken Chalmers (1):
drm/amd/display: fix ASSERT() caused by missing registers.
Leo (Sunpeng) Li (4):
drm/amd/display: Match actual state during S3 resume. drm/amd/display: Do not set bandwidth on page flips. drm/amd/display: Report stream as different on scaling change drm/amd/display: ASSERT on dc_create_state failing.
Martin Tsai (1):
drm/amd/display: To prevent detecting new sink from spurious HPD
Roman Li (4):
drm/amd/display: Add FBC on/off to front-end programming drm/amd/display: fix multi-display on CZ drm/amd/display: Fix hotplug after s3 resume. drm/amd/display: Fix irq enable/disable on resume.
ShihChen Chen (1):
drm/amd/display: make tile changing run at ISR
Shirish S (1):
drm/amd/display: make FBC configurable option
SivapiriyanKumarasamy (2):
drm/amd/display: Program stream's csc matrix instead of using default drm/amd/display: Pull transfer func defines into DC
Tony Cheng (10):
drm/amd/display: version 3.1.02
drm/amd/display: enable optional pipe split for single display drm/amd/display: add option to disable DCC for DCC 128b request drm/amd/display: option to maximize lb usage drm/amd/display: fix bug in force_single_disp_pipe_split drm/amd/display: dal 3.1.03
drm/amd/display: align DCLK to voltage level drm/amd/display: wrong VM setting cause invalid DF request from DCN drm/amd/display: dal 3.1.04
drm/amd/display: dal 3.1.05
Vitaly Prosyak (1):
drm/amd/display: [RV] bug in cm programming
Wenjing Liu (3):
drm/amd/display: set cp25201 to use TPS4 drm/amd/display: update link type to mst before topology discovery drm/amd/display: disconnect on HPD low even if edid is the same
Yongqiang Sun (9):
drm/amd/display: Fixed validation return wrong result. drm/amd/display: Fixed incorrect return value for validaton drm/amd/display: Early return when turn off a plane. drm/amd/display: Only reset top pipe back end. drm/amd/display: Enable double buffer as per vertical interrupt
enabled.
drm/amd/display: Program front end first when set mode. drm/amd/display: Fixed extend to second screen mode hang drm/amd/display: wa to program split pipedegamma regs after mode set. drm/amd/display: Fixed switching mode half screen gamma incorrect.
Yue Hin Lau (13):
drm/amd/display: Refactor dcn10_dpp_cm_helper to dcn10_cm_common drm/amd/display: fixing register includes drm/amd/display: removing remaining register definitions work around drm/amd/display: moving backlight registers to hwsequencer drm/amd/display: edp backlight regression fix drm/amd/display: moving cursor functions from ipp to mem_input drm/amd/display: Expose some mem_input functions for reuse drm/amd/display: renaming mem input to hubp drm/amd/display: Making hubp1_program_surface_config public drm/amd/display: rename struct mem_input to hubp for dcn drm/amd/display: renaming filename for hubp drm/amd/display: add null check for cursor functions drm/amd/display: rename transform to dpp for dcn
drivers/gpu/drm/amd/display/Kconfig | 10 +
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 110 +-
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 6 +-
.../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 135 +-
.../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 6 +
drivers/gpu/drm/amd/display/dc/basics/logger.c | 78 +-
drivers/gpu/drm/amd/display/dc/basics/logger.h | 37 -
drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 +-
.../gpu/drm/amd/display/dc/calcs/dcn_calc_math.c | 16 +
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 224 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 442 +-
drivers/gpu/drm/amd/display/dc/core/dc_link.c | 78 +-
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 16 +-
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 17 +-
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 108 +-
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 63 +-
drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 1 +
drivers/gpu/drm/amd/display/dc/dc.h | 135 +-
drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 +
drivers/gpu/drm/amd/display/dc/dc_types.h | 3 +-
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 175 +-
drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c | 2 +
.../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 253 +-
.../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 20 +-
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 3 -
.../drm/amd/display/dc/dce100/dce100_resource.c | 2 +-
.../drm/amd/display/dc/dce100/dce100_resource.h | 2 +-
.../drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
.../amd/display/dc/dce110/dce110_hw_sequencer.c | 316 +-
.../amd/display/dc/dce110/dce110_hw_sequencer.h | 11 +-
.../drm/amd/display/dc/dce110/dce110_resource.c | 33 +-
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 4 +-
.../{dcn10_dpp_cm_helper.c => dcn10_cm_common.c} | 2 +-
.../{dcn10_dpp_cm_helper.h => dcn10_cm_common.h} | 4 +-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 199 +-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 127 +-
.../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 263 +-
.../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 190 +-
.../dc/dcn10/{dcn10_mem_input.c => dcn10_hubp.c} | 344 +-
.../dc/dcn10/{dcn10_mem_input.h => dcn10_hubp.h} | 139 +-
.../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 359 +-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c | 189 -
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 215 +-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h | 45 +-
.../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 99 +-
.../amd/display/dc/dcn10/dcn10_timing_generator.c | 15 +
.../amd/display/dc/dcn10/dcn10_timing_generator.h | 15 +-
drivers/gpu/drm/amd/display/dc/dm_services.h | 2 +
drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +-
drivers/gpu/drm/amd/display/dc/dml/dc_features.h | 2 +
.../drm/amd/display/dc/dml/display_mode_enums.h | 56 +-
.../gpu/drm/amd/display/dc/dml/display_mode_lib.c | 7 +-
.../gpu/drm/amd/display/dc/dml/display_mode_lib.h | 8 +-
.../drm/amd/display/dc/dml/display_mode_structs.h | 903 +--
.../drm/amd/display/dc/dml/display_mode_support.c | 2326 --------
.../drm/amd/display/dc/dml/display_mode_support.h | 199 -
.../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 6104 ++++++++++++++++++++
.../gpu/drm/amd/display/dc/dml/display_mode_vba.h | 581 ++
.../drm/amd/display/dc/dml/display_pipe_clocks.c | 377 +-
.../drm/amd/display/dc/dml/display_pipe_clocks.h | 8 +-
.../drm/amd/display/dc/dml/display_rq_dlg_calc.c | 2457 ++++----
.../drm/amd/display/dc/dml/display_rq_dlg_calc.h | 151 +-
.../amd/display/dc/dml/display_rq_dlg_helpers.c | 482 +-
.../amd/display/dc/dml/display_rq_dlg_helpers.h | 41 +-
.../gpu/drm/amd/display/dc/dml/display_watermark.c | 1281 ----
.../gpu/drm/amd/display/dc/dml/display_watermark.h | 98 -
.../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 1903 ++++++
.../amd/display/dc/dml/dml1_display_rq_dlg_calc.h | 67 +
.../gpu/drm/amd/display/dc/dml/dml_common_defs.c | 24 +-
.../gpu/drm/amd/display/dc/dml/dml_common_defs.h | 11 +-
.../gpu/drm/amd/display/dc/dml/soc_bounding_box.c | 45 +-
.../gpu/drm/amd/display/dc/dml/soc_bounding_box.h | 9 +-
drivers/gpu/drm/amd/display/dc/inc/core_types.h | 16 +-
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 134 +
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 105 +
.../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 6 +-
drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h | 11 +-
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 15 +-
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 57 +
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 12 +-
drivers/gpu/drm/amd/display/dc/inc/link_hwss.h | 4 +
drivers/gpu/drm/amd/display/dc/inc/resource.h | 5 +
.../amd/display/dc/virtual/virtual_link_encoder.c | 13 +-
.../gpu/drm/amd/display/include/logger_interface.h | 28 +
drivers/gpu/drm/amd/display/include/logger_types.h | 36 +-
85 files changed, 13615 insertions(+), 8494 deletions(-)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_dpp_cm_helper.c => dcn10_cm_common.c} (99%)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_dpp_cm_helper.h => dcn10_cm_common.h} (97%)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_mem_input.c => dcn10_hubp.c} (73%)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_mem_input.h => dcn10_hubp.h} (85%)
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.c
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.h
create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.c
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.h
create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.h
create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h
create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/hubp.hSignature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20171010224112.3023-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
PATCH 1/103 drm/amd/display: Driver message to SMU to indicate display off
From: Hersen Wu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 3 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 38 ++++++++++++++-------- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 +- 4 files changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -763,7 +763,7 @@ static bool dc_commit_state_no_check(struct dc *dc, struct dc_state *context)if (!dcb->funcs->is_accelerated_mode (dcb)) dc->hwss.enable_accelerated_mode (dc); - dc->hwss.ready_shared_resources (dc); + dc->hwss.ready_shared_resources (dc, context);for (i =0 ; i < dc->res_pool->pipe_count; i++) { pipe = &context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -1
@@ -1889,6 +1889,7 @@ enum dc_status dce110_apply_ctx_to_hw(return status; } +/* pplib is notified if disp_num changed */ dc->hwss.set_bandwidth (dc, context, true);/* to save power */
@@ -2683,7 +2684,7 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx, } } -static void ready_shared_resources (struct dc *dc) {} +static void ready_shared_resources (struct dc *dc,struct dc_state *context) {}static void optimize_shared_resources (struct dc *dc) {}
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +24 -14
@@ -802,18 +802,14 @@ static void undo_DEGVIDCN10_253_wa(struct dc *dc) IP_REQUEST_EN, 0); } -static void ready_shared_resources (struct dc *dc) -{ -if (dc->current_state->stream_count ==0 && - !dc->debug.disable_stutter) -undo_DEGVIDCN10_253_wa (dc); -} -static void apply_DEGVIDCN10_253_wa (struct dc *dc) {struct dce_hwseq *hws = dc->hwseq;struct mem_input *mi = dc->res_pool->mis[0 ]; +if (dc->debug.disable_stutter) +return ; +REG_SET (DC_IP_REQUEST_CNTL ,0 ,IP_REQUEST_EN ,1 );
@@ -824,13 +820,6 @@ static void apply_DEGVIDCN10_253_wa(struct dc *dc) mi->funcs->set_hubp_blank_en (mi, false); } -static void optimize_shared_resources (struct dc *dc) -{ -if (dc->current_state->stream_count ==0 && - !dc->debug.disable_stutter) -apply_DEGVIDCN10_253_wa (dc); -} -static void bios_golden_init (struct dc *dc) {struct dc_bios *bp = dc->ctx->dc_bios;
@@ -2445,6 +2434,27 @@ static void dcn10_pplib_apply_display_requirements( dc->prev_display_config = *pp_display_cfg; } +static void optimize_shared_resources (struct dc *dc) +{ +if (dc->current_state->stream_count ==0 ) { +apply_DEGVIDCN10_253_wa (dc); +/* S0i2 message */ +dcn10_pplib_apply_display_requirements (dc, dc->current_state); + } +} + +static void ready_shared_resources (struct dc *dc,struct dc_state *context) +{ +if (dc->current_state->stream_count ==0 && + !dc->debug.disable_stutter) +undo_DEGVIDCN10_253_wa (dc); + +/* S0i2 message */ +if (dc->current_state->stream_count ==0 && + context->stream_count !=0 ) +dcn10_pplib_apply_display_requirements (dc, context); +} + static void dcn10_apply_ctx_for_surface( struct dc *dc, const struct dc_stream_state *stream,
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 -1
@@ -174,7 +174,7 @@ struct hw_sequencer_funcs {struct resource_pool *res_pool, struct pipe_ctx *pipe_ctx); -void (*ready_shared_resources)(struct dc *dc); +void (*ready_shared_resources)(struct dc *dc,struct dc_state *context);void (*optimize_shared_resources)(struct dc *dc); };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/103 drm/amd/display: Force always scale chroma, set always_scaled to false
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
This allows us to not always have scaling on, which causes issues with validation and causes the text to blur slightly.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 9 +++++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 4 ---- 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +5 -4
@@ -159,10 +159,11 @@ bool dpp_get_optimal_number_of_taps( scl_data->taps.h_taps =1 ;if (IDENTITY_RATIO (scl_data->ratios.vert)) scl_data->taps.v_taps =1 ; -if (IDENTITY_RATIO (scl_data->ratios.horz_c)) - scl_data->taps.h_taps_c =1 ; -if (IDENTITY_RATIO (scl_data->ratios.vert_c)) - scl_data->taps.v_taps_c =1 ; +/* +* Spreadsheet doesn't handle taps_c is one properly, +* need to force Chroma to always be scaled to pass +* bandwidth validation. +*/ }return true;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +0 -4
@@ -420,10 +420,6 @@ static const struct dc_debug debug_defaults_drv = { .force_abm_enable = false, .timing_trace = false, .clock_trace = true, - /* spread sheet doesn't handle taps_c is one properly, - * need to enable scaler for video surface to pass - * bandwidth validation.*/ - .always_scale = true, .disable_pplib_clock_request = true, .disable_pplib_wm_range = false,#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/103 drm/amd/display: fix usb-c dongle regression
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
A previous change moved link_disconnect_sink after dpcd read, this causes the sink count to be overwritten which in turn causes another detection to be triggered in the short pulse handler, which brings down the display.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -2
@@ -652,8 +652,6 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)if (link->local_sink) { sink = link->local_sink; }else { -link_disconnect_sink (link); - sink_init_data.link = link; sink_init_data.sink_signal = sink_caps.signal;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/103 drm/amd/display: Add FBC on/off to front-end programming
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
- Fixing text mode for cases when VT-switch doesn't result in timing change
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +9 -0
@@ -2554,6 +2554,15 @@ static void dce110_program_front_end_for_pipe(program_scaler (dc, pipe_ctx); +#ifdef ENABLE_FBC +if (dc->fbc_compressor && old_pipe->stream) { +if (plane_state->tiling_info.gfx8.array_mode ==DC_ARRAY_LINEAR_GENERAL ) + dc->fbc_compressor->funcs->disable_fbc (dc->fbc_compressor); +else +enable_fbc (dc, dc->current_state); + } +#endif + mi->funcs->mem_input_program_surface_config( mi, plane_state->format,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/103 drm/amd/display: To prevent detecting new sink from spurious HPD
In reply to a message not in the archiveFrom: Martin Tsai <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 33 ++++++++++++++++----------- drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 21 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +20 -13
@@ -649,27 +649,34 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) sink_init_data.link = link; sink_init_data.sink_signal = sink_caps.signal; -if (link->local_sink) { - sink = link->local_sink; - }else { - sink_init_data.link = link; - sink_init_data.sink_signal = sink_caps.signal; + sink =dc_sink_create (&sink_init_data); +if (!sink) { +DC_ERROR ("Failed to create sink!\n" ); +return false; + } - sink =dc_sink_create (&sink_init_data); -if (!sink) { -DC_ERROR ("Failed to create sink!\n" ); -return false; +if (link->local_sink) { + edid_status =dm_helpers_read_local_edid ( + link->ctx, + link, + sink); + +if (edid_status ==EDID_OK ) { +// Edid is not the same, to update the local sink with new sink. + sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock; + sink->converter_disable_audio = converter_disable_audio; + link->local_sink = sink; } + }else { sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock; sink->converter_disable_audio = converter_disable_audio; - link->local_sink = sink; - } - edid_status =dm_helpers_read_local_edid ( + edid_status =dm_helpers_read_local_edid ( link->ctx, link, sink); + }switch (edid_status) {case EDID_BAD_CHECKSUM :
@@ -762,7 +769,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) link->ctx, link, sink); -if (edid_status !=EDID_OK ) { +if (edid_status !=EDID_OK && edid_status !=EDID_THE_SAME ) {link_disconnect_sink (link); link->type = dc_connection_none; sink_caps.signal =SIGNAL_TYPE_NONE ;
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
@@ -151,6 +151,7 @@ enum dc_edid_status {EDID_BAD_INPUT ,EDID_NO_RESPONSE ,EDID_BAD_CHECKSUM , + EDID_THE_SAME, };/* audio capability from EDID*/
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/103 drm/amd/display: Don't report fake sink as connected
In reply to a message not in the archiveThis was missed in the previous fake sink change. The fake sink allows us to enable a pipe with a disconnected display. We shouldn't report it as connected.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -2470,7 +2470,8 @@ amdgpu_dm_connector_detect(struct drm_connector *connector, bool force)* 2. This interface *is called* in context of user-mode ioctl. Which * makes it a bad place for *any* MST-related activit. */ -if (aconnector->base.force ==DRM_FORCE_UNSPECIFIED ) +if (aconnector->base.force ==DRM_FORCE_UNSPECIFIED && + !aconnector->fake_enable) connected = (aconnector->dc_sink !=NULL );else connected = (aconnector->base.force ==DRM_FORCE_ON );
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/103 drm/amd/display: Refactor dcn10_dpp_cm_helper to dcn10_cm_common
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
---
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 2 +-
.../amd/display/dc/dcn10/{dcn10_dpp_cm_helper.c => dcn10_cm_common.c} | 2 +-
.../amd/display/dc/dcn10/{dcn10_dpp_cm_helper.h => dcn10_cm_common.h} | 4 ++--
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_dpp_cm_helper.c => dcn10_cm_common.c} (99%)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_dpp_cm_helper.h => dcn10_cm_common.h} (97%)drivers/gpu/drm/amd/display/dc/dcn10/Makefile +1 -1
@@ -4,7 +4,7 @@ DCN10 = dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \ dcn10_dpp.o dcn10_opp.o dcn10_timing_generator.o \ dcn10_mem_input.o dcn10_mpc.o \ - dcn10_dpp_dscl.o dcn10_dpp_cm.o dcn10_dpp_cm_helper.o + dcn10_dpp_dscl.o dcn10_dpp_cm.o dcn10_cm_common.o AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm_helper.c +1 -1
@@ -26,7 +26,7 @@#include "reg_helper.h" #include "dcn10_dpp.h" -#include "dcn10_dpp_cm_helper.h" +#include "dcn10_cm_common.h" #define REG (reg) reg
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm_helper.h +2 -2
@@ -23,8 +23,8 @@* */ -#ifndef __DAL_DPP_DCN10_CM_HELPER_H__ -#define __DAL_DPP_DCN10_CM_HELPER_H__ +#ifndef __DAL_DCN10_CM_COMMON_H__ +#define __DAL_DCN10_CM_COMMON_H__#define TF_HELPER_REG_FIELD_LIST (type) \ type exp_region0_lut_offset; \
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +1 -1
@@ -29,8 +29,8 @@#include "reg_helper.h" #include "dcn10_dpp.h" -#include "dcn10_dpp_cm_helper.h" #include "basics/conversion.h" +#include "dcn10_cm_common.h" #define NUM_PHASES 64#define HORZ_MAX_TAPS 8
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/103 drm/amd/display: fix multi-display on CZ
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
- fixed wrong index in dce110_validate_surface_sets()
- formatted for better readability
--- .../drm/amd/display/dc/dce110/dce110_resource.c | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +21 -8
@@ -849,7 +849,7 @@ static bool dce110_validate_bandwidth(static bool dce110_validate_surface_sets (struct dc_state *context) { -int i; +int i, j;for (i =0 ; i < context->stream_count; i++) {if (context->stream_status[i].plane_count ==0 )
@@ -858,14 +858,27 @@ static bool dce110_validate_surface_sets(if (context->stream_status[i].plane_count >2 )return false; -if ((context->stream_status[i].plane_states[i]->format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN ) && - (context->stream_status[i].plane_states[i]->src_rect.width >1920 || - context->stream_status[i].plane_states[i]->src_rect.height >1080 )) -return false; +for (j =0 ; j < context->stream_status[i].plane_count; j++) { +struct dc_plane_state *plane = + context->stream_status[i].plane_states[j]; -/* irrespective of plane format, stream should be RGB encoded */ -if (context->streams[i]->timing.pixel_encoding !=PIXEL_ENCODING_RGB ) -return false; +/* underlay validation */ +if (plane->format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN ) { + +if ((plane->src_rect.width >1920 || + plane->src_rect.height >1080 )) +return false; + +/* irrespective of plane format, +* stream should be RGB encoded +*/ +if (context->streams[i]->timing.pixel_encoding + !=PIXEL_ENCODING_RGB ) +return false; + + } + + } }return true;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/103 drm/amd/display: update mpc add/remove functions
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 17 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 173 ++++++++++++++------- drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 10 +- 3 files changed, 130 insertions(+), 70 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +11 -6
@@ -881,7 +881,8 @@ static void dcn10_init_hw(struct dc *dc) xfm->funcs->transform_reset (xfm); dc->res_pool->mpc->funcs->remove ( - dc->res_pool->mpc, dc->res_pool->opps[i], i); + dc->res_pool->mpc, &(dc->res_pool->opps[i]->mpc_tree), + dc->res_pool->opps[i]->inst, i);/* Blank controller using driver code instead of * command table.
@@ -1079,7 +1080,8 @@ static void plane_atomic_disconnect(struct dc *dc,if (dc->debug.sanity_checks)verify_allow_pstate_change_high (dc->hwseq); - mpc->funcs->remove (mpc, dc->res_pool->opps[opp_id], fe_idx); + mpc->funcs->remove (mpc, &(dc->res_pool->opps[opp_id]->mpc_tree), + dc->res_pool->opps[opp_id]->inst, fe_idx); }/* disable HW used by plane.
@@ -2299,8 +2301,9 @@ static void update_dchubp_dpp( plane_state->format, EXPANSION_MODE_ZERO); - mpcc_cfg.mi = mi; - mpcc_cfg.opp = pipe_ctx->stream_res.opp; + mpcc_cfg.dpp_id = mi->inst; + mpcc_cfg.opp_id = pipe_ctx->stream_res.opp->inst; + mpcc_cfg.tree_cfg = &(pipe_ctx->stream_res.opp->mpc_tree);for (top_pipe = pipe_ctx->top_pipe; top_pipe; top_pipe = top_pipe->top_pipe) mpcc_cfg.z_index++;if (dc->debug.surface_visual_confirm)
@@ -2317,7 +2320,8 @@ static void update_dchubp_dpp( mpcc_cfg.pre_multiplied_alpha =is_rgb_cspace ( pipe_ctx->stream->output_color_space) && per_pixel_alpha; - dc->res_pool->mpc->funcs->add (dc->res_pool->mpc, &mpcc_cfg); + mi->mpcc_id = dc->res_pool->mpc->funcs->add (dc->res_pool->mpc, &mpcc_cfg); + mi->opp_id = mpcc_cfg.opp_id; pipe_ctx->plane_res.scl_data.lb_params.alpha_en = per_pixel_alpha; pipe_ctx->plane_res.scl_data.lb_params.depth =LB_PIXEL_DEPTH_30BPP ;
@@ -2528,7 +2532,8 @@ static void dcn10_apply_ctx_for_surface(/* reset mpc */ dc->res_pool->mpc->funcs->remove ( dc->res_pool->mpc, - old_pipe_ctx->stream_res.opp, + &(old_pipe_ctx->stream_res.opp->mpc_tree), + old_pipe_ctx->stream_res.opp->inst, old_pipe_ctx->pipe_idx); old_pipe_ctx->stream_res.opp->mpcc_disconnect_pending[old_pipe_ctx->plane_res.mi->mpcc_id] = true;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +113 -60
237 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +6 -4
@@ -29,8 +29,9 @@#include "opp.h" struct mpcc_cfg { -struct mem_input *mi; -struct output_pixel_processor *opp; +int dpp_id; +int opp_id; +struct mpc_tree_cfg *tree_cfg;unsigned int z_index;struct tg_color black_color;
@@ -44,9 +45,10 @@ struct mpc { };struct mpc_funcs { -void (*add)(struct mpc *mpc,struct mpcc_cfg *cfg); +int (*add)(struct mpc *mpc,struct mpcc_cfg *cfg);void (*remove)(struct mpc *mpc, -struct output_pixel_processor *opp, +struct mpc_tree_cfg *tree_cfg, +int opp_id,int mpcc_inst);void (*wait_for_idle)(struct mpc *mpc,int id); };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/103 drm/amd/display: Match actual state during S3 resume.
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
During system suspend, we:
1. Cache a duplicate of the current DRM atomic state, which calls hooks to duplicate our internal states.
2. Call hooks to disable all functionalities.
3. System suspended.
During resume, we attempt to restore the cached state. However, our interal states are now stale, since step 1 was done before step 2. i.e. our cached state does not reflect the disabled nature of things.
This change resolves that by destroying all relevant states to reflect the actual state during resume.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +36 -0
@@ -617,6 +617,11 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)struct drm_connector *connector;struct drm_crtc *crtc;struct drm_crtc_state *crtc_state; +struct dm_crtc_state *dm_crtc_state; +struct drm_plane *plane; +struct drm_plane_state *plane_state; +struct dm_plane_state *dm_plane_state; +struct dm_atomic_state *cached_state;int ret =0 ;int i;
@@ -655,6 +660,37 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)for_each_crtc_in_state (adev->dm.cached_state, crtc, crtc_state, i) crtc_state->active_changed = true; + cached_state =to_dm_atomic_state (adev->dm.cached_state); + +/* +* During suspend, the cached state is saved before all streams are +* disabled. Refresh cached state to match actual current state before +* restoring it. +*/ +WARN_ON (kref_read (&cached_state->context->refcount) >1 ); +dc_release_state (cached_state->context); + + cached_state->context =dc_create_state (); +dc_resource_state_copy_construct_current (adev->dm.dc, cached_state->context); + +for_each_new_crtc_in_state (adev->dm.cached_state, crtc, crtc_state, i) { + dm_crtc_state =to_dm_crtc_state (crtc_state); +if (dm_crtc_state->stream) { +WARN_ON (kref_read (&dm_crtc_state->stream->refcount) >1 ); +dc_stream_release (dm_crtc_state->stream); + dm_crtc_state->stream =NULL ; + } + } + +for_each_new_plane_in_state (adev->dm.cached_state, plane, plane_state, i) { + dm_plane_state =to_dm_plane_state (plane_state); +if (dm_plane_state->dc_state) { +WARN_ON (kref_read (&dm_plane_state->dc_state->refcount) >1 ); +dc_plane_state_release (dm_plane_state->dc_state); + dm_plane_state->dc_state =NULL ; + } + } + ret =drm_atomic_helper_resume (ddev, adev->dm.cached_state);drm_atomic_state_put (adev->dm.cached_state);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/103 drm/amd/display: fixing register includes
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 89 +++++++++++----------- .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 2 + 2 files changed, 46 insertions(+), 45 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +44 -45
@@ -131,8 +131,6 @@ HWSEQ_PHYPLL_REG_LIST(CRTC)#define HWSEQ_DCN_REG_LIST ()\ - HWSEQ_PIXEL_RATE_REG_LIST(OTG), \ - HWSEQ_PHYPLL_REG_LIST(OTG), \ SRII(OTG_GLOBAL_SYNC_STATUS, OTG, 0), \ SRII(OTG_GLOBAL_SYNC_STATUS, OTG, 1), \ SRII(OTG_GLOBAL_SYNC_STATUS, OTG, 2), \
@@ -182,22 +180,6 @@SR (DCHUBBUB_TEST_DEBUG_INDEX ), \SR (DCHUBBUB_TEST_DEBUG_DATA ), \SR (DC_IP_REQUEST_CNTL ), \ -SR (DOMAIN0_PG_CONFIG ), \ -SR (DOMAIN1_PG_CONFIG ), \ -SR (DOMAIN2_PG_CONFIG ), \ -SR (DOMAIN3_PG_CONFIG ), \ -SR (DOMAIN4_PG_CONFIG ), \ -SR (DOMAIN5_PG_CONFIG ), \ -SR (DOMAIN6_PG_CONFIG ), \ -SR (DOMAIN7_PG_CONFIG ), \ -SR (DOMAIN0_PG_STATUS ), \ -SR (DOMAIN1_PG_STATUS ), \ -SR (DOMAIN2_PG_STATUS ), \ -SR (DOMAIN3_PG_STATUS ), \ -SR (DOMAIN4_PG_STATUS ), \ -SR (DOMAIN5_PG_STATUS ), \ -SR (DOMAIN6_PG_STATUS ), \ -SR (DOMAIN7_PG_STATUS ), \SR (DIO_MEM_PWR_CTRL ), \SR (DCCG_GATE_DISABLE_CNTL ), \ SR(DCCG_GATE_DISABLE_CNTL2), \
@@ -223,13 +205,30 @@#define HWSEQ_DCN1_REG_LIST ()\ HWSEQ_DCN_REG_LIST(), \ + HWSEQ_PIXEL_RATE_REG_LIST(OTG), \ + HWSEQ_PHYPLL_REG_LIST(OTG), \ SR(DCHUBBUB_SDPIF_FB_TOP),\ SR(DCHUBBUB_SDPIF_FB_BASE),\ SR(DCHUBBUB_SDPIF_FB_OFFSET),\ SR(DCHUBBUB_SDPIF_AGP_BASE),\ SR(DCHUBBUB_SDPIF_AGP_BOT),\ - SR(DCHUBBUB_SDPIF_AGP_TOP) - + SR(DCHUBBUB_SDPIF_AGP_TOP),\ + SR(DOMAIN0_PG_CONFIG), \ + SR(DOMAIN1_PG_CONFIG), \ + SR(DOMAIN2_PG_CONFIG), \ + SR(DOMAIN3_PG_CONFIG), \ + SR(DOMAIN4_PG_CONFIG), \ + SR(DOMAIN5_PG_CONFIG), \ + SR(DOMAIN6_PG_CONFIG), \ + SR(DOMAIN7_PG_CONFIG), \ + SR(DOMAIN0_PG_STATUS), \ + SR(DOMAIN1_PG_STATUS), \ + SR(DOMAIN2_PG_STATUS), \ + SR(DOMAIN3_PG_STATUS), \ + SR(DOMAIN4_PG_STATUS), \ + SR(DOMAIN5_PG_STATUS), \ + SR(DOMAIN6_PG_STATUS), \ + SR(DOMAIN7_PG_STATUS)struct dce_hwseq_registers {uint32_t DCFE_CLOCK_CONTROL[6 ];
@@ -417,30 +416,6 @@ struct dce_hwseq_registers {HWS_SF (OPP_PIPE0_ ,OPP_PIPE_CONTROL ,OPP_PIPE_CLOCK_EN , mask_sh),\ HWS_SF(, DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_ENABLE, mask_sh), \ HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \ - HWS_SF(, DOMAIN0_PG_CONFIG, DOMAIN0_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN0_PG_CONFIG, DOMAIN0_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN1_PG_CONFIG, DOMAIN1_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN1_PG_CONFIG, DOMAIN1_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN2_PG_CONFIG, DOMAIN2_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN2_PG_CONFIG, DOMAIN2_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN3_PG_CONFIG, DOMAIN3_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN3_PG_CONFIG, DOMAIN3_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN4_PG_CONFIG, DOMAIN4_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN4_PG_CONFIG, DOMAIN4_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN5_PG_CONFIG, DOMAIN5_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN5_PG_CONFIG, DOMAIN5_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN6_PG_CONFIG, DOMAIN6_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN6_PG_CONFIG, DOMAIN6_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN7_PG_CONFIG, DOMAIN7_POWER_FORCEON, mask_sh), \ - HWS_SF(, DOMAIN7_PG_CONFIG, DOMAIN7_POWER_GATE, mask_sh), \ - HWS_SF(, DOMAIN0_PG_STATUS, DOMAIN0_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN1_PG_STATUS, DOMAIN1_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN2_PG_STATUS, DOMAIN2_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN3_PG_STATUS, DOMAIN3_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN4_PG_STATUS, DOMAIN4_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN5_PG_STATUS, DOMAIN5_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN6_PG_STATUS, DOMAIN6_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL, DCHUBBUB_ARB_WATERMARK_CHANGE_REQUEST, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL, DCHUBBUB_ARB_WATERMARK_CHANGE_DONE_INTERRUPT_DISABLE, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_DRAM_STATE_CNTL, DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_VALUE, mask_sh), \
@@ -468,7 +443,31 @@ struct dce_hwseq_registers { HWS_SF(, VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32, PHYSICAL_PAGE_ADDR_LO32, mask_sh),\ HWS_SF(, MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB, PHYSICAL_PAGE_NUMBER_MSB, mask_sh),\ HWS_SF(, MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB, PHYSICAL_PAGE_NUMBER_LSB, mask_sh),\ - HWS_SF(, MC_VM_SYSTEM_APERTURE_LOW_ADDR, LOGICAL_ADDR, mask_sh) + HWS_SF(, MC_VM_SYSTEM_APERTURE_LOW_ADDR, LOGICAL_ADDR, mask_sh),\ + HWS_SF(, DOMAIN0_PG_CONFIG, DOMAIN0_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN0_PG_CONFIG, DOMAIN0_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN1_PG_CONFIG, DOMAIN1_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN1_PG_CONFIG, DOMAIN1_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN2_PG_CONFIG, DOMAIN2_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN2_PG_CONFIG, DOMAIN2_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN3_PG_CONFIG, DOMAIN3_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN3_PG_CONFIG, DOMAIN3_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN4_PG_CONFIG, DOMAIN4_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN4_PG_CONFIG, DOMAIN4_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN5_PG_CONFIG, DOMAIN5_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN5_PG_CONFIG, DOMAIN5_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN6_PG_CONFIG, DOMAIN6_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN6_PG_CONFIG, DOMAIN6_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN7_PG_CONFIG, DOMAIN7_POWER_FORCEON, mask_sh), \ + HWS_SF(, DOMAIN7_PG_CONFIG, DOMAIN7_POWER_GATE, mask_sh), \ + HWS_SF(, DOMAIN0_PG_STATUS, DOMAIN0_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN1_PG_STATUS, DOMAIN1_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN2_PG_STATUS, DOMAIN2_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN3_PG_STATUS, DOMAIN3_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN4_PG_STATUS, DOMAIN4_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN5_PG_STATUS, DOMAIN5_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN6_PG_STATUS, DOMAIN6_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh)#define HWSEQ_REG_FIELD_LIST (type) \ type DCFE_CLOCK_ENABLE; \
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +2 -0
@@ -120,6 +120,8 @@ SR(DCHUBBUB_SDPIF_FB_BASE),\ SR(DCHUBBUB_SDPIF_FB_OFFSET) + + struct dcn_mi_registers {uint32_t DCHUBP_CNTL ;uint32_t HUBPREQ_DEBUG_DB ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/103 drm/amd/display: Exclude MST from fake sink
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
Needs effort to take care of the fake sink scenario in downstream daisy chain device. Exclude MST from fake sink feature for now.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11 -2
@@ -2371,8 +2371,16 @@ static struct dc_stream_state *create_stream_for_sink( drm_connector = &aconnector->base; -if (!aconnector->dc_sink) +if (!aconnector->dc_sink) { +/* +* Exclude MST from creating fake_sink +* TODO: need to enable MST into fake_sink feature +*/ +if (aconnector->mst_port) + goto stream_create_fail; +create_fake_sink (aconnector); + } stream =dc_create_stream_for_sink (aconnector->dc_sink);
@@ -4541,7 +4549,8 @@ static int dm_update_crtcs_state( aconnector =amdgpu_dm_find_first_crct_matching_connector (state, crtc, true);/* TODO This hack should go away */ -if (aconnector) { +if (aconnector && enable) { +// Make sure fake sink is created in plug-in scenario conn_state =drm_atomic_get_connector_state (state, &aconnector->base);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/103 drm/amd/display: Fix NULL pointer on MST chained mode
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
Prevent NULL pointer on new_stream being added to ctx when added MST connectors cannot be found in existing crtc_state in the chained mode
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -0
@@ -4628,6 +4628,13 @@ static int dm_update_crtcs_state( *lock_and_validation_needed = true; }else {/* Add stream for any updated/enabled CRTC */ +/* +* Quick fix to prevent NULL pointer on new_stream when +* added MST connectors not found in existing crtc_state in the chained mode +* TODO: need to dig out the root cause of that +*/ +if (!aconnector || (!aconnector->dc_sink && aconnector->mst_port)) +continue ;if (modereset_required (crtc_state)) goto next_crtc;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/103 drm/amd/display: Refactor dc_update_planes_and_stream.
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
Split update_planes_and_stream_state (split Software and Hardware programming) as the state is already build, so we only need to program the hardware
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 21 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 256 +++++----------------- drivers/gpu/drm/amd/display/dc/dc.h | 36 +-- 3 files changed, 87 insertions(+), 226 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +16 -5
@@ -3935,7 +3935,8 @@ static void prepare_flip_isr(struct amdgpu_crtc *acrtc)static void amdgpu_dm_do_flip (struct drm_crtc *crtc,struct drm_framebuffer *fb, -uint32_t target) +uint32_t target, +struct dc_state *state) {unsigned long flags;uint32_t target_vblank;
@@ -4006,7 +4007,13 @@ static void amdgpu_dm_do_flip( surface_updates->flip_addr = &addr; -dc_update_planes_and_stream (adev->dm.dc, surface_updates,1 , acrtc_state->stream,NULL ); +dc_commit_updates_for_stream (adev->dm.dc, + surface_updates, +1 , + acrtc_state->stream, +NULL , + &surface_updates->surface, + state); DRM_DEBUG_DRIVER("%s Flipping to hi: 0x%x, low: 0x%x \n", __func__,
@@ -4030,6 +4037,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,struct dc_plane_state *plane_states_constructed[MAX_SURFACES ];struct amdgpu_crtc *acrtc_attach =to_amdgpu_crtc (pcrtc);struct dm_crtc_state *acrtc_state =to_dm_crtc_state (pcrtc->state); +struct dm_atomic_state *dm_state =to_dm_atomic_state (state);int planes_count =0 ;unsigned long flags;
@@ -4086,7 +4094,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,amdgpu_dm_do_flip ( crtc, fb, -drm_crtc_vblank_count (crtc) + *wait_for_vblank); +drm_crtc_vblank_count (crtc) + *wait_for_vblank, + dm_state->context); } }
@@ -4106,7 +4115,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,if (false ==dc_commit_planes_to_stream (dm->dc, plane_states_constructed, planes_count, - dc_stream_attach)) + dc_stream_attach, + dm_state->context))dm_error ("%s: Failed to attach plane!\n" , __func__); }else {/*TODO BUG Here should go disable planes on CRTC. */
@@ -4329,7 +4339,8 @@ void amdgpu_dm_atomic_commit_tail( dm->dc, status->plane_states, status->plane_count, - new_acrtc_state->stream)) + new_acrtc_state->stream, + dm_state->context))dm_error ("%s: Failed to update stream scaling!\n" , __func__); }
drivers/gpu/drm/amd/display/dc/core/dc.c +59 -197
296 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +12 -24
@@ -449,23 +449,6 @@ struct dc_flip_addrs {/* TODO: add flip duration for FreeSync */ }; -/* -* Set up surface attributes and associate to a stream -* The surfaces parameter is an absolute set of all surface active for the stream. -* If no surfaces are provided, the stream will be blanked; no memory read. -* Any flip related attribute changes must be done through this interface. -* -* After this call: -* Surfaces attributes are programmed and configured to be composed into stream. -* This does not trigger a flip. No surface address is programmed. -*/ - -bool dc_commit_planes_to_stream ( -struct dc *dc, -struct dc_plane_state **plane_states, -uint8_t new_plane_count, -struct dc_stream_state *stream); -bool dc_post_update_surfaces_to_stream (struct dc *dc);
@@ -571,9 +554,6 @@ bool dc_is_stream_unchanged( struct dc_stream_state *old_stream, struct dc_stream_state *stream);/* -* Setup stream attributes if no stream updates are provided -* there will be no impact on the stream parameters -* * Set up surface attributes and associate to a stream * The surfaces parameter is an absolute set of all surface active for the stream. * If no surfaces are provided, the stream will be blanked; no memory read.
@@ -582,14 +562,22 @@ bool dc_is_stream_unchanged(* After this call: * Surfaces attributes are programmed and configured to be composed into stream. * This does not trigger a flip. No surface address is programmed. -* */ -void dc_update_planes_and_stream (struct dc *dc, -struct dc_surface_update *surface_updates,int surface_count, +bool dc_commit_planes_to_stream ( +struct dc *dc, +struct dc_plane_state **plane_states, +uint8_t new_plane_count,struct dc_stream_state *dc_stream, -struct dc_stream_update *stream_update); +struct dc_state *state); +void dc_commit_updates_for_stream (struct dc *dc, +struct dc_surface_update *srf_updates, +int surface_count, +struct dc_stream_state *stream, +struct dc_stream_update *stream_update, +struct dc_plane_state **plane_states, +struct dc_state *state);/* * Log the current stream state. */
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/103 drm/amd/display: make tile changing run at ISR
In reply to a message not in the archiveFrom: ShihChen Chen <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +18 -3
@@ -1031,7 +1031,6 @@ static enum surface_update_type get_plane_info_update_type( temp_plane_info.plane_size = u->surface->plane_size; temp_plane_info.rotation = u->surface->rotation; temp_plane_info.stereo_format = u->surface->stereo_format; - temp_plane_info.tiling_info = u->surface->tiling_info;if (surface_index ==0 ) temp_plane_info.visible = u->plane_info->visible;
@@ -1044,10 +1043,26 @@ static enum surface_update_type get_plane_info_update_type(if (pixel_format_to_bpp (u->plane_info->format) !=pixel_format_to_bpp (u->surface->format)) { +/* different bytes per element will require full bandwidth +* and DML calculation +*/ return UPDATE_TYPE_FULL ; - }else { -return UPDATE_TYPE_MED ; } + +if (memcmp (&u->plane_info->tiling_info, &u->surface->tiling_info, +sizeof (union dc_tiling_info )) !=0 ) { +/* todo: below are HW dependent, we should add a hook to +* DCE/N resource and validated there. +*/ +if (u->plane_info->tiling_info.gfx9.swizzle !=DC_SW_LINEAR ) { +/* swizzled mode requires RQ to be setup properly, +* thus need to run DML to calculate RQ settings +*/ +return UPDATE_TYPE_FULL ; + } + } + +return UPDATE_TYPE_MED ; } static enum surface_update_type get_scaling_info_update_type(
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/103 drm/amd/display: power_down_Hw need signal type to turnoff backlight
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -1
@@ -1171,6 +1171,7 @@ static void power_down_encoders(struct dc *dc) {int i;enum connector_id connector_id; +enum signal_type signal =SIGNAL_TYPE_NONE ;for (i =0 ; i < dc->link_count; i++) { connector_id =dal_graphics_object_id_get_connector_id (dc->links[i]->link_id); if ((connector_id == CONNECTOR_ID_DISPLAY_PORT) ||
@@ -1178,10 +1179,12 @@ static void power_down_encoders(struct dc *dc)if (!dc->links[i]->wa_flags.dp_keep_receiver_powered)dp_receiver_power_ctrl (dc->links[i], false); +if (connector_id ==CONNECTOR_ID_EDP ) + signal =SIGNAL_TYPE_EDP ; } dc->links[i]->link_enc->funcs->disable_output ( - dc->links[i]->link_enc,SIGNAL_TYPE_NONE ); + dc->links[i]->link_enc, signal); } }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/103 drm/amd/display: removing remaining register definitions work around
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 16 ++++++++-------- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 21 ++++++++++++++------- .../amd/display/dc/dcn10/dcn10_timing_generator.h | 11 +---------- 3 files changed, 23 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +8 -8
@@ -179,16 +179,11 @@SR (DCHUBBUB_GLOBAL_TIMER_CNTL ), \SR (DCHUBBUB_TEST_DEBUG_INDEX ), \SR (DCHUBBUB_TEST_DEBUG_DATA ), \ -SR (DC_IP_REQUEST_CNTL ), \SR (DIO_MEM_PWR_CTRL ), \SR (DCCG_GATE_DISABLE_CNTL ), \SR (DCCG_GATE_DISABLE_CNTL2 ), \SR (DCFCLK_CNTL ),\SR (DCFCLK_CNTL ), \ -SR (D1VGA_CONTROL ), \ -SR (D2VGA_CONTROL ), \ -SR (D3VGA_CONTROL ), \ -SR (D4VGA_CONTROL ), \/* todo: get these from GVM instead of reading registers ourselves */ \MMHUB_SR (VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32 ),\ MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32),\
@@ -228,7 +223,12 @@SR (DOMAIN4_PG_STATUS ), \SR (DOMAIN5_PG_STATUS ), \SR (DOMAIN6_PG_STATUS ), \ -SR (DOMAIN7_PG_STATUS ) +SR (DOMAIN7_PG_STATUS ), \ +SR (D1VGA_CONTROL ), \ +SR (D2VGA_CONTROL ), \ +SR (D3VGA_CONTROL ), \ +SR (D4VGA_CONTROL ), \ +SR (DC_IP_REQUEST_CNTL ) struct dce_hwseq_registers { uint32_t DCFE_CLOCK_CONTROL[6];
@@ -415,7 +415,6 @@ struct dce_hwseq_registers {HWS_SF (DPP_TOP0_ ,DPP_CONTROL ,DPP_CLOCK_ENABLE , mask_sh), \HWS_SF (OPP_PIPE0_ ,OPP_PIPE_CONTROL ,OPP_PIPE_CLOCK_EN , mask_sh),\ HWS_SF(, DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_ENABLE, mask_sh), \ - HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL, DCHUBBUB_ARB_WATERMARK_CHANGE_REQUEST, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL, DCHUBBUB_ARB_WATERMARK_CHANGE_DONE_INTERRUPT_DISABLE, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_DRAM_STATE_CNTL, DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_VALUE, mask_sh), \
@@ -467,7 +466,8 @@ struct dce_hwseq_registers { HWS_SF(, DOMAIN4_PG_STATUS, DOMAIN4_PGFSM_PWR_STATUS, mask_sh), \ HWS_SF(, DOMAIN5_PG_STATUS, DOMAIN5_PGFSM_PWR_STATUS, mask_sh), \ HWS_SF(, DOMAIN6_PG_STATUS, DOMAIN6_PGFSM_PWR_STATUS, mask_sh), \ - HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh) + HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \ + HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh)#define HWSEQ_REG_FIELD_LIST (type) \ type DCFE_CLOCK_ENABLE; \
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +14 -7
@@ -44,8 +44,6 @@ SRI(DC_HPD_CONTROL, HPD, id)#define LE_COMMON_REG_LIST_BASE (id) \ - SR(LVTMA_PWRSEQ_CNTL), \ - SR(LVTMA_PWRSEQ_STATE), \ SR(DMCU_RAM_ACCESS_CTRL), \ SR(DMCU_IRAM_RD_CTRL), \ SR(DMCU_IRAM_RD_DATA), \
@@ -71,6 +69,10 @@SRI (DP_DPHY_FAST_TRAINING ,DP , id), \ SRI(DP_SEC_CNTL1, DP, id) +#define LE_EDP_REG_LIST (id)\ + SR(LVTMA_PWRSEQ_CNTL), \ + SR(LVTMA_PWRSEQ_STATE) +#define LE_COMMON_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
@@ -79,33 +81,38 @@#define LE_DCE80_REG_LIST (id)\ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - LE_COMMON_REG_LIST_BASE(id) + LE_COMMON_REG_LIST_BASE(id), \ + LE_EDP_REG_LIST(id)#define LE_DCE100_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - SR(DCI_MEM_PWR_STATUS) + SR(DCI_MEM_PWR_STATUS), \ + LE_EDP_REG_LIST(id)#define LE_DCE110_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id), \ - SR(DCI_MEM_PWR_STATUS) + SR(DCI_MEM_PWR_STATUS), \ + LE_EDP_REG_LIST(id)#define LE_DCE120_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id), \ - SR(DCI_MEM_PWR_STATUS) + SR(DCI_MEM_PWR_STATUS), \ + LE_EDP_REG_LIST(id)#define LE_DCN10_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id), \ - SR(DMU_MEM_PWR_CNTL) + SR(DMU_MEM_PWR_CNTL), \ + LE_EDP_REG_LIST(id)struct dce110_link_enc_aux_registers {uint32_t AUX_CONTROL;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.h +1 -10
@@ -71,11 +71,7 @@SRI (OPTC_INPUT_GLOBAL_CONTROL ,ODM , inst),\SRI (OPPBUF_CONTROL ,OPPBUF , inst),\SRI (OPPBUF_3D_PARAMETERS_0 ,OPPBUF , inst),\ -SRI (CONTROL ,VTG , inst),\ -SR (D1VGA_CONTROL ),\ -SR (D2VGA_CONTROL ),\ -SR (D3VGA_CONTROL ),\ - SR(D4VGA_CONTROL) + SRI(CONTROL, VTG, inst)#define TG_COMMON_REG_LIST_DCN1_0 (inst) \ TG_COMMON_REG_LIST_DCN(inst),\
@@ -128,11 +124,6 @@ struct dcn_tg_registers {uint32_t OPPBUF_CONTROL ;uint32_t OPPBUF_3D_PARAMETERS_0 ;uint32_t CONTROL ; -/*todo: move VGA to HWSS */ -uint32_t D1VGA_CONTROL ; -uint32_t D2VGA_CONTROL ; -uint32_t D3VGA_CONTROL ; -uint32_t D4VGA_CONTROL ; };#define TG_COMMON_MASK_SH_LIST_DCN (mask_sh)\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/103 drm/amd/display: set cp25201 to use TPS4
In reply to a message not in the archiveFrom: Wenjing Liu <[email protected]>
[Description]
hbr2 compliance eye output is unstable (toggling on and off) with debugger break. This caueses intermittent PHY automation failure. Need to look into the root cause later
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +14 -2
@@ -1700,6 +1700,12 @@ static void dp_test_send_link_training(struct dc_link *link)dp_retrain_link_dp_test (link, &link_settings, false); } +/* TODO hbr2 compliance eye output is unstable +* (toggling on and off) with debugger break +* This caueses intermittent PHY automation failure +* Need to look into the root cause */ +static uint8_t force_tps4_for_cp2520 =1 ; +static void dp_test_send_phy_test_pattern (struct dc_link *link) {union phy_test_pattern dpcd_test_pattern;
@@ -1758,10 +1764,16 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link) test_pattern =DP_TEST_PATTERN_80BIT_CUSTOM ;break ;case PHY_TEST_PATTERN_CP2520_1 : - test_pattern =DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE ; +/* CP2520 pattern is unstable, temporarily use TPS4 instead */ + test_pattern = (force_tps4_for_cp2520 ==1 ) ? +DP_TEST_PATTERN_TRAINING_PATTERN4 : +DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE ;break ;case PHY_TEST_PATTERN_CP2520_2 : - test_pattern =DP_TEST_PATTERN_CP2520_2 ; +/* CP2520 pattern is unstable, temporarily use TPS4 instead */ + test_pattern = (force_tps4_for_cp2520 ==1 ) ? +DP_TEST_PATTERN_TRAINING_PATTERN4 : +DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE ;break ;case PHY_TEST_PATTERN_CP2520_3 : test_pattern =DP_TEST_PATTERN_TRAINING_PATTERN4 ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/103 drm/amd/display: add back removed hack for mpcc add
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
A previous changed removed the hack to match mpcc_idd with mi instance. This causes pstate hang on resume from hibernate for yet unknown reason. Add the hack back for now to work around the issue. More debugging required in init_hw to root cause the hang.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +12 -0
@@ -279,6 +279,18 @@ static int mpc10_mpcc_add(struct mpc *mpc, struct mpcc_cfg *cfg)if (z_idx == cfg->tree_cfg->num_pipes) {ASSERT (cfg->z_index <= cfg->tree_cfg->num_pipes); mpcc_id =mpc10_get_idle_mpcc_id (mpc10); + +/* +* TODO: remove hack +* Note: currently there is a bug in init_hw such that +* on resume from hibernate, BIOS sets up MPCC0, and +* we do mpcc_remove but the mpcc cannot go to idle +* after remove. This cause us to pick mpcc1 here, +* which causes a pstate hang for yet unknown reason. +*/ + mpcc_id = cfg->dpp_id; +/* end hack*/ +ASSERT (!(mpc10->mpcc_in_use_mask &1 << mpcc_id));if (mpc->ctx->dc->debug.sanity_checks)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/103 drm/amd/display: update blending mode and set output denorm
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 27 +++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 4 ++++ 2 files changed, 30 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +26 -1
@@ -313,10 +313,34 @@ static int mpc10_mpcc_add(struct mpc *mpc, struct mpcc_cfg *cfg)return mpcc_id; } +static void mpc10_update_blend_mode ( +struct mpc *mpc, +struct mpcc_cfg *cfg) +{ +struct dcn10_mpc *mpc10 =TO_DCN10_MPC (mpc); +int mpcc_id, z_idx; +int alpha_blnd_mode = cfg->per_pixel_alpha ? +BLND_PP_ALPHA :BLND_GLOBAL_ALPHA ; + +/* find z_idx for the dpp that requires blending mode update*/ +for (z_idx =0 ; z_idx < cfg->tree_cfg->num_pipes; z_idx++) +if (cfg->tree_cfg->dpp[z_idx] == cfg->dpp_id) +break ; + +ASSERT (z_idx < cfg->tree_cfg->num_pipes); + mpcc_id = cfg->tree_cfg->mpcc[z_idx]; + +REG_UPDATE_2 (MPCC_CONTROL [mpcc_id], +MPCC_ALPHA_BLND_MODE , alpha_blnd_mode, +MPCC_ALPHA_MULTIPLIED_MODE , cfg->pre_multiplied_alpha); +} +const struct mpc_funcs dcn10_mpc_funcs = { .add = mpc10_mpcc_add, .remove = mpc10_mpcc_remove, - .wait_for_idle = mpc10_assert_idle_mpcc + .wait_for_idle = mpc10_assert_idle_mpcc, + .set_denorm =NULL , + .update_blend_mode = mpc10_update_blend_mode }; void dcn10_mpc_construct(struct dcn10_mpc *mpc10,
@@ -337,3 +361,4 @@ void dcn10_mpc_construct(struct dcn10_mpc *mpc10, mpc10->mpcc_in_use_mask =0 ; mpc10->num_mpcc = num_mpcc; } +
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +4 -0
@@ -51,6 +51,10 @@ struct mpc_funcs {int opp_id, int mpcc_inst);void (*wait_for_idle)(struct mpc *mpc,int id); +void (*set_denorm)(struct mpc *mpc, +int opp_id, +enum dc_color_depth output_depth); + void (*update_blend_mode)(struct mpc *mpc, struct mpcc_cfg *cfg); };#endif
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/103 drm/amd/display: moving backlight registers to hwsequencer
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 11 ++- drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 47 +++++++--- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 79 +--------------- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 27 ++---- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 103 ++++++++++++++++++++- .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 4 + .../amd/display/dc/virtual/virtual_link_encoder.c | 8 +- 9 files changed, 158 insertions(+), 127 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
@@ -1807,7 +1807,7 @@ static void disable_link(struct dc_link *link, enum signal_type signal)else dp_disable_link_phy_mst (link, signal); }else - link->link_enc->funcs->disable_output (link->link_enc, signal); + link->link_enc->funcs->disable_output (link->link_enc, signal, link); } enum dc_status dc_link_validate_mode_timing(
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +6 -5
@@ -94,7 +94,7 @@ void dp_enable_link_phy( link_enc, link_settings, clock_source); - link_enc->funcs->backlight_control (link_enc, true); + link->dc->hwss.backlight_control (link, true); }else link_enc->funcs->enable_dp_output( link_enc,
@@ -138,12 +138,12 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal)dp_receiver_power_ctrl (link, false);if (signal ==SIGNAL_TYPE_EDP ) { - link->link_enc->funcs->backlight_control (link->link_enc, false); + link->dc->hwss.backlight_control (link, false);edp_receiver_ready_T9 (link); - link->link_enc->funcs->disable_output (link->link_enc, signal); + link->link_enc->funcs->disable_output (link->link_enc, signal, link); link->link_enc->funcs->power_control (link->link_enc, false); }else - link->link_enc->funcs->disable_output (link->link_enc, signal); + link->link_enc->funcs->disable_output (link->link_enc, signal, link);/* Clear current link setting.*/ memset(&link->cur_link_settings, 0,
@@ -286,7 +286,8 @@ void dp_retrain_link_dp_test(struct dc_link *link, link->link_enc->funcs->disable_output ( link->link_enc, -SIGNAL_TYPE_DISPLAY_PORT ); +SIGNAL_TYPE_DISPLAY_PORT , + link);/* Clear current link setting. */ memset(&link->cur_link_settings, 0,
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +35 -12
134 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +3 -76
109 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +7 -20
@@ -69,10 +69,6 @@SRI (DP_DPHY_FAST_TRAINING ,DP , id), \ SRI(DP_SEC_CNTL1, DP, id) -#define LE_EDP_REG_LIST (id)\ - SR(LVTMA_PWRSEQ_CNTL), \ - SR(LVTMA_PWRSEQ_STATE) -#define LE_COMMON_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
@@ -81,38 +77,32 @@#define LE_DCE80_REG_LIST (id)\ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - LE_COMMON_REG_LIST_BASE(id), \ - LE_EDP_REG_LIST(id) + LE_COMMON_REG_LIST_BASE(id)#define LE_DCE100_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - SR(DCI_MEM_PWR_STATUS), \ - LE_EDP_REG_LIST(id) + SR(DCI_MEM_PWR_STATUS)#define LE_DCE110_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id), \ - SR(DCI_MEM_PWR_STATUS), \ - LE_EDP_REG_LIST(id) + SR(DCI_MEM_PWR_STATUS)#define LE_DCE120_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id), \ - SR(DCI_MEM_PWR_STATUS), \ - LE_EDP_REG_LIST(id) + SR(DCI_MEM_PWR_STATUS)#define LE_DCN10_REG_LIST (id)\ LE_COMMON_REG_LIST_BASE(id), \ SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ - SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id), \ - SR(DMU_MEM_PWR_CNTL), \ - LE_EDP_REG_LIST(id) + SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id)struct dce110_link_enc_aux_registers {uint32_t AUX_CONTROL;
@@ -243,7 +233,8 @@ void dce110_link_encoder_enable_dp_mst_output(/* disable PHY output */ void dce110_link_encoder_disable_output (struct link_encoder *link_enc, -enum signal_type signal); +enum signal_type signal, +struct dc_link *link);/* set DP lane settings */ void dce110_link_encoder_dp_set_lane_settings(
@@ -259,10 +250,6 @@ void dce110_link_encoder_update_mst_stream_allocation_table(struct link_encoder *enc, const struct link_mst_stream_allocation_table *table); -void dce110_link_encoder_edp_backlight_control ( -struct link_encoder *enc, -bool enable); -void dce110_link_encoder_edp_power_control (struct link_encoder *enc,bool power_up);
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +99 -4
139 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +1 -3
@@ -111,7 +111,7 @@ struct link_encoder_funcs {const struct dc_link_settings *link_settings, enum clock_source_id clock_source);void (*disable_output)(struct link_encoder *link_enc, -enum signal_type signal); +enum signal_type signal,struct dc_link *link);void (*dp_set_lane_settings)(struct link_encoder *enc,const struct link_training_settings *link_settings); void (*dp_set_phy_pattern)(struct link_encoder *enc,
@@ -123,8 +123,6 @@ struct link_encoder_funcs { bool exit_link_training_required);void (*psr_program_secondary_packet)(struct link_encoder *enc,unsigned int sdp_transmit_line_num_deadline); -void (*backlight_control) (struct link_encoder *enc, -bool enable);void (*power_control) (struct link_encoder *enc,bool power_up); void (*connect_dig_be_to_fe)(struct link_encoder *enc,
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +4 -0
@@ -176,6 +176,10 @@ struct hw_sequencer_funcs {void (*ready_shared_resources)(struct dc *dc,struct dc_state *context);void (*optimize_shared_resources)(struct dc *dc); + +void (*backlight_control)( +struct dc_link *link, +bool enable); }; void color_space_to_black_color(
drivers/gpu/drm/amd/display/dc/virtual/virtual_link_encoder.c +2 -6
@@ -58,7 +58,8 @@ static void virtual_link_encoder_enable_dp_mst_output(static void virtual_link_encoder_disable_output (struct link_encoder *link_enc, -enum signal_type signal) {} +enum signal_type signal, +struct dc_link *link) {} static void virtual_link_encoder_dp_set_lane_settings( struct link_encoder *enc,
@@ -72,10 +73,6 @@ static void virtual_link_encoder_update_mst_stream_allocation_table( struct link_encoder *enc, const struct link_mst_stream_allocation_table *table) {} -static void virtual_link_encoder_edp_backlight_control ( -struct link_encoder *enc, -bool enable) {} -static void virtual_link_encoder_edp_power_control (struct link_encoder *enc,bool power_up) {}
@@ -105,7 +102,6 @@ static const struct link_encoder_funcs virtual_lnk_enc_funcs = { .dp_set_phy_pattern = virtual_link_encoder_dp_set_phy_pattern, .update_mst_stream_allocation_table = virtual_link_encoder_update_mst_stream_allocation_table, - .backlight_control = virtual_link_encoder_edp_backlight_control, .power_control = virtual_link_encoder_edp_power_control, .connect_dig_be_to_fe = virtual_link_encoder_connect_dig_be_to_fe, .destroy = virtual_link_encoder_destroy
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 22/103 drm/amd/display: edp backlight regression fix
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h | 5 +++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 + 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +5 -0
@@ -68,5 +68,10 @@ void dce110_fill_display_configs(uint32_t dce110_get_min_vblank_time_us (const struct dc_state *context);void dp_receiver_power_ctrl (struct dc_link *link,bool on); + +void hwss_blacklight_control ( +struct dc_link *link, +bool enable); +#endif /* __DC_HWSS_DCE110_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -0
@@ -2897,6 +2897,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect, .ready_shared_resources = ready_shared_resources, .optimize_shared_resources = optimize_shared_resources, + .backlight_control = hwss_blacklight_control };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 23/103 drm/amd/display: fix ASSERT() caused by missing registers.
In reply to a message not in the archiveFrom: Ken Chalmers <[email protected]>
--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 42 ++++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +23 -19
@@ -771,14 +771,16 @@ static void power_on_plane(struct dce_hwseq *hws, int plane_id) { - REG_SET(DC_IP_REQUEST_CNTL, 0, - IP_REQUEST_EN, 1); -dpp_pg_control (hws, plane_id, true); -hubp_pg_control (hws, plane_id, true); -REG_SET (DC_IP_REQUEST_CNTL ,0 , -IP_REQUEST_EN ,0 ); -dm_logger_write (hws->ctx->logger,LOG_DEBUG , -"Un-gated front end for pipe %d\n" , plane_id); + if (REG(DC_IP_REQUEST_CNTL)) { + REG_SET(DC_IP_REQUEST_CNTL, 0, + IP_REQUEST_EN, 1); +dpp_pg_control (hws, plane_id, true); +hubp_pg_control (hws, plane_id, true); +REG_SET (DC_IP_REQUEST_CNTL ,0 , +IP_REQUEST_EN ,0 ); +dm_logger_write (hws->ctx->logger,LOG_DEBUG , +"Un-gated front end for pipe %d\n" , plane_id); + } }static void undo_DEGVIDCN10_253_wa (struct dc *dc)
@@ -1130,18 +1132,20 @@ static void plane_atomic_power_down(struct dc *dc, int fe_idx)struct dce_hwseq *hws = dc->hwseq;struct transform *xfm = dc->res_pool->transforms[fe_idx]; -REG_SET (DC_IP_REQUEST_CNTL ,0 , -IP_REQUEST_EN ,1 ); -dpp_pg_control (hws, fe_idx, false); -hubp_pg_control (hws, fe_idx, false); - xfm->funcs->transform_reset (xfm); -REG_SET (DC_IP_REQUEST_CNTL ,0 , -IP_REQUEST_EN ,0 ); -dm_logger_write (dc->ctx->logger,LOG_DEBUG , -"Power gated front end %d\n" , fe_idx); +if (REG (DC_IP_REQUEST_CNTL )) { +REG_SET (DC_IP_REQUEST_CNTL ,0 , +IP_REQUEST_EN ,1 ); +dpp_pg_control (hws, fe_idx, false); +hubp_pg_control (hws, fe_idx, false); + xfm->funcs->transform_reset (xfm); +REG_SET (DC_IP_REQUEST_CNTL ,0 , +IP_REQUEST_EN ,0 ); +dm_logger_write (dc->ctx->logger,LOG_DEBUG , +"Power gated front end %d\n" , fe_idx); -if (dc->debug.sanity_checks) -verify_allow_pstate_change_high (dc->hwseq); +if (dc->debug.sanity_checks) +verify_allow_pstate_change_high (dc->hwseq); + } }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 24/103 drm/amd/display: make sure BL off to mainlink off has enough time
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -7
@@ -819,13 +819,6 @@ void hwss_blacklight_control(return ; } -if (!enable && !is_panel_backlight_on (hws)) { -dm_logger_write (ctx->logger,LOG_HW_RESUME_S3 , -"%s: panel already powered down. Do nothing.\n" , - __func__); -return ; - } -/* Send VBIOS command to control eDP panel backlight */ dm_logger_write(ctx->logger, LOG_HW_RESUME_S3,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 25/103 drm/amd/display: add hubp/dpp pg debug key
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -191,6 +191,8 @@ struct dc_debug {bool disable_dmcu;bool disable_psr;bool force_abm_enable; +bool disable_hbup_pg; +bool disable_dpp_pg; };struct dc_state ;struct resource_pool ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 26/103 drm/amd/display: Fixed validation return wrong result.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -4918,7 +4918,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,if (ret) goto fail; -if (!dc_validate_global_state (dc, dm_state->context)) { +if (dc_validate_global_state (dc, dm_state->context) !=DC_OK ) { ret = -EINVAL ; goto fail; }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
@@ -1716,7 +1716,7 @@ void dc_resource_state_construct( dst_ctx->dis_clk = dc->res_pool->display_clock; } -bool dc_validate_global_state ( +enum dc_status dc_validate_global_state (struct dc *dc,struct dc_state *new_ctx) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -654,7 +654,7 @@ bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream);bool dc_validate_plane (struct dc *dc,const struct dc_plane_state *plane_state); -bool dc_validate_global_state ( +enum dc_status dc_validate_global_state (struct dc *dc,struct dc_state *new_ctx);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 27/103 drm/amd/display: version 3.1.02
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.01" +#define DC_VER "3.1.02"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 28/103 drm/amd/display: screen flickers when connected to ext monitor in clone
In reply to a message not in the archiveFrom: Hersen Wu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 8 ++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 3 +++ 3 files changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +8 -0
@@ -1018,9 +1018,17 @@ bool dcn_validate_bandwidth( context->bw.dcn.calc_clk.min_active_dram_ccm_us = (int )(v->min_active_dram_clock_change_margin); context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz = (int )(v->dcf_clk_deep_sleep *1000 ); context->bw.dcn.calc_clk.dcfclk_khz = (int )(v->dcfclk *1000 ); + context->bw.dcn.calc_clk.dispclk_khz = (int )(v->dispclk *1000 );if (dc->debug.max_disp_clk == true) context->bw.dcn.calc_clk.dispclk_khz = (int )(dc->dcn_soc->max_dispclk_vmax0p9 *1000 ); + +if (context->bw.dcn.calc_clk.dispclk_khz < + dc->debug.min_disp_clk_khz) { + context->bw.dcn.calc_clk.dispclk_khz = + dc->debug.min_disp_clk_khz; + } + context->bw.dcn.calc_clk.dppclk_div = (int )(v->dispclk_dppclk_ratio) ==2 ;for (i =0 , input_idx =0 ; i < pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -178,6 +178,7 @@ struct dc_debug {bool disable_pplib_wm_range;bool use_dml_wm;bool disable_pipe_split; +unsigned int min_disp_clk_khz;int sr_exit_time_dpm0_ns;int sr_enter_plus_exit_time_dpm0_ns;int sr_exit_time_ns;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +3 -0
@@ -420,6 +420,9 @@ static const struct dc_debug debug_defaults_drv = { .force_abm_enable = false, .timing_trace = false, .clock_trace = true, + + .min_disp_clk_khz = 300000, + .disable_pplib_clock_request = true, .disable_pplib_wm_range = false,#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 29/103 drm/amd/display: Fixed incorrect return value for validaton
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -4
@@ -1723,10 +1723,11 @@ enum dc_status dc_validate_global_state(enum dc_status result =DC_ERROR_UNEXPECTED ;int i, j; -if (dc->res_pool->funcs->validate_global && - dc->res_pool->funcs->validate_global ( - dc, new_ctx) !=DC_OK ) -return false; +if (dc->res_pool->funcs->validate_global) { + result = dc->res_pool->funcs->validate_global (dc, new_ctx); +if (result !=DC_OK ) +return result; + }for (i =0 ; new_ctx && i < new_ctx->stream_count; i++) {struct dc_stream_state *stream = new_ctx->streams[i];
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 30/103 drm/amd/display: Use active + border for bw validation
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
When doing SLS, KMD gives us clipped v_addressable with border. This results in bw validation failure.
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +5 -3
@@ -364,7 +364,8 @@ static void pipe_ctx_to_e2e_pipe_params ( } - input->dest.vactive = pipe->stream->timing.v_addressable; + input->dest.vactive = pipe->stream->timing.v_addressable + pipe->stream->timing.v_border_top + + pipe->stream->timing.v_border_bottom; input->dest.recout_width = pipe->plane_res.scl_data.recout.width; input->dest.recout_height = pipe->plane_res.scl_data.recout.height;
@@ -882,10 +883,11 @@ bool dcn_validate_bandwidth( v->htotal[input_idx] = pipe->stream->timing.h_total; v->vtotal[input_idx] = pipe->stream->timing.v_total; + v->vactive[input_idx] = pipe->stream->timing.v_addressable + + pipe->stream->timing.v_border_top + pipe->stream->timing.v_border_bottom; v->v_sync_plus_back_porch[input_idx] = pipe->stream->timing.v_total - - pipe->stream->timing.v_addressable + - v->vactive[input_idx] - pipe->stream->timing.v_front_porch; - v->vactive[input_idx] = pipe->stream->timing.v_addressable; v->pixel_clock[input_idx] = pipe->stream->timing.pix_clk_khz /1000.0f ;if (!pipe->plane_state) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 31/103 drm/amd/display: update link type to mst before topology discovery
In reply to a message not in the archiveFrom: Wenjing Liu <[email protected]>
[Description]
link type is not updated before mst topology discovery.
This causes issue when branch device response to link address after before the start topology discovery event finishes.
[Solution]
update link type to mst before topology discovery
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -3
@@ -496,6 +496,7 @@ static void detect_dp( }if (is_mst_supported (link)) { sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT_MST ; + link->type = dc_connection_mst_branch;/* * This call will initiate MST topology discovery. Which
@@ -524,12 +525,11 @@ static void detect_dp(if (reason ==DETECT_REASON_BOOT ) boot = true; -if (dm_helpers_dp_mst_start_top_mgr ( +if (!dm_helpers_dp_mst_start_top_mgr ( link->ctx, link, boot)) { - link->type = dc_connection_mst_branch; - }else {/* MST not supported */ + link->type = dc_connection_single; sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT ; } }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 32/103 drm/amd/display: Program stream's csc matrix instead of using default
In reply to a message not in the archiveFrom: SivapiriyanKumarasamy <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -4
@@ -2259,7 +2259,6 @@ static void update_dchubp_dpp(struct transform *xfm = pipe_ctx->plane_res.xfm;struct dc_plane_state *plane_state = pipe_ctx->plane_state;union plane_size size = plane_state->plane_size; -struct default_adjustment ocsc = {0 };struct mpcc_cfg mpcc_cfg = {0 };struct pipe_ctx *top_pipe;bool per_pixel_alpha = plane_state->per_pixel_alpha && pipe_ctx->bottom_pipe;
@@ -2338,9 +2337,9 @@ static void update_dchubp_dpp(/*gamut remap*/ program_gamut_remap (pipe_ctx); -/*TODO add adjustments parameters*/ - ocsc.out_color_space = pipe_ctx->stream->output_color_space; - pipe_ctx->plane_res.xfm->funcs->opp_set_csc_default (pipe_ctx->plane_res.xfm, &ocsc); +program_csc_matrix (pipe_ctx, + pipe_ctx->stream->output_color_space, + pipe_ctx->stream->csc_color_matrix.matrix); mi->funcs->mem_input_program_surface_config( mi,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 33/103 drm/amd/display: Early return when turn off a plane.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
In case of two monitor connected and turn off one of the monitors, OTG0 is locked after graphic plane off due to redundant programming front end regs.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -1
@@ -1190,8 +1190,14 @@ static void commit_planes_for_stream(struct dc *dc, } } -if (surface_count ==0 ) +if (surface_count ==0 ) { +/* +* In case of turning off screen, no need to program front end a second time. +* just return after program front end. +*/ dc->hwss.apply_ctx_for_surface (dc, stream, surface_count, context); +return ; + }/* Lock pipes for provided surfaces, or all active if full update*/ for (i =0 ; i < surface_count; i++) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 34/103 drm/amd/display: Only reset top pipe back end.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -0
@@ -1270,6 +1270,9 @@ static void reset_hw_ctx_wrap(if (!pipe_ctx_old->stream)continue ; +if (pipe_ctx_old->top_pipe) +continue ; +if (!pipe_ctx->stream ||pipe_need_reprogram (pipe_ctx_old, pipe_ctx)) {struct clock_source *old_clk = pipe_ctx_old->clock_source;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 35/103 drm/amd/display: Fix MST daisy chain SST not light up
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
In SST daisy chain scenario, edid is getting read in mst hotplug routine. It is getting conflict with drm send_enum_path_resources kernel thread in terms of i2c bus which is getting locked up in such case.
Have edid being read in get_mode hook, instead of in hotplug routine.
--- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 110 +++++++++------------ 1 file changed, 49 insertions(+), 61 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +49 -61
@@ -172,14 +172,60 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { .atomic_get_property = amdgpu_dm_connector_atomic_get_property }; +static int dm_connector_update_modes (struct drm_connector *connector, +struct edid *edid) +{ +int ret; + + ret =drm_add_edid_modes (connector, edid); +drm_edid_to_eld (connector, edid); + +return ret; +} +static int dm_dp_mst_get_modes (struct drm_connector *connector) {struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (connector);int ret =0 ; - ret =drm_add_edid_modes (&aconnector->base, aconnector->edid); +if (!aconnector) +return dm_connector_update_modes (connector,NULL ); + +if (!aconnector->edid) { +struct edid *edid; +struct dc_sink *dc_sink; +struct dc_sink_init_data init_params = { + .link = aconnector->dc_link, + .sink_signal =SIGNAL_TYPE_DISPLAY_PORT_MST }; + edid =drm_dp_mst_get_edid (connector, &aconnector->mst_port->mst_mgr, aconnector->port); -drm_edid_to_eld (&aconnector->base, aconnector->edid); +if (!edid) { +drm_mode_connector_update_edid_property ( + &aconnector->base, +NULL ); +return ret; + } + + aconnector->edid = edid; + + dc_sink =dc_link_add_remote_sink ( + aconnector->dc_link, + (uint8_t *)edid, + (edid->extensions +1 ) *EDID_LENGTH , + &init_params); + + dc_sink->priv = aconnector; + aconnector->dc_sink = dc_sink; + +if (aconnector->dc_sink) +amdgpu_dm_add_sink_to_freesync_module ( + connector, edid); + +drm_mode_connector_update_edid_property ( + &aconnector->base, edid); + } + + ret =dm_connector_update_modes (connector, aconnector->edid);return ret; }
@@ -341,66 +387,8 @@ static void dm_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) { struct amdgpu_dm_connector *master = container_of(mgr, struct amdgpu_dm_connector, mst_mgr);struct drm_device *dev = master->base.dev; -struct amdgpu_device *adev = dev->dev_private; -struct drm_connector *connector; -struct amdgpu_dm_connector *aconnector; -struct edid *edid; -struct dc_sink *dc_sink; - -drm_modeset_lock_all (dev); -list_for_each_entry (connector, &dev->mode_config.connector_list, head) { - aconnector =to_amdgpu_dm_connector (connector); -if (aconnector->port && - aconnector->port->pdt !=DP_PEER_DEVICE_NONE && - aconnector->port->pdt !=DP_PEER_DEVICE_MST_BRANCHING && - !aconnector->dc_sink) { -/* -* This is plug in case, where port has been created but -* sink hasn't been created yet -*/ -if (!aconnector->edid) { -struct dc_sink_init_data init_params = { - .link = aconnector->dc_link, - .sink_signal =SIGNAL_TYPE_DISPLAY_PORT_MST }; - edid =drm_dp_mst_get_edid (connector, &aconnector->mst_port->mst_mgr, aconnector->port); - -if (!edid) { -drm_mode_connector_update_edid_property ( - &aconnector->base, -NULL ); -continue ; - } - - aconnector->edid = edid; - - dc_sink =dc_link_add_remote_sink ( - aconnector->dc_link, - (uint8_t *)edid, - (edid->extensions +1 ) *EDID_LENGTH , - &init_params); - - dc_sink->priv = aconnector; - aconnector->dc_sink = dc_sink; - -if (aconnector->dc_sink) -amdgpu_dm_add_sink_to_freesync_module ( - connector, - edid); - -dm_restore_drm_connector_state (connector->dev, connector); - }else - edid = aconnector->edid; - -DRM_DEBUG_KMS ("edid retrieved %p\n" , edid); - -drm_mode_connector_update_edid_property ( - &aconnector->base, - aconnector->edid); - } - } -drm_modeset_unlock_all (dev); -schedule_work (&adev->dm.mst_hotplug_work); +drm_kms_helper_hotplug_event (dev); }static void dm_dp_mst_register_connector (struct drm_connector *connector)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 36/103 drm/amd/display: temp disable DCC on high res.
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +9 -2
@@ -1133,20 +1133,27 @@ static bool get_dcc_compression_cap(const struct dc *dc, output->grph.rgb.max_uncompressed_blk_size =256 ; output->grph.rgb.max_compressed_blk_size =256 ; output->grph.rgb.independent_64b_blks = false; + output->capable = true; + output->const_color_support = false;break ;case dcc_control__128_128_xxx: output->grph.rgb.max_uncompressed_blk_size =128 ; output->grph.rgb.max_compressed_blk_size =128 ; output->grph.rgb.independent_64b_blks = false; +/*temp: not allow dcc on high res*/ + output->capable = false; + output->const_color_support = false;break ;case dcc_control__256_64_64: output->grph.rgb.max_uncompressed_blk_size =256 ; output->grph.rgb.max_compressed_blk_size =64 ; output->grph.rgb.independent_64b_blks = true; +/*temp: not allow dcc on high res*/ + output->capable = false; + output->const_color_support = false;break ; } - output->capable = true; - output->const_color_support = false; +return true; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 37/103 drm/amd/display: enable optional pipe split for single display
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
also refactor debug option. now pipe_split_policy are
dynamic = no hack around dcn_calcs. will split based on HW recommendation avoid = avoid split if we can support the config with higher voltage avoid_multi_display = allow split with single display output.
force_single_disp_pipe_split
force single display to pipe split to improve stutter efficiency by using DET buffers using 2 HUBP.
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 44 ++++++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dc.h | 9 ++++- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 8 +--- 3 files changed, 51 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +41 -3
@@ -720,6 +720,46 @@ static bool dcn_bw_apply_registry_override(struct dc *dc)return updated; } +void hack_disable_optional_pipe_split (struct dcn_bw_internal_vars *v) +{ +/* +* disable optional pipe split by lower dispclk bounding box +* at DPM0 +*/ + v->max_dispclk[0 ] = v->max_dppclk_vmin0p65; +} + +void hack_force_pipe_split (struct dcn_bw_internal_vars *v, +unsigned int pixel_rate_khz) +{ +/* +* force enabling pipe split by lower dpp clock for DPM0 to just +* below the specify pixel_rate, so bw calc would split pipe. +*/ + v->max_dppclk[0 ] = pixel_rate_khz /1000 ; +} + +void hack_bounding_box (struct dcn_bw_internal_vars *v, +struct dc_debug *dbg, +struct dc_state *context) +{ +if (dbg->pipe_split_policy ==MPC_SPLIT_AVOID ) { +hack_disable_optional_pipe_split (v); + } + +if (dbg->pipe_split_policy ==MPC_SPLIT_AVOID_MULT_DISP && + context->stream_count >=2 ) { +hack_disable_optional_pipe_split (v); + } + +if (context->stream_count ==1 && + dbg->force_single_disp_pipe_split) { +struct dc_stream_state *stream0 = context->streams[0 ]; + +hack_force_pipe_split (v, stream0->timing.pix_clk_khz); + } +} +bool dcn_validate_bandwidth (struct dc *dc,struct dc_state *context)
@@ -851,9 +891,7 @@ bool dcn_validate_bandwidth( v->phyclk_per_state[1 ] = v->phyclkv_mid0p72; v->phyclk_per_state[0 ] = v->phyclkv_min0p65; -if (dc->debug.disable_pipe_split) { - v->max_dispclk[0 ] = v->max_dppclk_vmin0p65; - } +hack_bounding_box (v, &dc->debug, context);if (v->voltage_override == dcn_bw_v_max0p9) { v->voltage_override_level = number_of_states -1 ;
drivers/gpu/drm/amd/display/dc/dc.h +8 -1
@@ -162,6 +162,12 @@ struct dc_config {bool disable_disp_pll_sharing; }; +enum pipe_split_policy { +MPC_SPLIT_DYNAMIC =0 , +MPC_SPLIT_AVOID =1 , +MPC_SPLIT_AVOID_MULT_DISP =2 , +}; +struct dc_debug {bool surface_visual_confirm;bool sanity_checks;
@@ -177,7 +183,8 @@ struct dc_debug {bool disable_hubp_power_gate;bool disable_pplib_wm_range;bool use_dml_wm; -bool disable_pipe_split; +enum pipe_split_policy pipe_split_policy; +bool force_single_disp_pipe_split;unsigned int min_disp_clk_khz;int sr_exit_time_dpm0_ns;int sr_enter_plus_exit_time_dpm0_ns;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 -6
@@ -425,10 +425,9 @@ static const struct dc_debug debug_defaults_drv = { .disable_pplib_clock_request = true, .disable_pplib_wm_range = false, -#if defined(CONFIG_DRM_AMD_DC_DCN1_0 ) .use_dml_wm = false, - .disable_pipe_split = true -#endif + + .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, };static const struct dc_debug debug_defaults_diags = {
@@ -437,12 +436,9 @@ static const struct dc_debug debug_defaults_diags = { .timing_trace = true, .clock_trace = true, .disable_stutter = true, -#if defined(CONFIG_DRM_AMD_DC_DCN1_0 ) .disable_pplib_clock_request = true, .disable_pplib_wm_range = true, .use_dml_wm = false, - .disable_pipe_split = false -#endif };static void dcn10_dpp_destroy (struct transform **xfm)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 38/103 drm/amd/display: add option to disable DCC for DCC 128b request
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
1. reverts commit e67f51012740 ("dc: temp disable DCC on high res.")
- default still DCC enabled
2. add debug options to decide how DCC is disabled
- disable DCC
- disable DCC if DCC requires 128b (aka. half) request
-- observed compressed data corruption result in screen corruption in full (256b) request while half (128b) would cause DCN to hang, result in DF hang
--- drivers/gpu/drm/amd/display/dc/dc.h | 11 ++++++++--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 18 ++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +8 -3
@@ -56,11 +56,10 @@ struct dc_caps {uint32_t max_planes;uint32_t max_downscale_ratio;uint32_t i2c_speed_in_khz; -unsigned int max_cursor_size; +bool dcc_const_color; }; -struct dc_dcc_surface_param {struct dc_size surface_size;enum surface_pixel_format format;
@@ -162,6 +161,12 @@ struct dc_config {bool disable_disp_pll_sharing; }; +enum dcc_option { +DCC_ENABLE =0 , +DCC_DISABLE =1 , +DCC_HALF_REQ_DISALBE =2 , +}; +enum pipe_split_policy {MPC_SPLIT_DYNAMIC =0 ,MPC_SPLIT_AVOID =1 ,
@@ -177,7 +182,7 @@ struct dc_debug {bool clock_trace;bool validation_trace;bool disable_stutter; -bool disable_dcc; +enum dcc_option disable_dcc;bool disable_dfs_bypass;bool disable_dpp_power_gate;bool disable_hubp_power_gate;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +8 -10
@@ -414,7 +414,6 @@ static const struct resource_caps res_cap = { };static const struct dc_debug debug_defaults_drv = { - .disable_dcc = false, .sanity_checks = true, .disable_dmcu = true, .force_abm_enable = false,
@@ -428,6 +427,7 @@ static const struct dc_debug debug_defaults_drv = { .use_dml_wm = false, .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .disable_dcc = DCC_ENABLE, };static const struct dc_debug debug_defaults_diags = {
@@ -1080,7 +1080,7 @@ static bool get_dcc_compression_cap(const struct dc *dc,memset (output,0 ,sizeof (*output)); -if (dc->debug.disable_dcc) +if (dc->debug.disable_dcc ==DCC_DISABLE )return false; if (!dcc_support_pixel_format(input->format,
@@ -1124,32 +1124,30 @@ static bool get_dcc_compression_cap(const struct dc *dc, dcc_control = dcc_control__128_128_xxx; } +if (dc->debug.disable_dcc ==DCC_HALF_REQ_DISALBE && + dcc_control != dcc_control__256_256_xxx) +return false; +switch (dcc_control) {case dcc_control__256_256_xxx: output->grph.rgb.max_uncompressed_blk_size =256 ; output->grph.rgb.max_compressed_blk_size =256 ; output->grph.rgb.independent_64b_blks = false; - output->capable = true; - output->const_color_support = false;break ;case dcc_control__128_128_xxx: output->grph.rgb.max_uncompressed_blk_size =128 ; output->grph.rgb.max_compressed_blk_size =128 ; output->grph.rgb.independent_64b_blks = false; -/*temp: not allow dcc on high res*/ - output->capable = false; - output->const_color_support = false;break ;case dcc_control__256_64_64: output->grph.rgb.max_uncompressed_blk_size =256 ; output->grph.rgb.max_compressed_blk_size =64 ; output->grph.rgb.independent_64b_blks = true; -/*temp: not allow dcc on high res*/ - output->capable = false; - output->const_color_support = false;break ; } + output->capable = true; + output->const_color_support = false;return true; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 39/103 drm/amd/display: option to maximize lb usage
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
experimental change for testing if max line buffer result in better stutter efficiency
for 1080p, LB can hold up to 9 line at 10bpcc, potentially add 10 line time of latency hiding.
--- drivers/gpu/drm/amd/display/dc/dc.h | 8 ++++++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +6 -2
@@ -181,15 +181,19 @@ struct dc_debug {bool timing_trace;bool clock_trace;bool validation_trace; + +/* stutter efficiency related */ bool disable_stutter; +bool use_max_lb;enum dcc_option disable_dcc; +enum pipe_split_policy pipe_split_policy; +bool force_single_disp_pipe_split; +bool disable_dfs_bypass;bool disable_dpp_power_gate;bool disable_hubp_power_gate;bool disable_pplib_wm_range;bool use_dml_wm; -enum pipe_split_policy pipe_split_policy; -bool force_single_disp_pipe_split;unsigned int min_disp_clk_khz;int sr_exit_time_dpm0_ns;int sr_enter_plus_exit_time_dpm0_ns;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +3 -0
@@ -507,6 +507,9 @@ static enum lb_memory_config find_lb_memory_config(struct dcn10_dpp *xfm, {enum lb_memory_config mem_cfg =LB_MEMORY_CONFIG_0 ; +if (xfm->base.ctx->dc->debug.use_max_lb) +return mem_cfg; +if (xfm->tf_mask->PIXEL_DEPTH) { mem_cfg =dpp10_find_lb_memory_config (scl_data); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 40/103 drm/amd/display: fix bug in force_single_disp_pipe_split
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
should only lower dpp clock.
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +4 -1
@@ -732,11 +732,14 @@ void hack_disable_optional_pipe_split(struct dcn_bw_internal_vars *v)void hack_force_pipe_split (struct dcn_bw_internal_vars *v,unsigned int pixel_rate_khz) { +float pixel_rate_mhz = pixel_rate_khz /1000 ; +/* * force enabling pipe split by lower dpp clock for DPM0 to just * below the specify pixel_rate, so bw calc would split pipe. */ - v->max_dppclk[0 ] = pixel_rate_khz /1000 ; +if (pixel_rate_mhz < v->max_dppclk[0 ]) + v->max_dppclk[0 ] = pixel_rate_mhz; } void hack_bounding_box(struct dcn_bw_internal_vars *v,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 41/103 drm/amd/display: dal 3.1.03
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.02" +#define DC_VER "3.1.03"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 42/103 drm/amd/display: Fix ref_count messed up issue
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
In the full update type, need to add ref_count to the newly created dc_state->stream. It made mistake to add ref_count to dc->current_state->stream which keeps adding up without release.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +20 -1
@@ -1322,6 +1322,7 @@ void dc_commit_updates_for_stream(struct dc *dc,const struct dc_stream_status *stream_status;enum surface_update_type update_type;struct dc_state *context; +struct dc_context *dc_ctx = dc->ctx;int i; stream_status =dc_stream_get_status (stream);
@@ -1334,8 +1335,17 @@ void dc_commit_updates_for_stream(struct dc *dc,update_surface_trace (dc, srf_updates, surface_count); -if (update_type >=UPDATE_TYPE_FULL ) +if (update_type >=UPDATE_TYPE_FULL ) { + +/* initialize scratch memory for building context */ + context =dc_create_state (); +if (context ==NULL ) { +DC_ERROR ("Failed to allocate new validate context!\n" ); +return ; + } +dc_resource_state_copy_construct (state, context); + }for (i =0 ; i < surface_count; i++) {
@@ -1361,6 +1371,15 @@ void dc_commit_updates_for_stream(struct dc *dc,dc_post_update_surfaces_to_stream (dc); +if (dc->current_state != context) { + +struct dc_state *old = dc->current_state; + + dc->current_state = context; +dc_release_state (old); + + } +return ; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 43/103 drm/amd/display: moving cursor functions from ipp to mem_input
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 32 +++- drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c | 2 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 51 ++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 15 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c | 189 --------------------- .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 163 ++++++++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 57 ++++++- drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h | 10 ++ drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 11 ++ 9 files changed, 329 insertions(+), 201 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +27 -5
@@ -195,13 +195,23 @@ bool dc_stream_set_cursor_attributes(for (i =0 ; i <MAX_PIPES ; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; -if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.ipp) +if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.mi || !pipe_ctx->plane_res.xfm)continue ;if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state)continue ; - pipe_ctx->plane_res.ipp->funcs->ipp_cursor_set_attributes ( - pipe_ctx->plane_res.ipp, attributes); + +if (pipe_ctx->plane_res.ipp->funcs->ipp_cursor_set_attributes !=NULL ) + pipe_ctx->plane_res.ipp->funcs->ipp_cursor_set_attributes ( + pipe_ctx->plane_res.ipp, attributes); + +if (pipe_ctx->plane_res.mi->funcs->set_cursor_attributes !=NULL ) + pipe_ctx->plane_res.mi->funcs->set_cursor_attributes ( + pipe_ctx->plane_res.mi, attributes); + +if (pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes !=NULL ) + pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes ( + pipe_ctx->plane_res.xfm, attributes); }return true;
@@ -231,6 +241,8 @@ bool dc_stream_set_cursor_position(for (i =0 ; i <MAX_PIPES ; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; +struct mem_input *mi = pipe_ctx->plane_res.mi; +struct transform *xfm = pipe_ctx->plane_res.xfm;struct dc_cursor_position pos_cpy = *position;struct dc_cursor_mi_param param = { .pixel_clk_khz = stream->timing.pix_clk_khz,
@@ -241,7 +253,9 @@ bool dc_stream_set_cursor_position( };if (pipe_ctx->stream != stream || - !pipe_ctx->plane_res.ipp || !pipe_ctx->plane_state) + !pipe_ctx->plane_res.mi || + !pipe_ctx->plane_state || + !pipe_ctx->plane_res.xfm)continue ; if (pipe_ctx->plane_state->address.type
@@ -251,7 +265,15 @@ bool dc_stream_set_cursor_position(if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state) pos_cpy.enable = false; - ipp->funcs->ipp_cursor_set_position (ipp, &pos_cpy, ¶m); + +if (ipp->funcs->ipp_cursor_set_position !=NULL ) + ipp->funcs->ipp_cursor_set_position (ipp, &pos_cpy, ¶m); + +if (mi->funcs->set_cursor_attributes !=NULL ) + mi->funcs->set_cursor_position (mi, &pos_cpy, ¶m); + +if (xfm->funcs->set_cursor_attributes !=NULL ) + xfm->funcs->set_cursor_position (xfm, &pos_cpy, ¶m, mi->curs_attr.width); }return true;
drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c +2 -0
@@ -37,6 +37,7 @@#define CTX \ ipp_dce->base.ctx + static void dce_ipp_cursor_set_position( struct input_pixel_processor *ipp, const struct dc_cursor_position *position,
@@ -133,6 +134,7 @@ static void dce_ipp_cursor_set_attributes(REG_UPDATE (CUR_UPDATE ,CURSOR_UPDATE_LOCK , false); } +static void dce_ipp_program_prescale (struct input_pixel_processor *ipp,struct ipp_prescale_params *params)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +51 -0
63 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +12 -3
@@ -112,7 +112,10 @@SRI (CM_DGAM_CONTROL ,CM , id), \SRI (FORMAT_CONTROL ,CNVC_CFG , id), \SRI (CNVC_SURFACE_PIXEL_FORMAT ,CNVC_CFG , id), \ -SRI (CURSOR0_CONTROL ,CNVC_CUR , id) +SRI (CURSOR0_CONTROL ,CNVC_CUR , id), \ +SRI (CURSOR0_CONTROL ,CNVC_CUR , id), \ +SRI (CURSOR0_COLOR0 ,CNVC_CUR , id), \ +SRI (CURSOR0_COLOR1 ,CNVC_CUR , id)
@@ -302,7 +305,9 @@TF_SF (CNVC_CFG0_CNVC_SURFACE_PIXEL_FORMAT ,CNVC_SURFACE_PIXEL_FORMAT , mask_sh), \TF_SF (CNVC_CUR0_CURSOR0_CONTROL ,CUR0_MODE , mask_sh), \TF_SF (CNVC_CUR0_CURSOR0_CONTROL ,CUR0_EXPANSION_MODE , mask_sh), \ - TF_SF(CNVC_CUR0_CURSOR0_CONTROL, CUR0_ENABLE, mask_sh) +TF_SF (CNVC_CUR0_CURSOR0_CONTROL ,CUR0_ENABLE , mask_sh), \ +TF_SF (CNVC_CUR0_CURSOR0_COLOR0 ,CUR0_COLOR0 , mask_sh), \ + TF_SF(CNVC_CUR0_CURSOR0_COLOR1, CUR0_COLOR1, mask_sh) #define TF_REG_LIST_SH_MASK_DCN10(mask_sh)\ TF_REG_LIST_SH_MASK_DCN(mask_sh),\
@@ -989,7 +994,9 @@type CUR0_EXPANSION_MODE ; \type CUR0_ENABLE ; \type CM_BYPASS ; \ -type FORMAT_CONTROL__ALPHA_EN +type FORMAT_CONTROL__ALPHA_EN ; \ +type CUR0_COLOR0 ; \ +type CUR0_COLOR1
@@ -1237,6 +1244,8 @@ struct dcn_dpp_registers {uint32_t CNVC_SURFACE_PIXEL_FORMAT ;uint32_t CURSOR_CONTROL ;uint32_t CURSOR0_CONTROL ; +uint32_t CURSOR0_COLOR0 ; +uint32_t CURSOR0_COLOR1 ; };struct dcn10_dpp {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c +0 -189
201 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +163 -0
175 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +53 -4
87 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +10 -0
@@ -72,6 +72,7 @@ struct mem_input {int opp_id;int mpcc_id;struct stutter_modes stutter_mode; +struct dc_cursor_attributes curs_attr; };struct vm_system_aperture_param {
@@ -163,6 +164,15 @@ struct mem_input_funcs {void (*set_blank)(struct mem_input *mi,bool blank);void (*set_hubp_blank_en)(struct mem_input *mi,bool blank); +void (*set_cursor_attributes)( +struct mem_input *mem_input, +const struct dc_cursor_attributes *attr); + +void (*set_cursor_position)( +struct mem_input *mem_input, +const struct dc_cursor_position *pos, + const struct dc_cursor_mi_param *param); + };#endif
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +11 -0
@@ -238,6 +238,17 @@ struct transform_funcs {void (*ipp_full_bypass)(struct transform *xfm_base); +void (*set_cursor_attributes)( +struct transform *xfm_base, +const struct dc_cursor_attributes *attr); + +void (*set_cursor_position)( +struct transform *xfm_base, +const struct dc_cursor_position *pos, +const struct dc_cursor_mi_param *param, +uint32_t width + ); + };const uint16_t *get_filter_2tap_16p (void );
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 44/103 drm/amd/display: Move power control from link encoder to hwsequencer
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
A recent commit moved the backlight control code along with the register defines, but did not move the power control code. This along with remnant fields in the dce110_link_enc_registers struct made it so that the code still compiled, but any attempts to access the LVTMA_PWRSEQ_STATE register led to reading from an address of 0. This patch corrects that.
Also, rename blacklight_control to edp_backlight_control (Typo fix).
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 17 +- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 8 +- drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 18 ++- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 171 +-------------------- .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h | 8 - .../amd/display/dc/dce110/dce110_hw_sequencer.c | 155 +++++++++++++++++-- .../amd/display/dc/dce110/dce110_hw_sequencer.h | 6 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 +- .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 2 - drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 7 +- drivers/gpu/drm/amd/display/dc/inc/link_hwss.h | 4 + .../amd/display/dc/virtual/virtual_link_encoder.c | 5 - 12 files changed, 190 insertions(+), 214 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +9 -8
@@ -78,14 +78,15 @@ static void destruct(struct dc_link *link)dc_sink_release (link->remote_sinks[i]); } -static struct gpio *get_hpd_gpio (const struct dc_link *link) +struct gpio *get_hpd_gpio (struct dc_bios *dcb, +struct graphics_object_id link_id, +struct gpio_service *gpio_service) {enum bp_result bp_result; -struct dc_bios *dcb = link->ctx->dc_bios;struct graphics_object_hpd_info hpd_info;struct gpio_pin_info pin_info; -if (dcb->funcs->get_hpd_info (dcb, link->link_id, &hpd_info) !=BP_RESULT_OK ) +if (dcb->funcs->get_hpd_info (dcb, link_id, &hpd_info) !=BP_RESULT_OK )return NULL ; bp_result = dcb->funcs->get_gpio_pin_info(dcb,
@@ -97,7 +98,7 @@ static struct gpio *get_hpd_gpio(const struct dc_link *link) }return dal_gpio_service_create_irq ( - link->ctx->gpio_service, + gpio_service, pin_info.offset, pin_info.mask); }
@@ -153,7 +154,7 @@ static bool program_hpd_filter( }/* Obtain HPD handle */ - hpd =get_hpd_gpio (link); + hpd =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);if (!hpd)return result;
@@ -186,7 +187,7 @@ static bool detect_sink(struct dc_link *link, enum dc_connection_type *type)struct gpio *hpd_pin;/* todo: may need to lock gpio access */ - hpd_pin =get_hpd_gpio (link); + hpd_pin =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);if (hpd_pin ==NULL ) goto hpd_gpio_failure;
@@ -795,7 +796,7 @@ static enum hpd_source_id get_hpd_line(struct gpio *hpd;enum hpd_source_id hpd_id =HPD_SOURCEID_UNKNOWN ; - hpd =get_hpd_gpio (link); + hpd =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);if (hpd) {switch (dal_irq_get_source (hpd)) {
@@ -965,7 +966,7 @@ static bool construct( goto create_fail; } - hpd_gpio =get_hpd_gpio (link); + hpd_gpio =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);if (hpd_gpio !=NULL ) link->irq_source_hpd =dal_irq_get_source (hpd_gpio);
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +4 -4
@@ -89,12 +89,12 @@ void dp_enable_link_phy(if (dc_is_dp_sst_signal (signal)) {if (signal ==SIGNAL_TYPE_EDP ) { - link_enc->funcs->power_control (link_enc, true); + link->dc->hwss.edp_power_control (link->link_enc, true); link_enc->funcs->enable_dp_output ( link_enc, link_settings, clock_source); - link->dc->hwss.backlight_control (link, true); + link->dc->hwss.edp_backlight_control (link, true); }else link_enc->funcs->enable_dp_output( link_enc,
@@ -138,10 +138,10 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal)dp_receiver_power_ctrl (link, false);if (signal ==SIGNAL_TYPE_EDP ) { - link->dc->hwss.backlight_control (link, false); + link->dc->hwss.edp_backlight_control (link, false);edp_receiver_ready_T9 (link); link->link_enc->funcs->disable_output (link->link_enc, signal, link); - link->link_enc->funcs->power_control (link->link_enc, false); + link->dc->hwss.edp_power_control (link->link_enc, false); }else link->link_enc->funcs->disable_output (link->link_enc, signal, link);
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +13 -5
@@ -391,23 +391,27 @@ struct dce_hwseq_registers {HWS_SF (BLND_ ,V_UPDATE_LOCK ,BLND_DCP_GRPH_SURF_V_UPDATE_LOCK , mask_sh),\HWS_SF (BLND_ ,CONTROL ,BLND_MODE , mask_sh),\ HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh),\ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh),\ HWSEQ_PIXEL_RATE_MASK_SH_LIST(mask_sh, CRTC0_)#define HWSEQ_DCE10_MASK_SH_LIST (mask_sh)\ HWSEQ_DCEF_MASK_SH_LIST(mask_sh, DCFE_),\ HWSEQ_BLND_MASK_SH_LIST(mask_sh, BLND_),\ HWSEQ_PIXEL_RATE_MASK_SH_LIST(mask_sh, CRTC0_), \ - HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh) + HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh)#define HWSEQ_DCE11_MASK_SH_LIST (mask_sh)\ HWSEQ_DCE10_MASK_SH_LIST(mask_sh),\ SF(DCFEV_CLOCK_CONTROL, DCFEV_CLOCK_ENABLE, mask_sh),\ HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh),\ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh),\ HWSEQ_PIXEL_RATE_MASK_SH_LIST(mask_sh, CRTC0_)#define HWSEQ_DCE112_MASK_SH_LIST (mask_sh)\ HWSEQ_DCE10_MASK_SH_LIST(mask_sh),\ HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh),\ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh),\ HWSEQ_PHYPLL_MASK_SH_LIST(mask_sh, CRTC0_)#define HWSEQ_GFX9_DCHUB_MASK_SH_LIST (mask_sh)\
@@ -416,7 +420,8 @@ struct dce_hwseq_registers {SF (DCHUB_AGP_BASE ,AGP_BASE , mask_sh),\SF (DCHUB_AGP_BOT ,AGP_BOT , mask_sh),\SF (DCHUB_AGP_TOP ,AGP_TOP , mask_sh), \ - HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh) + HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh)#define HWSEQ_DCE12_MASK_SH_LIST (mask_sh)\ HWSEQ_DCEF_MASK_SH_LIST(mask_sh, DCFE0_DCFE_),\
@@ -424,7 +429,8 @@ struct dce_hwseq_registers {HWSEQ_PIXEL_RATE_MASK_SH_LIST (mask_sh,CRTC0_ ),\HWSEQ_PHYPLL_MASK_SH_LIST (mask_sh,CRTC0_ ),\HWSEQ_GFX9_DCHUB_MASK_SH_LIST (mask_sh), \ - HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh) + HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh)#define HWSEQ_DCN_MASK_SH_LIST (mask_sh)\ HWSEQ_PIXEL_RATE_MASK_SH_LIST(mask_sh, OTG0_),\
@@ -489,7 +495,8 @@ struct dce_hwseq_registers { HWS_SF(, DOMAIN6_PG_STATUS, DOMAIN6_PGFSM_PWR_STATUS, mask_sh), \ HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \ HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \ - HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh) + HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ + HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh)#define HWSEQ_REG_FIELD_LIST (type) \ type DCFE_CLOCK_ENABLE; \
@@ -520,7 +527,8 @@ struct dce_hwseq_registers {type LOGICAL_ADDR ; \type ENABLE_L1_TLB ;\type SYSTEM_ACCESS_MODE ;\ -type LVTMA_BLON ; +type LVTMA_BLON ;\ +type LVTMA_PWRSEQ_TARGET_STATE_R ;#define HWSEQ_DCN_REG_FIELD_LIST (type) \ type VUPDATE_NO_LOCK_EVENT_CLEAR; \
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +2 -169
201 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +0 -8
@@ -114,10 +114,6 @@ struct dce110_link_enc_hpd_registers { };struct dce110_link_enc_registers { -/* Backlight registers */ -uint32_t LVTMA_PWRSEQ_CNTL; -uint32_t LVTMA_PWRSEQ_STATE; -/* DMCU registers */ uint32_t MASTER_COMM_DATA_REG1;uint32_t MASTER_COMM_DATA_REG2;
@@ -250,10 +246,6 @@ void dce110_link_encoder_update_mst_stream_allocation_table(struct link_encoder *enc, const struct link_mst_stream_allocation_table *table); -void dce110_link_encoder_edp_power_control ( -struct link_encoder *enc, -bool power_up); - void dce110_link_encoder_connect_dig_be_to_fe( struct link_encoder *enc, enum engine_id engine,
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +146 -9
227 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +5 -1
@@ -69,7 +69,11 @@ uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context);void dp_receiver_power_ctrl (struct dc_link *link,bool on); -void hwss_blacklight_control ( +void hwss_edp_power_control ( +struct link_encoder *enc, +bool power_up); + +void hwss_edp_backlight_control (struct dc_link *link,bool enable);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -1
@@ -2903,7 +2903,8 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect, .ready_shared_resources = ready_shared_resources, .optimize_shared_resources = optimize_shared_resources, - .backlight_control = hwss_blacklight_control + .edp_backlight_control = hwss_edp_backlight_control, + .edp_power_control = hwss_edp_power_control };
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +0 -2
@@ -123,8 +123,6 @@ struct link_encoder_funcs { bool exit_link_training_required);void (*psr_program_secondary_packet)(struct link_encoder *enc,unsigned int sdp_transmit_line_num_deadline); -void (*power_control) (struct link_encoder *enc, -bool power_up);void (*connect_dig_be_to_fe)(struct link_encoder *enc,enum engine_id engine,bool connect);
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +5 -2
@@ -28,6 +28,7 @@#include "dc_types.h" #include "clock_source.h" #include "inc/hw/timing_generator.h" +#include "inc/hw/link_encoder.h" #include "core_status.h" enum pipe_gating_control {
@@ -176,8 +177,10 @@ struct hw_sequencer_funcs {void (*ready_shared_resources)(struct dc *dc,struct dc_state *context);void (*optimize_shared_resources)(struct dc *dc); - -void (*backlight_control)( +void (*edp_power_control)( +struct link_encoder *enc, +bool enable); +void (*edp_backlight_control)(struct dc_link *link,bool enable); };
drivers/gpu/drm/amd/display/dc/inc/link_hwss.h +4 -0
@@ -40,6 +40,10 @@ enum dc_status core_link_write_dpcd(const uint8_t *data, uint32_t size); +struct gpio *get_hpd_gpio (struct dc_bios *dcb, +struct graphics_object_id link_id, +struct gpio_service *gpio_service); + void dp_enable_link_phy( struct dc_link *link, enum signal_type signal,
drivers/gpu/drm/amd/display/dc/virtual/virtual_link_encoder.c +0 -5
@@ -73,10 +73,6 @@ static void virtual_link_encoder_update_mst_stream_allocation_table( struct link_encoder *enc, const struct link_mst_stream_allocation_table *table) {} -static void virtual_link_encoder_edp_power_control ( -struct link_encoder *enc, -bool power_up) {} - static void virtual_link_encoder_connect_dig_be_to_fe( struct link_encoder *enc, enum engine_id engine,
@@ -102,7 +98,6 @@ static const struct link_encoder_funcs virtual_lnk_enc_funcs = { .dp_set_phy_pattern = virtual_link_encoder_dp_set_phy_pattern, .update_mst_stream_allocation_table = virtual_link_encoder_update_mst_stream_allocation_table, - .power_control = virtual_link_encoder_edp_power_control, .connect_dig_be_to_fe = virtual_link_encoder_connect_dig_be_to_fe, .destroy = virtual_link_encoder_destroy };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 45/103 drm/amd/display: align DCLK to voltage level
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
in past program SMU will use all voltage headroom. RV does not
if DAL need higher voltage for DCFCLK or DISPCLK, also increase FCLK to improve stutter as voltage is already
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + 3 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +4 -0
@@ -1049,6 +1049,10 @@ bool dcn_validate_bandwidth(else bw_consumed = v->fabric_and_dram_bandwidth_vmax0p9; +if (bw_consumed < v->fabric_and_dram_bandwidth) +if (dc->debug.voltage_align_fclk) + bw_consumed = v->fabric_and_dram_bandwidth; +display_pipe_configuration (v);calc_wm_sets_and_perf_params (context, v); context->bw.dcn.calc_clk.fclk_khz = (int)(bw_consumed * 1000000 /
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -188,6 +188,7 @@ struct dc_debug {enum dcc_option disable_dcc;enum pipe_split_policy pipe_split_policy;bool force_single_disp_pipe_split; +bool voltage_align_fclk;bool disable_dfs_bypass;bool disable_dpp_power_gate;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
@@ -428,6 +428,7 @@ static const struct dc_debug debug_defaults_drv = { .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, .disable_dcc = DCC_ENABLE, + .voltage_align_fclk = true, };static const struct dc_debug debug_defaults_diags = {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 46/103 drm/amd/display: disconnect on HPD low even if edid is the same
In reply to a message not in the archiveFrom: Wenjing Liu <[email protected]>
[Description]
There are many occasions we need to retrieve sink capability and notify connectivity change to os even if edid is not changed on a HPD toggle.
(HDMI2.0 display needs re-enable link on every hpd, display changes other capability outside from edid
need to be queried again and possibly reset the mode, etc.)
In these cases we cannot keep the same sink without letting DM know.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 42 ++++++--------------------- 1 file changed, 9 insertions(+), 33 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +9 -33
@@ -566,6 +566,8 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) link->local_sink)return true; +link_disconnect_sink (link); +if (new_connection_type != dc_connection_none) { link->type = new_connection_type;
@@ -656,28 +658,15 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)return false; } -if (link->local_sink) { - edid_status =dm_helpers_read_local_edid ( - link->ctx, - link, - sink); + sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock; + sink->converter_disable_audio = converter_disable_audio; -if (edid_status ==EDID_OK ) { -// Edid is not the same, to update the local sink with new sink. - sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock; - sink->converter_disable_audio = converter_disable_audio; - link->local_sink = sink; - } - }else { - sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock; - sink->converter_disable_audio = converter_disable_audio; - link->local_sink = sink; + link->local_sink = sink; - edid_status =dm_helpers_read_local_edid ( + edid_status =dm_helpers_read_local_edid ( link->ctx, link, sink); - }switch (edid_status) {case EDID_BAD_CHECKSUM :
@@ -758,28 +747,15 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)if (link->type == dc_connection_mst_branch) {LINK_INFO ("link=%d, mst branch is now Disconnected\n" , link->link_index); +dm_helpers_dp_mst_stop_top_mgr (link->ctx, link); link->mst_stream_alloc_table.stream_count =0 ;memset (link->mst_stream_alloc_table.stream_allocations,0 ,sizeof (link->mst_stream_alloc_table.stream_allocations)); } -if (link->local_sink) { - sink = link->local_sink; - edid_status =dm_helpers_read_local_edid ( - link->ctx, - link, - sink); -if (edid_status !=EDID_OK && edid_status !=EDID_THE_SAME ) { -link_disconnect_sink (link); - link->type = dc_connection_none; - sink_caps.signal =SIGNAL_TYPE_NONE ; - } - }else { -link_disconnect_sink (link); - link->type = dc_connection_none; - sink_caps.signal =SIGNAL_TYPE_NONE ; - } + link->type = dc_connection_none; + sink_caps.signal =SIGNAL_TYPE_NONE ; } LINK_INFO("link=%d, dc_sink_in=%p is now %s\n",
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 47/103 drm/amd/display: Add override for reporting wm ranges
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
For verification of watermark select with SMU team, proper implementation will follow
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 47 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 6 +++ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + 4 files changed, 57 insertions(+)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +47 -0
@@ -1441,6 +1441,53 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc) ranges.writer_wm_sets[3 ].min_drain_clk_khz = max_fclk_khz; ranges.writer_wm_sets[3 ].max_drain_clk_khz = max_fclk_khz; +if (dc->debug.pplib_wm_report_mode ==WM_REPORT_OVERRIDE ) { + ranges.reader_wm_sets[0 ].wm_inst =WM_A ; + ranges.reader_wm_sets[0 ].min_drain_clk_khz =300000 ; + ranges.reader_wm_sets[0 ].max_drain_clk_khz =654000 ; + ranges.reader_wm_sets[0 ].min_fill_clk_khz =800000 ; + ranges.reader_wm_sets[0 ].max_fill_clk_khz =800000 ; + ranges.writer_wm_sets[0 ].wm_inst =WM_A ; + ranges.writer_wm_sets[0 ].min_fill_clk_khz =200000 ; + ranges.writer_wm_sets[0 ].max_fill_clk_khz =757000 ; + ranges.writer_wm_sets[0 ].min_drain_clk_khz =800000 ; + ranges.writer_wm_sets[0 ].max_drain_clk_khz =800000 ; + + ranges.reader_wm_sets[1 ].wm_inst =WM_B ; + ranges.reader_wm_sets[1 ].min_drain_clk_khz =300000 ; + ranges.reader_wm_sets[1 ].max_drain_clk_khz =654000 ; + ranges.reader_wm_sets[1 ].min_fill_clk_khz =933000 ; + ranges.reader_wm_sets[1 ].max_fill_clk_khz =933000 ; + ranges.writer_wm_sets[1 ].wm_inst =WM_B ; + ranges.writer_wm_sets[1 ].min_fill_clk_khz =200000 ; + ranges.writer_wm_sets[1 ].max_fill_clk_khz =757000 ; + ranges.writer_wm_sets[1 ].min_drain_clk_khz =933000 ; + ranges.writer_wm_sets[1 ].max_drain_clk_khz =933000 ; + + + ranges.reader_wm_sets[2 ].wm_inst =WM_C ; + ranges.reader_wm_sets[2 ].min_drain_clk_khz =300000 ; + ranges.reader_wm_sets[2 ].max_drain_clk_khz =654000 ; + ranges.reader_wm_sets[2 ].min_fill_clk_khz =1067000 ; + ranges.reader_wm_sets[2 ].max_fill_clk_khz =1067000 ; + ranges.writer_wm_sets[2 ].wm_inst =WM_C ; + ranges.writer_wm_sets[2 ].min_fill_clk_khz =200000 ; + ranges.writer_wm_sets[2 ].max_fill_clk_khz =757000 ; + ranges.writer_wm_sets[2 ].min_drain_clk_khz =1067000 ; + ranges.writer_wm_sets[2 ].max_drain_clk_khz =1067000 ; + + ranges.reader_wm_sets[3 ].wm_inst =WM_D ; + ranges.reader_wm_sets[3 ].min_drain_clk_khz =300000 ; + ranges.reader_wm_sets[3 ].max_drain_clk_khz =654000 ; + ranges.reader_wm_sets[3 ].min_fill_clk_khz =1200000 ; + ranges.reader_wm_sets[3 ].max_fill_clk_khz =1200000 ; + ranges.writer_wm_sets[3 ].wm_inst =WM_D ; + ranges.writer_wm_sets[3 ].min_fill_clk_khz =200000 ; + ranges.writer_wm_sets[3 ].max_fill_clk_khz =757000 ; + ranges.writer_wm_sets[3 ].min_drain_clk_khz =1200000 ; + ranges.writer_wm_sets[3 ].max_drain_clk_khz =1200000 ; + } +/* Notify PP Lib/SMU which Watermarks to use for which clock ranges */ pp->set_wm_ranges (&pp->pp_smu, &ranges); }
drivers/gpu/drm/amd/display/dc/dc.h +6 -0
@@ -173,6 +173,11 @@ enum pipe_split_policy { MPC_SPLIT_AVOID_MULT_DISP = 2, }; +enum wm_report_mode { +WM_REPORT_DEFAULT =0 , +WM_REPORT_OVERRIDE =1 , +}; +struct dc_debug {bool surface_visual_confirm;bool sanity_checks;
@@ -194,6 +199,7 @@ struct dc_debug {bool disable_dpp_power_gate;bool disable_hubp_power_gate;bool disable_pplib_wm_range; +enum wm_report_mode pplib_wm_report_mode;bool use_dml_wm;unsigned int min_disp_clk_khz;int sr_exit_time_dpm0_ns;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -0
@@ -2451,6 +2451,9 @@ static void optimize_shared_resources(struct dc *dc)/* S0i2 message */ dcn10_pplib_apply_display_requirements (dc, dc->current_state); } + +if (dc->debug.pplib_wm_report_mode ==WM_REPORT_OVERRIDE ) +dcn_bw_notify_pplib_of_wm_ranges (dc); }static void ready_shared_resources (struct dc *dc,struct dc_state *context)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
@@ -424,6 +424,7 @@ static const struct dc_debug debug_defaults_drv = { .disable_pplib_clock_request = true, .disable_pplib_wm_range = false, + .pplib_wm_report_mode = WM_REPORT_DEFAULT, .use_dml_wm = false, .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 48/103 drm/amd/display: soc_bound_box -update DML based on HW.
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/soc_bounding_box.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/soc_bounding_box.c +1 -2
@@ -67,7 +67,6 @@ double dml_socbb_return_bw_mhz(struct _vcs_dpi_soc_bounding_box_st *box, enum vo return_bw =dml_min ( ((double ) box->return_bus_width_bytes) * state.dcfclk_mhz, - state.dram_bw_per_chan_gbps *1000.0 * (double ) box->num_chans - * box->ideal_dram_bw_after_urgent_percent /100.0 ); + state.dram_bw_per_chan_gbps *1000.0 * box->ideal_dram_bw_after_urgent_percent /100.0 );return return_bw; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 49/103 drm/amd/display: Expose some mem_input functions for reuse
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 1 - .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 26 +++++----- .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 60 ++++++++++++++++++++++ 3 files changed, 73 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +0 -1
@@ -113,7 +113,6 @@SRI (FORMAT_CONTROL ,CNVC_CFG , id), \SRI (CNVC_SURFACE_PIXEL_FORMAT ,CNVC_CFG , id), \SRI (CURSOR0_CONTROL ,CNVC_CUR , id), \ -SRI (CURSOR0_CONTROL ,CNVC_CUR , id), \SRI (CURSOR0_COLOR0 ,CNVC_CUR , id), \SRI (CURSOR0_COLOR1 ,CNVC_CUR , id)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +13 -13
@@ -38,7 +38,7 @@#define FN (reg_name, field_name) \ mi->mi_shift->field_name, mi->mi_mask->field_name -static void min10_set_blank (struct mem_input *mem_input,bool blank) +void min10_set_blank (struct mem_input *mem_input,bool blank) {struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);uint32_t blank_en = blank ?1 :0 ;
@@ -87,7 +87,7 @@ static void min10_vready_workaround(struct mem_input *mem_input,REG_WRITE (HUBPREQ_DEBUG_DB , value); } -static void min10_program_tiling ( +void min10_program_tiling (struct dcn10_mem_input *mi,const union dc_tiling_info *info,const enum surface_pixel_format pixel_format)
@@ -107,7 +107,7 @@ static void min10_program_tiling( PIPE_ALIGNED, info->gfx9.pipe_aligned); } -static void min10_program_size_and_rotation( +void min10_program_size_and_rotation( struct dcn10_mem_input *mi, enum dc_rotation_angle rotation, enum surface_pixel_format format,
@@ -169,7 +169,7 @@ static void min10_program_size_and_rotation( H_MIRROR_EN, mirror); } -static void min10_program_pixel_format ( +void min10_program_pixel_format (struct dcn10_mem_input *mi,enum surface_pixel_format format) {
@@ -245,7 +245,7 @@ static void min10_program_pixel_format(/* don't see the need of program the xbar in DCN 1.0 */ } -static bool min10_program_surface_flip_and_addr ( +bool min10_program_surface_flip_and_addr (struct mem_input *mem_input,const struct dc_plane_address *address,bool flip_immediate)
@@ -395,7 +395,7 @@ static bool min10_program_surface_flip_and_addr(return true; } -static void min10_dcc_control (struct mem_input *mem_input,bool enable, +void min10_dcc_control (struct mem_input *mem_input,bool enable,bool independent_64b_blks) {uint32_t dcc_en = enable ?1 :0 ;
@@ -425,7 +425,7 @@ static void min10_program_surface_config(min10_program_pixel_format (mi, format); } -static void min10_program_requestor ( +void min10_program_requestor (struct mem_input *mem_input,struct _vcs_dpi_display_rq_regs_st *rq_regs) {
@@ -459,7 +459,7 @@ static void min10_program_requestor( } -static void min10_program_deadline ( +void min10_program_deadline (struct mem_input *mem_input,struct _vcs_dpi_display_dlg_regs_st *dlg_attr,struct _vcs_dpi_display_ttu_regs_st *ttu_attr)
@@ -595,7 +595,7 @@ static void min10_setup(min10_vready_workaround (mem_input, pipe_dest); } -static void min10_program_display_marks( +void min10_program_display_marks( struct mem_input *mem_input, struct dce_watermarks nbp, struct dce_watermarks stutter,
@@ -607,7 +607,7 @@ static void min10_program_display_marks(*/ } -static bool min10_is_flip_pending (struct mem_input *mem_input) +bool min10_is_flip_pending (struct mem_input *mem_input) {uint32_t flip_pending =0 ;struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);
@@ -696,7 +696,7 @@ static void min10_set_vm_context0_settings(struct mem_input *mem_input, SYSTEM_ACCESS_MODE, 3); } -static void min_set_viewport ( +void min_set_viewport (struct mem_input *mem_input,const struct rect *viewport,const struct rect *viewport_c)
@@ -845,7 +845,7 @@ static enum cursor_lines_per_chunk ippn10_get_lines_per_chunk(return line_per_chunk; } -static void ippn10_cursor_set_attributes ( +void ippn10_cursor_set_attributes (struct mem_input *mem_input,const struct dc_cursor_attributes *attr) {
@@ -873,7 +873,7 @@ static void ippn10_cursor_set_attributes( attr->color_format); } -static void ippn10_cursor_set_position ( +void ippn10_cursor_set_position (struct mem_input *mem_input,const struct dc_cursor_position *pos,const struct dc_cursor_mi_param *param)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +60 -0
72 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 50/103 drm/amd/display: Restructuring and cleaning up DML
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- .../gpu/drm/amd/display/dc/calcs/dcn_calc_math.c | 16 + drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 103 +- drivers/gpu/drm/amd/display/dc/dc.h | 1 - .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 5 +- drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +- drivers/gpu/drm/amd/display/dc/dml/dc_features.h | 2 + .../drm/amd/display/dc/dml/display_mode_enums.h | 52 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.c | 7 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.h | 8 +- .../drm/amd/display/dc/dml/display_mode_structs.h | 898 +++--- .../drm/amd/display/dc/dml/display_mode_support.c | 2326 -------------- .../drm/amd/display/dc/dml/display_mode_support.h | 199 -- .../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 3263 ++++++++++++++++++++ .../gpu/drm/amd/display/dc/dml/display_mode_vba.h | 410 +++ .../drm/amd/display/dc/dml/display_pipe_clocks.c | 377 +-- .../drm/amd/display/dc/dml/display_pipe_clocks.h | 8 +- .../drm/amd/display/dc/dml/display_rq_dlg_calc.c | 2457 ++++++--------- .../drm/amd/display/dc/dml/display_rq_dlg_calc.h | 151 +- .../amd/display/dc/dml/display_rq_dlg_helpers.c | 482 +-- .../amd/display/dc/dml/display_rq_dlg_helpers.h | 41 +- .../gpu/drm/amd/display/dc/dml/display_watermark.c | 1281 -------- .../gpu/drm/amd/display/dc/dml/display_watermark.h | 98 - .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 1903 ++++++++++++ .../amd/display/dc/dml/dml1_display_rq_dlg_calc.h | 67 + .../gpu/drm/amd/display/dc/dml/dml_common_defs.c | 12 +- .../gpu/drm/amd/display/dc/dml/dml_common_defs.h | 8 +- .../gpu/drm/amd/display/dc/dml/soc_bounding_box.c | 48 +- .../gpu/drm/amd/display/dc/dml/soc_bounding_box.h | 9 +- 28 files changed, 7658 insertions(+), 6582 deletions(-) delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.c delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.h create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.c delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.h create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.h
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c +16 -0
@@ -27,20 +27,36 @@float dcn_bw_mod (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 - arg1 * ((int ) (arg1 / arg2)); }float dcn_bw_min2 (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 < arg2 ? arg1 : arg2; }unsigned int dcn_bw_max (const unsigned int arg1,const unsigned int arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 > arg2 ? arg1 : arg2; }float dcn_bw_max2 (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 > arg2 ? arg1 : arg2; }
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +3 -100
127 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -200,7 +200,6 @@ struct dc_debug {bool disable_hubp_power_gate;bool disable_pplib_wm_range;enum wm_report_mode pplib_wm_report_mode; -bool use_dml_wm;unsigned int min_disp_clk_khz;int sr_exit_time_dpm0_ns;int sr_enter_plus_exit_time_dpm0_ns;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -4
@@ -425,8 +425,6 @@ static const struct dc_debug debug_defaults_drv = { .disable_pplib_clock_request = true, .disable_pplib_wm_range = false, .pplib_wm_report_mode = WM_REPORT_DEFAULT, - .use_dml_wm = false, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, .disable_dcc = DCC_ENABLE, .voltage_align_fclk = true,
@@ -439,8 +437,7 @@ static const struct dc_debug debug_defaults_diags = { .clock_trace = true, .disable_stutter = true, .disable_pplib_clock_request = true, - .disable_pplib_wm_range = true, - .use_dml_wm = false, + .disable_pplib_wm_range = true };static void dcn10_dpp_destroy (struct transform **xfm)
drivers/gpu/drm/amd/display/dc/dml/Makefile +4 -4
@@ -3,19 +3,19 @@ # It provides the general basic services required by other DAL # subcomponents. +CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4 +CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4 -CFLAGS_display_watermark.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4 -CFLAGS_display_mode_support.o := -mhard-float -msse -mpreferred-stack-boundary=4 DML = display_mode_lib.o display_pipe_clocks.o display_rq_dlg_calc.o \ - display_rq_dlg_helpers.o display_watermark.o \ - soc_bounding_box.o dml_common_defs.o display_mode_support.o + display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \ + soc_bounding_box.o dml_common_defs.o display_mode_vba.o AMD_DAL_DML = $(addprefix $(AMDDALPATH)/dc/dml/,$(DML))
drivers/gpu/drm/amd/display/dc/dml/dc_features.h +2 -0
@@ -25,9 +25,11 @@#ifndef __DC_FEATURES_H__#define __DC_FEATURES_H__ +// local features #define DC__PRESENT 1#define DC__PRESENT__1 1#define DC__NUM_DPP 4 +#define DC__VOLTAGE_STATES 7#define DC__NUM_DPP__4 1#define DC__NUM_DPP__0_PRESENT 1#define DC__NUM_DPP__1_PRESENT 1
drivers/gpu/drm/amd/display/dc/dml/display_mode_enums.h +24 -28
84 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c +2 -5
@@ -24,6 +24,7 @@*/ #include "display_mode_lib.h" +#include "dc_features.h" static void set_soc_bounding_box (struct _vcs_dpi_soc_bounding_box_st *soc,enum dml_project project) {
@@ -128,11 +129,7 @@ static void set_ip_params(struct _vcs_dpi_ip_params_st *ip, enum dml_project prostatic void set_mode_evaluation (struct _vcs_dpi_mode_evaluation_st *me,enum dml_project project) { -if (project ==DML_PROJECT_RAVEN1 ) { - me->voltage_override = dm_vmin; - }else { -BREAK_TO_DEBUGGER ();/* Invalid Project Specified */ - } + me->voltage_override = dm_vmin; }void dml_init_instance (struct display_mode_lib *lib,enum dml_project project)
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.h +4 -4
@@ -25,12 +25,13 @@#ifndef __DISPLAY_MODE_LIB_H__#define __DISPLAY_MODE_LIB_H__ +#include "dml_common_defs.h" #include "soc_bounding_box.h" -#include "display_watermark.h" +#include "display_mode_vba.h" #include "display_pipe_clocks.h" #include "display_rq_dlg_calc.h" -#include "display_mode_support.h" +#include "dml1_display_rq_dlg_calc.h" enum dml_project { DML_PROJECT_UNDEFINED,
@@ -42,8 +43,7 @@ struct display_mode_lib {struct _vcs_dpi_soc_bounding_box_st soc;struct _vcs_dpi_mode_evaluation_st me;enum dml_project project; -struct dml_ms_internal_vars vars; -struct _vcs_dpi_wm_calc_pipe_params_st wm_param[DC__NUM_PIPES__MAX ]; +struct vba_vars_st vba;struct dal_logger *logger; };
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +512 -386
917 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_support.c deleted +0 -2326
1,735 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_support.h deleted +0 -199
199 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c new file +3263 -0
3,263 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h new file +410 -0
410 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_pipe_clocks.c +58 -319
377 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_pipe_clocks.h +2 -6
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.c +982 -1475
2,457 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.h +80 -71
151 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_helpers.c +277 -205
482 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_helpers.h +11 -30
41 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_watermark.c deleted +0 -1281
1,281 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_watermark.h deleted +0 -98
98 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c new file +1903 -0
1,903 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.h new file +67 -0
67 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.h +5 -3
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml/soc_bounding_box.c +22 -26
48 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/soc_bounding_box.h +4 -5
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Part of the diff is not shown here. View the raw message.
A message that is not in the archive (sent off-list or not yet received): 20171010224112.3023-51-harry.wentland-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 050/103] drm/amd/display: Restructuring and cleaning up DML
Quoted 75 lines · Harry Wentland
From: Dmytro Laktyushkin <[email protected]>
Signed-off-by Dmytro Laktyushkin <[email protected]>Reviewed-by Tony Cheng <[email protected]>Acked-by Harry Wentland <[email protected]>--- .../gpu/drm/amd/display/dc/calcs/dcn_calc_math.c | 16 + drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 103 +- drivers/gpu/drm/amd/display/dc/dc.h | 1 - .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 5 +- drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +- drivers/gpu/drm/amd/display/dc/dml/dc_features.h | 2 + .../drm/amd/display/dc/dml/display_mode_enums.h | 52 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.c | 7 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.h | 8 +- .../drm/amd/display/dc/dml/display_mode_structs.h | 898 +++--- .../drm/amd/display/dc/dml/display_mode_support.c | 2326 -------------- .../drm/amd/display/dc/dml/display_mode_support.h | 199 -- .../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 3263 ++++++++++++++++++++ .../gpu/drm/amd/display/dc/dml/display_mode_vba.h | 410 +++ .../drm/amd/display/dc/dml/display_pipe_clocks.c | 377 +-- .../drm/amd/display/dc/dml/display_pipe_clocks.h | 8 +- .../drm/amd/display/dc/dml/display_rq_dlg_calc.c | 2457 ++++++--------- .../drm/amd/display/dc/dml/display_rq_dlg_calc.h | 151 +- .../amd/display/dc/dml/display_rq_dlg_helpers.c | 482 +-- .../amd/display/dc/dml/display_rq_dlg_helpers.h | 41 +- .../gpu/drm/amd/display/dc/dml/display_watermark.c | 1281 -------- .../gpu/drm/amd/display/dc/dml/display_watermark.h | 98 - .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 1903 ++++++++++++ .../amd/display/dc/dml/dml1_display_rq_dlg_calc.h | 67 + .../gpu/drm/amd/display/dc/dml/dml_common_defs.c | 12 +- .../gpu/drm/amd/display/dc/dml/dml_common_defs.h | 8 +- .../gpu/drm/amd/display/dc/dml/soc_bounding_box.c | 48 +- .../gpu/drm/amd/display/dc/dml/soc_bounding_box.h | 9 +- 28 files changed, 7658 insertions(+), 6582 deletions(-) delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.c delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.h create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.c delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.h create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.hdrivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c +12
-0@@ -27,20 +27,36 @@float dcn_bw_mod (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 - arg1 * ((int ) (arg1 / arg2)); }float dcn_bw_min2 (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 < arg2 ? arg1 : arg2; }unsigned int dcn_bw_max (const unsigned int arg1,const unsigned int arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 > arg2 ? arg1 : arg2;
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c line 62
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c +4
-0}float dcn_bw_max2 (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 > arg2 ? arg1 : arg2; }
I got this far. Wow none of the added above code makes any sense, step up the internal review please.
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CAPM=9tyvdXzi2KX7LNc_dqZRWSS98TCKABcPs2xXomS9XZZj3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 050/103] drm/amd/display: Restructuring and cleaning up DML
Quoted 81 lines · Dave Airlie
Quoted 80 lines · Harry Wentland
From: Dmytro Laktyushkin <[email protected]>
Signed-off-by Dmytro Laktyushkin <[email protected]>Reviewed-by Tony Cheng <[email protected]>Acked-by Harry Wentland <[email protected]>--- .../gpu/drm/amd/display/dc/calcs/dcn_calc_math.c | 16 + drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 103 +- drivers/gpu/drm/amd/display/dc/dc.h | 1 - .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 5 +- drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +- drivers/gpu/drm/amd/display/dc/dml/dc_features.h | 2 + .../drm/amd/display/dc/dml/display_mode_enums.h | 52 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.c | 7 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.h | 8 +- .../drm/amd/display/dc/dml/display_mode_structs.h | 898 +++--- .../drm/amd/display/dc/dml/display_mode_support.c | 2326 -------------- .../drm/amd/display/dc/dml/display_mode_support.h | 199 -- .../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 3263 ++++++++++++++++++++ .../gpu/drm/amd/display/dc/dml/display_mode_vba.h | 410 +++ .../drm/amd/display/dc/dml/display_pipe_clocks.c | 377 +-- .../drm/amd/display/dc/dml/display_pipe_clocks.h | 8 +- .../drm/amd/display/dc/dml/display_rq_dlg_calc.c | 2457 ++++++--------- .../drm/amd/display/dc/dml/display_rq_dlg_calc.h | 151 +- .../amd/display/dc/dml/display_rq_dlg_helpers.c | 482 +-- .../amd/display/dc/dml/display_rq_dlg_helpers.h | 41 +- .../gpu/drm/amd/display/dc/dml/display_watermark.c | 1281 -------- .../gpu/drm/amd/display/dc/dml/display_watermark.h | 98 - .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 1903 ++++++++++++ .../amd/display/dc/dml/dml1_display_rq_dlg_calc.h | 67 + .../gpu/drm/amd/display/dc/dml/dml_common_defs.c | 12 +- .../gpu/drm/amd/display/dc/dml/dml_common_defs.h | 8 +- .../gpu/drm/amd/display/dc/dml/soc_bounding_box.c | 48 +- .../gpu/drm/amd/display/dc/dml/soc_bounding_box.h | 9 +- 28 files changed, 7658 insertions(+), 6582 deletions(-) delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.c delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_support.h create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.c delete mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_watermark.h create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.hdrivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c +14
-0@@ -27,20 +27,36 @@float dcn_bw_mod (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 - arg1 * ((int ) (arg1 / arg2)); }float dcn_bw_min2 (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 < arg2 ? arg1 : arg2; }unsigned int dcn_bw_max (const unsigned int arg1,const unsigned int arg2) { +if (arg1 != arg1) +return arg2; +if (arg2 != arg2) +return arg1;return arg1 > arg2 ? arg1 : arg2; }float dcn_bw_max2 (const float arg1,const float arg2) { +if (arg1 != arg1) +return arg2;
Quoted 9 lines
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c line 62
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c +2
-0+if (arg2 != arg2) +return arg1;return arg1 > arg2 ? arg1 : arg2; }I got this far. Wow none of the added above code makes any sense, step up the internal review please.
These are NaN checks for floating point math and is the recommended way to check for those. Is there a different recommended way in the kernel?
Unfortunately this is HW magic and we'll need to find a way to deal with it.
Harry
Quoted 2 lines
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 51/103 drm/amd/display: add mode support check to dml vba code
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- .../drm/amd/display/dc/dml/display_mode_enums.h | 10 +- .../drm/amd/display/dc/dml/display_mode_structs.h | 5 + .../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 5701 +++++++++++++++----- .../gpu/drm/amd/display/dc/dml/display_mode_vba.h | 456 +- .../gpu/drm/amd/display/dc/dml/dml_common_defs.c | 12 + .../gpu/drm/amd/display/dc/dml/dml_common_defs.h | 3 + 6 files changed, 4604 insertions(+), 1583 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_enums.h +7 -3
@@ -26,7 +26,7 @@#define __DISPLAY_MODE_ENUMS_H__enum output_encoder_class { - dm_dp =0 , dm_hdmi =1 , dm_wb =2 + dm_dp =0 , dm_hdmi =1 , dm_wb =2 , dm_edp };enum output_format_class { dm_444 =0 , dm_420 =1 , dm_n422, dm_s422
@@ -39,7 +39,9 @@ enum source_format_class { dm_420_10 =4 , dm_422_8 =5 , dm_422_10 =6 , - dm_444_8 =7 + dm_444_8 =7 , + dm_mono_8, + dm_mono_16 };enum output_bpc_class { dm_out_6 = 0, dm_out_8 = 1, dm_out_10 = 2, dm_out_12 = 3, dm_out_16 = 4
@@ -79,7 +81,9 @@ enum dm_swizzle_mode { dm_sw_SPARE_15 =28 , dm_sw_var_s_x =29 , dm_sw_var_d_x =30 , - dm_sw_64kb_r_x + dm_sw_64kb_r_x, + dm_sw_gfx7_2d_thin_lvp, + dm_sw_gfx7_2d_thin_gl };enum lb_depth { dm_lb_10 = 0, dm_lb_8 = 1, dm_lb_6 = 2, dm_lb_12 = 3, dm_lb_16
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +5 -0
@@ -66,6 +66,7 @@ struct _vcs_dpi_mode_evaluation_st {struct _vcs_dpi_voltage_scaling_st {int state; +double dscclk_mhz;double dcfclk_mhz;double socclk_mhz;double dram_speed_mhz;
@@ -131,6 +132,9 @@ struct _vcs_dpi_ip_params_st {unsigned int writeback_chroma_line_buffer_width_pixels;unsigned int max_page_table_levels;unsigned int max_num_dpp; +unsigned int max_num_otg; +unsigned int cursor_chunk_size; +unsigned int cursor_buffer_size;unsigned int max_num_wb;unsigned int max_dchub_pscl_bw_pix_per_clk;unsigned int max_pscl_lb_bw_pix_per_clk;
@@ -224,6 +228,7 @@ struct writeback_st { };struct _vcs_dpi_display_output_params_st { +int dp_lanes;int output_bpp;int dsc_enable;int wb_enable;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +4265 -1436
2,949 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +312 -144
456 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.c +12 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.h +3 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Part of the diff is not shown here. View the raw message.
PATCH 52/103 drm/amd/display: extract global sync params from vba
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- .../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 32 +++++++++++++++------- .../gpu/drm/amd/display/dc/dml/display_mode_vba.h | 3 ++ 2 files changed, 25 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +22 -10
@@ -88,7 +88,10 @@ static bool CalculatePrefetchSchedule(double *VRatioPrefetchC, double *RequiredPrefetchPixDataBW, unsigned int *VStartupRequiredWhenNotEnoughTimeForDynamicMetadata, - double *Tno_bw); + double *Tno_bw, + unsigned int *VUpdateOffsetPix, + unsigned int *VUpdateWidthPix, + unsigned int *VReadyOffsetPix);static double RoundToDFSGranularityUp (double Clock,double VCOSpeed);static double RoundToDFSGranularityDown (double Clock,double VCOSpeed); static double CalculatePrefetchSourceLines(
@@ -264,7 +267,7 @@ unsigned int dml_get_voltage_level(memcpy (mode_lib->vba.cache_pipes, pipes,sizeof (*pipes) * num_pipes); mode_lib->vba.cache_num_pipes = num_pipes; -if (need_recalculate) +if (need_recalculate && pipes[0 ].clks_cfg.dppclk_mhz !=0 )recalculate (mode_lib);else {fetch_socbb_params (mode_lib);
@@ -1066,10 +1069,13 @@ static bool CalculatePrefetchSchedule(double *VRatioPrefetchC, double *RequiredPrefetchPixDataBW, unsigned int *VStartupRequiredWhenNotEnoughTimeForDynamicMetadata, - double *Tno_bw) + double *Tno_bw, + unsigned int *VUpdateOffsetPix, + unsigned int *VUpdateWidthPix, + unsigned int *VReadyOffsetPix) { bool MyError = false; -unsigned int DPPCycles, DISPCLKCycles, VUpdateOffsetPix, VUpdateWidthPix, VReadyOffsetPix; +unsigned int DPPCycles, DISPCLKCycles;double DSTTotalPixelsAfterScaler, TotalRepeaterDelayTime;double Tdm, LineTime, Tsetup;double dst_y_prefetch_equ;
@@ -1110,17 +1116,17 @@ static bool CalculatePrefetchSchedule( *DSTYAfterScaler =dml_floor (DSTTotalPixelsAfterScaler / HTotal,1 ); *DSTXAfterScaler = DSTTotalPixelsAfterScaler - ((double ) (*DSTYAfterScaler * HTotal)); - VUpdateOffsetPix =dml_ceil (HTotal /4.0 ,1 ); + *VUpdateOffsetPix =dml_ceil (HTotal /4.0 ,1 ); TotalRepeaterDelayTime = MaxInterDCNTileRepeaters * (2.0 /DPPCLK +3.0 /DISPCLK ); - VUpdateWidthPix = (14.0 / DCFClkDeepSleep +12.0 /DPPCLK + TotalRepeaterDelayTime) + *VUpdateWidthPix = (14.0 / DCFClkDeepSleep +12.0 /DPPCLK + TotalRepeaterDelayTime) * PixelClock; - VReadyOffsetPix =dml_max ( + *VReadyOffsetPix =dml_max (150.0 /DPPCLK , TotalRepeaterDelayTime +20.0 / DCFClkDeepSleep +10.0 /DPPCLK ) * PixelClock; - Tsetup = (double ) (VUpdateOffsetPix + VUpdateWidthPix + VReadyOffsetPix) / PixelClock; + Tsetup = (double ) (*VUpdateOffsetPix + *VUpdateWidthPix + *VReadyOffsetPix) / PixelClock; LineTime = (double ) HTotal / PixelClock;
@@ -2710,7 +2716,10 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman &mode_lib->vba.VRatioPrefetchC[k], &mode_lib->vba.RequiredPrefetchPixDataBW[k], &mode_lib->vba.VStartupRequiredWhenNotEnoughTimeForDynamicMetadata, - &mode_lib->vba.Tno_bw[k]); + &mode_lib->vba.Tno_bw[k], + &mode_lib->vba.VUpdateOffsetPix[k], + &mode_lib->vba.VUpdateWidthPix[k], + &mode_lib->vba.VReadyOffsetPix[k]);if (mode_lib->vba.BlendingAndTiming[k] == k) { mode_lib->vba.VStartup[k] = dml_min( mode_lib->vba.VStartupLines,
@@ -5805,7 +5814,10 @@ static void ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_ &mode_lib->vba.VRatioPreC[i][k], &mode_lib->vba.RequiredPrefetchPixelDataBW[i][k], &mode_lib->vba.VStartupRequiredWhenNotEnoughTimeForDynamicMetadata, - &mode_lib->vba.Tno_bw[k]); + &mode_lib->vba.Tno_bw[k], + &mode_lib->vba.VUpdateOffsetPix[k], + &mode_lib->vba.VUpdateWidthPix[k], + &mode_lib->vba.VReadyOffsetPix[k]); }for (k =0 ; k <= mode_lib->vba.NumberOfActivePlanes -1 ; k++) { mode_lib->vba.cursor_bw[k] = mode_lib->vba.NumberOfCursors[k]
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +3 -0
@@ -383,6 +383,9 @@ struct vba_vars_st {double DPPCLK_calculated[DC__NUM_DPP__MAX ];unsigned int VStartup[DC__NUM_DPP__MAX ]; +unsigned int VUpdateOffsetPix[DC__NUM_DPP__MAX ]; +unsigned int VUpdateWidthPix[DC__NUM_DPP__MAX ]; +unsigned int VReadyOffsetPix[DC__NUM_DPP__MAX ];unsigned int VStartupRequiredWhenNotEnoughTimeForDynamicMetadata;double ImmediateFlipBW;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 53/103 drm/amd/display: change dml vba cursor count define to correct one
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -1
@@ -633,7 +633,7 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.NumberOfCursors[mode_lib->vba.NumberOfActivePlanes] =0 ;// The DML spreadsheet assumes that the two cursors utilize the same amount of bandwidth. We'll // calculate things a little more accurately -for (k =0 ; k <DC__NUM_CURSOR ; ++k) { +for (k =0 ; k <DC__NUM_CURSOR__MAX ; ++k) {switch (k) {case 0 : mode_lib->vba.CursorBPP[mode_lib->vba.NumberOfActivePlanes][0] =
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +2 -2
@@ -332,8 +332,8 @@ struct vba_vars_st {unsigned int BlendingAndTiming[DC__NUM_DPP__MAX ];bool SynchronizedVBlank;unsigned int NumberOfCursors[DC__NUM_DPP__MAX ]; -unsigned int CursorWidth[DC__NUM_DPP__MAX ][DC__NUM_CURSOR ]; -unsigned int CursorBPP[DC__NUM_DPP__MAX ][DC__NUM_CURSOR ]; +unsigned int CursorWidth[DC__NUM_DPP__MAX ][DC__NUM_CURSOR__MAX ]; +unsigned int CursorBPP[DC__NUM_DPP__MAX ][DC__NUM_CURSOR__MAX ];bool XFCEnabled[DC__NUM_DPP__MAX ];bool ScalerEnabled[DC__NUM_DPP__MAX ];
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 54/103 drm/amd/display: Enable double buffer as per vertical interrupt enabled.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 11 +++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.h | 4 ++++ 2 files changed, 15 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +11 -0
@@ -299,6 +299,17 @@ static void tgn10_program_timing(static void tgn10_unblank_crtc (struct timing_generator *tg) {struct dcn10_timing_generator *tgn10 =DCN10TG_FROM_TG (tg); +uint32_t vertical_interrupt_enable =0 ; + +REG_GET (OTG_VERTICAL_INTERRUPT2_CONTROL , +OTG_VERTICAL_INTERRUPT2_INT_ENABLE , &vertical_interrupt_enable); + +/* temporary work around for vertical interrupt, once vertical interrupt enabled, +* this check will be removed. +*/ +if (vertical_interrupt_enable) +REG_UPDATE (OTG_DOUBLE_BUFFER_CONTROL , +OTG_BLANK_DATA_DOUBLE_BUFFER_EN ,1 ); REG_UPDATE_2(OTG_BLANK_CONTROL, OTG_BLANK_DATA_EN, 0,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.h +4 -0
@@ -65,6 +65,7 @@SRI (OTG_NOM_VERT_POSITION ,OTG , inst),\SRI (OTG_BLACK_COLOR ,OTG , inst),\SRI (OTG_CLOCK_CONTROL ,OTG , inst),\ +SRI (OTG_VERTICAL_INTERRUPT2_CONTROL ,OTG , inst),\SRI (OTG_VERTICAL_INTERRUPT2_POSITION ,OTG , inst),\SRI (OPTC_INPUT_CLOCK_CONTROL ,ODM , inst),\ SRI(OPTC_DATA_SOURCE_SELECT, ODM, inst),\
@@ -117,6 +118,7 @@ struct dcn_tg_registers {uint32_t OTG_TEST_PATTERN_CONTROL ;uint32_t OTG_TEST_PATTERN_COLOR ;uint32_t OTG_CLOCK_CONTROL ; +uint32_t OTG_VERTICAL_INTERRUPT2_CONTROL ;uint32_t OTG_VERTICAL_INTERRUPT2_POSITION ;uint32_t OPTC_INPUT_CLOCK_CONTROL ;uint32_t OPTC_DATA_SOURCE_SELECT ;
@@ -196,6 +198,7 @@ struct dcn_tg_registers {SF (OTG0_OTG_CLOCK_CONTROL ,OTG_CLOCK_EN , mask_sh),\SF (OTG0_OTG_CLOCK_CONTROL ,OTG_CLOCK_ON , mask_sh),\SF (OTG0_OTG_CLOCK_CONTROL ,OTG_CLOCK_GATE_DIS , mask_sh),\ +SF (OTG0_OTG_VERTICAL_INTERRUPT2_CONTROL ,OTG_VERTICAL_INTERRUPT2_INT_ENABLE , mask_sh),\SF (OTG0_OTG_VERTICAL_INTERRUPT2_POSITION ,OTG_VERTICAL_INTERRUPT2_LINE_START , mask_sh),\SF (ODM0_OPTC_INPUT_CLOCK_CONTROL ,OPTC_INPUT_CLK_EN , mask_sh),\ SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_ON, mask_sh),\
@@ -302,6 +305,7 @@ struct dcn_tg_registers {type OTG_CLOCK_EN ;\type OTG_CLOCK_ON ;\type OTG_CLOCK_GATE_DIS ;\ +type OTG_VERTICAL_INTERRUPT2_INT_ENABLE ;\type OTG_VERTICAL_INTERRUPT2_LINE_START ;\type OPTC_INPUT_CLK_EN ;\type OPTC_INPUT_CLK_ON ;\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 55/103 drm/amd/display: wrong VM setting cause invalid DF request from DCN
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
fix typo in register field. we are lucky the shift/mask is the same, no behavior change
add globals to experiment with using different VM settings
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 11 +++++++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +7 -4
@@ -632,6 +632,9 @@ bool min10_is_flip_pending(struct mem_input *mem_input)return false; } +uint32_t aperture_default_system =1 ; +uint32_t context0_default_system;/* = 0;*/ +static void min10_set_vm_system_aperture_settings (struct mem_input *mem_input,struct vm_system_aperture_param *apt) {
@@ -645,7 +648,7 @@ static void min10_set_vm_system_aperture_settings(struct mem_input *mem_input, mc_vm_apt_high.quad_part = apt->sys_high.quad_part >>12 ;REG_SET_2 (DCN_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB ,0 , -MC_VM_SYSTEM_APERTURE_DEFAULT_SYSTEM ,1 ,/* 1 = system physical memory */ +MC_VM_SYSTEM_APERTURE_DEFAULT_SYSTEM , aperture_default_system,/* 1 = system physical memory */ MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB , mc_vm_apt_default.high_part);REG_SET (DCN_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB ,0 ,MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB , mc_vm_apt_default.low_part);
@@ -684,9 +687,9 @@ static void min10_set_vm_context0_settings(struct mem_input *mem_input, VM_CONTEXT0_PAGE_TABLE_END_ADDR_LSB, vm0->pte_end.low_part);/* fault handling */ -REG_SET (DCN_VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB ,0 , -VM_CONTEXT0_PAGE_TABLE_END_ADDR_MSB , vm0->fault_default.high_part); -/* VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_SYSTEM, 0 */ +REG_SET_2 (DCN_VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB ,0 , +VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB , vm0->fault_default.high_part, +VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_SYSTEM , context0_default_system);REG_SET (DCN_VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_LSB ,0 ,VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_LSB , vm0->fault_default.low_part);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +2 -0
@@ -369,6 +369,7 @@ struct dcn_mi_registers {MI_SF (HUBPREQ0_DCN_VM_CONTEXT0_PAGE_TABLE_END_ADDR_MSB ,VM_CONTEXT0_PAGE_TABLE_END_ADDR_MSB , mask_sh),\MI_SF (HUBPREQ0_DCN_VM_CONTEXT0_PAGE_TABLE_END_ADDR_LSB ,VM_CONTEXT0_PAGE_TABLE_END_ADDR_LSB , mask_sh),\MI_SF (HUBPREQ0_DCN_VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB ,VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB , mask_sh),\ +MI_SF (HUBPREQ0_DCN_VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB ,VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_SYSTEM , mask_sh),\MI_SF (HUBPREQ0_DCN_VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_LSB ,VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_LSB , mask_sh),\MI_SF (HUBPREQ0_DCN_VM_SYSTEM_APERTURE_LOW_ADDR_MSB ,MC_VM_SYSTEM_APERTURE_LOW_ADDR_MSB , mask_sh),\ MI_SF(HUBPREQ0_DCN_VM_SYSTEM_APERTURE_LOW_ADDR_LSB, MC_VM_SYSTEM_APERTURE_LOW_ADDR_LSB, mask_sh),\
@@ -522,6 +523,7 @@ struct dcn_mi_registers {type VM_CONTEXT0_PAGE_TABLE_END_ADDR_MSB ;\type VM_CONTEXT0_PAGE_TABLE_END_ADDR_LSB ;\type VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_MSB ;\ +type VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_SYSTEM ;\type VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR_LSB ;\type ENABLE_L1_TLB ;\type SYSTEM_ACCESS_MODE ;\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 56/103 drm/amd/display: Fix hotplug after s3 resume.
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
On S3 resume the HPD6 irq source was not reenabled due to loop boundary bug.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +2 -2
@@ -535,7 +535,7 @@ int amdgpu_dm_irq_resume_early(struct amdgpu_device *adev)DRM_DEBUG_KMS ("DM_IRQ: early resume\n" );/* re-enable short pulse interrupts HW interrupt */ -for (src =DC_IRQ_SOURCE_HPD1RX ; src <DC_IRQ_SOURCE_HPD6RX +1 ; src++) { +for (src =DC_IRQ_SOURCE_HPD1RX ; src <=DC_IRQ_SOURCE_HPD6RX +1 ; src++) { hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; hnd_list_h = &adev->dm.irq_handler_list_high_tab[src];if (!list_empty (hnd_list_l) || !list_empty (hnd_list_h))
@@ -561,7 +561,7 @@ int amdgpu_dm_irq_resume_late(struct amdgpu_device *adev)* Renable HW interrupt for HPD and only since FLIP and VBLANK * will be enabled from manage_dm_interrupts on enable CRTC. */ -for (src =DC_IRQ_SOURCE_HPD1 ; src <DC_IRQ_SOURCE_HPD6 ; src++) { +for (src =DC_IRQ_SOURCE_HPD1 ; src <=DC_IRQ_SOURCE_HPD6 ; src++) { hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; hnd_list_h = &adev->dm.irq_handler_list_high_tab[src];if (!list_empty (hnd_list_l) || !list_empty (hnd_list_h))
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 57/103 drm/amd/display: make FBC configurable option
In reply to a message not in the archiveFrom: Shirish S <[email protected]>
Currently FBC is guarded with ENABLE_FBC macro, which needs to be manually enabled in Makefile.
This patch moves it to Kconfig so that there wont be any need to additional patch to be carried for enabling or disabling on every SoC.
--- drivers/gpu/drm/amd/display/Kconfig | 10 ++++++++++ drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 4 ++-- drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +- .../gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 16 ++++++++-------- drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 4 ++-- 7 files changed, 25 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/Kconfig +10 -0
@@ -9,6 +9,16 @@ config DRM_AMD_DC Will be deprecated when the DC component is upstream. +config DRM_AMD_DC_FBC + bool "AMD FBC - Enable Frame Buffer Compression" + depends on DRM_AMD_DC + help + Choose this option if you want to use frame buffer compression + support. + This is a power optimisation feature, check its availability + on your hardware before enabling this option. + + config DRM_AMD_DC_DCN1_0 bool "DCN 1.0 Raven family" depends on DRM_AMD_DC && X86
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -507,7 +507,7 @@ static bool construct(struct dc *dc, dc_version =resource_parse_asic_id (init_params->asic_id); dc->ctx->dce_version = dc_version; -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC ) dc->ctx->fbc_gpu_addr = init_params->fbc_gpu_addr;#endif /* Resource should construct all asic specific resources.
drivers/gpu/drm/amd/display/dc/dc.h +2 -2
@@ -258,7 +258,7 @@ struct dc {struct dm_pp_display_configuration prev_display_config;/* FBC compressor */ -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )struct compressor *fbc_compressor;#endif };
@@ -293,7 +293,7 @@ struct dc_init_data {struct dc_config flags;uint32_t log_mask; -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )uint64_t fbc_gpu_addr;#endif };
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -1
@@ -92,7 +92,7 @@ struct dc_context {bool created_bios;struct gpio_service *gpio_service;struct i2caux *i2caux; -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )uint64_t fbc_gpu_addr;#endif };
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +1 -1
@@ -514,7 +514,7 @@ void dce110_compressor_construct(struct dce110_compressor *compressor, compressor->base.lpt_channels_num =0 ; compressor->base.attached_inst =0 ; compressor->base.is_enabled = false; -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC ) compressor->base.funcs = &dce110_compressor_funcs;#endif
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +8 -8
@@ -34,7 +34,7 @@#include "dce/dce_hwseq.h" #include "gpio_service_interface.h" -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )#include "dce110_compressor.h" #endif
@@ -1445,7 +1445,7 @@ static void power_down_all_hw_blocks(struct dc *dc)power_down_clock_sources (dc); -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )if (dc->fbc_compressor) dc->fbc_compressor->funcs->disable_fbc (dc->fbc_compressor);#endif
@@ -1618,7 +1618,7 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,if (events->cursor_update) value |=0x2 ; -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC ) value |=0x84 ;#endif
@@ -1748,7 +1748,7 @@ static void apply_min_clocks( } } -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )/* * Check if FBC can be enabled
@@ -1940,7 +1940,7 @@ enum dc_status dce110_apply_ctx_to_hw(set_safe_displaymarks (&context->res_ctx, dc->res_pool); -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )if (dc->fbc_compressor) dc->fbc_compressor->funcs->disable_fbc (dc->fbc_compressor);#endif
@@ -2124,7 +2124,7 @@ enum dc_status dce110_apply_ctx_to_hw( dcb->funcs->set_scratch_critical_state (dcb, false); -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )if (dc->fbc_compressor)enable_fbc (dc, context);
@@ -2533,7 +2533,7 @@ static void init_hw(struct dc *dc) abm->funcs->init_backlight (abm); abm->funcs->abm_init (abm); } -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )if (dc->fbc_compressor) dc->fbc_compressor->funcs->power_up_fbc (dc->fbc_compressor);#endif
@@ -2781,7 +2781,7 @@ static void dce110_program_front_end_for_pipe(program_scaler (dc, pipe_ctx); -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )if (dc->fbc_compressor && old_pipe->stream) {if (plane_state->tiling_info.gfx8.array_mode ==DC_ARRAY_LINEAR_GENERAL ) dc->fbc_compressor->funcs->disable_fbc (dc->fbc_compressor);
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +2 -2
@@ -52,7 +52,7 @@#include "dce/dce_abm.h" #include "dce/dce_dmcu.h" -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC )#include "dce110/dce110_compressor.h" #endif
@@ -1279,7 +1279,7 @@ static bool construct( } } -#ifdef ENABLE_FBC +#if defined(CONFIG_DRM_AMD_DC_FBC ) dc->fbc_compressor =dce110_compressor_create (ctx);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 58/103 drm/amd/display: Program front end first when set mode.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 27 ++++++++++++++-------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 5 ++-- 2 files changed, 20 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +17 -10
@@ -763,16 +763,6 @@ static bool dc_commit_state_no_check(struct dc *dc, struct dc_state *context)if (!dcb->funcs->is_accelerated_mode (dcb)) dc->hwss.enable_accelerated_mode (dc); - dc->hwss.ready_shared_resources (dc, context); - -for (i =0 ; i < dc->res_pool->pipe_count; i++) { - pipe = &context->res_ctx.pipe_ctx[i]; - dc->hwss.wait_for_mpcc_disconnect (dc, dc->res_pool, pipe); - } - result = dc->hwss.apply_ctx_to_hw (dc, context); - -program_timing_sync (dc, context); -for (i =0 ; i < context->stream_count; i++) {const struct dc_sink *sink = context->streams[i]->sink;
@@ -798,6 +788,13 @@ static bool dc_commit_state_no_check(struct dc *dc, struct dc_state *context) } } +for (j =0 ; j <MAX_PIPES ; j++) { + pipe = &context->res_ctx.pipe_ctx[j]; + +if (!pipe->top_pipe && pipe->stream == context->streams[i]) + dc->hwss.pipe_control_lock (dc, pipe, false); + } + CONN_MSG_MODE(sink->link, "{%dx%d, %dx%d@%dKhz}", context->streams[i]->timing.h_addressable, context->streams[i]->timing.v_addressable,
@@ -806,6 +803,16 @@ static bool dc_commit_state_no_check(struct dc *dc, struct dc_state *context) context->streams[i]->timing.pix_clk_khz); } + dc->hwss.ready_shared_resources (dc, context); + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { + pipe = &context->res_ctx.pipe_ctx[i]; + dc->hwss.wait_for_mpcc_disconnect (dc, dc->res_pool, pipe); + } + result = dc->hwss.apply_ctx_to_hw (dc, context); + +program_timing_sync (dc, context); +dc_enable_stereo (dc, context, dc_streams, context->stream_count);dc_release_state (dc->current_state);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -2
@@ -2283,8 +2283,6 @@ static void update_dchubp_dpp(*/ REG_UPDATE (DCHUBP_CNTL [pipe_ctx->pipe_idx],HUBP_VTG_SEL , pipe_ctx->stream_res.tg->inst); - dc->hwss.update_plane_addr (dc, pipe_ctx); - mi->funcs->mem_input_setup( mi, &pipe_ctx->dlg_regs,
@@ -2353,6 +2351,8 @@ static void update_dchubp_dpp( &plane_state->dcc, plane_state->horizontal_mirror); + dc->hwss.update_plane_addr (dc, pipe_ctx); +if (is_pipe_tree_visible (pipe_ctx)) mi->funcs->set_blank (mi, false); }
@@ -2556,6 +2556,7 @@ static void dcn10_apply_ctx_for_surface( old_pipe_ctx->top_pipe =NULL ; old_pipe_ctx->bottom_pipe =NULL ; old_pipe_ctx->plane_state =NULL ; + old_pipe_ctx->stream =NULL ; dm_logger_write(dc->ctx->logger, LOG_DC, "Reset mpcc for pipe %d\n",
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 59/103 drm/amd/display: audio dynamic resource acquired related
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++-- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 24 ++++++++++++++++------ drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../amd/display/dc/dce110/dce110_hw_sequencer.c | 12 +++++++++-- .../amd/display/dc/dce110/dce110_hw_sequencer.h | 2 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 7 ++++++- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 3 ++- drivers/gpu/drm/amd/display/dc/inc/resource.h | 5 +++++ 10 files changed, 47 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
@@ -2323,14 +2323,14 @@ void core_link_enable_stream(allocate_mst_payload (pipe_ctx); } -void core_link_disable_stream (struct pipe_ctx *pipe_ctx) +void core_link_disable_stream (struct pipe_ctx *pipe_ctx,int option) {struct dc *core_dc = pipe_ctx->stream->ctx->dc;if (pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST )deallocate_mst_payload (pipe_ctx); - core_dc->hwss.disable_stream (pipe_ctx); + core_dc->hwss.disable_stream (pipe_ctx, option);disable_link (pipe_ctx->stream->sink->link, pipe_ctx->stream->signal); }
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +1 -1
@@ -282,7 +282,7 @@ void dp_retrain_link_dp_test(struct dc_link *link,dp_receiver_power_ctrl (link, false); - link->dc->hwss.disable_stream (&pipes[i]); + link->dc->hwss.disable_stream (&pipes[i],KEEP_ACQUIRED_RESOURCE ); link->link_enc->funcs->disable_output( link->link_enc,
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +18 -6
@@ -242,7 +242,10 @@ bool resource_construct( pool->stream_enc_count++; } } - + dc->caps.dynamic_audio = false; +if (pool->audio_count < pool->stream_enc_count) { + dc->caps.dynamic_audio = true; + }for (i =0 ; i < num_virtual_links; i++) { pool->stream_enc[pool->stream_enc_count] = virtual_stream_encoder_create(
@@ -1330,7 +1333,7 @@ static void update_stream_engine_usage( }/* TODO: release audio object */ -static void update_audio_usage( +void update_audio_usage( struct resource_context *res_ctx, const struct resource_pool *pool, struct audio *audio,
@@ -1414,12 +1417,21 @@ static struct audio *find_first_free_audio( const struct resource_pool *pool) {int i; -for (i =0 ; i < pool->audio_count; i++) { -if (res_ctx->is_audio_acquired[i] == false) { -return pool->audios[i]; +if (pool->audio_count >= pool->stream_enc_count) { +for (i =0 ; i < pool->audio_count; i++) { +if ((res_ctx->is_audio_acquired[i] == false) && (res_ctx->is_stream_enc_acquired[i] == true)) { +/*we have enough audio endpoint, no need to do dynamic distribution*/ +return pool->audios[i]; + } } - } + }else {/*first come first serve*/ +for (i =0 ; i < pool->audio_count; i++) { +if (res_ctx->is_audio_acquired[i] == false) { +return pool->audios[i]; + } + } + }return 0 ; }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -58,6 +58,7 @@ struct dc_caps {uint32_t i2c_speed_in_khz;unsigned int max_cursor_size;bool dcc_const_color; +bool dynamic_audio; };struct dc_dcc_surface_param {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +10 -2
@@ -985,10 +985,11 @@ void hwss_edp_backlight_control(link_transmitter_control (link->dc->ctx->dc_bios, &cntl); } -void dce110_disable_stream (struct pipe_ctx *pipe_ctx) +void dce110_disable_stream (struct pipe_ctx *pipe_ctx,int option) {struct dc_stream_state *stream = pipe_ctx->stream;struct dc_link *link = stream->sink->link; +struct dc *dc = pipe_ctx->stream->ctx->dc;if (pipe_ctx->stream_res.audio) { pipe_ctx->stream_res.audio->funcs->az_disable (pipe_ctx->stream_res.audio);
@@ -999,6 +1000,13 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)else pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_disable ( pipe_ctx->stream_res.stream_enc); +/*don't free audio if it is from retrain or internal disable stream*/ +if (option ==FREE_ACQUIRED_RESOURCE && dc->caps.dynamic_audio == true) { +/*we have to dynamic arbitrate the audio endpoints*/ + pipe_ctx->stream_res.audio =NULL ; +/*we free the resource, need reset is_audio_acquired*/ +update_audio_usage (&dc->current_state->res_ctx, dc->res_pool, pipe_ctx->stream_res.audio, false); + }/* TODO: notify audio driver for if audio modes list changed * add audio mode list change flag */
@@ -1871,7 +1879,7 @@ static void dce110_reset_hw_ctx_wrap( pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {struct clock_source *old_clk = pipe_ctx_old->clock_source; -core_link_disable_stream (pipe_ctx_old); +core_link_disable_stream (pipe_ctx_old,FREE_ACQUIRED_RESOURCE ); pipe_ctx_old->stream_res.tg->funcs->set_blank (pipe_ctx_old->stream_res.tg, true);if (!hwss_wait_for_blank_complete (pipe_ctx_old->stream_res.tg)) {dm_error ("DC: failed to blank crtc!\n" );
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +1 -1
@@ -47,7 +47,7 @@ void dce110_set_displaymarks(void dce110_enable_stream (struct pipe_ctx *pipe_ctx); -void dce110_disable_stream (struct pipe_ctx *pipe_ctx); +void dce110_disable_stream (struct pipe_ctx *pipe_ctx,int option);void dce110_unblank_stream (struct pipe_ctx *pipe_ctx,struct dc_link_settings *link_settings);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
@@ -1025,7 +1025,7 @@ static void reset_back_end_for_pipe(* which is used by otg. Move disable_link after disable_crtc */ if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) -core_link_disable_stream (pipe_ctx); +core_link_disable_stream (pipe_ctx,FREE_ACQUIRED_RESOURCE );/* by upper caller loop, parent pipe: pipe0, will be reset last. * back end share by all pipes and will be disable only when disable
drivers/gpu/drm/amd/display/dc/inc/core_types.h +6 -1
@@ -58,6 +58,11 @@ struct link_init_data {TODO: remove it when DC is complete. */ }; +enum { +FREE_ACQUIRED_RESOURCE =0 , +KEEP_ACQUIRED_RESOURCE =1 , +}; +struct dc_link *link_create (const struct link_init_data *init_params);void link_destroy (struct dc_link **link);
@@ -72,7 +77,7 @@ void core_link_enable_stream(struct dc_state *state, struct pipe_ctx *pipe_ctx); -void core_link_disable_stream (struct pipe_ctx *pipe_ctx); +void core_link_disable_stream (struct pipe_ctx *pipe_ctx,int option);void core_link_set_avmute (struct pipe_ctx *pipe_ctx,bool enable);/********** DAL Core*********************/
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +2 -1
@@ -134,7 +134,8 @@ struct hw_sequencer_funcs {void (*enable_stream)(struct pipe_ctx *pipe_ctx); -void (*disable_stream)(struct pipe_ctx *pipe_ctx); +void (*disable_stream)(struct pipe_ctx *pipe_ctx, +int option);void (*unblank_stream)(struct pipe_ctx *pipe_ctx,struct dc_link_settings *link_settings);
drivers/gpu/drm/amd/display/dc/inc/resource.h +5 -0
@@ -164,4 +164,9 @@ bool pipe_need_reprogram(void resource_build_bit_depth_reduction_params (struct dc_stream_state *stream,struct bit_depth_reduction_params *fmt_bit_depth); +void update_audio_usage ( +struct resource_context *res_ctx, +const struct resource_pool *pool, +struct audio *audio, +bool acquired);#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 60/103 drm/amd/display: renaming mem input to hubp
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 76 +++++++++++----------- .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 24 +++---- 2 files changed, 50 insertions(+), 50 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +38 -38
@@ -38,7 +38,7 @@#define FN (reg_name, field_name) \ mi->mi_shift->field_name, mi->mi_mask->field_name -void min10_set_blank (struct mem_input *mem_input,bool blank) +void hubp1_set_blank (struct mem_input *mem_input,bool blank) {struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);uint32_t blank_en = blank ?1 :0 ;
@@ -56,7 +56,7 @@ void min10_set_blank(struct mem_input *mem_input, bool blank) } } -static void min10_set_hubp_blank_en (struct mem_input *mem_input,bool blank) +static void hubp1_set_hubp_blank_en (struct mem_input *mem_input,bool blank) {struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);uint32_t blank_en = blank ?1 :0 ;
@@ -64,7 +64,7 @@ static void min10_set_hubp_blank_en(struct mem_input *mem_input, bool blank)REG_UPDATE (DCHUBP_CNTL ,HUBP_BLANK_EN , blank_en); } -static void min10_vready_workaround (struct mem_input *mem_input, +static void hubp1_vready_workaround (struct mem_input *mem_input,struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest) {uint32_t value =0 ;
@@ -87,7 +87,7 @@ static void min10_vready_workaround(struct mem_input *mem_input,REG_WRITE (HUBPREQ_DEBUG_DB , value); } -void min10_program_tiling ( +void hubp1_program_tiling (struct dcn10_mem_input *mi,const union dc_tiling_info *info,const enum surface_pixel_format pixel_format)
@@ -107,7 +107,7 @@ void min10_program_tiling( PIPE_ALIGNED, info->gfx9.pipe_aligned); } -void min10_program_size_and_rotation( +void hubp1_program_size_and_rotation( struct dcn10_mem_input *mi, enum dc_rotation_angle rotation, enum surface_pixel_format format,
@@ -169,7 +169,7 @@ void min10_program_size_and_rotation( H_MIRROR_EN, mirror); } -void min10_program_pixel_format ( +void hubp1_program_pixel_format (struct dcn10_mem_input *mi,enum surface_pixel_format format) {
@@ -245,7 +245,7 @@ void min10_program_pixel_format(/* don't see the need of program the xbar in DCN 1.0 */ } -bool min10_program_surface_flip_and_addr ( +bool hubp1_program_surface_flip_and_addr (struct mem_input *mem_input,const struct dc_plane_address *address,bool flip_immediate)
@@ -395,7 +395,7 @@ bool min10_program_surface_flip_and_addr(return true; } -void min10_dcc_control (struct mem_input *mem_input,bool enable, +void hubp1_dcc_control (struct mem_input *mem_input,bool enable,bool independent_64b_blks) {uint32_t dcc_en = enable ?1 :0 ;
@@ -407,7 +407,7 @@ void min10_dcc_control(struct mem_input *mem_input, bool enable, PRIMARY_SURFACE_DCC_IND_64B_BLK, dcc_ind_64b_blk); } -static void min10_program_surface_config( +static void hubp1_program_surface_config( struct mem_input *mem_input, enum surface_pixel_format format, union dc_tiling_info *tiling_info,
@@ -418,14 +418,14 @@ static void min10_program_surface_config( {struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input); -min10_dcc_control (mem_input, dcc->enable, dcc->grph.independent_64b_blks); -min10_program_tiling (mi, tiling_info, format); -min10_program_size_and_rotation ( +hubp1_dcc_control (mem_input, dcc->enable, dcc->grph.independent_64b_blks); +hubp1_program_tiling (mi, tiling_info, format); +hubp1_program_size_and_rotation ( mi, rotation, format, plane_size, dcc, horizontal_mirror); -min10_program_pixel_format (mi, format); +hubp1_program_pixel_format (mi, format); } -void min10_program_requestor ( +void hubp1_program_requestor (struct mem_input *mem_input,struct _vcs_dpi_display_rq_regs_st *rq_regs) {
@@ -459,7 +459,7 @@ void min10_program_requestor( } -void min10_program_deadline ( +void hubp1_program_deadline (struct mem_input *mem_input,struct _vcs_dpi_display_dlg_regs_st *dlg_attr,struct _vcs_dpi_display_ttu_regs_st *ttu_attr)
@@ -580,7 +580,7 @@ void min10_program_deadline( ttu_attr->refcyc_per_req_delivery_pre_c); } -static void min10_setup( +static void hubp1_setup( struct mem_input *mem_input, struct _vcs_dpi_display_dlg_regs_st *dlg_attr, struct _vcs_dpi_display_ttu_regs_st *ttu_attr,
@@ -590,12 +590,12 @@ static void min10_setup(/* otg is locked when this func is called. Register are double buffered. * disable the requestors is not needed */ -min10_program_requestor (mem_input, rq_regs); -min10_program_deadline (mem_input, dlg_attr, ttu_attr); -min10_vready_workaround (mem_input, pipe_dest); +hubp1_program_requestor (mem_input, rq_regs); +hubp1_program_deadline (mem_input, dlg_attr, ttu_attr); +hubp1_vready_workaround (mem_input, pipe_dest); } -void min10_program_display_marks( +void hubp1_program_display_marks( struct mem_input *mem_input, struct dce_watermarks nbp, struct dce_watermarks stutter,
@@ -607,7 +607,7 @@ void min10_program_display_marks(*/ } -bool min10_is_flip_pending (struct mem_input *mem_input) +bool hubp1_is_flip_pending (struct mem_input *mem_input) {uint32_t flip_pending =0 ;struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);
@@ -635,7 +635,7 @@ bool min10_is_flip_pending(struct mem_input *mem_input)uint32_t aperture_default_system =1 ;uint32_t context0_default_system;/* = 0;*/ -static void min10_set_vm_system_aperture_settings (struct mem_input *mem_input, +static void hubp1_set_vm_system_aperture_settings (struct mem_input *mem_input,struct vm_system_aperture_param *apt) {struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);
@@ -664,7 +664,7 @@ static void min10_set_vm_system_aperture_settings(struct mem_input *mem_input, MC_VM_SYSTEM_APERTURE_HIGH_ADDR_LSB, mc_vm_apt_high.low_part); } -static void min10_set_vm_context0_settings (struct mem_input *mem_input, +static void hubp1_set_vm_context0_settings (struct mem_input *mem_input,const struct vm_context0_param *vm0) {struct dcn10_mem_input *mi =TO_DCN10_MEM_INPUT (mem_input);
@@ -848,7 +848,7 @@ static enum cursor_lines_per_chunk ippn10_get_lines_per_chunk(return line_per_chunk; } -void ippn10_cursor_set_attributes ( +void hubp1_cursor_set_attributes (struct mem_input *mem_input,const struct dc_cursor_attributes *attr) {
@@ -876,7 +876,7 @@ void ippn10_cursor_set_attributes( attr->color_format); } -void ippn10_cursor_set_position ( +void hubp1_cursor_set_position (struct mem_input *mem_input,const struct dc_cursor_position *pos,const struct dc_cursor_mi_param *param)
@@ -913,7 +913,7 @@ void ippn10_cursor_set_position( cur_en =0 ;/* not visible beyond left edge*/ if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 ) -ippn10_cursor_set_attributes (mem_input, &mem_input->curs_attr); +hubp1_cursor_set_attributes (mem_input, &mem_input->curs_attr);REG_UPDATE (CURSOR_CONTROL ,CURSOR_ENABLE , cur_en);
@@ -931,21 +931,21 @@ void ippn10_cursor_set_position( }static struct mem_input_funcs dcn10_mem_input_funcs = { - .mem_input_program_display_marks = min10_program_display_marks, + .mem_input_program_display_marks = hubp1_program_display_marks, .mem_input_program_surface_flip_and_addr = - min10_program_surface_flip_and_addr, + hubp1_program_surface_flip_and_addr, .mem_input_program_surface_config = - min10_program_surface_config, - .mem_input_is_flip_pending = min10_is_flip_pending, - .mem_input_setup = min10_setup, - .mem_input_set_vm_system_aperture_settings = min10_set_vm_system_aperture_settings, - .mem_input_set_vm_context0_settings = min10_set_vm_context0_settings, - .set_blank = min10_set_blank, - .dcc_control = min10_dcc_control, + hubp1_program_surface_config, + .mem_input_is_flip_pending = hubp1_is_flip_pending, + .mem_input_setup = hubp1_setup, + .mem_input_set_vm_system_aperture_settings = hubp1_set_vm_system_aperture_settings, + .mem_input_set_vm_context0_settings = hubp1_set_vm_context0_settings, + .set_blank = hubp1_set_blank, + .dcc_control = hubp1_dcc_control, .mem_program_viewport = min_set_viewport, - .set_hubp_blank_en = min10_set_hubp_blank_en, - .set_cursor_attributes = ippn10_cursor_set_attributes, - .set_cursor_position = ippn10_cursor_set_position, + .set_hubp_blank_en = hubp1_set_hubp_blank_en, + .set_cursor_attributes = hubp1_cursor_set_attributes, + .set_cursor_position = hubp1_cursor_set_position, };/*****************************************/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +12 -12
@@ -591,20 +591,20 @@ struct dcn10_mem_input {const struct dcn_mi_mask *mi_mask; }; -void min10_program_deadline ( +void hubp1_program_deadline (struct mem_input *mem_input,struct _vcs_dpi_display_dlg_regs_st *dlg_attr,struct _vcs_dpi_display_ttu_regs_st *ttu_attr); -void min10_program_requestor ( +void hubp1_program_requestor (struct mem_input *mem_input,struct _vcs_dpi_display_rq_regs_st *rq_regs); -void min10_program_pixel_format ( +void hubp1_program_pixel_format (struct dcn10_mem_input *mi,enum surface_pixel_format format); -void min10_program_size_and_rotation( +void hubp1_program_size_and_rotation( struct dcn10_mem_input *mi, enum dc_rotation_angle rotation, enum surface_pixel_format format,
@@ -612,39 +612,39 @@ void min10_program_size_and_rotation(struct dc_plane_dcc_param *dcc, bool horizontal_mirror); -void min10_program_tiling ( +void hubp1_program_tiling (struct dcn10_mem_input *mi,const union dc_tiling_info *info,const enum surface_pixel_format pixel_format); -void min10_dcc_control (struct mem_input *mem_input, +void hubp1_dcc_control (struct mem_input *mem_input,bool enable,bool independent_64b_blks); -void min10_program_display_marks ( +void hubp1_program_display_marks (struct mem_input *mem_input,struct dce_watermarks nbp,struct dce_watermarks stutter,struct dce_watermarks urgent,uint32_t total_dest_line_time_ns); -bool min10_program_surface_flip_and_addr ( +bool hubp1_program_surface_flip_and_addr (struct mem_input *mem_input,const struct dc_plane_address *address,bool flip_immediate); -bool min10_is_flip_pending (struct mem_input *mem_input); +bool hubp1_is_flip_pending (struct mem_input *mem_input); -void ippn10_cursor_set_attributes ( +void hubp1_cursor_set_attributes (struct mem_input *mem_input,const struct dc_cursor_attributes *attr); -void ippn10_cursor_set_position ( +void hubp1_cursor_set_position (struct mem_input *mem_input,const struct dc_cursor_position *pos,const struct dc_cursor_mi_param *param); -void min10_set_blank (struct mem_input *mem_input,bool blank); +void hubp1_set_blank (struct mem_input *mem_input,bool blank); void min_set_viewport(struct mem_input *mem_input, const struct rect *viewport,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 61/103 drm/amd/display: arbitration find the matching dig-az first.
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
[Description]
this change is in branch already.
without this change, after resume, az_inst might swapped.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +8 -12
@@ -1417,19 +1417,15 @@ static struct audio *find_first_free_audio( const struct resource_pool *pool) {int i; -if (pool->audio_count >= pool->stream_enc_count) { -for (i =0 ; i < pool->audio_count; i++) { -if ((res_ctx->is_audio_acquired[i] == false) && (res_ctx->is_stream_enc_acquired[i] == true)) { -/*we have enough audio endpoint, no need to do dynamic distribution*/ -return pool->audios[i]; - } +for (i =0 ; i < pool->audio_count; i++) { +if ((res_ctx->is_audio_acquired[i] == false) && (res_ctx->is_stream_enc_acquired[i] == true)) { +return pool->audios[i]; } - }else {/*first come first serve*/ -for (i =0 ; i < pool->audio_count; i++) { -if (res_ctx->is_audio_acquired[i] == false) { - -return pool->audios[i]; - } + } +/*not found the matching one, first come first serve*/ +for (i =0 ; i < pool->audio_count; i++) { +if (res_ctx->is_audio_acquired[i] == false) { +return pool->audios[i]; } }return 0 ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 62/103 drm/amd/display: Making hubp1_program_surface_config public
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +2 -1
@@ -407,7 +407,7 @@ void hubp1_dcc_control(struct mem_input *mem_input, bool enable, PRIMARY_SURFACE_DCC_IND_64B_BLK, dcc_ind_64b_blk); } -static void hubp1_program_surface_config( +void hubp1_program_surface_config( struct mem_input *mem_input, enum surface_pixel_format format, union dc_tiling_info *tiling_info,
@@ -970,3 +970,4 @@ void dcn10_mem_input_construct( mi->base.mpcc_id =0xf ; } +
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +9 -0
@@ -591,6 +591,15 @@ struct dcn10_mem_input {const struct dcn_mi_mask *mi_mask; }; +void hubp1_program_surface_config ( +struct mem_input *mem_input, +enum surface_pixel_format format, +union dc_tiling_info *tiling_info, +union plane_size *plane_size, +enum dc_rotation_angle rotation, +struct dc_plane_dcc_param *dcc, +bool horizontal_mirror); + void hubp1_program_deadline( struct mem_input *mem_input, struct _vcs_dpi_display_dlg_regs_st *dlg_attr,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 63/103 drm/amd/display: Fix irq enable/disable on resume.
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
Fixing loop boundaries in irq enable/disable on resume.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +2 -2
@@ -508,7 +508,7 @@ int amdgpu_dm_irq_suspend(* Disable HW interrupt for HPD and HPDRX only since FLIP and VBLANK * will be disabled from manage_dm_interrupts on disable CRTC. */ -for (src =DC_IRQ_SOURCE_HPD1 ; src <DC_IRQ_SOURCE_HPD6RX ; src++) { +for (src =DC_IRQ_SOURCE_HPD1 ; src <=DC_IRQ_SOURCE_HPD6RX ; src++) { hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; hnd_list_h = &adev->dm.irq_handler_list_high_tab[src];if (!list_empty (hnd_list_l) || !list_empty (hnd_list_h))
@@ -535,7 +535,7 @@ int amdgpu_dm_irq_resume_early(struct amdgpu_device *adev)DRM_DEBUG_KMS ("DM_IRQ: early resume\n" );/* re-enable short pulse interrupts HW interrupt */ -for (src =DC_IRQ_SOURCE_HPD1RX ; src <=DC_IRQ_SOURCE_HPD6RX +1 ; src++) { +for (src =DC_IRQ_SOURCE_HPD1RX ; src <=DC_IRQ_SOURCE_HPD6RX ; src++) { hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; hnd_list_h = &adev->dm.irq_handler_list_high_tab[src];if (!list_empty (hnd_list_l) || !list_empty (hnd_list_h))
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 64/103 drm/amd/display: Do not access fbdev helper members
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
Original code is no longer needed and tested without loop.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -12
@@ -395,21 +395,10 @@ static void dm_dp_mst_register_connector(struct drm_connector *connector) {struct drm_device *dev = connector->dev;struct amdgpu_device *adev = dev->dev_private; -int i;drm_modeset_lock_all (dev); -if (adev->mode_info.rfbdev) { -/*Do not add if already registered in past*/ -for (i =0 ; i < adev->mode_info.rfbdev->helper.connector_count; i++) { -if (adev->mode_info.rfbdev->helper.connector_info[i]->connector - == connector) { -drm_modeset_unlock_all (dev); -return ; - } - } - +if (adev->mode_info.rfbdev)drm_fb_helper_add_one_connector (&adev->mode_info.rfbdev->helper, connector); - }else DRM_ERROR ("adev->mode_info.rfbdev is NULL\n" );
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 65/103 drm/amd/display: Remove drm_modeset_lock in MST code
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
Locks are no longer needed since the drm framework takes care of correct locking.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +5 -7
@@ -284,9 +284,10 @@ static struct drm_connector *dm_dp_add_mst_connector(struct drm_dp_mst_topology_struct amdgpu_device *adev = dev->dev_private;struct amdgpu_dm_connector *aconnector;struct drm_connector *connector; +struct drm_connector_list_iter conn_iter; -drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); -list_for_each_entry (connector, &dev->mode_config.connector_list, head) { +drm_connector_list_iter_begin (dev, &conn_iter); +drm_for_each_connector_iter (connector, &conn_iter) { aconnector =to_amdgpu_dm_connector (connector);if (aconnector->mst_port == master && !aconnector->port) {
@@ -296,11 +297,11 @@ static struct drm_connector *dm_dp_add_mst_connector(struct drm_dp_mst_topology_ aconnector->port = port;drm_mode_connector_set_path_property (connector, pathprop); -drm_modeset_unlock (&dev->mode_config.connection_mutex); +drm_connector_list_iter_end (&conn_iter);return &aconnector->base; } } -drm_modeset_unlock (&dev->mode_config.connection_mutex); +drm_connector_list_iter_end (&conn_iter); aconnector =kzalloc (sizeof (*aconnector),GFP_KERNEL );if (!aconnector)
@@ -396,14 +397,11 @@ static void dm_dp_mst_register_connector(struct drm_connector *connector)struct drm_device *dev = connector->dev;struct amdgpu_device *adev = dev->dev_private; -drm_modeset_lock_all (dev);if (adev->mode_info.rfbdev)drm_fb_helper_add_one_connector (&adev->mode_info.rfbdev->helper, connector);else DRM_ERROR ("adev->mode_info.rfbdev is NULL\n" ); -drm_modeset_unlock_all (dev); -drm_connector_register (connector); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 66/103 drm/amd/display: clean up dcn10 dpp after HW review
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 20 +++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 85 +++++++++++----------- 3 files changed, 65 insertions(+), 42 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +2 -0
@@ -204,6 +204,8 @@ enum surface_pixel_format {/*grow 444 video here if necessary */ }; + +/* Pixel format */ enum pixel_format {/*graph*/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +20 -0
@@ -1265,6 +1265,21 @@ struct dcn10_dpp { }; +enum lb_memory_config { +/* Enable all 3 pieces of memory */ +LB_MEMORY_CONFIG_0 =0 , + +/* Enable only the first piece of memory */ +LB_MEMORY_CONFIG_1 =1 , + +/* Enable only the second piece of memory */ +LB_MEMORY_CONFIG_2 =2 , + +/* Only applicable in 4:2:0 mode, enable all 3 pieces of memory and the +* last piece of chroma memory used for the luma storage +*/ +LB_MEMORY_CONFIG_3 =3 +};enum dcn10_input_csc_select {INPUT_CSC_SELECT_BYPASS =0 ,
@@ -1272,6 +1287,11 @@ enum dcn10_input_csc_select { INPUT_CSC_SELECT_COMA }; +bool is_lb_conf_valid ( +int ceil_vratio, +int num_partitions, +int vtaps); +void ippn10_degamma_ram_select (struct transform *xfm_base,bool use_ram_a);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +43 -42
175 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 67/103 drm/amd/display: Add stereo_support debug flag
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -217,6 +217,7 @@ struct dc_debug {bool force_abm_enable;bool disable_hbup_pg;bool disable_dpp_pg; +bool stereo_support; };struct dc_state ;struct resource_pool ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 68/103 drm/amd/display: Fixed extend to second screen mode hang
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
1. Fixed acquire free split pipe bug.
2. Change return value for dc_add_stream_to_ctx from bool to enum.
4. Remove redundant apply_ctx_for_surface calling
5. Unlock pipe after back end programming.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 48 ++++++++++++----------- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 9 ++--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 4 files changed, 32 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -4661,10 +4661,10 @@ static int dm_update_crtcs_state(DRM_DEBUG_DRIVER ("Enabling DRM crtc: %d\n" , crtc->base.id); -if (!dc_add_stream_to_ctx ( +if (dc_add_stream_to_ctx ( dc, dm_state->context, - new_acrtc_state->stream)) { + new_acrtc_state->stream) !=DC_OK ) { ret = -EINVAL ; goto fail; }
drivers/gpu/drm/amd/display/dc/core/dc.c +25 -23
65 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 -5
@@ -1446,7 +1446,7 @@ bool resource_is_stream_unchanged(return false; } -bool dc_add_stream_to_ctx ( +enum dc_status dc_add_stream_to_ctx (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *stream)
@@ -1467,7 +1467,7 @@ bool dc_add_stream_to_ctx(if (res !=DC_OK )DC_ERROR ("Adding stream %p to context failed with err %d!\n" , stream, res); -return res ==DC_OK ; +return res; } bool dc_remove_stream_from_ctx(
@@ -1640,10 +1640,9 @@ enum dc_status resource_map_pool_resources(/* acquire new resources */ pipe_idx =acquire_first_free_pipe (&context->res_ctx, pool, stream); -#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )if (pipe_idx <0 ) -acquire_first_split_pipe (&context->res_ctx, pool, stream); -#endif + pipe_idx =acquire_first_split_pipe (&context->res_ctx, pool, stream); +if (pipe_idx <0 )return DC_NO_CONTROLLER_RESOURCE ;
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -631,7 +631,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,uint32_t *h_position, uint32_t *v_position); -bool dc_add_stream_to_ctx ( +enum dc_status dc_add_stream_to_ctx (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *stream);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 69/103 drm/amd/display: wa to program split pipedegamma regs after mode set.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -1282,7 +1282,9 @@ static void commit_planes_for_stream(struct dc *dc,if (update_type ==UPDATE_TYPE_FAST )continue ; -if (srf_updates[i].in_transfer_func) +/* work around to program degamma regs for split pipe after set mode. */ +if (srf_updates[i].in_transfer_func || (pipe_ctx->top_pipe && + pipe_ctx->top_pipe->plane_state == pipe_ctx->plane_state)) dc->hwss.set_input_transfer_func ( pipe_ctx, pipe_ctx->plane_state);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 70/103 drm/amd/display: Add debug flag for VSR support
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 1 + 3 files changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -218,6 +218,7 @@ struct dc_debug {bool disable_hbup_pg;bool disable_dpp_pg;bool stereo_support; +bool vsr_support; };struct dc_state ;struct resource_pool ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
@@ -428,6 +428,7 @@ static const struct dc_debug debug_defaults_drv = { .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, .disable_dcc = DCC_ENABLE, .voltage_align_fclk = true, + .vsr_support = true, };static const struct dc_debug debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +1 -0
@@ -25,6 +25,7 @@#include "reg_helper.h" #include "dcn10_timing_generator.h" +#include "dc.h" #define REG (reg)\ tgn10->tg_regs->reg
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 71/103 drm/amd/display: fix re-enabling stutter for raven
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
We were overwriting the whole register which was re-enabling stutter for raven. Now we are reading the register then setting the values only for pstate.
--- drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 4 ++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +4 -0
@@ -446,6 +446,8 @@ struct dce_hwseq_registers { HWS_SF(, DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL, DCHUBBUB_ARB_WATERMARK_CHANGE_DONE_INTERRUPT_DISABLE, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_DRAM_STATE_CNTL, DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_VALUE, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_DRAM_STATE_CNTL, DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE, mask_sh), \ + HWS_SF(, DCHUBBUB_ARB_DRAM_STATE_CNTL, DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_VALUE, mask_sh), \ + HWS_SF(, DCHUBBUB_ARB_DRAM_STATE_CNTL, DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_ENABLE, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_SAT_LEVEL, DCHUBBUB_ARB_SAT_LEVEL, mask_sh), \ HWS_SF(, DCHUBBUB_ARB_DF_REQ_OUTSTAND, DCHUBBUB_ARB_MIN_REQ_OUTSTAND, mask_sh), \ HWS_SF(, DCFCLK_CNTL, DCFCLK_GATE_DIS, mask_sh)
@@ -554,6 +556,8 @@ struct dce_hwseq_registers {type DCHUBBUB_ARB_WATERMARK_CHANGE_DONE_INTERRUPT_DISABLE ;\type DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_VALUE ;\type DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE ;\ +type DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_VALUE ;\ +type DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_ENABLE ;\type DCHUBBUB_ARB_SAT_LEVEL ;\type DCHUBBUB_ARB_MIN_REQ_OUTSTAND ;\type OPP_PIPE_CLOCK_EN ;\
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 -3
@@ -253,7 +253,6 @@ static void verify_allow_pstate_change_high(unsigned int debug_index =0x7 ;unsigned int debug_data; -unsigned int force_allow_pstate =0x30 ;unsigned int i;if (forced_pstate_allow) {
@@ -261,7 +260,9 @@ static void verify_allow_pstate_change_high(* we verify_allow_pstate_change_high. so disable force * here so we can check status */ -REG_WRITE (DCHUBBUB_ARB_DRAM_STATE_CNTL ,0 ); +REG_UPDATE_2 (DCHUBBUB_ARB_DRAM_STATE_CNTL , +DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_VALUE ,0 , +DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_ENABLE ,0 ); forced_pstate_allow = false; }
@@ -304,7 +305,9 @@ static void verify_allow_pstate_change_high(/* force pstate allow to prevent system hang * and break to debugger to investigate */ -REG_WRITE (DCHUBBUB_ARB_DRAM_STATE_CNTL , force_allow_pstate); +REG_UPDATE_2 (DCHUBBUB_ARB_DRAM_STATE_CNTL , +DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_VALUE ,1 , +DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_ENABLE ,1 ); forced_pstate_allow = true;if (should_log_hw_state) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 72/103 drm/amd/display: reject 3D mode based on static debug flag.
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -217,7 +217,7 @@ struct dc_debug {bool force_abm_enable;bool disable_hbup_pg;bool disable_dpp_pg; -bool stereo_support; +bool disable_stereo_support;bool vsr_support; };struct dc_state ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
@@ -428,6 +428,7 @@ static const struct dc_debug debug_defaults_drv = { .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, .disable_dcc = DCC_ENABLE, .voltage_align_fclk = true, + .disable_stereo_support = true, .vsr_support = true, };
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +3 -0
@@ -499,6 +499,9 @@ static bool tgn10_validate_timing( timing->timing_3d_format != TIMING_3D_FORMAT_INBAND_FA)return false; +if (timing->timing_3d_format !=TIMING_3D_FORMAT_NONE && + tg->ctx->dc->debug.disable_stereo_support) +return false;/* Temporarily blocking interlacing mode until it's supported */ if (timing->flags.INTERLACE ==1 )return false;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 73/103 drm/amd/display: increase pstate wait timeout
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
For linux it takes longer than 40us so increasing it to 200us. Also added debug prints regarding the change
--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +17 -3
@@ -245,8 +245,13 @@ static void verify_allow_pstate_change_high( {/* pstate latency is ~20us so if we wait over 40us and pstate allow * still not asserted, we are probably stuck and going to hang +* +* TODO: Figure out why it takes ~100us on linux +* pstate takes around ~100us on linux. Unknown currently as to +* why it takes that long on linux */ -static unsigned int pstate_wait_timeout_us =40 ; +static unsigned int pstate_wait_timeout_us =200 ; +static unsigned int pstate_wait_expected_timeout_us =40 ;static unsigned int max_sampled_pstate_wait_us;/* data collection */ static bool forced_pstate_allow;/* help with revert wa */ static bool should_log_hw_state;/* prevent hw state log by default */
@@ -293,9 +298,15 @@ static void verify_allow_pstate_change_high(for (i =0 ; i < pstate_wait_timeout_us; i++) { debug_data =REG_READ (DCHUBBUB_TEST_DEBUG_DATA ); -if (debug_data & (1 <<30 )) -return ; +if (debug_data & (1 <<30 )) { + +if (i > pstate_wait_expected_timeout_us) +dm_logger_write (hws->ctx->logger,LOG_WARNING , +"pstate took longer than expected ~%dus" , + i); +return ; + }if (max_sampled_pstate_wait_us < i) max_sampled_pstate_wait_us = i;
@@ -314,6 +325,9 @@ static void verify_allow_pstate_change_high(dcn10_log_hw_state (hws->ctx->dc); } +dm_logger_write (hws->ctx->logger,LOG_WARNING , +"pstate TEST_DEBUG_DATA: 0x%X" , + debug_data);BREAK_TO_DEBUGGER (); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 74/103 drm/amd/display: block video planes >4k on dcn10
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +9 -0
@@ -1163,6 +1163,14 @@ static void dcn10_destroy_resource_pool(struct resource_pool **pool) *pool =NULL ; } +enum dc_status dcn10_validate_plane (const struct dc_plane_state *plane_state) +{ +if (plane_state->format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN + && plane_state->src_rect.width >3840 ) +return DC_FAIL_SURFACE_VALIDATE ; + +return DC_OK ; +}static struct dc_cap_funcs cap_funcs = { .get_dcc_compression_cap = get_dcc_compression_cap
@@ -1174,6 +1182,7 @@ static struct resource_funcs dcn10_res_pool_funcs = { .validate_guaranteed = dcn10_validate_guaranteed, .validate_bandwidth = dcn_validate_bandwidth, .acquire_idle_pipe_for_layer = dcn10_acquire_idle_pipe_for_layer, + .validate_plane = dcn10_validate_plane, .add_stream_to_ctx = dcn10_add_stream_to_ctx };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 75/103 drm/amd/display: add max_video_width cap to dc
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++---- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 6 ++++-- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -4
@@ -2750,11 +2750,9 @@ bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)bool dc_validate_plane (struct dc *dc,const struct dc_plane_state *plane_state) { -struct dc *core_dc = dc; -/* TODO For now validates pixel format only */ -if (core_dc->res_pool->funcs->validate_plane) -return core_dc->res_pool->funcs->validate_plane (plane_state) ==DC_OK ; +if (dc->res_pool->funcs->validate_plane) +return dc->res_pool->funcs->validate_plane (plane_state, &dc->caps) ==DC_OK ;return true; }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -57,6 +57,7 @@ struct dc_caps {uint32_t max_downscale_ratio;uint32_t i2c_speed_in_khz;unsigned int max_cursor_size; +unsigned int max_video_width;bool dcc_const_color;bool dynamic_audio; };
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +1 -1
@@ -743,7 +743,7 @@ static void dce100_destroy_resource_pool(struct resource_pool **pool) *pool =NULL ; } -enum dc_status dce100_validate_plane (const struct dc_plane_state *plane_state) +enum dc_status dce100_validate_plane (const struct dc_plane_state *plane_state,struct dc_caps *caps) {if (plane_state->format <SURFACE_PIXEL_FORMAT_VIDEO_BEGIN )
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h +1 -1
@@ -16,7 +16,7 @@ struct resource_pool *dce100_create_resource_pool(uint8_t num_virtual_links, struct dc *dc); -enum dc_status dce100_validate_plane (const struct dc_plane_state *plane_state); +enum dc_status dce100_validate_plane (const struct dc_plane_state *plane_state,struct dc_caps *caps); enum dc_status dce100_add_stream_to_ctx( struct dc *dc,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +4 -2
@@ -1163,10 +1163,11 @@ static void dcn10_destroy_resource_pool(struct resource_pool **pool) *pool =NULL ; } -enum dc_status dcn10_validate_plane (const struct dc_plane_state *plane_state) +static enum dc_status dcn10_validate_plane (const struct dc_plane_state *plane_state,struct dc_caps *caps) {if (plane_state->format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN - && plane_state->src_rect.width >3840 ) + && caps->max_video_width !=0 + && plane_state->src_rect.width > caps->max_video_width)return DC_FAIL_SURFACE_VALIDATE ;return DC_OK ;
@@ -1222,6 +1223,7 @@ static bool construct(/* max pipe num for ASIC before check pipe fuses */ pool->base.pipe_count = pool->base.res_cap->num_timing_generator; + dc->caps.max_video_width =3840 ; dc->caps.max_downscale_ratio =200 ; dc->caps.i2c_speed_in_khz =100 ; dc->caps.max_cursor_size =256 ;
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
@@ -111,7 +111,7 @@ struct resource_funcs {const struct resource_pool *pool, struct dc_stream_state *stream); -enum dc_status (*validate_plane)(const struct dc_plane_state *plane_state); +enum dc_status (*validate_plane)(const struct dc_plane_state *plane_state,struct dc_caps *caps); enum dc_status (*add_stream_to_ctx)( struct dc *dc,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 76/103 drm/amd/display: add dpms state to DC
In reply to a message not in the archiveFrom: Hersen Wu <[email protected]>
- avoid eDP screen flash 4 times when resume from s3
- improve s3 and boot time
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 39 +++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++ drivers/gpu/drm/amd/display/dc/dc.h | 5 +++ .../amd/display/dc/dce110/dce110_hw_sequencer.c | 13 ++++---- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 11 +++--- 5 files changed, 58 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +38 -1
@@ -332,7 +332,16 @@ static void set_dither_option(struct dc_stream_state *stream, {struct bit_depth_reduction_params params;struct dc_link *link = stream->status.link; -struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx; +struct pipe_ctx *pipes; +int i; + +for (i =0 ; i <MAX_PIPES ; i++) { +if (link->dc->current_state->res_ctx.pipe_ctx[i].stream == + stream) { + pipes = &link->dc->current_state->res_ctx.pipe_ctx[i]; +break ; + } + }memset (¶ms,0 ,sizeof (params));if (!stream)
@@ -349,6 +358,31 @@ static void set_dither_option(struct dc_stream_state *stream,opp_program_bit_depth_reduction (pipes->stream_res.opp, ¶ms); } +void set_dpms ( +struct dc *dc, +struct dc_stream_state *stream, +bool dpms_off) +{ +struct pipe_ctx *pipe_ctx; +int i; + +for (i =0 ; i <MAX_PIPES ; i++) { +if (dc->current_state->res_ctx.pipe_ctx[i].stream == stream) { + pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i]; +break ; + } + } + +if (stream->dpms_off != dpms_off) { + stream->dpms_off = dpms_off; +if (dpms_off) +core_link_disable_stream (pipe_ctx, +KEEP_ACQUIRED_RESOURCE ); +else +core_link_enable_stream (dc->current_state, pipe_ctx); + } +} +static void allocate_dc_stream_funcs (struct dc *dc) {if (dc->hwss.set_drr !=NULL ) {
@@ -371,6 +405,9 @@ static void allocate_dc_stream_funcs(struct dc *dc) dc->stream_funcs.set_dither_option = set_dither_option; + dc->stream_funcs.set_dpms = + set_dpms; + dc->link_funcs.set_drive_settings = set_drive_settings;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -0
@@ -2321,6 +2321,10 @@ void core_link_enable_stream(if (pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST )allocate_mst_payload (pipe_ctx); + +if (dc_is_dp_signal (pipe_ctx->stream->signal)) + core_dc->hwss.unblank_stream (pipe_ctx, + &pipe_ctx->stream->sink->link->cur_link_settings); }void core_link_disable_stream (struct pipe_ctx *pipe_ctx,int option)
drivers/gpu/drm/amd/display/dc/dc.h +5 -0
@@ -133,6 +133,10 @@ struct dc_stream_state_funcs {void (*set_dither_option)(struct dc_stream_state *stream,enum dc_dither_option option); + +void (*set_dpms)(struct dc *dc, +struct dc_stream_state *stream, +bool dpms_off); };struct link_training_settings ;
@@ -566,6 +570,7 @@ struct dc_stream_state {int phy_pix_clk;enum signal_type signal; +bool dpms_off;struct dc_stream_status status;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 -7
@@ -1364,12 +1364,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(resource_build_info_frame (pipe_ctx);dce110_update_info_frame (pipe_ctx);if (!pipe_ctx_old->stream) { -core_link_enable_stream (context, pipe_ctx); - - -if (dc_is_dp_signal (pipe_ctx->stream->signal)) -dce110_unblank_stream (pipe_ctx, - &stream->sink->link->cur_link_settings); +if (!pipe_ctx->stream->dpms_off) +core_link_enable_stream (context, pipe_ctx); } pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe !=0 ;
@@ -1879,7 +1875,10 @@ static void dce110_reset_hw_ctx_wrap( pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {struct clock_source *old_clk = pipe_ctx_old->clock_source; -core_link_disable_stream (pipe_ctx_old,FREE_ACQUIRED_RESOURCE ); +/* disable already, no need to disable again */ +if (!pipe_ctx->stream->dpms_off) +core_link_disable_stream (pipe_ctx_old,FREE_ACQUIRED_RESOURCE ); + pipe_ctx_old->stream_res.tg->funcs->set_blank (pipe_ctx_old->stream_res.tg, true);if (!hwss_wait_for_blank_complete (pipe_ctx_old->stream_res.tg)) {dm_error ("DC: failed to blank crtc!\n" );
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -6
@@ -1037,12 +1037,11 @@ static void reset_back_end_for_pipe(return ; } -/* TODOFPGA break core_link_disable_stream into 2 functions: -* disable_stream and disable_link. disable_link will disable PHYPLL -* which is used by otg. Move disable_link after disable_crtc -*/ -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) -core_link_disable_stream (pipe_ctx,FREE_ACQUIRED_RESOURCE ); +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { +/* DPMS may already disable */ +if (!pipe_ctx->stream->dpms_off) +core_link_disable_stream (pipe_ctx,FREE_ACQUIRED_RESOURCE ); + }/* by upper caller loop, parent pipe: pipe0, will be reset last. * back end share by all pipes and will be disable only when disable
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 77/103 drm/amd/display: Fixed switching mode half screen gamma incorrect.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
Half screen gamma setting and cursor are incorrect when switching mode through win+p due to wrong programming gamma sequence (In case of bottom pipe, gamma and cursor are programmed before front end programmed, pipe is power gated).
change:
1. Cache curor attributes to stream
2. Move set gamma and cursor inside front end programming.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 15 --------------- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 9 ++++++++- drivers/gpu/drm/amd/display/dc/dc.h | 4 +++- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 10 ++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 17 +++++++++++++++++ 5 files changed, 38 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -15
@@ -1269,10 +1269,6 @@ static void commit_planes_for_stream(struct dc *dc,/* Full fe update*/ for (j =0 ; j < dc->res_pool->pipe_count; j++) {struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j]; -struct pipe_ctx *cur_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[j]; -bool is_new_pipe_surface = cur_pipe_ctx->plane_state != pipe_ctx->plane_state; -struct dc_cursor_position position = {0 }; -if (update_type !=UPDATE_TYPE_FULL || !pipe_ctx->plane_state)continue ;
@@ -1283,17 +1279,6 @@ static void commit_planes_for_stream(struct dc *dc, dc->hwss.apply_ctx_for_surface ( dc, pipe_ctx->stream, stream_status->plane_count, context); } - -/* TODO: this is a hack w/a for switching from mpo to pipe split */ -dc_stream_set_cursor_position (pipe_ctx->stream, &position); - -if (is_new_pipe_surface) { - dc->hwss.update_plane_addr (dc, pipe_ctx); - dc->hwss.set_input_transfer_func ( - pipe_ctx, pipe_ctx->plane_state); - dc->hwss.set_output_transfer_func ( - pipe_ctx, pipe_ctx->stream); - } }if (update_type >UPDATE_TYPE_FAST )
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +8 -1
@@ -173,7 +173,7 @@ struct dc_stream_status *dc_stream_get_status(* Update the cursor attributes and set cursor surface address */ bool dc_stream_set_cursor_attributes ( -const struct dc_stream_state *stream, +struct dc_stream_state *stream,const struct dc_cursor_attributes *attributes) {int i;
@@ -189,6 +189,11 @@ bool dc_stream_set_cursor_attributes(return false; } +if (attributes->address.quad_part ==0 ) { +dm_error ("DC: Cursor address is 0!\n" ); +return false; + } + core_dc = stream->ctx->dc; res_ctx = &core_dc->current_state->res_ctx;
@@ -214,6 +219,8 @@ bool dc_stream_set_cursor_attributes( pipe_ctx->plane_res.xfm, attributes); } + stream->cursor_attributes = *attributes; +return true; }
drivers/gpu/drm/amd/display/dc/dc.h +3 -1
@@ -574,6 +574,8 @@ struct dc_stream_state {struct dc_stream_status status; +struct dc_cursor_attributes cursor_attributes; +/* from stream struct */ struct kref refcount; };
@@ -1013,7 +1015,7 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);******************************************************************************/ /* TODO: Deprecated once we switch to dc_set_cursor_position */ bool dc_stream_set_cursor_attributes ( -const struct dc_stream_state *stream, +struct dc_stream_state *stream,const struct dc_cursor_attributes *attributes); bool dc_stream_set_cursor_position(
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +10 -0
@@ -2725,6 +2725,8 @@ static void dce110_program_front_end_for_pipe(struct dc_plane_state *plane_state = pipe_ctx->plane_state;struct xfm_grph_csc_adjustment adjust;struct out_csc_color_matrix tbl_entry; +struct pipe_ctx *cur_pipe_ctx = + &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];unsigned int i;memset (&tbl_entry,0 ,sizeof (tbl_entry));
@@ -2815,6 +2817,14 @@ static void dce110_program_front_end_for_pipe( &plane_state->tiling_info, plane_state->rotation); +/* Moved programming gamma from dc to hwss */ +if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) { + dc->hwss.set_input_transfer_func ( + pipe_ctx, pipe_ctx->plane_state); + dc->hwss.set_output_transfer_func ( + pipe_ctx, pipe_ctx->stream); + } +dm_logger_write (dc->ctx->logger,LOG_SURFACE ,"Pipe:%d 0x%x: addr hi:0x%x, " "addr low:0x%x, "
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +17 -0
@@ -2408,6 +2408,10 @@ static void program_all_pipe_in_tree( }if (pipe_ctx->plane_state !=NULL ) { +struct dc_cursor_position position = {0 }; +struct pipe_ctx *cur_pipe_ctx = + &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx]; +dcn10_power_on_fe (dc, pipe_ctx, context);/* temporary dcn1 wa:
@@ -2422,6 +2426,19 @@ static void program_all_pipe_in_tree(toggle_watermark_change_req (dc->hwseq);update_dchubp_dpp (dc, pipe_ctx, context); + +/* TODO: this is a hack w/a for switching from mpo to pipe split */ +dc_stream_set_cursor_position (pipe_ctx->stream, &position); + +dc_stream_set_cursor_attributes (pipe_ctx->stream, + &pipe_ctx->stream->cursor_attributes); + +if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) { + dc->hwss.set_input_transfer_func ( + pipe_ctx, pipe_ctx->plane_state); + dc->hwss.set_output_transfer_func ( + pipe_ctx, pipe_ctx->stream); + } }if (dc->debug.sanity_checks) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 78/103 drm/amd/display: add dpms state to DC follow up
In reply to a message not in the archiveFrom: Hersen Wu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -332,7 +332,7 @@ static void set_dither_option(struct dc_stream_state *stream, {struct bit_depth_reduction_params params;struct dc_link *link = stream->status.link; -struct pipe_ctx *pipes; +struct pipe_ctx *pipes =NULL ;int i;for (i =0 ; i <MAX_PIPES ; i++) {
@@ -344,7 +344,7 @@ static void set_dither_option(struct dc_stream_state *stream, }memset (¶ms,0 ,sizeof (params)); -if (!stream) +if (!pipes)return ;if (option >DITHER_OPTION_MAX )return ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 79/103 drm/amd/display: Handle case when stream not found in set_dpms
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
When validate with context fail to add stream to the context, we have a case where set_dpms won't be able to find the stream that need to be disabled.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -1
@@ -363,7 +363,7 @@ void set_dpms( struct dc_stream_state *stream, bool dpms_off) { -struct pipe_ctx *pipe_ctx; +struct pipe_ctx *pipe_ctx =NULL ;int i;for (i =0 ; i <MAX_PIPES ; i++) {
@@ -373,6 +373,11 @@ void set_dpms( } } +if (!pipe_ctx) { +ASSERT (0 ); +return ; + } +if (stream->dpms_off != dpms_off) { stream->dpms_off = dpms_off;if (dpms_off)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 80/103 drm/amd/display: Ignore wrong tautological warning
In reply to a message not in the archiveSome of our HW calcs functions compares a var against itself to check for NaN. Gcc isn't fond of it and wrongfully warns about a tautological comparison. Disable this check for dcn_calcs_math.c.
--- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +1 -1
@@ -5,7 +5,7 @@ CFLAGS_dcn_calcs.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_auto.o := -mhard-float -msse -mpreferred-stack-boundary=4 -CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 +CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 -Wno-tautological-compare BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 81/103 drm/amd/display: dal 3.1.04
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.03" +#define DC_VER "3.1.04"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 82/103 drm/amd/display: group DCN watermark registers
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +11 -8
@@ -163,23 +163,15 @@SR (REFCLK_CNTL ), \SR (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A ),\SR (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_A ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A ),\SR (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A ),\SR (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B ),\SR (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_B ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B ),\SR (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B ),\SR (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C ),\SR (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_C ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C ),\SR (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C ),\SR (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D ),\SR (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_D ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D ),\ -SR (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D ),\SR (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D ),\SR (DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL ),\ SR(DCHUBBUB_ARB_DRAM_STATE_CNTL),\
@@ -207,8 +199,19 @@MMHUB_SR (MC_VM_SYSTEM_APERTURE_LOW_ADDR ),\ MMHUB_SR(MC_VM_SYSTEM_APERTURE_HIGH_ADDR) +#define HWSEQ_SR_WATERMARK_REG_LIST ()\ + SR(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A),\ + SR(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A),\ + SR(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B),\ + SR(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B),\ + SR(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C),\ + SR(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C),\ + SR(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D),\ + SR(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D) +#define HWSEQ_DCN1_REG_LIST ()\ HWSEQ_DCN_REG_LIST(), \ + HWSEQ_SR_WATERMARK_REG_LIST(), \ HWSEQ_PIXEL_RATE_REG_LIST(OTG), \ HWSEQ_PHYPLL_REG_LIST(OTG), \ SR(DCHUBBUB_SDPIF_FB_TOP),\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 83/103 drm/amd/display: rename struct mem_input to hubp for dcn
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 22 +-- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 3 - .../amd/display/dc/dce110/dce110_hw_sequencer.c | 19 +-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 88 ++++++------ .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c | 157 ++++++++++----------- .../gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h | 49 +++---- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 26 ++-- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 105 ++++++++++++++ drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h | 3 - 13 files changed, 286 insertions(+), 195 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -0
@@ -485,6 +485,7 @@ static void split_stream_across_pipes( secondary_pipe->pipe_idx = pipe_idx; secondary_pipe->plane_res.mi = pool->mis[secondary_pipe->pipe_idx]; + secondary_pipe->plane_res.hubp = pool->hubps[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.ipp = pool->ipps[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.xfm = pool->transforms[secondary_pipe->pipe_idx];if (primary_pipe->bottom_pipe) {
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -47,6 +47,7 @@#include "dc_link_ddc.h" #include "dm_helpers.h" #include "mem_input.h" +#include "hubp.h" /*******************************************************************************
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -1
@@ -1024,7 +1024,7 @@ static int acquire_first_split_pipe(memset (pipe_ctx,0 ,sizeof (*pipe_ctx)); pipe_ctx->stream_res.tg = pool->timing_generators[i]; - pipe_ctx->plane_res.mi = pool->mis[i]; + pipe_ctx->plane_res.hubp = pool->hubps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.xfm = pool->transforms[i]; pipe_ctx->stream_res.opp = pool->opps[i];
@@ -1359,6 +1359,7 @@ static int acquire_first_free_pipe( pipe_ctx->stream_res.tg = pool->timing_generators[i]; pipe_ctx->plane_res.mi = pool->mis[i]; + pipe_ctx->plane_res.hubp = pool->hubps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.xfm = pool->transforms[i]; pipe_ctx->stream_res.opp = pool->opps[i];
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +14 -8
@@ -200,7 +200,7 @@ bool dc_stream_set_cursor_attributes(for (i =0 ; i <MAX_PIPES ; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; -if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.mi || !pipe_ctx->plane_res.xfm) +if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.xfm)continue ;if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state)continue ;
@@ -210,10 +210,15 @@ bool dc_stream_set_cursor_attributes( pipe_ctx->plane_res.ipp->funcs->ipp_cursor_set_attributes ( pipe_ctx->plane_res.ipp, attributes); -if (pipe_ctx->plane_res.mi->funcs->set_cursor_attributes !=NULL ) +if (pipe_ctx->plane_res.hubp !=NULL ) + pipe_ctx->plane_res.hubp->funcs->set_cursor_attributes ( + pipe_ctx->plane_res.hubp, attributes); + +if (pipe_ctx->plane_res.mi !=NULL ) pipe_ctx->plane_res.mi->funcs->set_cursor_attributes ( pipe_ctx->plane_res.mi, attributes); +if (pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes !=NULL ) pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes ( pipe_ctx->plane_res.xfm, attributes);
@@ -248,7 +253,7 @@ bool dc_stream_set_cursor_position(for (i =0 ; i <MAX_PIPES ; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; -struct mem_input *mi = pipe_ctx->plane_res.mi; +struct hubp *hubp = pipe_ctx->plane_res.hubp;struct transform *xfm = pipe_ctx->plane_res.xfm;struct dc_cursor_position pos_cpy = *position;struct dc_cursor_mi_param param = {
@@ -260,7 +265,7 @@ bool dc_stream_set_cursor_position( };if (pipe_ctx->stream != stream || - !pipe_ctx->plane_res.mi || + (!pipe_ctx->plane_res.mi && !pipe_ctx->plane_res.hubp) || !pipe_ctx->plane_state || !pipe_ctx->plane_res.xfm)continue ;
@@ -276,11 +281,12 @@ bool dc_stream_set_cursor_position(if (ipp->funcs->ipp_cursor_set_position !=NULL ) ipp->funcs->ipp_cursor_set_position (ipp, &pos_cpy, ¶m); -if (mi->funcs->set_cursor_attributes !=NULL ) - mi->funcs->set_cursor_position (mi, &pos_cpy, ¶m); +if (hubp !=NULL ) + hubp->funcs->set_cursor_position (hubp, &pos_cpy, ¶m); + +if (xfm !=NULL ) + xfm->funcs->set_cursor_position (xfm, &pos_cpy, ¶m, hubp->curs_attr.width); -if (xfm->funcs->set_cursor_attributes !=NULL ) - xfm->funcs->set_cursor_position (xfm, &pos_cpy, ¶m, mi->curs_attr.width); }return true;
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +0 -3
@@ -685,9 +685,6 @@ void dce_mem_input_construct( dce_mi->regs = regs; dce_mi->shifts = mi_shift; dce_mi->masks = mi_mask; - - dce_mi->base.mpcc_id =0xf ; - dce_mi->base.opp_id =0xf ; } void dce112_mem_input_construct(
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +10 -9
@@ -1378,15 +1378,14 @@ static enum dc_status apply_single_controller_ctx_to_hw( }/* mst support - use total stream count */ -#if defined(CONFIG_DRM_AMD_DC_DCN1_0 ) - if (pipe_ctx->plane_res.mi->funcs->allocate_mem_input != NULL) -#endif +if (pipe_ctx->plane_res.mi !=NULL ) { pipe_ctx->plane_res.mi->funcs->allocate_mem_input ( - pipe_ctx->plane_res.mi, - stream->timing.h_total, - stream->timing.v_total, - stream->timing.pix_clk_khz, - context->stream_count); + pipe_ctx->plane_res.mi, + stream->timing.h_total, + stream->timing.v_total, + stream->timing.pix_clk_khz, + context->stream_count); + } pipe_ctx->stream->sink->link->psr_enabled = false;
@@ -1556,7 +1555,7 @@ static void set_safe_displaymarks( SAFE_NBP_MARK, SAFE_NBP_MARK, SAFE_NBP_MARK, SAFE_NBP_MARK };for (i =0 ; i <MAX_PIPES ; i++) { -if (res_ctx->pipe_ctx[i].stream ==NULL ) +if (res_ctx->pipe_ctx[i].stream ==NULL || res_ctx->pipe_ctx[i].plane_res.mi ==NULL )continue ; res_ctx->pipe_ctx[i].plane_res.mi->funcs->mem_input_program_display_marks(
@@ -1565,6 +1564,7 @@ static void set_safe_displaymarks( max_marks, max_marks, MAX_WATERMARK); +if (i == underlay_idx) res_ctx->pipe_ctx[i].plane_res.mi->funcs->mem_input_program_chroma_display_marks( res_ctx->pipe_ctx[i].plane_res.mi,
@@ -1572,6 +1572,7 @@ static void set_safe_displaymarks( max_marks, max_marks, MAX_WATERMARK); + } }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +44 -44
266 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +72 -85
381 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +21 -28
118 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +13 -13
@@ -704,9 +704,9 @@ static void destruct(struct dcn10_resource_pool *pool)if (pool->base.ipps[i] !=NULL ) pool->base.ipps[i]->funcs->ipp_destroy (&pool->base.ipps[i]); -if (pool->base.mis[i] !=NULL ) { -kfree (TO_DCN10_MEM_INPUT (pool->base.mis[i])); - pool->base.mis[i] =NULL ; +if (pool->base.hubps[i] !=NULL ) { +kfree (TO_DCN10_HUBP (pool->base.hubps[i])); + pool->base.hubps[i] =NULL ; }if (pool->base.irqs !=NULL ) {
@@ -753,19 +753,19 @@ static void destruct(struct dcn10_resource_pool *pool)kfree (pool->base.pp_smu); } -static struct mem_input *dcn10_mem_input_create ( +static struct hubp *dcn10_hubp_create (struct dc_context *ctx,uint32_t inst) { -struct dcn10_mem_input *mem_inputn10 = -kzalloc (sizeof (struct dcn10_mem_input ),GFP_KERNEL ); +struct dcn10_hubp *hubp1 = +kzalloc (sizeof (struct dcn10_hubp ),GFP_KERNEL ); -if (!mem_inputn10) +if (!hubp1)return NULL ; -dcn10_mem_input_construct (mem_inputn10, ctx, inst, - &mi_regs[inst], &mi_shift, &mi_mask); -return &mem_inputn10->base; +dcn10_hubp_construct (hubp1, ctx, inst, + &mi_regs[inst], &mi_shift, &mi_mask); +return &hubp1->base; } static void get_pixel_clock_parameters(
@@ -918,7 +918,7 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer( idle_pipe->stream_res.tg = head_pipe->stream_res.tg; idle_pipe->stream_res.opp = head_pipe->stream_res.opp; - idle_pipe->plane_res.mi = pool->mis[idle_pipe->pipe_idx]; + idle_pipe->plane_res.hubp = pool->hubps[idle_pipe->pipe_idx]; idle_pipe->plane_res.ipp = pool->ipps[idle_pipe->pipe_idx]; idle_pipe->plane_res.xfm = pool->transforms[idle_pipe->pipe_idx];
@@ -1357,8 +1357,8 @@ static bool construct(if ((pipe_fuses & (1 << i)) !=0 )continue ; - pool->base.mis[j] =dcn10_mem_input_create (ctx, i); -if (pool->base.mis[j] ==NULL ) { + pool->base.hubps[j] =dcn10_hubp_create (ctx, i); +if (pool->base.hubps[j] ==NULL ) {BREAK_TO_DEBUGGER ();dm_error ("DC: failed to create memory input!\n" );
drivers/gpu/drm/amd/display/dc/inc/core_types.h +3 -1
@@ -32,6 +32,7 @@#include "ddc_service_types.h" #include "dc_bios_types.h" #include "mem_input.h" +#include "hubp.h" #if defined(CONFIG_DRM_AMD_DC_DCN1_0 )#include "mpc.h" #endif
@@ -129,6 +130,7 @@ struct audio_support{struct resource_pool {struct mem_input *mis[MAX_PIPES ]; +struct hubp *hubps[MAX_PIPES ];struct input_pixel_processor *ipps[MAX_PIPES ];struct transform *transforms[MAX_PIPES ];struct output_pixel_processor *opps[MAX_PIPES ];
@@ -178,7 +180,7 @@ struct stream_resource {struct plane_resource {struct scaler_data scl_data; - +struct hubp *hubp;struct mem_input *mi;struct input_pixel_processor *ipp;struct transform *xfm;
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h new file +105 -0
105 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +0 -3
@@ -69,10 +69,7 @@ struct mem_input {struct dc_plane_address request_address;struct dc_plane_address current_address;int inst; -int opp_id; -int mpcc_id;struct stutter_modes stutter_mode; -struct dc_cursor_attributes curs_attr; };struct vm_system_aperture_param {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 84/103 drm/amd/display: Add DPP capabilities
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 5 +++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 23 +++-------- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 42 +++++++------------- drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 46 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +5 -0
@@ -444,6 +444,10 @@ static const struct transform_funcs dcn10_dpp_funcs = { .set_cursor_position = dcn10_set_cursor_position, }; +static struct dpp_caps dcn10_dpp_cap = { + .dscl_data_proc_format =DSCL_DATA_PRCESSING_FIXED_FORMAT , + .dscl_calc_lb_num_partitions = dscl1_calc_lb_num_partitions, +};/*****************************************/ /* Constructor, Destructor */
@@ -461,6 +465,7 @@ void dcn10_dpp_construct( xfm->base.inst = inst; xfm->base.funcs = &dcn10_dpp_funcs; + xfm->base.caps = &dcn10_dpp_cap; xfm->tf_regs = tf_regs; xfm->tf_shift = tf_shift;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +6 -17
@@ -1264,23 +1264,6 @@ struct dcn10_dpp {bool is_write_to_ram_a_safe; }; - -enum lb_memory_config { -/* Enable all 3 pieces of memory */ -LB_MEMORY_CONFIG_0 =0 , - -/* Enable only the first piece of memory */ -LB_MEMORY_CONFIG_1 =1 , - -/* Enable only the second piece of memory */ -LB_MEMORY_CONFIG_2 =2 , - -/* Only applicable in 4:2:0 mode, enable all 3 pieces of memory and the -* last piece of chroma memory used for the luma storage -*/ -LB_MEMORY_CONFIG_3 =3 -}; -enum dcn10_input_csc_select {INPUT_CSC_SELECT_BYPASS =0 ,INPUT_CSC_SELECT_ICSC ,
@@ -1292,6 +1275,12 @@ bool is_lb_conf_valid(int num_partitions, int vtaps); +void dscl1_calc_lb_num_partitions ( +const struct scaler_data *scl_data, +enum lb_memory_config lb_config, +int *num_part_y, +int *num_part_c); +void ippn10_degamma_ram_select (struct transform *xfm_base,bool use_ram_a);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +15 -27
105 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +46 -0
62 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 85/103 drm/amd/display: Add missing newlines in pstate wait debug messages
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
These were spamming the debugger logs.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -2
@@ -302,7 +302,7 @@ static void verify_allow_pstate_change_high(if (i > pstate_wait_expected_timeout_us)dm_logger_write (hws->ctx->logger,LOG_WARNING , -"pstate took longer than expected ~%dus" , +"pstate took longer than expected ~%dus\n" , i);return ;
@@ -326,7 +326,7 @@ static void verify_allow_pstate_change_high( }dm_logger_write (hws->ctx->logger,LOG_WARNING , -"pstate TEST_DEBUG_DATA: 0x%X" , +"pstate TEST_DEBUG_DATA: 0x%X\n" , debug_data);BREAK_TO_DEBUGGER (); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 86/103 drm/amd/display: Fix up plane_states add/remove logic
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
Our plane_states array trimming logic was faulty, we should be starting to shuffle from the plane that was just released, not from the very beginning of the array.
Also get rid of a leftover line that was setting the plane state at the stream index to null, leading to issues. Also move the dc_plane_state_retain call to where we reference plane_state, in case we do hit the error case where we can't get a free pipe.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -8
@@ -1073,9 +1073,6 @@ bool dc_add_plane_to_context(return false; } -/* retain new surfaces */ -dc_plane_state_retain (plane_state); - free_pipe =acquire_free_pipe_for_stream (context, pool, stream);#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )
@@ -1085,11 +1082,11 @@ bool dc_add_plane_to_context( free_pipe = &context->res_ctx.pipe_ctx[pipe_idx]; }#endif -if (!free_pipe) { - stream_status->plane_states[i] =NULL ; +if (!free_pipe)return false; - } +/* retain new surfaces */ +dc_plane_state_retain (plane_state); free_pipe->plane_state = plane_state;if (head_pipe != free_pipe) {
@@ -1181,8 +1178,8 @@ bool dc_remove_plane_from_context( stream_status->plane_count--; -/* Trim back arrays */ -for (i =0 ; i < stream_status->plane_count; i++) +/* Start at the plane we've just released, and move all the planes one index forward to "trim" the array */ +for (; i < stream_status->plane_count; i++) stream_status->plane_states[i] = stream_status->plane_states[i +1 ]; stream_status->plane_states[stream_status->plane_count] =NULL ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 87/103 drm/amd/display: dal 3.1.05
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.04" +#define DC_VER "3.1.05"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 88/103 drm/amd/display: renaming filename for hubp
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
---
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn10/{dcn10_mem_input.c => dcn10_hubp.c} | 2 +-
.../gpu/drm/amd/display/dc/dcn10/{dcn10_mem_input.h => dcn10_hubp.h} | 0
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 2 +-
5 files changed, 4 insertions(+), 4 deletions(-)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_mem_input.c => dcn10_hubp.c} (99%)
rename drivers/gpu/drm/amd/display/dc/dcn10/{dcn10_mem_input.h => dcn10_hubp.h} (100%)drivers/gpu/drm/amd/display/dc/dcn10/Makefile +1 -1
@@ -3,7 +3,7 @@ DCN10 = dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \ dcn10_dpp.o dcn10_opp.o dcn10_timing_generator.o \ - dcn10_mem_input.o dcn10_mpc.o \ + dcn10_hubp.o dcn10_mpc.o \ dcn10_dpp_dscl.o dcn10_dpp_cm.o dcn10_cm_common.o AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.c +1 -1
@@ -24,9 +24,9 @@*/ #include "dm_services.h" #include "dce_calcs.h" -#include "dcn10_mem_input.h" #include "reg_helper.h" #include "basics/conversion.h" +#include "dcn10_hubp.h" #define REG (reg)\ hubp1->mi_regs->reg
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mem_input.h +0 -0
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
@@ -31,7 +31,6 @@#include "dce110/dce110_hw_sequencer.h" #include "dce/dce_hwseq.h" #include "abm.h" -#include "dcn10/dcn10_mem_input.h" #include "dcn10/dcn10_timing_generator.h" #include "dcn10/dcn10_dpp.h" #include "dcn10/dcn10_mpc.h"
@@ -41,6 +40,7 @@#include "mpc.h" #include "reg_helper.h" #include "custom_float.h" +#include "dcn10_hubp.h" #define CTX \ hws->ctx
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -1
@@ -42,12 +42,12 @@#include "dce/dce_stream_encoder.h" #include "dce/dce_clocks.h" #include "dce/dce_clock_source.h" -#include "dcn10/dcn10_mem_input.h" #include "dce/dce_audio.h" #include "dce/dce_hwseq.h" #include "../virtual/virtual_stream_encoder.h" #include "dce110/dce110_resource.h" #include "dce112/dce112_resource.h" +#include "dcn10_hubp.h" #include "vega10/soc15ip.h"
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 89/103 drm/amd/display: Pull transfer func defines into DC
In reply to a message not in the archiveFrom: SivapiriyanKumarasamy <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +38 -0
@@ -318,6 +318,38 @@ enum {TRANSFER_FUNC_POINTS =1025 }; +// Moved here from color module for linux +enum color_transfer_func { + transfer_func_unknown, + transfer_func_srgb, + transfer_func_bt709, + transfer_func_pq2084, + transfer_func_pq2084_interim, + transfer_func_linear_0_1, + transfer_func_linear_0_125, + transfer_func_dolbyvision, + transfer_func_gamma_22, + transfer_func_gamma_26 +}; + +enum color_color_space { + color_space_unsupported, + color_space_srgb, + color_space_bt601, + color_space_bt709, + color_space_xv_ycc_bt601, + color_space_xv_ycc_bt709, + color_space_xr_rgb, + color_space_bt2020, + color_space_adobe, + color_space_dci_p3, + color_space_sc_rgb_ms_ref, + color_space_display_native, + color_space_app_ctrl, + color_space_dolby_vision, + color_space_custom_coordinates +}; +struct dc_hdr_static_metadata {/* display chromaticities and white point in units of 0.00001 */ unsigned int chromaticity_green_x;
@@ -398,6 +430,12 @@ struct dc_plane_state {struct dc_gamma *gamma_correction;struct dc_transfer_func *in_transfer_func; +// sourceContentAttribute cache +bool is_source_input_valid; +struct dc_hdr_static_metadata source_input_mastering_info; +enum color_color_space source_input_color_space; +enum color_transfer_func source_input_tf; +enum dc_color_space color_space;enum surface_pixel_format format;enum dc_rotation_angle rotation;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 90/103 drm/amd/display: Fix underscan not using proper scaling
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
fix underscan not being set correctly
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +11 -2
@@ -1362,7 +1362,7 @@ void dc_commit_updates_for_stream(struct dc *dc,enum surface_update_type update_type;struct dc_state *context;struct dc_context *dc_ctx = dc->ctx; -int i; +int i, j; stream_status =dc_stream_get_status (stream); context = dc->current_state;
@@ -1396,8 +1396,17 @@ void dc_commit_updates_for_stream(struct dc *dc,if (srf_updates[i].flip_addr) surface->address = srf_updates[i].flip_addr->address; - } +if (update_type >=UPDATE_TYPE_MED ) { +for (j =0 ; j < dc->res_pool->pipe_count; j++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j]; + +if (pipe_ctx->plane_state != surface) +continue ; +resource_build_scaling_params (pipe_ctx); + } + } + } commit_planes_for_stream( dc,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 91/103 drm/amd/display: Expose some MPC functions for reuse
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 11 +++--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h | 45 ++++++++++++++++------ .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 6 ++- drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 7 ++-- 4 files changed, 48 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +5 -6
@@ -65,7 +65,7 @@ static void mpc10_set_bg_color( MPCC_BG_B_CB, bg_b_cb); } -static void mpc10_assert_idle_mpcc (struct mpc *mpc,int id) +void mpc10_assert_idle_mpcc (struct mpc *mpc,int id) {struct dcn10_mpc *mpc10 =TO_DCN10_MPC (mpc);
@@ -116,7 +116,7 @@ static void mpc10_assert_mpcc_idle_before_connect(struct dcn10_mpc *mpc10, int i } } -static void mpc10_mpcc_remove( +void mpc10_mpcc_remove( struct mpc *mpc, struct mpc_tree_cfg *tree_cfg, int opp_id,
@@ -265,7 +265,7 @@ static void mpc10_add_to_tree_cfg( tree_cfg->num_pipes++; } -static int mpc10_mpcc_add (struct mpc *mpc,struct mpcc_cfg *cfg) +int mpc10_mpcc_add (struct mpc *mpc,struct mpcc_cfg *cfg) {struct dcn10_mpc *mpc10 =TO_DCN10_MPC (mpc);int mpcc_id, z_idx;
@@ -313,7 +313,7 @@ static int mpc10_mpcc_add(struct mpc *mpc, struct mpcc_cfg *cfg)return mpcc_id; } -static void mpc10_update_blend_mode ( +void mpc10_update_blend_mode (struct mpc *mpc,struct mpcc_cfg *cfg) {
@@ -339,8 +339,7 @@ const struct mpc_funcs dcn10_mpc_funcs = { .add = mpc10_mpcc_add, .remove = mpc10_mpcc_remove, .wait_for_idle = mpc10_assert_idle_mpcc, - .set_denorm = NULL, - .update_blend_mode = mpc10_update_blend_mode + .update_blend_mode = mpc10_update_blend_mode, }; void dcn10_mpc_construct(struct dcn10_mpc *mpc10,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h +34 -11
68 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +5 -1
@@ -329,7 +329,11 @@ static const struct dcn_mpc_registers mpc_regs = {MPC_COMMON_REG_LIST_DCN1_0 (0 ),MPC_COMMON_REG_LIST_DCN1_0 (1 ),MPC_COMMON_REG_LIST_DCN1_0 (2 ), -MPC_COMMON_REG_LIST_DCN1_0 (3 ) +MPC_COMMON_REG_LIST_DCN1_0 (3 ), +MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0 (0 ), +MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0 (1 ), +MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0 (2 ), +MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0 (3 ) }; static const struct dcn_mpc_shift mpc_shift = {
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +4 -3
@@ -46,15 +46,16 @@ struct mpc {struct mpc_funcs {int (*add)(struct mpc *mpc,struct mpcc_cfg *cfg); +void (*remove)(struct mpc *mpc,struct mpc_tree_cfg *tree_cfg,int opp_id,int mpcc_inst); +void (*wait_for_idle)(struct mpc *mpc,int id); -void (*set_denorm)(struct mpc *mpc, -int opp_id, -enum dc_color_depth output_depth); +void (*update_blend_mode)(struct mpc *mpc,struct mpcc_cfg *cfg); + };#endif
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 92/103 drm/amd/display: change when to set tap_hardcode_coeff
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
Set hardcode_coeff only when BOTH chroma and luma taps are more than 1
without this underscan with h or v set to 0 darkens the screen (either h or v set to 0, not both)
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +2 -2
@@ -306,10 +306,10 @@ static void dpp_set_scl_filter( h_2tap_hardcode_coef_en = scl_data->taps.h_taps <3 && scl_data->taps.h_taps_c <3 - && (scl_data->taps.h_taps >1 || scl_data->taps.h_taps_c >1 ); + && (scl_data->taps.h_taps >1 && scl_data->taps.h_taps_c >1 ); v_2tap_hardcode_coef_en = scl_data->taps.v_taps <3 && scl_data->taps.v_taps_c <3 - && (scl_data->taps.v_taps >1 || scl_data->taps.v_taps_c >1 ); + && (scl_data->taps.v_taps >1 && scl_data->taps.v_taps_c >1 ); h_2tap_sharp_en = h_2tap_hardcode_coef_en && h_2tap_sharp_factor !=0 ; v_2tap_sharp_en = v_2tap_hardcode_coef_en && v_2tap_sharp_factor !=0 ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 93/103 drm/amd/display: [RV] bug in cm programming
In reply to a message not in the archiveFrom: Vitaly Prosyak <[email protected]>
When surface bigger then 10 bpc the output pixel does not match to the required value.Update CRC's.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 6 +++++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +5 -1
@@ -164,7 +164,8 @@SRI (CM_IGAM_LUT_RW_CONTROL ,CM , id), \SRI (CM_IGAM_LUT_RW_INDEX ,CM , id), \SRI (CM_IGAM_LUT_SEQ_COLOR ,CM , id), \ - SRI(CURSOR_CONTROL, CURSOR, id) +SRI (CURSOR_CONTROL ,CURSOR , id), \ + SRI(CM_CMOUT_CONTROL, CM, id)#define TF_REG_LIST_SH_MASK_DCN (mask_sh)\
@@ -401,6 +402,7 @@TF_SF (CM0_CM_CONTROL ,CM_BYPASS_EN , mask_sh), \TF_SF (CM0_CM_IGAM_LUT_SEQ_COLOR ,CM_IGAM_LUT_SEQ_COLOR , mask_sh), \TF_SF (CNVC_CFG0_FORMAT_CONTROL ,OUTPUT_FP , mask_sh), \ +TF_SF (CM0_CM_CMOUT_CONTROL ,CM_CMOUT_ROUND_TRUNC_MODE , mask_sh), \TF_SF (CURSOR0_CURSOR_CONTROL ,CURSOR_MODE , mask_sh), \TF_SF (CURSOR0_CURSOR_CONTROL ,CURSOR_PITCH , mask_sh), \ TF_SF(CURSOR0_CURSOR_CONTROL, CURSOR_LINES_PER_CHUNK, mask_sh), \
@@ -549,6 +551,7 @@type CM_RGAM_RAMA_EXP_REGION33_LUT_OFFSET ; \type CM_RGAM_RAMA_EXP_REGION33_NUM_SEGMENTS ; \type CM_RGAM_LUT_MODE ; \ +type CM_CMOUT_ROUND_TRUNC_MODE ; \type OBUF_BYPASS ; \type OBUF_H_2X_UPSCALE_EN ; \type CM_BLNDGAM_LUT_MODE ; \
@@ -1081,6 +1084,7 @@ struct dcn_dpp_registers {uint32_t CM_RGAM_RAMA_REGION_0_1 ;uint32_t CM_RGAM_RAMA_REGION_32_33 ;uint32_t CM_RGAM_CONTROL ; +uint32_t CM_CMOUT_CONTROL ;uint32_t OBUF_CONTROL ;uint32_t CM_BLNDGAM_LUT_WRITE_EN_MASK ;uint32_t CM_BLNDGAM_CONTROL ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +1 -1
@@ -602,7 +602,7 @@ static void ippn10_enable_cm_block( struct transform *xfm_base) {struct dcn10_dpp *xfm =TO_DCN10_DPP (xfm_base); - +REG_UPDATE (CM_CMOUT_CONTROL ,CM_CMOUT_ROUND_TRUNC_MODE ,8 );REG_UPDATE (CM_CONTROL ,CM_BYPASS_EN ,0 ); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 94/103 drm/amd/display: Fix a logic defect in cursor move
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
Regression caused by: Ib98354194d7
Need to check crtc->stream before updating cursor attributes and position.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -4
@@ -3899,14 +3899,15 @@ static void handle_cursor_update( attributes.pitch = attributes.width; -if (!dc_stream_set_cursor_attributes (crtc_state->stream, - &attributes)) -DRM_ERROR ("DC failed to set cursor attributes\n" ); +if (crtc_state->stream) { +if (!dc_stream_set_cursor_attributes (crtc_state->stream, + &attributes)) +DRM_ERROR ("DC failed to set cursor attributes\n" ); -if (crtc_state->stream)if (!dc_stream_set_cursor_position (crtc_state->stream, &position))DRM_ERROR ("DC failed to set cursor position\n" ); + } }static void prepare_flip_isr (struct amdgpu_crtc *acrtc)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 95/103 drm/amd/display: fix null dereference in reset hw ctx
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
@@ -1877,7 +1877,7 @@ static void dce110_reset_hw_ctx_wrap(struct clock_source *old_clk = pipe_ctx_old->clock_source;/* disable already, no need to disable again */ -if (!pipe_ctx->stream->dpms_off) +if (pipe_ctx->stream && !pipe_ctx->stream->dpms_off)core_link_disable_stream (pipe_ctx_old,FREE_ACQUIRED_RESOURCE ); pipe_ctx_old->stream_res.tg->funcs->set_blank (pipe_ctx_old->stream_res.tg, true);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 96/103 drm/amd/display: add null check for cursor functions
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +10 -4
@@ -210,11 +210,13 @@ bool dc_stream_set_cursor_attributes( pipe_ctx->plane_res.ipp->funcs->ipp_cursor_set_attributes ( pipe_ctx->plane_res.ipp, attributes); -if (pipe_ctx->plane_res.hubp !=NULL ) +if (pipe_ctx->plane_res.hubp !=NULL && + pipe_ctx->plane_res.hubp->funcs->set_cursor_attributes !=NULL ) pipe_ctx->plane_res.hubp->funcs->set_cursor_attributes ( pipe_ctx->plane_res.hubp, attributes); -if (pipe_ctx->plane_res.mi !=NULL ) +if (pipe_ctx->plane_res.mi !=NULL && + pipe_ctx->plane_res.mi->funcs->set_cursor_attributes !=NULL ) pipe_ctx->plane_res.mi->funcs->set_cursor_attributes ( pipe_ctx->plane_res.mi, attributes);
@@ -253,6 +255,7 @@ bool dc_stream_set_cursor_position(for (i =0 ; i <MAX_PIPES ; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; +struct mem_input *mi = pipe_ctx->plane_res.mi;struct hubp *hubp = pipe_ctx->plane_res.hubp;struct transform *xfm = pipe_ctx->plane_res.xfm;struct dc_cursor_position pos_cpy = *position;
@@ -281,10 +284,13 @@ bool dc_stream_set_cursor_position(if (ipp->funcs->ipp_cursor_set_position !=NULL ) ipp->funcs->ipp_cursor_set_position (ipp, &pos_cpy, ¶m); -if (hubp !=NULL ) +if (mi !=NULL && mi->funcs->set_cursor_position !=NULL ) + mi->funcs->set_cursor_position (mi, &pos_cpy, ¶m); + +if (hubp !=NULL && hubp->funcs->set_cursor_position !=NULL ) hubp->funcs->set_cursor_position (hubp, &pos_cpy, ¶m); -if (xfm !=NULL ) +if (xfm !=NULL && xfm->funcs->set_cursor_position !=NULL ) xfm->funcs->set_cursor_position (xfm, &pos_cpy, ¶m, hubp->curs_attr.width); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 97/103 drm/amd/display: rename transform to dpp for dcn
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 16 +- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 16 +- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 144 ++++++------ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 94 ++++---- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 261 +++++++++++---------- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 104 ++++---- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 59 ++--- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 22 +- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 3 + drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 134 +++++++++++ 13 files changed, 509 insertions(+), 347 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -0
@@ -488,6 +488,7 @@ static void split_stream_across_pipes( secondary_pipe->plane_res.hubp = pool->hubps[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.ipp = pool->ipps[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.xfm = pool->transforms[secondary_pipe->pipe_idx]; + secondary_pipe->plane_res.dpp = pool->dpps[secondary_pipe->pipe_idx];if (primary_pipe->bottom_pipe) {ASSERT (primary_pipe->bottom_pipe != secondary_pipe); secondary_pipe->bottom_pipe = primary_pipe->bottom_pipe;
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -38,6 +38,7 @@#include "bios_parser_interface.h" #include "include/irq_service_interface.h" #include "transform.h" +#include "dpp.h" #include "timing_generator.h" #include "virtual/virtual_link_encoder.h"
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +13 -3
@@ -31,6 +31,7 @@#include "opp.h" #include "timing_generator.h" #include "transform.h" +#include "dpp.h" #include "core_types.h" #include "set_mode_types.h" #include "virtual/virtual_stream_encoder.h"
@@ -853,8 +854,13 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx) pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable;/* Taps calculations */ - res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps ( - pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality); +if (pipe_ctx->plane_res.xfm !=NULL ) + res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps ( + pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality); + +if (pipe_ctx->plane_res.dpp !=NULL ) + res = pipe_ctx->plane_res.dpp->funcs->dpp_get_optimal_number_of_taps ( + pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);if (!res) {/* Try 24 bpp linebuffer */
@@ -862,6 +868,9 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx) res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps ( pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality); + + res = pipe_ctx->plane_res.dpp->funcs->dpp_get_optimal_number_of_taps ( + pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality); }if (res)
@@ -1026,7 +1035,7 @@ static int acquire_first_split_pipe( pipe_ctx->stream_res.tg = pool->timing_generators[i]; pipe_ctx->plane_res.hubp = pool->hubps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i]; - pipe_ctx->plane_res.xfm = pool->transforms[i]; + pipe_ctx->plane_res.dpp = pool->dpps[i]; pipe_ctx->stream_res.opp = pool->opps[i]; pipe_ctx->pipe_idx = i;
@@ -1359,6 +1368,7 @@ static int acquire_first_free_pipe( pipe_ctx->plane_res.hubp = pool->hubps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.xfm = pool->transforms[i]; + pipe_ctx->plane_res.dpp = pool->dpps[i]; pipe_ctx->stream_res.opp = pool->opps[i]; pipe_ctx->pipe_idx = i;
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +13 -3
@@ -200,7 +200,7 @@ bool dc_stream_set_cursor_attributes(for (i =0 ; i <MAX_PIPES ; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; -if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.xfm) +if (pipe_ctx->stream != stream || (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp))continue ;if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state)continue ;
@@ -221,9 +221,15 @@ bool dc_stream_set_cursor_attributes( pipe_ctx->plane_res.mi, attributes); -if (pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes !=NULL ) +if (pipe_ctx->plane_res.xfm !=NULL && + pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes !=NULL ) pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes ( pipe_ctx->plane_res.xfm, attributes); + +if (pipe_ctx->plane_res.dpp !=NULL && + pipe_ctx->plane_res.dpp->funcs->set_cursor_attributes !=NULL ) + pipe_ctx->plane_res.dpp->funcs->set_cursor_attributes ( + pipe_ctx->plane_res.dpp, attributes); } stream->cursor_attributes = *attributes;
@@ -258,6 +264,7 @@ bool dc_stream_set_cursor_position(struct mem_input *mi = pipe_ctx->plane_res.mi;struct hubp *hubp = pipe_ctx->plane_res.hubp;struct transform *xfm = pipe_ctx->plane_res.xfm; +struct dpp *dpp = pipe_ctx->plane_res.dpp;struct dc_cursor_position pos_cpy = *position;struct dc_cursor_mi_param param = { .pixel_clk_khz = stream->timing.pix_clk_khz,
@@ -270,7 +277,7 @@ bool dc_stream_set_cursor_position(if (pipe_ctx->stream != stream || (!pipe_ctx->plane_res.mi && !pipe_ctx->plane_res.hubp) || !pipe_ctx->plane_state || - !pipe_ctx->plane_res.xfm) + (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp))continue ; if (pipe_ctx->plane_state->address.type
@@ -293,6 +300,9 @@ bool dc_stream_set_cursor_position(if (xfm !=NULL && xfm->funcs->set_cursor_position !=NULL ) xfm->funcs->set_cursor_position (xfm, &pos_cpy, ¶m, hubp->curs_attr.width); +if (dpp !=NULL && dpp->funcs->set_cursor_position !=NULL ) + dpp->funcs->set_cursor_position (dpp, &pos_cpy, ¶m, hubp->curs_attr.width); + }return true;
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +1 -0
@@ -30,6 +30,7 @@/* DC core (private) */ #include "core_types.h" #include "transform.h" +#include "dpp.h" /******************************************************************************* * Private functions
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +72 -72
283 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +47 -47
163 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +131 -130
562 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +52 -52
297 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +30 -29
177 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +11 -11
@@ -446,13 +446,13 @@ static const struct dc_debug debug_defaults_diags = { .disable_pplib_wm_range = true }; -static void dcn10_dpp_destroy (struct transform **xfm) +static void dcn10_dpp_destroy (struct dpp **dpp) { -kfree (TO_DCN10_DPP (*xfm)); - *xfm =NULL ; +kfree (TO_DCN10_DPP (*dpp)); + *dpp =NULL ; } -static struct transform *dcn10_dpp_create ( +static struct dpp *dcn10_dpp_create (struct dc_context *ctx,uint32_t inst) {
@@ -462,8 +462,8 @@ static struct transform *dcn10_dpp_create(if (!dpp)return NULL ; -dcn10_dpp_construct (dpp, ctx, inst, - &tf_regs[inst], &tf_shift, &tf_mask); +dpp1_construct (dpp, ctx, inst, + &tf_regs[inst], &tf_shift, &tf_mask);return &dpp->base; }
@@ -702,8 +702,8 @@ static void destruct(struct dcn10_resource_pool *pool)if (pool->base.opps[i] !=NULL ) pool->base.opps[i]->funcs->opp_destroy (&pool->base.opps[i]); -if (pool->base.transforms[i] !=NULL ) -dcn10_dpp_destroy (&pool->base.transforms[i]); +if (pool->base.dpps[i] !=NULL ) +dcn10_dpp_destroy (&pool->base.dpps[i]);if (pool->base.ipps[i] !=NULL ) pool->base.ipps[i]->funcs->ipp_destroy (&pool->base.ipps[i]);
@@ -924,7 +924,7 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer( idle_pipe->plane_res.hubp = pool->hubps[idle_pipe->pipe_idx]; idle_pipe->plane_res.ipp = pool->ipps[idle_pipe->pipe_idx]; - idle_pipe->plane_res.xfm = pool->transforms[idle_pipe->pipe_idx]; + idle_pipe->plane_res.dpp = pool->dpps[idle_pipe->pipe_idx];return idle_pipe; }
@@ -1377,8 +1377,8 @@ static bool construct( goto ipp_create_fail; } - pool->base.transforms[j] =dcn10_dpp_create (ctx, i); -if (pool->base.transforms[j] ==NULL ) { + pool->base.dpps[j] =dcn10_dpp_create (ctx, i); +if (pool->base.dpps[j] ==NULL ) {BREAK_TO_DEBUGGER ();dm_error ("DC: failed to create dpp!\n" );
drivers/gpu/drm/amd/display/dc/inc/core_types.h +3 -0
@@ -84,6 +84,7 @@ void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable);/********** DAL Core*********************/ #include "display_clock.h" #include "transform.h" +#include "dpp.h" struct resource_pool ;struct dc_state ;
@@ -133,6 +134,7 @@ struct resource_pool {struct hubp *hubps[MAX_PIPES ];struct input_pixel_processor *ipps[MAX_PIPES ];struct transform *transforms[MAX_PIPES ]; +struct dpp *dpps[MAX_PIPES ];struct output_pixel_processor *opps[MAX_PIPES ];struct timing_generator *timing_generators[MAX_PIPES ];struct stream_encoder *stream_enc[MAX_PIPES *2 ];
@@ -184,6 +186,7 @@ struct plane_resource {struct mem_input *mi;struct input_pixel_processor *ipp;struct transform *xfm; +struct dpp *dpp; };struct pipe_ctx {
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h new file +134 -0
134 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 98/103 drm/amd/display: Do not set bandwidth on page flips.
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
Which removes a lockdep warning for a possible deadlock situation:
While holding the drm event mutex (hard irq safe), dc_post_update_surfaces_to_stream eventually acquires the atom context lock, which is hard irq unsafe. We should only be calling it on full updates anyways.
Also remove a redundant call to dc_post_update_surfaces_to_stream, dc_commit_updates_for_stream already calls it.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -3
@@ -980,8 +980,6 @@ bool dc_commit_planes_to_stream( new_plane_count, dc_stream, stream_update, plane_states, state); -dc_post_update_surfaces_to_stream (dc); -kfree (stream_update);return true; }
@@ -1418,7 +1416,8 @@ void dc_commit_updates_for_stream(struct dc *dc, update_type, context); -dc_post_update_surfaces_to_stream (dc); +if (update_type >=UPDATE_TYPE_FULL ) +dc_post_update_surfaces_to_stream (dc);if (dc->current_state != context) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 99/103 drm/amd/display: Remove a false-positive error message
In reply to a message not in the archiveFrom: Jerry Zuo <[email protected]>
To avoid confusion, need to suppress the error message when get -ERESTARTSYS error code. It is normal when getting interrupted by signals in the process of a wait for the buffer to become unreserved. Only propagate to user-mode for further action, no need to pop up error message.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -1
@@ -1779,7 +1779,9 @@ static int get_fb_info(int r =amdgpu_bo_reserve (rbo, false);if (unlikely (r)) { -DRM_ERROR ("Unable to reserve buffer\n" ); +// Don't show error msg. when return -ERESTARTSYS +if (r != -ERESTARTSYS ) +DRM_ERROR ("Unable to reserve buffer: %d\n" , r);return r; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 100/103 drm/amd/display: add performance trace macro to dc
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 6 ++ drivers/gpu/drm/amd/display/dc/basics/logger.c | 78 ++++++---------------- drivers/gpu/drm/amd/display/dc/basics/logger.h | 37 ---------- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 5 +- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 5 -- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 40 +++++------ .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dm_services.h | 2 + .../gpu/drm/amd/display/include/logger_interface.h | 28 ++++++++ drivers/gpu/drm/amd/display/include/logger_types.h | 36 +++++++++- 11 files changed, 118 insertions(+), 121 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +6 -0
@@ -76,6 +76,12 @@ void dal_isr_release_lock(struct dc_context *ctx)* End-of-IRQ Interfaces. *****************************************************************************/ +unsigned long long dm_get_timestamp (struct dc_context *ctx) +{ +/* TODO: return actual timestamp */ +return 0 ; +} + bool dm_write_persistent_data(struct dc_context *ctx, const struct dc_sink *sink, const char *module_name,
drivers/gpu/drm/amd/display/dc/basics/logger.c +22 -56
125 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/basics/logger.h +0 -37
@@ -26,42 +26,5 @@#ifndef __DAL_LOGGER_H__#define __DAL_LOGGER_H__ -/* Structure for keeping track of offsets, buffer, etc */ - -#define DAL_LOGGER_BUFFER_MAX_SIZE 2048 - -/*Connectivity log needs to output EDID, which needs at lease 256x3 bytes, -* change log line size to 896 to meet the request. -*/ -#define LOG_MAX_LINE_SIZE 896 - -#include "include/logger_types.h" - -struct dal_logger { - -/* How far into the circular buffer has been read by dsat -* Read offset should never cross write offset. Write \0's to -* read data just to be sure? -*/ -uint32_t buffer_read_offset; - -/* How far into the circular buffer we have written -* Write offset should never cross read offset -*/ -uint32_t buffer_write_offset; - -uint32_t write_wrap_count; -uint32_t read_wrap_count; - -uint32_t open_count; - -char *log_buffer;/* Pointer to malloc'ed buffer */ -uint32_t log_buffer_size;/* Size of circular buffer */ - -uint32_t mask;/*array of masks for major elements*/ - -union logger_flags flags; -struct dc_context *ctx; -};#endif /* __DAL_LOGGER_H__ */
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +4 -1
@@ -682,6 +682,7 @@ bool dcn_validate_bandwidth(bool bw_limit_pass;float bw_limit; +PERFORMANCE_TRACE_START ();if (dcn_bw_apply_registry_override (dc))dcn_bw_sync_calcs_and_dml (dc);
@@ -1089,6 +1090,8 @@ bool dcn_validate_bandwidth(kernel_fpu_end (); +PERFORMANCE_TRACE_END (); +if (bw_limit_pass && v->voltage_level !=5 )return true;else
@@ -1223,7 +1226,7 @@ unsigned int dcn_find_dcfclk_suits_all(else dcf_clk = dc->dcn_soc->dcfclkv_min0p65*1000 ; -dm_logger_write (dc->ctx->logger,LOG_HW_MARKS , +dm_logger_write (dc->ctx->logger,LOG_BANDWIDTH_CALCS ,"\tdcf_clk for voltage = %d\n" , dcf_clk);return dcf_clk; }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -224,6 +224,7 @@ struct dc_debug {bool disable_dpp_pg;bool disable_stereo_support;bool vsr_support; +bool performance_trace; };struct dc_state ;struct resource_pool ;
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +0 -5
@@ -757,11 +757,6 @@ void dce110_link_encoder_construct( enc110->base.preferred_engine =ENGINE_ID_UNKNOWN ; } -dm_logger_write (init_data->ctx->logger,LOG_I2C_AUX , -"Using channel: %s [%d]\n" , -DECODE_CHANNEL_ID (init_data->channel), - init_data->channel); -/* Override features with DCE-specific values */ if (BP_RESULT_OK == bp_funcs->get_encoder_cap_info( enc110->base.ctx->dc_bios, enc110->base.id,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +20 -20
@@ -468,7 +468,7 @@ static void program_watermarks( refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.urgent_ns, prog_wm_value);
@@ -476,7 +476,7 @@ static void program_watermarks( prog_wm_value =convert_and_clamp (watermarks->a.pte_meta_urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.pte_meta_urgent_ns, prog_wm_value);
@@ -487,7 +487,7 @@ static void program_watermarks( refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_EXIT_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -497,7 +497,7 @@ static void program_watermarks( watermarks->a.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -507,7 +507,7 @@ static void program_watermarks( watermarks->a.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n\n" , watermarks->a.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -517,7 +517,7 @@ static void program_watermarks( prog_wm_value =convert_and_clamp ( watermarks->b.urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.urgent_ns, prog_wm_value);
@@ -527,7 +527,7 @@ static void program_watermarks( watermarks->b.pte_meta_urgent_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.pte_meta_urgent_ns, prog_wm_value);
@@ -537,7 +537,7 @@ static void program_watermarks( watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -547,7 +547,7 @@ static void program_watermarks( watermarks->b.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -556,7 +556,7 @@ static void program_watermarks( watermarks->b.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_B calculated =%d\n\n" "HW register value = 0x%x\n" , watermarks->b.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -565,7 +565,7 @@ static void program_watermarks( prog_wm_value =convert_and_clamp ( watermarks->c.urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.urgent_ns, prog_wm_value);
@@ -575,7 +575,7 @@ static void program_watermarks( watermarks->c.pte_meta_urgent_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.pte_meta_urgent_ns, prog_wm_value);
@@ -585,7 +585,7 @@ static void program_watermarks( watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -595,7 +595,7 @@ static void program_watermarks( watermarks->c.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -605,7 +605,7 @@ static void program_watermarks( watermarks->c.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_C calculated =%d\n\n" "HW register value = 0x%x\n" , watermarks->c.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -614,7 +614,7 @@ static void program_watermarks( prog_wm_value =convert_and_clamp ( watermarks->d.urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.urgent_ns, prog_wm_value);
@@ -623,7 +623,7 @@ static void program_watermarks( watermarks->d.pte_meta_urgent_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.pte_meta_urgent_ns, prog_wm_value);
@@ -633,7 +633,7 @@ static void program_watermarks( watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -643,7 +643,7 @@ static void program_watermarks( watermarks->d.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -653,7 +653,7 @@ static void program_watermarks( watermarks->d.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_HW_MARKS , +dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n\n" , watermarks->d.cstate_pstate.pstate_change_ns, prog_wm_value);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
@@ -434,6 +434,7 @@ static const struct dc_debug debug_defaults_drv = { .voltage_align_fclk = true, .disable_stereo_support = true, .vsr_support = true, + .performance_trace = false, };static const struct dc_debug debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dm_services.h +2 -0
@@ -417,6 +417,8 @@ bool dm_dmcu_set_pipe(struct dc_context *ctx, unsigned int controller_id);#define dm_log_to_buffer (buffer, size, fmt, args)\ vsnprintf(buffer, size, fmt, args) +unsigned long long dm_get_timestamp (struct dc_context *ctx); +/* * Debug and verification hooks */
drivers/gpu/drm/amd/display/include/logger_interface.h +28 -0
@@ -44,6 +44,8 @@ struct dal_logger *dal_logger_create(struct dc_context *ctx, uint32_t log_mask);uint32_t dal_logger_destroy (struct dal_logger **logger); +void dm_logger_flush_buffer (struct dal_logger *logger,bool should_warn); + void dm_logger_write( struct dal_logger *logger, enum dc_log_type log_type,
@@ -157,4 +159,30 @@ void context_clock_trace(#define DTN_INFO_END () \ dm_dtn_log_end(dc_ctx) +#define PERFORMANCE_TRACE_START () \ + unsigned long long perf_trc_start_stmp = dm_get_timestamp(dc->ctx); \ + unsigned long long perf_trc_start_log_msk = dc->ctx->logger->mask; \ + unsigned int perf_trc_start_log_flags = dc->ctx->logger->flags.value; \ + if (dc->debug.performance_trace) {\ + dm_logger_flush_buffer(dc->ctx->logger, false);\ + dc->ctx->logger->mask = 1<<LOG_PERF_TRACE;\ + dc->ctx->logger->flags.bits.ENABLE_CONSOLE = 0;\ + dc->ctx->logger->flags.bits.ENABLE_BUFFER = 1;\ + } + +#define PERFORMANCE_TRACE_END () do {\ + unsigned long long perf_trc_end_stmp = dm_get_timestamp(dc->ctx);\ + if (dc->debug.performance_trace) {\ + dm_logger_write(dc->ctx->logger, \ + LOG_PERF_TRACE, \ + "%s duration: %d ticks\n", __func__,\ + perf_trc_end_stmp - perf_trc_start_stmp); \ + if (perf_trc_start_log_msk != 1<<LOG_PERF_TRACE) {\ + dc->ctx->logger->mask = perf_trc_start_log_msk;\ + dc->ctx->logger->flags.value = perf_trc_start_log_flags;\ + dm_logger_flush_buffer(dc->ctx->logger, false);\ + } \ + } \ +} while (0) +#endif /* __DAL_LOGGER_INTERFACE_H__ */
drivers/gpu/drm/amd/display/include/logger_types.h +34 -2
@@ -64,8 +64,7 @@ enum dc_log_type {LOG_EVENT_LINK_LOSS ,LOG_EVENT_UNDERFLOW ,LOG_IF_TRACE , -LOG_HW_MARKS , -LOG_PPLIB , +LOG_PERF_TRACE , LOG_SECTION_TOTAL_COUNT };
@@ -131,4 +130,37 @@ struct dc_log_type_info { char name[MAX_NAME_LEN]; }; +/* Structure for keeping track of offsets, buffer, etc */ + +#define DAL_LOGGER_BUFFER_MAX_SIZE 2048 + +/*Connectivity log needs to output EDID, which needs at lease 256x3 bytes, +* change log line size to 896 to meet the request. +*/ +#define LOG_MAX_LINE_SIZE 896 + +struct dal_logger { + +/* How far into the circular buffer has been read by dsat +* Read offset should never cross write offset. Write \0's to +* read data just to be sure? +*/ +uint32_t buffer_read_offset; + +/* How far into the circular buffer we have written +* Write offset should never cross read offset +*/ +uint32_t buffer_write_offset; + +uint32_t open_count; + +char *log_buffer;/* Pointer to malloc'ed buffer */ +uint32_t log_buffer_size;/* Size of circular buffer */ + +uint32_t mask;/*array of masks for major elements*/ + +union logger_flags flags; +struct dc_context *ctx; +}; +#endif /* __DAL_LOGGER_TYPES_H__ */
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 101/103 drm/amd/display: Set addressable region as active + border
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
This ensures that we do not draw the blank region onscreen, and that we do underscan instead.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +14 -0
@@ -850,6 +850,20 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)*/ pipe_ctx->plane_res.scl_data.lb_params.depth =LB_PIXEL_DEPTH_30BPP ; +/** +* KMD sends us h and v_addressable without the borders, which causes us sometimes to draw +* the blank region on-screen. Correct for this by adding the borders back to their +* respective addressable values, and by shifting recout. +*/ + timing->h_addressable += timing->h_border_left + timing->h_border_right; + timing->v_addressable += timing->v_border_top + timing->v_border_bottom; + pipe_ctx->plane_res.scl_data.recout.y += timing->v_border_top; + pipe_ctx->plane_res.scl_data.recout.x += timing->h_border_left; + timing->v_border_top =0 ; + timing->v_border_bottom =0 ; + timing->h_border_left =0 ; + timing->h_border_right =0 ; + pipe_ctx->plane_res.scl_data.h_active = timing->h_addressable; pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 102/103 drm/amd/display: Report stream as different on scaling change
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
When scaling is enabled, our preference is to scale up to the prefered (native) mode. This means that hardware timings will be the same across a modeset.
Therefore, also report mode as changed if source or destination rectangle is different.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +++++----- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ 3 files changed, 29 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -5
@@ -4593,13 +4593,13 @@ static int dm_update_crtcs_state( } } -if (dc_is_stream_unchanged (new_stream, - old_acrtc_state->stream)) { +if (dc_is_stream_unchanged (new_stream, old_acrtc_state->stream) && +dc_is_stream_scaling_unchanged (new_stream, old_acrtc_state->stream)) { - crtc_state->mode_changed = false; + crtc_state->mode_changed = false; -DRM_DEBUG_DRIVER ("Mode change not required, setting mode_changed to %d" , - crtc_state->mode_changed); +DRM_DEBUG_DRIVER ("Mode change not required, setting mode_changed to %d" , + crtc_state->mode_changed); }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +22 -0
@@ -1335,6 +1335,28 @@ bool dc_is_stream_unchanged(return true; } +bool dc_is_stream_scaling_unchanged ( +struct dc_stream_state *old_stream,struct dc_stream_state *stream) +{ +if (old_stream == stream) +return true; + +if (old_stream ==NULL || stream ==NULL ) +return false; + +if (memcmp (&old_stream->src, + &stream->src, +sizeof (struct rect )) !=0 ) +return false; + +if (memcmp (&old_stream->dst, + &stream->dst, +sizeof (struct rect )) !=0 ) +return false; + +return true; +} +/* Maximum TMDS single link pixel clock 165MHz */ #define TMDS_MAX_PIXEL_CLOCK_IN_KHZ 165000
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -627,6 +627,8 @@ struct dc_stream_update {bool dc_is_stream_unchanged (struct dc_stream_state *old_stream,struct dc_stream_state *stream); +bool dc_is_stream_scaling_unchanged ( +struct dc_stream_state *old_stream,struct dc_stream_state *stream);/* * Set up surface attributes and associate to a stream
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 103/103 drm/amd/display: ASSERT on dc_create_state failing.
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
dc_create_state() returns NULL on allocation failure. Raise warning when that happens.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -671,6 +671,7 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)dc_release_state (cached_state->context); cached_state->context =dc_create_state (); +ASSERT (cached_state->context);dc_resource_state_copy_construct_current (adev->dm.dc, cached_state->context);for_each_new_crtc_in_state (adev->dm.cached_state, crtc, crtc_state, i) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx