2
2
//
3
3
// Copyright 2024 Advanced Micro Devices, Inc.
4
4
5
+ #include <linux/vmalloc.h>
5
6
6
7
#include "dml2_internal_types.h"
7
8
#include "dml_top.h"
13
14
14
15
static bool dml21_allocate_memory (struct dml2_context * * dml_ctx )
15
16
{
16
- * dml_ctx = kzalloc (sizeof (struct dml2_context ), GFP_KERNEL );
17
+ * dml_ctx = vzalloc (sizeof (struct dml2_context ));
17
18
if (!(* dml_ctx ))
18
19
return false;
19
20
20
- (* dml_ctx )-> v21 .dml_init .dml2_instance = kzalloc (sizeof (struct dml2_instance ), GFP_KERNEL );
21
+ (* dml_ctx )-> v21 .dml_init .dml2_instance = vzalloc (sizeof (struct dml2_instance ));
21
22
if (!((* dml_ctx )-> v21 .dml_init .dml2_instance ))
22
23
return false;
23
24
@@ -27,7 +28,7 @@ static bool dml21_allocate_memory(struct dml2_context **dml_ctx)
27
28
(* dml_ctx )-> v21 .mode_support .display_config = & (* dml_ctx )-> v21 .display_config ;
28
29
(* dml_ctx )-> v21 .mode_programming .display_config = (* dml_ctx )-> v21 .mode_support .display_config ;
29
30
30
- (* dml_ctx )-> v21 .mode_programming .programming = kzalloc (sizeof (struct dml2_display_cfg_programming ), GFP_KERNEL );
31
+ (* dml_ctx )-> v21 .mode_programming .programming = vzalloc (sizeof (struct dml2_display_cfg_programming ));
31
32
if (!((* dml_ctx )-> v21 .mode_programming .programming ))
32
33
return false;
33
34
@@ -115,8 +116,8 @@ bool dml21_create(const struct dc *in_dc, struct dml2_context **dml_ctx, const s
115
116
116
117
void dml21_destroy (struct dml2_context * dml2 )
117
118
{
118
- kfree (dml2 -> v21 .dml_init .dml2_instance );
119
- kfree (dml2 -> v21 .mode_programming .programming );
119
+ vfree (dml2 -> v21 .dml_init .dml2_instance );
120
+ vfree (dml2 -> v21 .mode_programming .programming );
120
121
}
121
122
122
123
static void dml21_calculate_rq_and_dlg_params (const struct dc * dc , struct dc_state * context , struct resource_context * out_new_hw_state ,
0 commit comments