summaryrefslogtreecommitdiff
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.c37
-rw-r--r--drivers/gpu/drm/amd/display/modules/freesync/freesync.c2
-rw-r--r--drivers/gpu/drm/amd/display/modules/vmid/vmid.c2
3 files changed, 19 insertions, 22 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 a71df052cf25..33a7627191f8 100644
--- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
+++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
@@ -933,7 +933,7 @@ static bool build_regamma(struct pwl_float_data_ex *rgb_regamma,
struct pwl_float_data_ex *rgb = rgb_regamma;
const struct hw_x_point *coord_x = coordinate_x;
- coeff = kvzalloc(sizeof(*coeff), GFP_KERNEL);
+ coeff = kvzalloc_obj(*coeff, GFP_KERNEL);
if (!coeff)
goto release;
@@ -1714,14 +1714,15 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
input_tf->type = TF_TYPE_DISTRIBUTED_POINTS;
if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) {
- rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS,
- sizeof(*rgb_user),
- GFP_KERNEL);
+ rgb_user = kvzalloc_objs(*rgb_user,
+ ramp->num_entries + _EXTRA_POINTS,
+ GFP_KERNEL);
if (!rgb_user)
goto rgb_user_alloc_fail;
- axis_x = kvcalloc(ramp->num_entries + _EXTRA_POINTS, sizeof(*axis_x),
- GFP_KERNEL);
+ axis_x = kvzalloc_objs(*axis_x,
+ ramp->num_entries + _EXTRA_POINTS,
+ GFP_KERNEL);
if (!axis_x)
goto axis_x_alloc_fail;
@@ -1737,13 +1738,11 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
scale_gamma(rgb_user, ramp, dividers);
}
- curve = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, sizeof(*curve),
- GFP_KERNEL);
+ curve = kvzalloc_objs(*curve, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL);
if (!curve)
goto curve_alloc_fail;
- coeff = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, sizeof(*coeff),
- GFP_KERNEL);
+ coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL);
if (!coeff)
goto coeff_alloc_fail;
@@ -1940,14 +1939,14 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
if (ramp && ramp->type != GAMMA_CS_TFM_1D &&
(map_user_ramp || ramp->type != GAMMA_RGB_256)) {
- rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS,
- sizeof(*rgb_user),
- GFP_KERNEL);
+ rgb_user = kvzalloc_objs(*rgb_user,
+ ramp->num_entries + _EXTRA_POINTS,
+ GFP_KERNEL);
if (!rgb_user)
goto rgb_user_alloc_fail;
- axis_x = kvcalloc(ramp->num_entries + 3, sizeof(*axis_x),
- GFP_KERNEL);
+ axis_x = kvzalloc_objs(*axis_x, ramp->num_entries + 3,
+ GFP_KERNEL);
if (!axis_x)
goto axis_x_alloc_fail;
@@ -1966,14 +1965,12 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
scale_gamma_dx(rgb_user, ramp, dividers);
}
- rgb_regamma = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS,
- sizeof(*rgb_regamma),
- GFP_KERNEL);
+ rgb_regamma = kvzalloc_objs(*rgb_regamma, MAX_HW_POINTS + _EXTRA_POINTS,
+ GFP_KERNEL);
if (!rgb_regamma)
goto rgb_regamma_alloc_fail;
- coeff = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, sizeof(*coeff),
- GFP_KERNEL);
+ coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL);
if (!coeff)
goto coeff_alloc_fail;
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 1aae46d703ba..b819610021f2 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -61,7 +61,7 @@ struct core_freesync {
struct mod_freesync *mod_freesync_create(struct dc *dc)
{
struct core_freesync *core_freesync =
- kzalloc(sizeof(struct core_freesync), GFP_KERNEL);
+ kzalloc_obj(struct core_freesync, GFP_KERNEL);
if (core_freesync == NULL)
goto fail_alloc_context;
diff --git a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c
index 2c40212d86da..ccd35d1f05ec 100644
--- a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c
+++ b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c
@@ -144,7 +144,7 @@ struct mod_vmid *mod_vmid_create(
if (dc == NULL)
goto fail_dc_null;
- core_vmid = kzalloc(sizeof(struct core_vmid), GFP_KERNEL);
+ core_vmid = kzalloc_obj(struct core_vmid, GFP_KERNEL);
if (core_vmid == NULL)
goto fail_alloc_context;