mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-08-18 02:22:47 -07:00
drm/amd/display: Use kernel alloc/free
Abstractions are frowned upon. cocci script: virtual context virtual patch virtual org virtual report @@ expression ptr; @@ - dm_alloc(ptr) + kzalloc(ptr, GFP_KERNEL) @@ expression ptr, size; @@ - dm_realloc(ptr, size) + krealloc(ptr, size, GFP_KERNEL) @@ expression ptr; @@ - dm_free(ptr) + kfree(ptr) v2: use GFP_KERNEL, not GFP_ATOMIC. add cocci script Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
1 parent
82b400a62f
commit
2004f45ef8
59 files changed
+362
-330
No files matched your search
@@ -2429,7 +2429,7 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc)
|
||||
if (WARN_ON(!crtc->state))
|
||||
return NULL;
|
||||
|
||||
state = dm_alloc(sizeof(*state));
|
||||
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||
|
||||
__drm_atomic_helper_crtc_duplicate_state(crtc, &state->base);
|
||||
|
||||
|
||||
@@ -70,8 +70,8 @@ static bool construct(struct dc_context *ctx, struct dal_logger *logger,
|
||||
{
|
||||
/* malloc buffer and init offsets */
|
||||
logger->log_buffer_size = DAL_LOGGER_BUFFER_MAX_SIZE;
|
||||
logger->log_buffer = (char *)dm_alloc(logger->log_buffer_size *
|
||||
sizeof(char));
|
||||
logger->log_buffer = (char *)kzalloc(logger->log_buffer_size * sizeof(char),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!logger->log_buffer)
|
||||
return false;
|
||||
@@ -97,7 +97,7 @@ static bool construct(struct dc_context *ctx, struct dal_logger *logger,
|
||||
static void destruct(struct dal_logger *logger)
|
||||
{
|
||||
if (logger->log_buffer) {
|
||||
dm_free(logger->log_buffer);
|
||||
kfree(logger->log_buffer);
|
||||
logger->log_buffer = NULL;
|
||||
}
|
||||
}
|
||||
@@ -105,12 +105,13 @@ static void destruct(struct dal_logger *logger)
|
||||
struct dal_logger *dal_logger_create(struct dc_context *ctx, uint32_t log_mask)
|
||||
{
|
||||
/* malloc struct */
|
||||
struct dal_logger *logger = dm_alloc(sizeof(struct dal_logger));
|
||||
struct dal_logger *logger = kzalloc(sizeof(struct dal_logger),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!logger)
|
||||
return NULL;
|
||||
if (!construct(ctx, logger, log_mask)) {
|
||||
dm_free(logger);
|
||||
kfree(logger);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -122,7 +123,7 @@ uint32_t dal_logger_destroy(struct dal_logger **logger)
|
||||
if (logger == NULL || *logger == NULL)
|
||||
return 1;
|
||||
destruct(*logger);
|
||||
dm_free(*logger);
|
||||
kfree(*logger);
|
||||
*logger = NULL;
|
||||
|
||||
return 0;
|
||||
@@ -390,7 +391,8 @@ void dm_logger_open(
|
||||
entry->type = log_type;
|
||||
entry->logger = logger;
|
||||
|
||||
entry->buf = dm_alloc(DAL_LOGGER_BUFFER_MAX_SIZE * sizeof(char));
|
||||
entry->buf = kzalloc(DAL_LOGGER_BUFFER_MAX_SIZE * sizeof(char),
|
||||
GFP_KERNEL);
|
||||
|
||||
entry->buf_offset = 0;
|
||||
entry->max_buf_bytes = DAL_LOGGER_BUFFER_MAX_SIZE * sizeof(char);
|
||||
@@ -421,7 +423,7 @@ void dm_logger_close(struct log_entry *entry)
|
||||
|
||||
cleanup:
|
||||
if (entry->buf) {
|
||||
dm_free(entry->buf);
|
||||
kfree(entry->buf);
|
||||
entry->buf = NULL;
|
||||
entry->buf_offset = 0;
|
||||
entry->max_buf_bytes = 0;
|
||||
|
||||
@@ -40,7 +40,7 @@ bool dal_vector_construct(
|
||||
return false;
|
||||
}
|
||||
|
||||
vector->container = dm_alloc(struct_size * capacity);
|
||||
vector->container = kzalloc(struct_size * capacity, GFP_KERNEL);
|
||||
if (vector->container == NULL)
|
||||
return false;
|
||||
vector->capacity = capacity;
|
||||
@@ -67,7 +67,7 @@ bool dal_vector_presized_costruct(
|
||||
return false;
|
||||
}
|
||||
|
||||
vector->container = dm_alloc(struct_size * count);
|
||||
vector->container = kzalloc(struct_size * count, GFP_KERNEL);
|
||||
|
||||
if (vector->container == NULL)
|
||||
return false;
|
||||
@@ -95,7 +95,7 @@ struct vector *dal_vector_presized_create(
|
||||
void *initial_value,
|
||||
uint32_t struct_size)
|
||||
{
|
||||
struct vector *vector = dm_alloc(sizeof(struct vector));
|
||||
struct vector *vector = kzalloc(sizeof(struct vector), GFP_KERNEL);
|
||||
|
||||
if (vector == NULL)
|
||||
return NULL;
|
||||
@@ -105,7 +105,7 @@ struct vector *dal_vector_presized_create(
|
||||
return vector;
|
||||
|
||||
BREAK_TO_DEBUGGER();
|
||||
dm_free(vector);
|
||||
kfree(vector);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ struct vector *dal_vector_create(
|
||||
uint32_t capacity,
|
||||
uint32_t struct_size)
|
||||
{
|
||||
struct vector *vector = dm_alloc(sizeof(struct vector));
|
||||
struct vector *vector = kzalloc(sizeof(struct vector), GFP_KERNEL);
|
||||
|
||||
if (vector == NULL)
|
||||
return NULL;
|
||||
@@ -123,7 +123,7 @@ struct vector *dal_vector_create(
|
||||
return vector;
|
||||
|
||||
BREAK_TO_DEBUGGER();
|
||||
dm_free(vector);
|
||||
kfree(vector);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ void dal_vector_destruct(
|
||||
struct vector *vector)
|
||||
{
|
||||
if (vector->container != NULL)
|
||||
dm_free(vector->container);
|
||||
kfree(vector->container);
|
||||
vector->count = 0;
|
||||
vector->capacity = 0;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ void dal_vector_destroy(
|
||||
if (vector == NULL || *vector == NULL)
|
||||
return;
|
||||
dal_vector_destruct(*vector);
|
||||
dm_free(*vector);
|
||||
kfree(*vector);
|
||||
*vector = NULL;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,8 @@ bool dal_vector_reserve(struct vector *vector, uint32_t capacity)
|
||||
if (capacity <= vector->capacity)
|
||||
return true;
|
||||
|
||||
new_container = dm_realloc(vector->container, capacity * vector->struct_size);
|
||||
new_container = krealloc(vector->container,
|
||||
capacity * vector->struct_size, GFP_KERNEL);
|
||||
|
||||
if (new_container) {
|
||||
vector->container = new_container;
|
||||
|
||||
@@ -116,14 +116,14 @@ struct dc_bios *bios_parser_create(
|
||||
{
|
||||
struct bios_parser *bp = NULL;
|
||||
|
||||
bp = dm_alloc(sizeof(struct bios_parser));
|
||||
bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
|
||||
if (!bp)
|
||||
return NULL;
|
||||
|
||||
if (bios_parser_construct(bp, init, dce_version))
|
||||
return &bp->base;
|
||||
|
||||
dm_free(bp);
|
||||
kfree(bp);
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
@@ -131,10 +131,10 @@ struct dc_bios *bios_parser_create(
|
||||
static void destruct(struct bios_parser *bp)
|
||||
{
|
||||
if (bp->base.bios_local_image)
|
||||
dm_free(bp->base.bios_local_image);
|
||||
kfree(bp->base.bios_local_image);
|
||||
|
||||
if (bp->base.integrated_info)
|
||||
dm_free(bp->base.integrated_info);
|
||||
kfree(bp->base.integrated_info);
|
||||
}
|
||||
|
||||
static void bios_parser_destroy(struct dc_bios **dcb)
|
||||
@@ -148,7 +148,7 @@ static void bios_parser_destroy(struct dc_bios **dcb)
|
||||
|
||||
destruct(bp);
|
||||
|
||||
dm_free(bp);
|
||||
kfree(bp);
|
||||
*dcb = NULL;
|
||||
}
|
||||
|
||||
@@ -3531,7 +3531,8 @@ static void process_ext_display_connection_info(struct bios_parser *bp)
|
||||
uint8_t *original_bios;
|
||||
/* Step 1: Replace bios image with the new copy which will be
|
||||
* patched */
|
||||
bp->base.bios_local_image = dm_alloc(bp->base.bios_size);
|
||||
bp->base.bios_local_image = kzalloc(bp->base.bios_size,
|
||||
GFP_KERNEL);
|
||||
if (bp->base.bios_local_image == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
/* Failed to alloc bp->base.bios_local_image */
|
||||
@@ -3965,7 +3966,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
|
||||
struct bios_parser *bp = BP_FROM_DCB(dcb);
|
||||
struct integrated_info *info = NULL;
|
||||
|
||||
info = dm_alloc(sizeof(struct integrated_info));
|
||||
info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
|
||||
|
||||
if (info == NULL) {
|
||||
ASSERT_CRITICAL(0);
|
||||
@@ -3975,7 +3976,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
|
||||
if (construct_integrated_info(bp, info) == BP_RESULT_OK)
|
||||
return info;
|
||||
|
||||
dm_free(info);
|
||||
kfree(info);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ static struct atom_encoder_caps_record *get_encoder_cap_record(
|
||||
static void destruct(struct bios_parser *bp)
|
||||
{
|
||||
if (bp->base.bios_local_image)
|
||||
dm_free(bp->base.bios_local_image);
|
||||
kfree(bp->base.bios_local_image);
|
||||
|
||||
if (bp->base.integrated_info)
|
||||
dm_free(bp->base.integrated_info);
|
||||
kfree(bp->base.integrated_info);
|
||||
}
|
||||
|
||||
static void firmware_parser_destroy(struct dc_bios **dcb)
|
||||
@@ -124,7 +124,7 @@ static void firmware_parser_destroy(struct dc_bios **dcb)
|
||||
|
||||
destruct(bp);
|
||||
|
||||
dm_free(bp);
|
||||
kfree(bp);
|
||||
*dcb = NULL;
|
||||
}
|
||||
|
||||
@@ -2030,7 +2030,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
|
||||
struct bios_parser *bp = BP_FROM_DCB(dcb);
|
||||
struct integrated_info *info = NULL;
|
||||
|
||||
info = dm_alloc(sizeof(struct integrated_info));
|
||||
info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
|
||||
|
||||
if (info == NULL) {
|
||||
ASSERT_CRITICAL(0);
|
||||
@@ -2040,7 +2040,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
|
||||
if (construct_integrated_info(bp, info) == BP_RESULT_OK)
|
||||
return info;
|
||||
|
||||
dm_free(info);
|
||||
kfree(info);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -2205,14 +2205,14 @@ struct dc_bios *firmware_parser_create(
|
||||
{
|
||||
struct bios_parser *bp = NULL;
|
||||
|
||||
bp = dm_alloc(sizeof(struct bios_parser));
|
||||
bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
|
||||
if (!bp)
|
||||
return NULL;
|
||||
|
||||
if (bios_parser_construct(bp, init, dce_version))
|
||||
return &bp->base;
|
||||
|
||||
dm_free(bp);
|
||||
kfree(bp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2792,7 +2792,8 @@ bool bw_calcs(struct dc_context *ctx,
|
||||
int pipe_count,
|
||||
struct dce_bw_output *calcs_output)
|
||||
{
|
||||
struct bw_calcs_data *data = dm_alloc(sizeof(struct bw_calcs_data));
|
||||
struct bw_calcs_data *data = kzalloc(sizeof(struct bw_calcs_data),
|
||||
GFP_KERNEL);
|
||||
|
||||
populate_initial_data(pipe, pipe_count, data);
|
||||
|
||||
@@ -3248,7 +3249,7 @@ bool bw_calcs(struct dc_context *ctx,
|
||||
calcs_output->sclk_khz = 0;
|
||||
}
|
||||
|
||||
dm_free(data);
|
||||
kfree(data);
|
||||
|
||||
return is_display_configuration_supported(vbios, calcs_output);
|
||||
}
|
||||
@@ -481,8 +481,8 @@ static void dcn_dml_wm_override(
|
||||
{
|
||||
int i, in_idx, active_count;
|
||||
|
||||
struct _vcs_dpi_display_e2e_pipe_params_st *input = dm_alloc(pool->pipe_count *
|
||||
sizeof(struct _vcs_dpi_display_e2e_pipe_params_st));
|
||||
struct _vcs_dpi_display_e2e_pipe_params_st *input = kzalloc(pool->pipe_count * sizeof(struct _vcs_dpi_display_e2e_pipe_params_st),
|
||||
GFP_KERNEL);
|
||||
struct wm {
|
||||
double urgent;
|
||||
struct _vcs_dpi_cstate_pstate_watermarks_st cpstate;
|
||||
@@ -560,7 +560,7 @@ static void dcn_dml_wm_override(
|
||||
pipe->plane_state->flip_immediate);
|
||||
in_idx++;
|
||||
}
|
||||
dm_free(input);
|
||||
kfree(input);
|
||||
}
|
||||
|
||||
static void split_stream_across_pipes(
|
||||
|
||||
@@ -113,7 +113,7 @@ static bool create_links(
|
||||
}
|
||||
|
||||
for (i = 0; i < num_virtual_links; i++) {
|
||||
struct dc_link *link = dm_alloc(sizeof(*link));
|
||||
struct dc_link *link = kzalloc(sizeof(*link), GFP_KERNEL);
|
||||
struct encoder_init_data enc_init = {0};
|
||||
|
||||
if (link == NULL) {
|
||||
@@ -127,7 +127,7 @@ static bool create_links(
|
||||
link->link_id.type = OBJECT_TYPE_CONNECTOR;
|
||||
link->link_id.id = CONNECTOR_ID_VIRTUAL;
|
||||
link->link_id.enum_id = ENUM_ID_1;
|
||||
link->link_enc = dm_alloc(sizeof(*link->link_enc));
|
||||
link->link_enc = kzalloc(sizeof(*link->link_enc), GFP_KERNEL);
|
||||
|
||||
enc_init.ctx = dc->ctx;
|
||||
enc_init.channel = CHANNEL_ID_UNKNOWN;
|
||||
@@ -413,20 +413,20 @@ static void destruct(struct dc *dc)
|
||||
if (dc->ctx->logger)
|
||||
dal_logger_destroy(&dc->ctx->logger);
|
||||
|
||||
dm_free(dc->ctx);
|
||||
kfree(dc->ctx);
|
||||
dc->ctx = NULL;
|
||||
|
||||
dm_free(dc->bw_vbios);
|
||||
kfree(dc->bw_vbios);
|
||||
dc->bw_vbios = NULL;
|
||||
|
||||
dm_free(dc->bw_dceip);
|
||||
kfree(dc->bw_dceip);
|
||||
dc->bw_dceip = NULL;
|
||||
|
||||
#ifdef CONFIG_DRM_AMD_DC_DCN1_0
|
||||
dm_free(dc->dcn_soc);
|
||||
kfree(dc->dcn_soc);
|
||||
dc->dcn_soc = NULL;
|
||||
|
||||
dm_free(dc->dcn_ip);
|
||||
kfree(dc->dcn_ip);
|
||||
dc->dcn_ip = NULL;
|
||||
|
||||
#endif
|
||||
@@ -436,12 +436,15 @@ static bool construct(struct dc *dc,
|
||||
const struct dc_init_data *init_params)
|
||||
{
|
||||
struct dal_logger *logger;
|
||||
struct dc_context *dc_ctx = dm_alloc(sizeof(*dc_ctx));
|
||||
struct bw_calcs_dceip *dc_dceip = dm_alloc(sizeof(*dc_dceip));
|
||||
struct bw_calcs_vbios *dc_vbios = dm_alloc(sizeof(*dc_vbios));
|
||||
struct dc_context *dc_ctx = kzalloc(sizeof(*dc_ctx), GFP_KERNEL);
|
||||
struct bw_calcs_dceip *dc_dceip = kzalloc(sizeof(*dc_dceip),
|
||||
GFP_KERNEL);
|
||||
struct bw_calcs_vbios *dc_vbios = kzalloc(sizeof(*dc_vbios),
|
||||
GFP_KERNEL);
|
||||
#ifdef CONFIG_DRM_AMD_DC_DCN1_0
|
||||
struct dcn_soc_bounding_box *dcn_soc = dm_alloc(sizeof(*dcn_soc));
|
||||
struct dcn_ip_params *dcn_ip = dm_alloc(sizeof(*dcn_ip));
|
||||
struct dcn_soc_bounding_box *dcn_soc = kzalloc(sizeof(*dcn_soc),
|
||||
GFP_KERNEL);
|
||||
struct dcn_ip_params *dcn_ip = kzalloc(sizeof(*dcn_ip), GFP_KERNEL);
|
||||
#endif
|
||||
|
||||
enum dce_version dc_version = DCE_VERSION_UNKNOWN;
|
||||
@@ -604,7 +607,7 @@ void ProgramPixelDurationV(unsigned int pixelClockInKHz )
|
||||
|
||||
struct dc *dc_create(const struct dc_init_data *init_params)
|
||||
{
|
||||
struct dc *dc = dm_alloc(sizeof(*dc));
|
||||
struct dc *dc = kzalloc(sizeof(*dc), GFP_KERNEL);
|
||||
unsigned int full_pipe_count;
|
||||
|
||||
if (NULL == dc)
|
||||
@@ -638,7 +641,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)
|
||||
return dc;
|
||||
|
||||
construct_fail:
|
||||
dm_free(dc);
|
||||
kfree(dc);
|
||||
|
||||
alloc_fail:
|
||||
return NULL;
|
||||
@@ -647,7 +650,7 @@ alloc_fail:
|
||||
void dc_destroy(struct dc **dc)
|
||||
{
|
||||
destruct(*dc);
|
||||
dm_free(*dc);
|
||||
kfree(*dc);
|
||||
*dc = NULL;
|
||||
}
|
||||
|
||||
@@ -900,7 +903,7 @@ bool dc_commit_planes_to_stream(
|
||||
struct dc_scaling_info scaling_info[MAX_SURFACES];
|
||||
int i;
|
||||
struct dc_stream_update *stream_update =
|
||||
dm_alloc(sizeof(struct dc_stream_update));
|
||||
kzalloc(sizeof(struct dc_stream_update), GFP_KERNEL);
|
||||
|
||||
if (!stream_update) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -951,13 +954,14 @@ bool dc_commit_planes_to_stream(
|
||||
|
||||
dc_post_update_surfaces_to_stream(dc);
|
||||
|
||||
dm_free(stream_update);
|
||||
kfree(stream_update);
|
||||
return true;
|
||||
}
|
||||
|
||||
struct dc_state *dc_create_state(void)
|
||||
{
|
||||
struct dc_state *context = dm_alloc(sizeof(struct dc_state));
|
||||
struct dc_state *context = kzalloc(sizeof(struct dc_state),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!context)
|
||||
return NULL;
|
||||
@@ -979,7 +983,7 @@ void dc_release_state(struct dc_state *context)
|
||||
|
||||
if (atomic_read(&context->ref_count) == 0) {
|
||||
dc_resource_state_destruct(context);
|
||||
dm_free(context);
|
||||
kfree(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1100,7 +1100,7 @@ create_fail:
|
||||
struct dc_link *link_create(const struct link_init_data *init_params)
|
||||
{
|
||||
struct dc_link *link =
|
||||
dm_alloc(sizeof(*link));
|
||||
kzalloc(sizeof(*link), GFP_KERNEL);
|
||||
|
||||
if (NULL == link)
|
||||
goto alloc_fail;
|
||||
@@ -1111,7 +1111,7 @@ struct dc_link *link_create(const struct link_init_data *init_params)
|
||||
return link;
|
||||
|
||||
construct_fail:
|
||||
dm_free(link);
|
||||
kfree(link);
|
||||
|
||||
alloc_fail:
|
||||
return NULL;
|
||||
@@ -1120,7 +1120,7 @@ alloc_fail:
|
||||
void link_destroy(struct dc_link **link)
|
||||
{
|
||||
destruct(*link);
|
||||
dm_free(*link);
|
||||
kfree(*link);
|
||||
*link = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ struct i2c_payloads *dal_ddc_i2c_payloads_create(struct dc_context *ctx, uint32_
|
||||
{
|
||||
struct i2c_payloads *payloads;
|
||||
|
||||
payloads = dm_alloc(sizeof(struct i2c_payloads));
|
||||
payloads = kzalloc(sizeof(struct i2c_payloads), GFP_KERNEL);
|
||||
|
||||
if (!payloads)
|
||||
return NULL;
|
||||
@@ -139,7 +139,7 @@ struct i2c_payloads *dal_ddc_i2c_payloads_create(struct dc_context *ctx, uint32_
|
||||
&payloads->payloads, ctx, count, sizeof(struct i2c_payload)))
|
||||
return payloads;
|
||||
|
||||
dm_free(payloads);
|
||||
kfree(payloads);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void dal_ddc_i2c_payloads_destroy(struct i2c_payloads **p)
|
||||
if (!p || !*p)
|
||||
return;
|
||||
dal_vector_destruct(&(*p)->payloads);
|
||||
dm_free(*p);
|
||||
kfree(*p);
|
||||
*p = NULL;
|
||||
|
||||
}
|
||||
@@ -168,7 +168,7 @@ struct aux_payloads *dal_ddc_aux_payloads_create(struct dc_context *ctx, uint32_
|
||||
{
|
||||
struct aux_payloads *payloads;
|
||||
|
||||
payloads = dm_alloc(sizeof(struct aux_payloads));
|
||||
payloads = kzalloc(sizeof(struct aux_payloads), GFP_KERNEL);
|
||||
|
||||
if (!payloads)
|
||||
return NULL;
|
||||
@@ -177,7 +177,7 @@ struct aux_payloads *dal_ddc_aux_payloads_create(struct dc_context *ctx, uint32_
|
||||
&payloads->payloads, ctx, count, sizeof(struct aux_payload)))
|
||||
return payloads;
|
||||
|
||||
dm_free(payloads);
|
||||
kfree(payloads);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ void dal_ddc_aux_payloads_destroy(struct aux_payloads **p)
|
||||
return;
|
||||
|
||||
dal_vector_destruct(&(*p)->payloads);
|
||||
dm_free(*p);
|
||||
kfree(*p);
|
||||
*p = NULL;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ struct ddc_service *dal_ddc_service_create(
|
||||
{
|
||||
struct ddc_service *ddc_service;
|
||||
|
||||
ddc_service = dm_alloc(sizeof(struct ddc_service));
|
||||
ddc_service = kzalloc(sizeof(struct ddc_service), GFP_KERNEL);
|
||||
|
||||
if (!ddc_service)
|
||||
return NULL;
|
||||
@@ -298,7 +298,7 @@ struct ddc_service *dal_ddc_service_create(
|
||||
if (construct(ddc_service, init_data))
|
||||
return ddc_service;
|
||||
|
||||
dm_free(ddc_service);
|
||||
kfree(ddc_service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ void dal_ddc_service_destroy(struct ddc_service **ddc)
|
||||
return;
|
||||
}
|
||||
destruct(*ddc);
|
||||
dm_free(*ddc);
|
||||
kfree(*ddc);
|
||||
*ddc = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ void dc_destroy_resource_pool(struct dc *dc)
|
||||
dc->res_pool->funcs->destroy(&dc->res_pool);
|
||||
|
||||
if (dc->hwseq)
|
||||
dm_free(dc->hwseq);
|
||||
kfree(dc->hwseq);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
static void destruct(struct dc_sink *sink)
|
||||
{
|
||||
if (sink->dc_container_id) {
|
||||
dm_free(sink->dc_container_id);
|
||||
kfree(sink->dc_container_id);
|
||||
sink->dc_container_id = NULL;
|
||||
}
|
||||
}
|
||||
@@ -74,13 +74,13 @@ void dc_sink_release(struct dc_sink *sink)
|
||||
|
||||
if (atomic_read(&sink->ref_count) == 0) {
|
||||
destruct(sink);
|
||||
dm_free(sink);
|
||||
kfree(sink);
|
||||
}
|
||||
}
|
||||
|
||||
struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params)
|
||||
{
|
||||
struct dc_sink *sink = dm_alloc(sizeof(*sink));
|
||||
struct dc_sink *sink = kzalloc(sizeof(*sink), GFP_KERNEL);
|
||||
|
||||
if (NULL == sink)
|
||||
goto alloc_fail;
|
||||
@@ -93,7 +93,7 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params)
|
||||
return sink;
|
||||
|
||||
construct_fail:
|
||||
dm_free(sink);
|
||||
kfree(sink);
|
||||
|
||||
alloc_fail:
|
||||
return NULL;
|
||||
@@ -117,7 +117,8 @@ bool dc_sink_set_container_id(struct dc_sink *dc_sink, const struct dc_container
|
||||
{
|
||||
if (dc_sink && container_id) {
|
||||
if (!dc_sink->dc_container_id)
|
||||
dc_sink->dc_container_id = dm_alloc(sizeof(*dc_sink->dc_container_id));
|
||||
dc_sink->dc_container_id = kzalloc(sizeof(*dc_sink->dc_container_id),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (dc_sink->dc_container_id) {
|
||||
memmove(&dc_sink->dc_container_id->guid, &container_id->guid,
|
||||
|
||||
@@ -131,7 +131,7 @@ void dc_stream_release(struct dc_stream_state *stream)
|
||||
|
||||
if (atomic_read(&stream->ref_count) == 0) {
|
||||
destruct(stream);
|
||||
dm_free(stream);
|
||||
kfree(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ struct dc_stream_state *dc_create_stream_for_sink(
|
||||
if (sink == NULL)
|
||||
goto alloc_fail;
|
||||
|
||||
stream = dm_alloc(sizeof(struct dc_stream_state));
|
||||
stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
|
||||
|
||||
if (NULL == stream)
|
||||
goto alloc_fail;
|
||||
@@ -157,7 +157,7 @@ struct dc_stream_state *dc_create_stream_for_sink(
|
||||
return stream;
|
||||
|
||||
construct_fail:
|
||||
dm_free(stream);
|
||||
kfree(stream);
|
||||
|
||||
alloc_fail:
|
||||
return NULL;
|
||||
|
||||
@@ -68,7 +68,8 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc)
|
||||
{
|
||||
struct dc *core_dc = dc;
|
||||
|
||||
struct dc_plane_state *plane_state = dm_alloc(sizeof(*plane_state));
|
||||
struct dc_plane_state *plane_state = kzalloc(sizeof(*plane_state),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (NULL == plane_state)
|
||||
goto alloc_fail;
|
||||
@@ -81,7 +82,7 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc)
|
||||
return plane_state;
|
||||
|
||||
construct_fail:
|
||||
dm_free(plane_state);
|
||||
kfree(plane_state);
|
||||
|
||||
alloc_fail:
|
||||
return NULL;
|
||||
@@ -133,7 +134,7 @@ void dc_plane_state_release(struct dc_plane_state *plane_state)
|
||||
|
||||
if (atomic_read(&plane_state->ref_count) == 0) {
|
||||
destruct(plane_state);
|
||||
dm_free(plane_state);
|
||||
kfree(plane_state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,14 +150,14 @@ void dc_gamma_release(struct dc_gamma **gamma)
|
||||
atomic_dec(&(*gamma)->ref_count);
|
||||
|
||||
if (atomic_read(&(*gamma)->ref_count) == 0)
|
||||
dm_free((*gamma));
|
||||
kfree((*gamma));
|
||||
|
||||
*gamma = NULL;
|
||||
}
|
||||
|
||||
struct dc_gamma *dc_create_gamma()
|
||||
{
|
||||
struct dc_gamma *gamma = dm_alloc(sizeof(*gamma));
|
||||
struct dc_gamma *gamma = kzalloc(sizeof(*gamma), GFP_KERNEL);
|
||||
|
||||
if (gamma == NULL)
|
||||
goto alloc_fail;
|
||||
@@ -181,12 +182,12 @@ void dc_transfer_func_release(struct dc_transfer_func *tf)
|
||||
atomic_dec(&tf->ref_count);
|
||||
|
||||
if (atomic_read(&tf->ref_count) == 0)
|
||||
dm_free(tf);
|
||||
kfree(tf);
|
||||
}
|
||||
|
||||
struct dc_transfer_func *dc_create_transfer_func()
|
||||
{
|
||||
struct dc_transfer_func *tf = dm_alloc(sizeof(*tf));
|
||||
struct dc_transfer_func *tf = kzalloc(sizeof(*tf), GFP_KERNEL);
|
||||
|
||||
if (tf == NULL)
|
||||
goto alloc_fail;
|
||||
|
||||
@@ -462,7 +462,7 @@ struct abm *dce_abm_create(
|
||||
const struct dce_abm_shift *abm_shift,
|
||||
const struct dce_abm_mask *abm_mask)
|
||||
{
|
||||
struct dce_abm *abm_dce = dm_alloc(sizeof(*abm_dce));
|
||||
struct dce_abm *abm_dce = kzalloc(sizeof(*abm_dce), GFP_KERNEL);
|
||||
|
||||
if (abm_dce == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -480,6 +480,6 @@ void dce_abm_destroy(struct abm **abm)
|
||||
{
|
||||
struct dce_abm *abm_dce = TO_DCE_ABM(*abm);
|
||||
|
||||
dm_free(abm_dce);
|
||||
kfree(abm_dce);
|
||||
*abm = NULL;
|
||||
}
|
||||
@@ -897,7 +897,7 @@ void dce_aud_destroy(struct audio **audio)
|
||||
{
|
||||
struct dce_audio *aud = DCE_AUD(*audio);
|
||||
|
||||
dm_free(aud);
|
||||
kfree(aud);
|
||||
*audio = NULL;
|
||||
}
|
||||
|
||||
@@ -909,7 +909,7 @@ struct audio *dce_audio_create(
|
||||
const struct dce_aduio_mask *masks
|
||||
)
|
||||
{
|
||||
struct dce_audio *audio = dm_alloc(sizeof(*audio));
|
||||
struct dce_audio *audio = kzalloc(sizeof(*audio), GFP_KERNEL);
|
||||
|
||||
if (audio == NULL) {
|
||||
ASSERT_CRITICAL(audio);
|
||||
|
||||
@@ -1084,12 +1084,14 @@ static void get_ss_info_from_atombios(
|
||||
if (*ss_entries_num == 0)
|
||||
return;
|
||||
|
||||
ss_info = dm_alloc(sizeof(struct spread_spectrum_info) * (*ss_entries_num));
|
||||
ss_info = kzalloc(sizeof(struct spread_spectrum_info) * (*ss_entries_num),
|
||||
GFP_KERNEL);
|
||||
ss_info_cur = ss_info;
|
||||
if (ss_info == NULL)
|
||||
return;
|
||||
|
||||
ss_data = dm_alloc(sizeof(struct spread_spectrum_data) * (*ss_entries_num));
|
||||
ss_data = kzalloc(sizeof(struct spread_spectrum_data) * (*ss_entries_num),
|
||||
GFP_KERNEL);
|
||||
if (ss_data == NULL)
|
||||
goto out_free_info;
|
||||
|
||||
@@ -1157,14 +1159,14 @@ static void get_ss_info_from_atombios(
|
||||
}
|
||||
|
||||
*spread_spectrum_data = ss_data;
|
||||
dm_free(ss_info);
|
||||
kfree(ss_info);
|
||||
return;
|
||||
|
||||
out_free_data:
|
||||
dm_free(ss_data);
|
||||
kfree(ss_data);
|
||||
*ss_entries_num = 0;
|
||||
out_free_info:
|
||||
dm_free(ss_info);
|
||||
kfree(ss_info);
|
||||
}
|
||||
|
||||
static void ss_info_from_atombios_create(
|
||||
|
||||
@@ -719,7 +719,7 @@ struct display_clock *dce_disp_clk_create(
|
||||
const struct dce_disp_clk_shift *clk_shift,
|
||||
const struct dce_disp_clk_mask *clk_mask)
|
||||
{
|
||||
struct dce_disp_clk *clk_dce = dm_alloc(sizeof(*clk_dce));
|
||||
struct dce_disp_clk *clk_dce = kzalloc(sizeof(*clk_dce), GFP_KERNEL);
|
||||
|
||||
if (clk_dce == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -742,7 +742,7 @@ struct display_clock *dce110_disp_clk_create(
|
||||
const struct dce_disp_clk_shift *clk_shift,
|
||||
const struct dce_disp_clk_mask *clk_mask)
|
||||
{
|
||||
struct dce_disp_clk *clk_dce = dm_alloc(sizeof(*clk_dce));
|
||||
struct dce_disp_clk *clk_dce = kzalloc(sizeof(*clk_dce), GFP_KERNEL);
|
||||
|
||||
if (clk_dce == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -767,7 +767,7 @@ struct display_clock *dce112_disp_clk_create(
|
||||
const struct dce_disp_clk_shift *clk_shift,
|
||||
const struct dce_disp_clk_mask *clk_mask)
|
||||
{
|
||||
struct dce_disp_clk *clk_dce = dm_alloc(sizeof(*clk_dce));
|
||||
struct dce_disp_clk *clk_dce = kzalloc(sizeof(*clk_dce), GFP_KERNEL);
|
||||
|
||||
if (clk_dce == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -788,7 +788,7 @@ struct display_clock *dce112_disp_clk_create(
|
||||
|
||||
struct display_clock *dce120_disp_clk_create(struct dc_context *ctx)
|
||||
{
|
||||
struct dce_disp_clk *clk_dce = dm_alloc(sizeof(*clk_dce));
|
||||
struct dce_disp_clk *clk_dce = kzalloc(sizeof(*clk_dce), GFP_KERNEL);
|
||||
struct dm_pp_clock_levels_with_voltage clk_level_info = {0};
|
||||
|
||||
if (clk_dce == NULL) {
|
||||
@@ -822,6 +822,6 @@ void dce_disp_clk_destroy(struct display_clock **disp_clk)
|
||||
{
|
||||
struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(*disp_clk);
|
||||
|
||||
dm_free(clk_dce);
|
||||
kfree(clk_dce);
|
||||
*disp_clk = NULL;
|
||||
}
|
||||
@@ -573,7 +573,7 @@ struct dmcu *dce_dmcu_create(
|
||||
const struct dce_dmcu_shift *dmcu_shift,
|
||||
const struct dce_dmcu_mask *dmcu_mask)
|
||||
{
|
||||
struct dce_dmcu *dmcu_dce = dm_alloc(sizeof(*dmcu_dce));
|
||||
struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL);
|
||||
|
||||
if (dmcu_dce == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -595,7 +595,7 @@ struct dmcu *dcn10_dmcu_create(
|
||||
const struct dce_dmcu_shift *dmcu_shift,
|
||||
const struct dce_dmcu_mask *dmcu_mask)
|
||||
{
|
||||
struct dce_dmcu *dmcu_dce = dm_alloc(sizeof(*dmcu_dce));
|
||||
struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL);
|
||||
|
||||
if (dmcu_dce == NULL) {
|
||||
BREAK_TO_DEBUGGER();
|
||||
@@ -615,6 +615,6 @@ void dce_dmcu_destroy(struct dmcu **dmcu)
|
||||
{
|
||||
struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(*dmcu);
|
||||
|
||||
dm_free(dmcu_dce);
|
||||
kfree(dmcu_dce);
|
||||
*dmcu = NULL;
|
||||
}
|
||||
@@ -261,6 +261,6 @@ void dce_ipp_construct(
|
||||
|
||||
void dce_ipp_destroy(struct input_pixel_processor **ipp)
|
||||
{
|
||||
dm_free(TO_DCE_IPP(*ipp));
|
||||
kfree(TO_DCE_IPP(*ipp));
|
||||
*ipp = NULL;
|
||||
}
|
||||
Loaded 20 of 59 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user