Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'amd-drm-next-6.2-2022-12-07' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.2-2022-12-07:

amdgpu:
- DSC fixes for DCN 2.1
- HDMI PCON fixes
- PSR fixes
- DC DML fixes
- Properly throttle on BO allocation
- GFX 11.0.4 fixes
- MMHUB fix
- Make some functions static

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221207232439.5908-1-alexander.deucher@amd.com

+156 -94
+3 -13
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
··· 113 113 bp.resv = resv; 114 114 bp.preferred_domain = initial_domain; 115 115 bp.flags = flags; 116 - bp.domain = initial_domain; 116 + bp.domain = initial_domain | AMDGPU_GEM_DOMAIN_CPU; 117 117 bp.bo_ptr_size = sizeof(struct amdgpu_bo); 118 118 119 119 r = amdgpu_bo_create_user(adev, &bp, &ubo); ··· 332 332 } 333 333 334 334 initial_domain = (u32)(0xffffffff & args->in.domains); 335 - retry: 336 335 r = amdgpu_gem_object_create(adev, size, args->in.alignment, 337 - initial_domain, 338 - flags, ttm_bo_type_device, resv, &gobj); 336 + initial_domain, flags, ttm_bo_type_device, 337 + resv, &gobj); 339 338 if (r && r != -ERESTARTSYS) { 340 - if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) { 341 - flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; 342 - goto retry; 343 - } 344 - 345 - if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) { 346 - initial_domain |= AMDGPU_GEM_DOMAIN_GTT; 347 - goto retry; 348 - } 349 339 DRM_DEBUG("Failed to allocate GEM object (%llu, %d, %llu, %d)\n", 350 340 size, initial_domain, args->in.alignment, r); 351 341 }
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
··· 549 549 /* YELLOW_CARP*/ 550 550 case IP_VERSION(10, 3, 3): 551 551 case IP_VERSION(11, 0, 1): 552 + case IP_VERSION(11, 0, 4): 552 553 /* Don't enable it by default yet. 553 554 */ 554 555 if (amdgpu_tmz < 1) {
+1 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 581 581 bo->flags |= AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE; 582 582 583 583 bo->tbo.bdev = &adev->mman.bdev; 584 - if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA | 585 - AMDGPU_GEM_DOMAIN_GDS)) 586 - amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU); 587 - else 588 - amdgpu_bo_placement_from_domain(bo, bp->domain); 584 + amdgpu_bo_placement_from_domain(bo, bp->domain); 589 585 if (bp->type == ttm_bo_type_kernel) 590 586 bo->tbo.priority = 1; 591 587
+3 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c
··· 350 350 } 351 351 352 352 /*Scan on low prio rings to have unsignaled fence and high ring has no fence.*/ 353 - int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux) 353 + static int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux) 354 354 { 355 355 struct amdgpu_ring *ring; 356 356 int i, need_preempt; ··· 370 370 } 371 371 372 372 /* Trigger Mid-Command Buffer Preemption (MCBP) and find if we need to resubmit. */ 373 - int amdgpu_mcbp_trigger_preempt(struct amdgpu_ring_mux *mux) 373 + static int amdgpu_mcbp_trigger_preempt(struct amdgpu_ring_mux *mux) 374 374 { 375 375 int r; 376 376 ··· 434 434 435 435 static void scan_and_remove_signaled_chunk(struct amdgpu_ring_mux *mux, struct amdgpu_ring *ring) 436 436 { 437 - uint32_t last_seq, size = 0; 437 + uint32_t last_seq = 0; 438 438 struct amdgpu_mux_entry *e; 439 439 struct amdgpu_mux_chunk *chunk, *tmp; 440 440 ··· 450 450 if (chunk->sync_seq <= last_seq) { 451 451 list_del(&chunk->entry); 452 452 kmem_cache_free(amdgpu_mux_chunk_slab, chunk); 453 - } else { 454 - size++; 455 453 } 456 454 } 457 455 }
+3
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 5058 5058 if (enable && (adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) { 5059 5059 switch (adev->ip_versions[GC_HWIP][0]) { 5060 5060 case IP_VERSION(11, 0, 1): 5061 + case IP_VERSION(11, 0, 4): 5061 5062 WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1); 5062 5063 break; 5063 5064 default: ··· 5092 5091 amdgpu_gfx_off_ctrl(adev, enable); 5093 5092 break; 5094 5093 case IP_VERSION(11, 0, 1): 5094 + case IP_VERSION(11, 0, 4): 5095 5095 gfx_v11_cntl_pg(adev, enable); 5096 5096 amdgpu_gfx_off_ctrl(adev, enable); 5097 5097 break; ··· 5116 5114 case IP_VERSION(11, 0, 1): 5117 5115 case IP_VERSION(11, 0, 2): 5118 5116 case IP_VERSION(11, 0, 3): 5117 + case IP_VERSION(11, 0, 4): 5119 5118 gfx_v11_0_update_gfx_clock_gating(adev, 5120 5119 state == AMD_CG_STATE_GATE); 5121 5120 break;
+1 -1
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
··· 319 319 320 320 tmp = mmMMVM_L2_CNTL5_DEFAULT; 321 321 tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL5, L2_CACHE_SMALLK_FRAGMENT_SIZE, 0); 322 - WREG32_SOC15(GC, 0, mmMMVM_L2_CNTL5, tmp); 322 + WREG32_SOC15(MMHUB, 0, mmMMVM_L2_CNTL5, tmp); 323 323 } 324 324 325 325 static void mmhub_v2_0_enable_system_domain(struct amdgpu_device *adev)
+1 -1
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c
··· 243 243 244 244 tmp = mmMMVM_L2_CNTL5_DEFAULT; 245 245 tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL5, L2_CACHE_SMALLK_FRAGMENT_SIZE, 0); 246 - WREG32_SOC15(GC, 0, mmMMVM_L2_CNTL5, tmp); 246 + WREG32_SOC15(MMHUB, 0, mmMMVM_L2_CNTL5, tmp); 247 247 } 248 248 249 249 static void mmhub_v2_3_enable_system_domain(struct amdgpu_device *adev)
+1 -1
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
··· 275 275 276 276 tmp = regMMVM_L2_CNTL5_DEFAULT; 277 277 tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL5, L2_CACHE_SMALLK_FRAGMENT_SIZE, 0); 278 - WREG32_SOC15(GC, 0, regMMVM_L2_CNTL5, tmp); 278 + WREG32_SOC15(MMHUB, 0, regMMVM_L2_CNTL5, tmp); 279 279 } 280 280 281 281 static void mmhub_v3_0_enable_system_domain(struct amdgpu_device *adev)
+1 -1
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_1.c
··· 269 269 270 270 tmp = regMMVM_L2_CNTL5_DEFAULT; 271 271 tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL5, L2_CACHE_SMALLK_FRAGMENT_SIZE, 0); 272 - WREG32_SOC15(GC, 0, regMMVM_L2_CNTL5, tmp); 272 + WREG32_SOC15(MMHUB, 0, regMMVM_L2_CNTL5, tmp); 273 273 } 274 274 275 275 static void mmhub_v3_0_1_enable_system_domain(struct amdgpu_device *adev)
+1 -1
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c
··· 268 268 269 269 tmp = regMMVM_L2_CNTL5_DEFAULT; 270 270 tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL5, L2_CACHE_SMALLK_FRAGMENT_SIZE, 0); 271 - WREG32_SOC15(GC, 0, regMMVM_L2_CNTL5, tmp); 271 + WREG32_SOC15(MMHUB, 0, regMMVM_L2_CNTL5, tmp); 272 272 } 273 273 274 274 static void mmhub_v3_0_2_enable_system_domain(struct amdgpu_device *adev)
+17 -1
drivers/gpu/drm/amd/amdgpu/soc21.c
··· 647 647 adev->external_rev_id = adev->rev_id + 0x20; 648 648 break; 649 649 case IP_VERSION(11, 0, 4): 650 - adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG | 650 + adev->cg_flags = 651 + AMD_CG_SUPPORT_GFX_CGCG | 652 + AMD_CG_SUPPORT_GFX_CGLS | 653 + AMD_CG_SUPPORT_GFX_MGCG | 654 + AMD_CG_SUPPORT_GFX_FGCG | 655 + AMD_CG_SUPPORT_REPEATER_FGCG | 656 + AMD_CG_SUPPORT_GFX_PERF_CLK | 657 + AMD_CG_SUPPORT_MC_MGCG | 658 + AMD_CG_SUPPORT_MC_LS | 659 + AMD_CG_SUPPORT_HDP_MGCG | 660 + AMD_CG_SUPPORT_HDP_LS | 661 + AMD_CG_SUPPORT_ATHUB_MGCG | 662 + AMD_CG_SUPPORT_ATHUB_LS | 663 + AMD_CG_SUPPORT_IH_CG | 664 + AMD_CG_SUPPORT_BIF_MGCG | 665 + AMD_CG_SUPPORT_BIF_LS | 666 + AMD_CG_SUPPORT_VCN_MGCG | 651 667 AMD_CG_SUPPORT_JPEG_MGCG; 652 668 adev->pg_flags = AMD_PG_SUPPORT_VCN | 653 669 AMD_PG_SUPPORT_GFX_PG |
-37
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
··· 233 233 DC_FP_END(); 234 234 } 235 235 236 - static void dcn32_update_clocks_update_dtb_dto(struct clk_mgr_internal *clk_mgr, 237 - struct dc_state *context, 238 - int ref_dtbclk_khz) 239 - { 240 - struct dccg *dccg = clk_mgr->dccg; 241 - uint32_t tg_mask = 0; 242 - int i; 243 - 244 - for (i = 0; i < clk_mgr->base.ctx->dc->res_pool->pipe_count; i++) { 245 - struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; 246 - struct dtbclk_dto_params dto_params = {0}; 247 - 248 - /* use mask to program DTO once per tg */ 249 - if (pipe_ctx->stream_res.tg && 250 - !(tg_mask & (1 << pipe_ctx->stream_res.tg->inst))) { 251 - tg_mask |= (1 << pipe_ctx->stream_res.tg->inst); 252 - 253 - dto_params.otg_inst = pipe_ctx->stream_res.tg->inst; 254 - dto_params.ref_dtbclk_khz = ref_dtbclk_khz; 255 - 256 - if (is_dp_128b_132b_signal(pipe_ctx)) { 257 - dto_params.pixclk_khz = pipe_ctx->stream->phy_pix_clk; 258 - 259 - if (pipe_ctx->stream_res.audio != NULL) 260 - dto_params.req_audio_dtbclk_khz = 24000; 261 - } 262 - if (dc_is_hdmi_signal(pipe_ctx->stream->signal)) 263 - dto_params.is_hdmi = true; 264 - 265 - dccg->funcs->set_dtbclk_dto(clk_mgr->dccg, &dto_params); 266 - //dccg->funcs->set_audio_dtbclk_dto(clk_mgr->dccg, &dto_params); 267 - } 268 - } 269 - } 270 - 271 236 /* Since DPPCLK request to PMFW needs to be exact (due to DPP DTO programming), 272 237 * update DPPCLK to be the exact frequency that will be set after the DPPCLK 273 238 * divider is updated. This will prevent rounding issues that could cause DPP ··· 412 447 /* DCCG requires KHz precision for DTBCLK */ 413 448 clk_mgr_base->clks.ref_dtbclk_khz = 414 449 dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DTBCLK, khz_to_mhz_ceil(new_clocks->ref_dtbclk_khz)); 415 - 416 - dcn32_update_clocks_update_dtb_dto(clk_mgr, context, clk_mgr_base->clks.ref_dtbclk_khz); 417 450 } 418 451 419 452 if (dc->config.forced_clocks == false || (force_reset && safe_to_lower)) {
+4 -1
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 1556 1556 if (tg_inst >= dc->res_pool->timing_generator_count) 1557 1557 return false; 1558 1558 1559 + if (tg_inst != link->link_enc->preferred_engine) 1560 + return false; 1561 + 1559 1562 tg = dc->res_pool->timing_generators[tg_inst]; 1560 1563 1561 1564 if (!tg->funcs->get_hw_timing) ··· 1988 1985 1989 1986 DC_LOG_DC("%s Finished.\n", __func__); 1990 1987 1991 - return (res == DC_OK); 1988 + return res; 1992 1989 } 1993 1990 1994 1991 /* TODO: When the transition to the new commit sequence is done, remove this
+1 -1
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 3378 3378 case FAMILY_YELLOW_CARP: 3379 3379 case AMDGPU_FAMILY_GC_10_3_6: 3380 3380 case AMDGPU_FAMILY_GC_11_0_1: 3381 - if (dc->debug.disable_z10) 3381 + if (dc->debug.disable_z10 || dc->debug.psr_skip_crtc_disable) 3382 3382 psr_context->psr_level.bits.SKIP_CRTC_DISABLE = true; 3383 3383 break; 3384 3384 default:
+2 -1
drivers/gpu/drm/amd/display/dc/dc.h
··· 47 47 struct set_config_cmd_payload; 48 48 struct dmub_notification; 49 49 50 - #define DC_VER "3.2.214" 50 + #define DC_VER "3.2.215" 51 51 52 52 #define MAX_SURFACES 3 53 53 #define MAX_PLANES 6 ··· 844 844 int crb_alloc_policy_min_disp_count; 845 845 bool disable_z10; 846 846 bool enable_z9_disable_interface; 847 + bool psr_skip_crtc_disable; 847 848 union dpia_debug_options dpia_debug; 848 849 bool disable_fixed_vs_aux_timeout_wa; 849 850 bool force_disable_subvp;
+6
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
··· 2216 2216 opp = grouped_pipes[i]->stream_res.opp; 2217 2217 tg = grouped_pipes[i]->stream_res.tg; 2218 2218 tg->funcs->get_otg_active_size(tg, &width, &height); 2219 + 2220 + if (!tg->funcs->is_tg_enabled(tg)) { 2221 + DC_SYNC_INFO("Skipping timing sync on disabled OTG\n"); 2222 + return; 2223 + } 2224 + 2219 2225 if (opp->funcs->opp_program_dpg_dimensions) 2220 2226 opp->funcs->opp_program_dpg_dimensions(opp, width, 2*(height) + 1); 2221 2227 }
+5 -2
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
··· 2011 2011 2012 2012 /* decrease compbuf size */ 2013 2013 if (hubbub->funcs->program_compbuf_size) { 2014 - if (context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes) 2014 + if (context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes) { 2015 2015 compbuf_size_kb = context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes; 2016 - else 2016 + dc->wm_optimized_required |= (compbuf_size_kb != dc->current_state->bw_ctx.dml.ip.min_comp_buffer_size_kbytes); 2017 + } else { 2017 2018 compbuf_size_kb = context->bw_ctx.bw.dcn.compbuf_size_kb; 2019 + dc->wm_optimized_required |= (compbuf_size_kb != dc->current_state->bw_ctx.bw.dcn.compbuf_size_kb); 2020 + } 2018 2021 2019 2022 hubbub->funcs->program_compbuf_size(hubbub, compbuf_size_kb, false); 2020 2023 }
+2
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
··· 1493 1493 dc->caps.color.mpc.ogam_rom_caps.hlg = 0; 1494 1494 dc->caps.color.mpc.ocsc = 1; 1495 1495 1496 + dc->caps.dp_hdmi21_pcon_support = true; 1497 + 1496 1498 /* read VBIOS LTTPR caps */ 1497 1499 if (ctx->dc_bios->funcs->get_lttpr_caps) { 1498 1500 enum bp_result bp_query_result;
+2
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
··· 1281 1281 dc->caps.color.mpc.ogam_rom_caps.hlg = 0; 1282 1282 dc->caps.color.mpc.ocsc = 1; 1283 1283 1284 + dc->caps.dp_hdmi21_pcon_support = true; 1285 + 1284 1286 /* read VBIOS LTTPR caps */ 1285 1287 if (ctx->dc_bios->funcs->get_lttpr_caps) { 1286 1288 enum bp_result bp_query_result;
+2
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
··· 1212 1212 dc->caps.color.mpc.ogam_rom_caps.hlg = 0; 1213 1213 dc->caps.color.mpc.ocsc = 1; 1214 1214 1215 + dc->caps.dp_hdmi21_pcon_support = true; 1216 + 1215 1217 /* read VBIOS LTTPR caps */ 1216 1218 if (ctx->dc_bios->funcs->get_lttpr_caps) { 1217 1219 enum bp_result bp_query_result;
+40
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c
··· 623 623 if (hws->ctx->dc->debug.hpo_optimization) 624 624 REG_UPDATE(HPO_TOP_HW_CONTROL, HPO_IO_EN, !!enable); 625 625 } 626 + void dcn31_set_drr(struct pipe_ctx **pipe_ctx, 627 + int num_pipes, struct dc_crtc_timing_adjust adjust) 628 + { 629 + int i = 0; 630 + struct drr_params params = {0}; 631 + unsigned int event_triggers = 0x2;/*Bit[1]: OTG_TRIG_A*/ 632 + unsigned int num_frames = 2; 633 + params.vertical_total_max = adjust.v_total_max; 634 + params.vertical_total_min = adjust.v_total_min; 635 + params.vertical_total_mid = adjust.v_total_mid; 636 + params.vertical_total_mid_frame_num = adjust.v_total_mid_frame_num; 637 + for (i = 0; i < num_pipes; i++) { 638 + if ((pipe_ctx[i]->stream_res.tg != NULL) && pipe_ctx[i]->stream_res.tg->funcs) { 639 + if (pipe_ctx[i]->stream_res.tg->funcs->set_drr) 640 + pipe_ctx[i]->stream_res.tg->funcs->set_drr( 641 + pipe_ctx[i]->stream_res.tg, &params); 642 + if (adjust.v_total_max != 0 && adjust.v_total_min != 0) 643 + if (pipe_ctx[i]->stream_res.tg->funcs->set_static_screen_control) 644 + pipe_ctx[i]->stream_res.tg->funcs->set_static_screen_control( 645 + pipe_ctx[i]->stream_res.tg, 646 + event_triggers, num_frames); 647 + } 648 + } 649 + } 650 + void dcn31_set_static_screen_control(struct pipe_ctx **pipe_ctx, 651 + int num_pipes, const struct dc_static_screen_params *params) 652 + { 653 + unsigned int i; 654 + unsigned int triggers = 0; 655 + if (params->triggers.surface_update) 656 + triggers |= 0x600;/*bit 9 and bit10 : 110 0000 0000*/ 657 + if (params->triggers.cursor_update) 658 + triggers |= 0x10;/*bit4*/ 659 + if (params->triggers.force_trigger) 660 + triggers |= 0x1; 661 + for (i = 0; i < num_pipes; i++) 662 + pipe_ctx[i]->stream_res.tg->funcs-> 663 + set_static_screen_control(pipe_ctx[i]->stream_res.tg, 664 + triggers, params->num_frames); 665 + }
+4
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.h
··· 56 56 void dcn31_init_pipes(struct dc *dc, struct dc_state *context); 57 57 void dcn31_setup_hpo_hw_control(const struct dce_hwseq *hws, bool enable); 58 58 59 + void dcn31_set_static_screen_control(struct pipe_ctx **pipe_ctx, 60 + int num_pipes, const struct dc_static_screen_params *params); 61 + void dcn31_set_drr(struct pipe_ctx **pipe_ctx, 62 + int num_pipes, struct dc_crtc_timing_adjust adjust); 59 63 #endif /* __DC_HWSS_DCN31_H__ */
+2 -2
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c
··· 64 64 .prepare_bandwidth = dcn20_prepare_bandwidth, 65 65 .optimize_bandwidth = dcn20_optimize_bandwidth, 66 66 .update_bandwidth = dcn20_update_bandwidth, 67 - .set_drr = dcn10_set_drr, 67 + .set_drr = dcn31_set_drr, 68 68 .get_position = dcn10_get_position, 69 - .set_static_screen_control = dcn10_set_static_screen_control, 69 + .set_static_screen_control = dcn31_set_static_screen_control, 70 70 .setup_stereo = dcn10_setup_stereo, 71 71 .set_avmute = dcn30_set_avmute, 72 72 .log_hw_state = dcn10_log_hw_state,
+28 -1
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.c
··· 40 40 #define FN(reg_name, field_name) \ 41 41 optc1->tg_shift->field_name, optc1->tg_mask->field_name 42 42 43 + #define STATIC_SCREEN_EVENT_MASK_DRR_DOUBLE_BUFFER_UPDATE_EN 0x2000 /*bit 13*/ 43 44 static void optc31_set_odm_combine(struct timing_generator *optc, int *opp_id, int opp_cnt, 44 45 struct dc_crtc_timing *timing) 45 46 { ··· 232 231 OPTC_MEM_SEL, 0); 233 232 optc1->opp_count = 1; 234 233 } 234 + void optc31_set_static_screen_control( 235 + struct timing_generator *optc, 236 + uint32_t event_triggers, 237 + uint32_t num_frames) 238 + { 239 + struct optc *optc1 = DCN10TG_FROM_TG(optc); 240 + uint32_t framecount; 241 + uint32_t events; 242 + 243 + if (num_frames > 0xFF) 244 + num_frames = 0xFF; 245 + REG_GET_2(OTG_STATIC_SCREEN_CONTROL, 246 + OTG_STATIC_SCREEN_EVENT_MASK, &events, 247 + OTG_STATIC_SCREEN_FRAME_COUNT, &framecount); 248 + 249 + if (events == event_triggers && num_frames == framecount) 250 + return; 251 + if ((event_triggers & STATIC_SCREEN_EVENT_MASK_DRR_DOUBLE_BUFFER_UPDATE_EN) 252 + != 0) 253 + event_triggers = event_triggers & 254 + ~STATIC_SCREEN_EVENT_MASK_DRR_DOUBLE_BUFFER_UPDATE_EN; 255 + 256 + REG_UPDATE_2(OTG_STATIC_SCREEN_CONTROL, 257 + OTG_STATIC_SCREEN_EVENT_MASK, event_triggers, 258 + OTG_STATIC_SCREEN_FRAME_COUNT, num_frames); 259 + } 235 260 236 261 static struct timing_generator_funcs dcn31_tg_funcs = { 237 262 .validate_timing = optc1_validate_timing, ··· 293 266 .set_drr = optc31_set_drr, 294 267 .get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal, 295 268 .set_vtotal_min_max = optc1_set_vtotal_min_max, 296 - .set_static_screen_control = optc1_set_static_screen_control, 269 + .set_static_screen_control = optc31_set_static_screen_control, 297 270 .program_stereo = optc1_program_stereo, 298 271 .is_stereo_left_eye = optc1_is_stereo_left_eye, 299 272 .tg_init = optc3_tg_init,
+4 -1
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.h
··· 263 263 void optc31_set_drr(struct timing_generator *optc, const struct drr_params *params); 264 264 265 265 void optc3_init_odm(struct timing_generator *optc); 266 - 266 + void optc31_set_static_screen_control( 267 + struct timing_generator *optc, 268 + uint32_t event_triggers, 269 + uint32_t num_frames); 267 270 #endif /* __DC_OPTC_DCN31_H__ */
+2 -2
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c
··· 66 66 .prepare_bandwidth = dcn20_prepare_bandwidth, 67 67 .optimize_bandwidth = dcn20_optimize_bandwidth, 68 68 .update_bandwidth = dcn20_update_bandwidth, 69 - .set_drr = dcn10_set_drr, 69 + .set_drr = dcn31_set_drr, 70 70 .get_position = dcn10_get_position, 71 - .set_static_screen_control = dcn10_set_static_screen_control, 71 + .set_static_screen_control = dcn31_set_static_screen_control, 72 72 .setup_stereo = dcn10_setup_stereo, 73 73 .set_avmute = dcn30_set_avmute, 74 74 .log_hw_state = dcn10_log_hw_state,
+1 -1
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c
··· 228 228 .set_drr = optc31_set_drr, 229 229 .get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal, 230 230 .set_vtotal_min_max = optc1_set_vtotal_min_max, 231 - .set_static_screen_control = optc1_set_static_screen_control, 231 + .set_static_screen_control = optc31_set_static_screen_control, 232 232 .program_stereo = optc1_program_stereo, 233 233 .is_stereo_left_eye = optc1_is_stereo_left_eye, 234 234 .tg_init = optc3_tg_init,
+1
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
··· 886 886 static const struct dc_debug_options debug_defaults_drv = { 887 887 .disable_z10 = false, 888 888 .enable_z9_disable_interface = true, 889 + .psr_skip_crtc_disable = true, 889 890 .disable_dmcu = true, 890 891 .force_abm_enable = false, 891 892 .timing_trace = false,
+5 -5
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
··· 703 703 for (i = 0; i < dc->res_pool->pipe_count; i++) { 704 704 struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; 705 705 706 - // For SubVP + DRR, also force disallow on the DRR pipe 707 - // (We will force allow in the DMUB sequence -- some DRR timings by default won't allow P-State so we have 708 - // to force once the vblank is stretched). 709 - if (pipe->stream && pipe->plane_state && (pipe->stream->mall_stream_config.type == SUBVP_MAIN || 710 - (pipe->stream->mall_stream_config.type == SUBVP_NONE && pipe->stream->ignore_msa_timing_param))) { 706 + if (pipe->stream && pipe->plane_state && (pipe->stream->mall_stream_config.type == SUBVP_MAIN)) { 711 707 struct hubp *hubp = pipe->plane_res.hubp; 712 708 713 709 if (hubp && hubp->funcs->hubp_update_force_pstate_disallow) ··· 780 784 // Update MALL_SEL register for each pipe 781 785 if (hws && hws->funcs.update_mall_sel) 782 786 hws->funcs.update_mall_sel(dc, context); 787 + 788 + //update subvp force pstate 789 + if (hws && hws->funcs.subvp_update_force_pstate) 790 + dc->hwseq->funcs.subvp_update_force_pstate(dc, context); 783 791 784 792 // Program FORCE_ONE_ROW_FOR_FRAME and CURSOR_REQ_MODE for main subvp pipes 785 793 for (i = 0; i < dc->res_pool->pipe_count; i++) {
+1 -1
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
··· 743 743 .dmub_command_table = true, 744 744 .enable_tri_buf = true, 745 745 .use_max_lb = true, 746 - .force_disable_subvp = true 746 + .force_disable_subvp = true, 747 747 }; 748 748 749 749
+3 -3
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
··· 565 565 .dppclk_mhz = 847.06, 566 566 .phyclk_mhz = 810.0, 567 567 .socclk_mhz = 953.0, 568 - .dscclk_mhz = 489.0, 568 + .dscclk_mhz = 300.0, 569 569 .dram_speed_mts = 2400.0, 570 570 }, 571 571 { ··· 576 576 .dppclk_mhz = 960.00, 577 577 .phyclk_mhz = 810.0, 578 578 .socclk_mhz = 278.0, 579 - .dscclk_mhz = 287.67, 579 + .dscclk_mhz = 342.86, 580 580 .dram_speed_mts = 2666.0, 581 581 }, 582 582 { ··· 587 587 .dppclk_mhz = 1028.57, 588 588 .phyclk_mhz = 810.0, 589 589 .socclk_mhz = 715.0, 590 - .dscclk_mhz = 318.334, 590 + .dscclk_mhz = 369.23, 591 591 .dram_speed_mts = 3200.0, 592 592 }, 593 593 {
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
··· 4851 4851 v->SwathHeightYThisState[k], 4852 4852 v->SwathHeightCThisState[k], 4853 4853 v->HTotal[k] / v->PixelClock[k], 4854 - v->UrgentLatency, 4854 + v->UrgLatency[i], 4855 4855 v->CursorBufferSize, 4856 4856 v->CursorWidth[k][0], 4857 4857 v->CursorBPP[k][0],
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
··· 5082 5082 v->SwathHeightYThisState[k], 5083 5083 v->SwathHeightCThisState[k], 5084 5084 v->HTotal[k] / v->PixelClock[k], 5085 - v->UrgentLatency, 5085 + v->UrgLatency[i], 5086 5086 v->CursorBufferSize, 5087 5087 v->CursorWidth[k][0], 5088 5088 v->CursorBPP[k][0],
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
··· 5179 5179 v->SwathHeightYThisState[k], 5180 5180 v->SwathHeightCThisState[k], 5181 5181 v->HTotal[k] / v->PixelClock[k], 5182 - v->UrgentLatency, 5182 + v->UrgLatency[i], 5183 5183 v->CursorBufferSize, 5184 5184 v->CursorWidth[k][0], 5185 5185 v->CursorBPP[k][0],
+2 -1
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
··· 1683 1683 && mode_lib->vba.PTEBufferSizeNotExceeded[i][j] == true 1684 1684 && mode_lib->vba.DCCMetaBufferSizeNotExceeded[i][j] == true 1685 1685 && mode_lib->vba.NonsupportedDSCInputBPC == false 1686 - && mode_lib->vba.NotEnoughDETSwathFillLatencyHidingPerState[i][j] == false 1687 1686 && !mode_lib->vba.ExceededMALLSize 1687 + && (mode_lib->vba.NotEnoughDETSwathFillLatencyHidingPerState[i][j] == false 1688 + || i == v->soc.num_states - 1) 1688 1689 && ((mode_lib->vba.HostVMEnable == false 1689 1690 && !mode_lib->vba.ImmediateFlipRequiredFinal) 1690 1691 || mode_lib->vba.ImmediateFlipSupportedForState[i][j])
+1 -1
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h
··· 1163 1163 double UrgBurstFactorLumaPre[DC__NUM_DPP__MAX]; 1164 1164 double UrgBurstFactorChromaPre[DC__NUM_DPP__MAX]; 1165 1165 bool NotUrgentLatencyHidingPre[DC__NUM_DPP__MAX]; 1166 - bool LinkCapacitySupport[DC__NUM_DPP__MAX]; 1166 + bool LinkCapacitySupport[DC__VOLTAGE_STATES]; 1167 1167 bool VREADY_AT_OR_AFTER_VSYNC[DC__NUM_DPP__MAX]; 1168 1168 unsigned int MIN_DST_Y_NEXT_START[DC__NUM_DPP__MAX]; 1169 1169 unsigned int VFrontPorch[DC__NUM_DPP__MAX];
+2 -2
drivers/gpu/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c
··· 256 256 */ 257 257 void dal_hw_factory_dcn32_init(struct hw_factory *factory) 258 258 { 259 - factory->number_of_pins[GPIO_ID_DDC_DATA] = 6; 260 - factory->number_of_pins[GPIO_ID_DDC_CLOCK] = 6; 259 + factory->number_of_pins[GPIO_ID_DDC_DATA] = 8; 260 + factory->number_of_pins[GPIO_ID_DDC_CLOCK] = 8; 261 261 factory->number_of_pins[GPIO_ID_GENERIC] = 4; 262 262 factory->number_of_pins[GPIO_ID_HPD] = 5; 263 263 factory->number_of_pins[GPIO_ID_GPIO_PAD] = 28;