mirror of
https://github.com/torvalds/linux.git
synced 2026-05-04 14:32:27 -04:00
drm/amd/display/dml2: use vzalloc rather than kzalloc
The structures are large and they do not require contiguous
memory so use vzalloc.
Fixes: 70839da636 ("drm/amd/display: Add new DCN401 sources")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4126
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
#include "display_mode_core.h"
|
||||
#include "dml2_internal_types.h"
|
||||
#include "dml2_utils.h"
|
||||
@@ -750,7 +752,7 @@ bool dml2_validate(const struct dc *in_dc, struct dc_state *context, struct dml2
|
||||
|
||||
static inline struct dml2_context *dml2_allocate_memory(void)
|
||||
{
|
||||
return (struct dml2_context *) kzalloc(sizeof(struct dml2_context), GFP_KERNEL);
|
||||
return (struct dml2_context *) vzalloc(sizeof(struct dml2_context));
|
||||
}
|
||||
|
||||
static void dml2_init(const struct dc *in_dc, const struct dml2_configuration_options *config, struct dml2_context **dml2)
|
||||
@@ -824,7 +826,7 @@ void dml2_destroy(struct dml2_context *dml2)
|
||||
|
||||
if (dml2->architecture == dml2_architecture_21)
|
||||
dml21_destroy(dml2);
|
||||
kfree(dml2);
|
||||
vfree(dml2);
|
||||
}
|
||||
|
||||
void dml2_extract_dram_and_fclk_change_support(struct dml2_context *dml2,
|
||||
|
||||
Reference in New Issue
Block a user