1 // SPDX-License-Identifier: MIT
2 //
3 // Copyright 2024 Advanced Micro Devices, Inc.
4 
5 #include "dml2_core_factory.h"
6 #include "dml2_core_dcn4.h"
7 #include "dml2_external_lib_deps.h"
8 
dml2_core_create(enum dml2_project_id project_id,struct dml2_core_instance * out)9 bool dml2_core_create(enum dml2_project_id project_id, struct dml2_core_instance *out)
10 {
11 	bool result = false;
12 
13 	if (out == 0)
14 		return false;
15 
16 	memset(out, 0, sizeof(struct dml2_core_instance));
17 
18 	switch (project_id) {
19 	case dml2_project_dcn4x_stage1:
20 		result = false;
21 		break;
22 	case dml2_project_dcn4x_stage2:
23 	case dml2_project_dcn4x_stage2_auto_drr_svp:
24 		out->initialize = &core_dcn4_initialize;
25 		out->mode_support = &core_dcn4_mode_support;
26 		out->mode_programming = &core_dcn4_mode_programming;
27 		out->populate_informative = &core_dcn4_populate_informative;
28 		out->calculate_mcache_allocation = &core_dcn4_calculate_mcache_allocation;
29 		result = true;
30 		break;
31 	case dml2_project_invalid:
32 	default:
33 		break;
34 	}
35 
36 	return result;
37 }
38