aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/modules
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules')
-rw-r--r--drivers/gpu/drm/amd/display/modules/color/color_gamma.c10
-rw-r--r--drivers/gpu/drm/amd/display/modules/freesync/freesync.c3
-rw-r--r--drivers/gpu/drm/amd/display/modules/stats/stats.c12
3 files changed, 13 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
index 0cd111d59018..2533274e9cef 100644
--- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
+++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
@@ -1413,13 +1413,15 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf,
1413 1413
1414 output_tf->type = TF_TYPE_DISTRIBUTED_POINTS; 1414 output_tf->type = TF_TYPE_DISTRIBUTED_POINTS;
1415 1415
1416 rgb_user = kzalloc(sizeof(*rgb_user) * (GAMMA_RGB_256_ENTRIES + _EXTRA_POINTS), 1416 rgb_user = kcalloc(GAMMA_RGB_256_ENTRIES + _EXTRA_POINTS,
1417 GFP_KERNEL); 1417 sizeof(*rgb_user),
1418 GFP_KERNEL);
1418 if (!rgb_user) 1419 if (!rgb_user)
1419 goto rgb_user_alloc_fail; 1420 goto rgb_user_alloc_fail;
1420 1421
1421 rgb_regamma = kzalloc(sizeof(*rgb_regamma) * (MAX_HW_POINTS + _EXTRA_POINTS), 1422 rgb_regamma = kcalloc(MAX_HW_POINTS + _EXTRA_POINTS,
1422 GFP_KERNEL); 1423 sizeof(*rgb_regamma),
1424 GFP_KERNEL);
1423 if (!rgb_regamma) 1425 if (!rgb_regamma)
1424 goto rgb_regamma_alloc_fail; 1426 goto rgb_regamma_alloc_fail;
1425 1427
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 27d4003aa2c7..fa344ceafc17 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -155,7 +155,8 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
155 if (core_freesync == NULL) 155 if (core_freesync == NULL)
156 goto fail_alloc_context; 156 goto fail_alloc_context;
157 157
158 core_freesync->map = kzalloc(sizeof(struct freesync_entity) * MOD_FREESYNC_MAX_CONCURRENT_STREAMS, 158 core_freesync->map = kcalloc(MOD_FREESYNC_MAX_CONCURRENT_STREAMS,
159 sizeof(struct freesync_entity),
159 GFP_KERNEL); 160 GFP_KERNEL);
160 161
161 if (core_freesync->map == NULL) 162 if (core_freesync->map == NULL)
diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c
index 3f7d47fdc367..710852ad03f3 100644
--- a/drivers/gpu/drm/amd/display/modules/stats/stats.c
+++ b/drivers/gpu/drm/amd/display/modules/stats/stats.c
@@ -141,19 +141,17 @@ struct mod_stats *mod_stats_create(struct dc *dc)
141 else 141 else
142 core_stats->entries = reg_data; 142 core_stats->entries = reg_data;
143 } 143 }
144 core_stats->time = kzalloc( 144 core_stats->time = kcalloc(core_stats->entries,
145 sizeof(struct stats_time_cache) * 145 sizeof(struct stats_time_cache),
146 core_stats->entries,
147 GFP_KERNEL); 146 GFP_KERNEL);
148 147
149 if (core_stats->time == NULL) 148 if (core_stats->time == NULL)
150 goto fail_construct_time; 149 goto fail_construct_time;
151 150
152 core_stats->event_entries = DAL_STATS_EVENT_ENTRIES_DEFAULT; 151 core_stats->event_entries = DAL_STATS_EVENT_ENTRIES_DEFAULT;
153 core_stats->events = kzalloc( 152 core_stats->events = kcalloc(core_stats->event_entries,
154 sizeof(struct stats_event_cache) * 153 sizeof(struct stats_event_cache),
155 core_stats->event_entries, 154 GFP_KERNEL);
156 GFP_KERNEL);
157 155
158 if (core_stats->events == NULL) 156 if (core_stats->events == NULL)
159 goto fail_construct_events; 157 goto fail_construct_events;