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_create and init to the non-FPU dml2_wrapper

[WHAT]
dml2_init calls DC_FP_START/END and needs to be moved out
of the 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
811ffdbf 69249b47

+107 -77
+75
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
··· 6 6 */ 7 7 8 8 #include "dml2_internal_types.h" 9 + #include "dml2_wrapper_fpu.h" 9 10 10 11 bool dml2_validate(const struct dc *in_dc, struct dc_state *context, struct dml2_context *dml2, 11 12 enum dc_validate_mode validate_mode) ··· 34 33 DC_FP_END(); 35 34 36 35 return out; 36 + } 37 + 38 + static void dml2_init(const struct dc *in_dc, const struct dml2_configuration_options *config, struct dml2_context **dml2) 39 + { 40 + if ((in_dc->debug.using_dml21) && (in_dc->ctx->dce_version >= DCN_VERSION_4_01)) { 41 + dml21_reinit(in_dc, *dml2, config); 42 + return; 43 + } 44 + 45 + // Store config options 46 + (*dml2)->config = *config; 47 + 48 + switch (in_dc->ctx->dce_version) { 49 + case DCN_VERSION_3_5: 50 + (*dml2)->v20.dml_core_ctx.project = dml_project_dcn35; 51 + break; 52 + case DCN_VERSION_3_51: 53 + (*dml2)->v20.dml_core_ctx.project = dml_project_dcn351; 54 + break; 55 + case DCN_VERSION_3_6: 56 + (*dml2)->v20.dml_core_ctx.project = dml_project_dcn36; 57 + break; 58 + case DCN_VERSION_3_2: 59 + (*dml2)->v20.dml_core_ctx.project = dml_project_dcn32; 60 + break; 61 + case DCN_VERSION_3_21: 62 + (*dml2)->v20.dml_core_ctx.project = dml_project_dcn321; 63 + break; 64 + case DCN_VERSION_4_01: 65 + (*dml2)->v20.dml_core_ctx.project = dml_project_dcn401; 66 + break; 67 + default: 68 + (*dml2)->v20.dml_core_ctx.project = dml_project_default; 69 + break; 70 + } 71 + 72 + DC_FP_START(); 73 + 74 + initialize_dml2_ip_params(*dml2, in_dc, &(*dml2)->v20.dml_core_ctx.ip); 75 + 76 + initialize_dml2_soc_bbox(*dml2, in_dc, &(*dml2)->v20.dml_core_ctx.soc); 77 + 78 + initialize_dml2_soc_states(*dml2, in_dc, &(*dml2)->v20.dml_core_ctx.soc, &(*dml2)->v20.dml_core_ctx.states); 79 + 80 + DC_FP_END(); 81 + } 82 + 83 + bool dml2_create(const struct dc *in_dc, const struct dml2_configuration_options *config, struct dml2_context **dml2) 84 + { 85 + // TODO : Temporarily add DCN_VERSION_3_2 for N-1 validation. Remove DCN_VERSION_3_2 after N-1 validation phase is complete. 86 + if ((in_dc->debug.using_dml21) && (in_dc->ctx->dce_version >= DCN_VERSION_4_01)) 87 + return dml21_create(in_dc, dml2, config); 88 + 89 + // Allocate Mode Lib Ctx 90 + *dml2 = dml2_allocate_memory(); 91 + 92 + if (!(*dml2)) 93 + return false; 94 + 95 + dml2_init(in_dc, config, dml2); 96 + 97 + return true; 98 + } 99 + 100 + void dml2_reinit(const struct dc *in_dc, 101 + const struct dml2_configuration_options *config, 102 + struct dml2_context **dml2) 103 + { 104 + if ((in_dc->debug.using_dml21) && (in_dc->ctx->dce_version >= DCN_VERSION_4_01)) { 105 + dml21_reinit(in_dc, *dml2, config); 106 + return; 107 + } 108 + 109 + dml2_init(in_dc, config, dml2); 37 110 }
+2
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.h
··· 312 312 bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_state *context, 313 313 enum dc_validate_mode validate_mode); 314 314 315 + struct dml2_context *dml2_allocate_memory(void); 316 + 315 317 #endif //_DML2_WRAPPER_H_ 316 318
+5 -77
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper_fpu.c
··· 32 32 #include "dml2_mall_phantom.h" 33 33 #include "dml2_dc_resource_mgmt.h" 34 34 #include "dml21_wrapper.h" 35 + #include "dml2_wrapper_fpu.h" 35 36 36 - static void initialize_dml2_ip_params(struct dml2_context *dml2, const struct dc *in_dc, struct ip_params_st *out) 37 + void initialize_dml2_ip_params(struct dml2_context *dml2, const struct dc *in_dc, struct ip_params_st *out) 37 38 { 38 39 if (dml2->config.use_native_soc_bb_construction) 39 40 dml2_init_ip_params(dml2, in_dc, out); ··· 42 41 dml2_translate_ip_params(in_dc, out); 43 42 } 44 43 45 - static void initialize_dml2_soc_bbox(struct dml2_context *dml2, const struct dc *in_dc, struct soc_bounding_box_st *out) 44 + void initialize_dml2_soc_bbox(struct dml2_context *dml2, const struct dc *in_dc, struct soc_bounding_box_st *out) 46 45 { 47 46 if (dml2->config.use_native_soc_bb_construction) 48 47 dml2_init_socbb_params(dml2, in_dc, out); ··· 50 49 dml2_translate_socbb_params(in_dc, out); 51 50 } 52 51 53 - static void initialize_dml2_soc_states(struct dml2_context *dml2, 52 + void initialize_dml2_soc_states(struct dml2_context *dml2, 54 53 const struct dc *in_dc, const struct soc_bounding_box_st *in_bbox, struct soc_states_st *out) 55 54 { 56 55 if (dml2->config.use_native_soc_bb_construction) ··· 546 545 } 547 546 } 548 547 549 - static inline struct dml2_context *dml2_allocate_memory(void) 548 + inline struct dml2_context *dml2_allocate_memory(void) 550 549 { 551 550 return (struct dml2_context *) vzalloc(sizeof(struct dml2_context)); 552 - } 553 - 554 - static void dml2_init(const struct dc *in_dc, const struct dml2_configuration_options *config, struct dml2_context **dml2) 555 - { 556 - if ((in_dc->debug.using_dml21) && (in_dc->ctx->dce_version >= DCN_VERSION_4_01)) { 557 - dml21_reinit(in_dc, *dml2, config); 558 - return; 559 - } 560 - 561 - // Store config options 562 - (*dml2)->config = *config; 563 - 564 - switch (in_dc->ctx->dce_version) { 565 - case DCN_VERSION_3_5: 566 - (*dml2)->v20.dml_core_ctx.project = dml_project_dcn35; 567 - break; 568 - case DCN_VERSION_3_51: 569 - (*dml2)->v20.dml_core_ctx.project = dml_project_dcn351; 570 - break; 571 - case DCN_VERSION_3_6: 572 - (*dml2)->v20.dml_core_ctx.project = dml_project_dcn36; 573 - break; 574 - case DCN_VERSION_3_2: 575 - (*dml2)->v20.dml_core_ctx.project = dml_project_dcn32; 576 - break; 577 - case DCN_VERSION_3_21: 578 - (*dml2)->v20.dml_core_ctx.project = dml_project_dcn321; 579 - break; 580 - case DCN_VERSION_4_01: 581 - (*dml2)->v20.dml_core_ctx.project = dml_project_dcn401; 582 - break; 583 - default: 584 - (*dml2)->v20.dml_core_ctx.project = dml_project_default; 585 - break; 586 - } 587 - 588 - DC_FP_START(); 589 - 590 - initialize_dml2_ip_params(*dml2, in_dc, &(*dml2)->v20.dml_core_ctx.ip); 591 - 592 - initialize_dml2_soc_bbox(*dml2, in_dc, &(*dml2)->v20.dml_core_ctx.soc); 593 - 594 - initialize_dml2_soc_states(*dml2, in_dc, &(*dml2)->v20.dml_core_ctx.soc, &(*dml2)->v20.dml_core_ctx.states); 595 - 596 - DC_FP_END(); 597 - } 598 - 599 - bool dml2_create(const struct dc *in_dc, const struct dml2_configuration_options *config, struct dml2_context **dml2) 600 - { 601 - // TODO : Temporarily add DCN_VERSION_3_2 for N-1 validation. Remove DCN_VERSION_3_2 after N-1 validation phase is complete. 602 - if ((in_dc->debug.using_dml21) && (in_dc->ctx->dce_version >= DCN_VERSION_4_01)) 603 - return dml21_create(in_dc, dml2, config); 604 - 605 - // Allocate Mode Lib Ctx 606 - *dml2 = dml2_allocate_memory(); 607 - 608 - if (!(*dml2)) 609 - return false; 610 - 611 - dml2_init(in_dc, config, dml2); 612 - 613 - return true; 614 551 } 615 552 616 553 void dml2_destroy(struct dml2_context *dml2) ··· 602 663 return true; 603 664 } 604 665 605 - void dml2_reinit(const struct dc *in_dc, 606 - const struct dml2_configuration_options *config, 607 - struct dml2_context **dml2) 608 - { 609 - if ((in_dc->debug.using_dml21) && (in_dc->ctx->dce_version >= DCN_VERSION_4_01)) { 610 - dml21_reinit(in_dc, *dml2, config); 611 - return; 612 - } 613 - 614 - dml2_init(in_dc, config, dml2); 615 - }
+25
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper_fpu.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright 2025 Advanced Micro Devices, Inc. 4 + * 5 + * Authors: AMD 6 + */ 7 + 8 + #ifndef _DML2_WRAPPER_FPU_H_ 9 + #define _DML2_WRAPPER_FPU_H_ 10 + 11 + #include "os_types.h" 12 + 13 + struct dml2_context; 14 + struct dc; 15 + struct ip_params_st; 16 + struct soc_bounding_box_st; 17 + struct soc_states_st; 18 + 19 + void initialize_dml2_ip_params(struct dml2_context *dml2, const struct dc *in_dc, struct ip_params_st *out); 20 + void initialize_dml2_soc_bbox(struct dml2_context *dml2, const struct dc *in_dc, struct soc_bounding_box_st *out); 21 + void initialize_dml2_soc_states(struct dml2_context *dml2, 22 + const struct dc *in_dc, const struct soc_bounding_box_st *in_bbox, struct soc_states_st *out); 23 + 24 + #endif //_DML2_WRAPPER_FPU_H_ 25 +