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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Move dml2_validate to the non-FPU dml2_wrapper

[WHAT]
It calls DC_FP_START/END and shouldn't be living inside an
FPU compilation unit.

Reviewed-by: Austin Zheng <austin.zheng@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Harry Wentland and committed by
Alex Deucher
69249b47 20f311b6

+47 -32
+1 -1
drivers/gpu/drm/amd/display/dc/dml2_0/Makefile
··· 73 73 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml_display_rq_dlg_calc.o := $(dml2_rcflags) 74 74 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml2_dc_resource_mgmt.o := $(dml2_rcflags) 75 75 76 - DML2 = display_mode_core.o display_mode_util.o dml2_wrapper_fpu.o \ 76 + DML2 = display_mode_core.o display_mode_util.o dml2_wrapper_fpu.o dml2_wrapper.o \ 77 77 dml2_utils.o dml2_policy.o dml2_translation_helper.o dml2_dc_resource_mgmt.o dml2_mall_phantom.o \ 78 78 dml_display_rq_dlg_calc.o 79 79
+36
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright 2025 Advanced Micro Devices, Inc. 4 + * 5 + * Authors: AMD 6 + */ 7 + 8 + #include "dml2_internal_types.h" 9 + 10 + bool dml2_validate(const struct dc *in_dc, struct dc_state *context, struct dml2_context *dml2, 11 + enum dc_validate_mode validate_mode) 12 + { 13 + bool out = false; 14 + 15 + if (!dml2) 16 + return false; 17 + dml2_apply_debug_options(in_dc, dml2); 18 + 19 + /* DML2.1 validation path */ 20 + if (dml2->architecture == dml2_architecture_21) { 21 + out = dml21_validate(in_dc, context, dml2, validate_mode); 22 + return out; 23 + } 24 + 25 + DC_FP_START(); 26 + 27 + /* Use dml_validate_only for DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX path */ 28 + if (validate_mode != DC_VALIDATE_MODE_AND_PROGRAMMING) 29 + out = dml2_validate_only(context, validate_mode); 30 + else 31 + out = dml2_validate_and_build_resource(in_dc, context, validate_mode); 32 + 33 + DC_FP_END(); 34 + 35 + return out; 36 + }
+7
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.h
··· 306 306 void dml2_extract_dram_and_fclk_change_support(struct dml2_context *dml2, 307 307 unsigned int *fclk_change_support, unsigned int *dram_clk_change_support); 308 308 void dml2_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context, struct dml2_context *dml2); 309 + 310 + void dml2_apply_debug_options(const struct dc *dc, struct dml2_context *dml2); 311 + bool dml2_validate_only(struct dc_state *context, enum dc_validate_mode validate_mode); 312 + bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_state *context, 313 + enum dc_validate_mode validate_mode); 314 + 309 315 #endif //_DML2_WRAPPER_H_ 316 +
+3 -31
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper_fpu.c
··· 395 395 return result; 396 396 } 397 397 398 - static bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_state *context, 398 + bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_state *context, 399 399 enum dc_validate_mode validate_mode) 400 400 { 401 401 struct dml2_context *dml2 = context->bw_ctx.dml2; ··· 505 505 return result; 506 506 } 507 507 508 - static bool dml2_validate_only(struct dc_state *context, enum dc_validate_mode validate_mode) 508 + bool dml2_validate_only(struct dc_state *context, enum dc_validate_mode validate_mode) 509 509 { 510 510 struct dml2_context *dml2; 511 511 unsigned int result = 0; ··· 538 538 return result == 1; 539 539 } 540 540 541 - static void dml2_apply_debug_options(const struct dc *dc, struct dml2_context *dml2) 541 + void dml2_apply_debug_options(const struct dc *dc, struct dml2_context *dml2) 542 542 { 543 543 if (dc->debug.override_odm_optimization) { 544 544 dml2->config.minimize_dispclk_using_odm = dc->debug.minimize_dispclk_using_odm; 545 545 } 546 - } 547 - 548 - bool dml2_validate(const struct dc *in_dc, struct dc_state *context, struct dml2_context *dml2, 549 - enum dc_validate_mode validate_mode) 550 - { 551 - bool out = false; 552 - 553 - if (!dml2) 554 - return false; 555 - dml2_apply_debug_options(in_dc, dml2); 556 - 557 - /* DML2.1 validation path */ 558 - if (dml2->architecture == dml2_architecture_21) { 559 - out = dml21_validate(in_dc, context, dml2, validate_mode); 560 - return out; 561 - } 562 - 563 - DC_FP_START(); 564 - 565 - /* Use dml_validate_only for DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX path */ 566 - if (validate_mode != DC_VALIDATE_MODE_AND_PROGRAMMING) 567 - out = dml2_validate_only(context, validate_mode); 568 - else 569 - out = dml2_validate_and_build_resource(in_dc, context, validate_mode); 570 - 571 - DC_FP_END(); 572 - 573 - return out; 574 546 } 575 547 576 548 static inline struct dml2_context *dml2_allocate_memory(void)