Commit d9e32672 authored by Anthony Koo's avatar Anthony Koo Committed by Alex Deucher

drm/amd/display: cleanup of construct and destruct funcs

[Why]
Too many construct functions which makes searching
difficult, especially on some debuggers.

[How]
Append all construct and destruct functions with dcn
number and object type to make each construct function
name unique
Signed-off-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 03527f0d
...@@ -111,7 +111,7 @@ struct dc_bios *bios_parser_create( ...@@ -111,7 +111,7 @@ struct dc_bios *bios_parser_create(
return NULL; return NULL;
} }
static void destruct(struct bios_parser *bp) static void bios_parser_destruct(struct bios_parser *bp)
{ {
kfree(bp->base.bios_local_image); kfree(bp->base.bios_local_image);
kfree(bp->base.integrated_info); kfree(bp->base.integrated_info);
...@@ -126,7 +126,7 @@ static void bios_parser_destroy(struct dc_bios **dcb) ...@@ -126,7 +126,7 @@ static void bios_parser_destroy(struct dc_bios **dcb)
return; return;
} }
destruct(bp); bios_parser_destruct(bp);
kfree(bp); kfree(bp);
*dcb = NULL; *dcb = NULL;
......
...@@ -111,7 +111,7 @@ static struct atom_encoder_caps_record *get_encoder_cap_record( ...@@ -111,7 +111,7 @@ static struct atom_encoder_caps_record *get_encoder_cap_record(
#define DATA_TABLES(table) (bp->master_data_tbl->listOfdatatables.table) #define DATA_TABLES(table) (bp->master_data_tbl->listOfdatatables.table)
static void destruct(struct bios_parser *bp) static void bios_parser2_destruct(struct bios_parser *bp)
{ {
kfree(bp->base.bios_local_image); kfree(bp->base.bios_local_image);
kfree(bp->base.integrated_info); kfree(bp->base.integrated_info);
...@@ -126,7 +126,7 @@ static void firmware_parser_destroy(struct dc_bios **dcb) ...@@ -126,7 +126,7 @@ static void firmware_parser_destroy(struct dc_bios **dcb)
return; return;
} }
destruct(bp); bios_parser2_destruct(bp);
kfree(bp); kfree(bp);
*dcb = NULL; *dcb = NULL;
...@@ -1925,7 +1925,7 @@ static const struct dc_vbios_funcs vbios_funcs = { ...@@ -1925,7 +1925,7 @@ static const struct dc_vbios_funcs vbios_funcs = {
.get_board_layout_info = bios_get_board_layout_info, .get_board_layout_info = bios_get_board_layout_info,
}; };
static bool bios_parser_construct( static bool bios_parser2_construct(
struct bios_parser *bp, struct bios_parser *bp,
struct bp_init_data *init, struct bp_init_data *init,
enum dce_version dce_version) enum dce_version dce_version)
...@@ -2018,7 +2018,7 @@ struct dc_bios *firmware_parser_create( ...@@ -2018,7 +2018,7 @@ struct dc_bios *firmware_parser_create(
if (!bp) if (!bp)
return NULL; return NULL;
if (bios_parser_construct(bp, init, dce_version)) if (bios_parser2_construct(bp, init, dce_version))
return &bp->base; return &bp->base;
kfree(bp); kfree(bp);
......
...@@ -533,7 +533,7 @@ void dc_stream_set_static_screen_events(struct dc *dc, ...@@ -533,7 +533,7 @@ void dc_stream_set_static_screen_events(struct dc *dc,
dc->hwss.set_static_screen_control(pipes_affected, num_pipes_affected, events); dc->hwss.set_static_screen_control(pipes_affected, num_pipes_affected, events);
} }
static void destruct(struct dc *dc) static void dc_destruct(struct dc *dc)
{ {
if (dc->current_state) { if (dc->current_state) {
dc_release_state(dc->current_state); dc_release_state(dc->current_state);
...@@ -579,7 +579,7 @@ static void destruct(struct dc *dc) ...@@ -579,7 +579,7 @@ static void destruct(struct dc *dc)
} }
static bool construct(struct dc *dc, static bool dc_construct(struct dc *dc,
const struct dc_init_data *init_params) const struct dc_init_data *init_params)
{ {
struct dc_context *dc_ctx; struct dc_context *dc_ctx;
...@@ -729,7 +729,7 @@ static bool construct(struct dc *dc, ...@@ -729,7 +729,7 @@ static bool construct(struct dc *dc,
fail: fail:
destruct(dc); dc_destruct(dc);
return false; return false;
} }
...@@ -795,7 +795,7 @@ struct dc *dc_create(const struct dc_init_data *init_params) ...@@ -795,7 +795,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)
if (NULL == dc) if (NULL == dc)
goto alloc_fail; goto alloc_fail;
if (false == construct(dc, init_params)) if (false == dc_construct(dc, init_params))
goto construct_fail; goto construct_fail;
full_pipe_count = dc->res_pool->pipe_count; full_pipe_count = dc->res_pool->pipe_count;
...@@ -852,7 +852,7 @@ void dc_deinit_callbacks(struct dc *dc) ...@@ -852,7 +852,7 @@ void dc_deinit_callbacks(struct dc *dc)
void dc_destroy(struct dc **dc) void dc_destroy(struct dc **dc)
{ {
destruct(*dc); dc_destruct(*dc);
kfree(*dc); kfree(*dc);
*dc = NULL; *dc = NULL;
} }
......
...@@ -74,7 +74,7 @@ enum { ...@@ -74,7 +74,7 @@ enum {
/******************************************************************************* /*******************************************************************************
* Private functions * Private functions
******************************************************************************/ ******************************************************************************/
static void destruct(struct dc_link *link) static void dc_link_destruct(struct dc_link *link)
{ {
int i; int i;
...@@ -1244,7 +1244,7 @@ static enum transmitter translate_encoder_to_transmitter( ...@@ -1244,7 +1244,7 @@ static enum transmitter translate_encoder_to_transmitter(
} }
} }
static bool construct( static bool dc_link_construct(
struct dc_link *link, struct dc_link *link,
const struct link_init_data *init_params) const struct link_init_data *init_params)
{ {
...@@ -1446,7 +1446,7 @@ struct dc_link *link_create(const struct link_init_data *init_params) ...@@ -1446,7 +1446,7 @@ struct dc_link *link_create(const struct link_init_data *init_params)
if (NULL == link) if (NULL == link)
goto alloc_fail; goto alloc_fail;
if (false == construct(link, init_params)) if (false == dc_link_construct(link, init_params))
goto construct_fail; goto construct_fail;
return link; return link;
...@@ -1460,7 +1460,7 @@ struct dc_link *link_create(const struct link_init_data *init_params) ...@@ -1460,7 +1460,7 @@ struct dc_link *link_create(const struct link_init_data *init_params)
void link_destroy(struct dc_link **link) void link_destroy(struct dc_link **link)
{ {
destruct(*link); dc_link_destruct(*link);
kfree(*link); kfree(*link);
*link = NULL; *link = NULL;
} }
......
...@@ -187,7 +187,7 @@ void dal_ddc_i2c_payloads_add( ...@@ -187,7 +187,7 @@ void dal_ddc_i2c_payloads_add(
} }
static void construct( static void ddc_service_construct(
struct ddc_service *ddc_service, struct ddc_service *ddc_service,
struct ddc_service_init_data *init_data) struct ddc_service_init_data *init_data)
{ {
...@@ -239,11 +239,11 @@ struct ddc_service *dal_ddc_service_create( ...@@ -239,11 +239,11 @@ struct ddc_service *dal_ddc_service_create(
if (!ddc_service) if (!ddc_service)
return NULL; return NULL;
construct(ddc_service, init_data); ddc_service_construct(ddc_service, init_data);
return ddc_service; return ddc_service;
} }
static void destruct(struct ddc_service *ddc) static void ddc_service_destruct(struct ddc_service *ddc)
{ {
if (ddc->ddc_pin) if (ddc->ddc_pin)
dal_gpio_destroy_ddc(&ddc->ddc_pin); dal_gpio_destroy_ddc(&ddc->ddc_pin);
...@@ -255,7 +255,7 @@ void dal_ddc_service_destroy(struct ddc_service **ddc) ...@@ -255,7 +255,7 @@ void dal_ddc_service_destroy(struct ddc_service **ddc)
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
return; return;
} }
destruct(*ddc); ddc_service_destruct(*ddc);
kfree(*ddc); kfree(*ddc);
*ddc = NULL; *ddc = NULL;
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* Private functions * Private functions
******************************************************************************/ ******************************************************************************/
static void destruct(struct dc_sink *sink) static void dc_sink_destruct(struct dc_sink *sink)
{ {
if (sink->dc_container_id) { if (sink->dc_container_id) {
kfree(sink->dc_container_id); kfree(sink->dc_container_id);
...@@ -41,7 +41,7 @@ static void destruct(struct dc_sink *sink) ...@@ -41,7 +41,7 @@ static void destruct(struct dc_sink *sink)
} }
} }
static bool construct(struct dc_sink *sink, const struct dc_sink_init_data *init_params) static bool dc_sink_construct(struct dc_sink *sink, const struct dc_sink_init_data *init_params)
{ {
struct dc_link *link = init_params->link; struct dc_link *link = init_params->link;
...@@ -75,7 +75,7 @@ void dc_sink_retain(struct dc_sink *sink) ...@@ -75,7 +75,7 @@ void dc_sink_retain(struct dc_sink *sink)
static void dc_sink_free(struct kref *kref) static void dc_sink_free(struct kref *kref)
{ {
struct dc_sink *sink = container_of(kref, struct dc_sink, refcount); struct dc_sink *sink = container_of(kref, struct dc_sink, refcount);
destruct(sink); dc_sink_destruct(sink);
kfree(sink); kfree(sink);
} }
...@@ -91,7 +91,7 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params) ...@@ -91,7 +91,7 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params)
if (NULL == sink) if (NULL == sink)
goto alloc_fail; goto alloc_fail;
if (false == construct(sink, init_params)) if (false == dc_sink_construct(sink, init_params))
goto construct_fail; goto construct_fail;
kref_init(&sink->refcount); kref_init(&sink->refcount);
......
...@@ -58,7 +58,7 @@ void update_stream_signal(struct dc_stream_state *stream, struct dc_sink *sink) ...@@ -58,7 +58,7 @@ void update_stream_signal(struct dc_stream_state *stream, struct dc_sink *sink)
} }
} }
static void construct(struct dc_stream_state *stream, static void dc_stream_construct(struct dc_stream_state *stream,
struct dc_sink *dc_sink_data) struct dc_sink *dc_sink_data)
{ {
uint32_t i = 0; uint32_t i = 0;
...@@ -127,7 +127,7 @@ static void construct(struct dc_stream_state *stream, ...@@ -127,7 +127,7 @@ static void construct(struct dc_stream_state *stream,
stream->ctx->dc_stream_id_count++; stream->ctx->dc_stream_id_count++;
} }
static void destruct(struct dc_stream_state *stream) static void dc_stream_destruct(struct dc_stream_state *stream)
{ {
dc_sink_release(stream->sink); dc_sink_release(stream->sink);
if (stream->out_transfer_func != NULL) { if (stream->out_transfer_func != NULL) {
...@@ -145,7 +145,7 @@ static void dc_stream_free(struct kref *kref) ...@@ -145,7 +145,7 @@ static void dc_stream_free(struct kref *kref)
{ {
struct dc_stream_state *stream = container_of(kref, struct dc_stream_state, refcount); struct dc_stream_state *stream = container_of(kref, struct dc_stream_state, refcount);
destruct(stream); dc_stream_destruct(stream);
kfree(stream); kfree(stream);
} }
...@@ -168,7 +168,7 @@ struct dc_stream_state *dc_create_stream_for_sink( ...@@ -168,7 +168,7 @@ struct dc_stream_state *dc_create_stream_for_sink(
if (stream == NULL) if (stream == NULL)
return NULL; return NULL;
construct(stream, sink); dc_stream_construct(stream, sink);
kref_init(&stream->refcount); kref_init(&stream->refcount);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/******************************************************************************* /*******************************************************************************
* Private functions * Private functions
******************************************************************************/ ******************************************************************************/
static void construct(struct dc_context *ctx, struct dc_plane_state *plane_state) static void dc_plane_construct(struct dc_context *ctx, struct dc_plane_state *plane_state)
{ {
plane_state->ctx = ctx; plane_state->ctx = ctx;
...@@ -68,7 +68,7 @@ static void construct(struct dc_context *ctx, struct dc_plane_state *plane_state ...@@ -68,7 +68,7 @@ static void construct(struct dc_context *ctx, struct dc_plane_state *plane_state
} }
static void destruct(struct dc_plane_state *plane_state) static void dc_plane_destruct(struct dc_plane_state *plane_state)
{ {
if (plane_state->gamma_correction != NULL) { if (plane_state->gamma_correction != NULL) {
dc_gamma_release(&plane_state->gamma_correction); dc_gamma_release(&plane_state->gamma_correction);
...@@ -117,7 +117,7 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc) ...@@ -117,7 +117,7 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc)
return NULL; return NULL;
kref_init(&plane_state->refcount); kref_init(&plane_state->refcount);
construct(core_dc->ctx, plane_state); dc_plane_construct(core_dc->ctx, plane_state);
return plane_state; return plane_state;
} }
...@@ -187,7 +187,7 @@ void dc_plane_state_retain(struct dc_plane_state *plane_state) ...@@ -187,7 +187,7 @@ void dc_plane_state_retain(struct dc_plane_state *plane_state)
static void dc_plane_state_free(struct kref *kref) static void dc_plane_state_free(struct kref *kref)
{ {
struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount); struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount);
destruct(plane_state); dc_plane_destruct(plane_state);
kvfree(plane_state); kvfree(plane_state);
} }
......
...@@ -725,7 +725,7 @@ void dce100_clock_source_destroy(struct clock_source **clk_src) ...@@ -725,7 +725,7 @@ void dce100_clock_source_destroy(struct clock_source **clk_src)
*clk_src = NULL; *clk_src = NULL;
} }
static void destruct(struct dce110_resource_pool *pool) static void dce100_resource_destruct(struct dce110_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -885,7 +885,7 @@ static void dce100_destroy_resource_pool(struct resource_pool **pool) ...@@ -885,7 +885,7 @@ static void dce100_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool); struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool);
destruct(dce110_pool); dce100_resource_destruct(dce110_pool);
kfree(dce110_pool); kfree(dce110_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -950,7 +950,7 @@ static const struct resource_funcs dce100_res_pool_funcs = { ...@@ -950,7 +950,7 @@ static const struct resource_funcs dce100_res_pool_funcs = {
.find_first_free_match_stream_enc_for_link = dce100_find_first_free_match_stream_enc_for_link .find_first_free_match_stream_enc_for_link = dce100_find_first_free_match_stream_enc_for_link
}; };
static bool construct( static bool dce100_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dce110_resource_pool *pool) struct dce110_resource_pool *pool)
...@@ -1122,7 +1122,7 @@ static bool construct( ...@@ -1122,7 +1122,7 @@ static bool construct(
return true; return true;
res_create_fail: res_create_fail:
destruct(pool); dce100_resource_destruct(pool);
return false; return false;
} }
...@@ -1137,7 +1137,7 @@ struct resource_pool *dce100_create_resource_pool( ...@@ -1137,7 +1137,7 @@ struct resource_pool *dce100_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(num_virtual_links, dc, pool)) if (dce100_resource_construct(num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
kfree(pool); kfree(pool);
......
...@@ -782,7 +782,7 @@ void dce110_clock_source_destroy(struct clock_source **clk_src) ...@@ -782,7 +782,7 @@ void dce110_clock_source_destroy(struct clock_source **clk_src)
*clk_src = NULL; *clk_src = NULL;
} }
static void destruct(struct dce110_resource_pool *pool) static void dce110_resource_destruct(struct dce110_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -1161,7 +1161,7 @@ static void dce110_destroy_resource_pool(struct resource_pool **pool) ...@@ -1161,7 +1161,7 @@ static void dce110_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool); struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool);
destruct(dce110_pool); dce110_resource_destruct(dce110_pool);
kfree(dce110_pool); kfree(dce110_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -1313,7 +1313,7 @@ const struct resource_caps *dce110_resource_cap( ...@@ -1313,7 +1313,7 @@ const struct resource_caps *dce110_resource_cap(
return &carrizo_resource_cap; return &carrizo_resource_cap;
} }
static bool construct( static bool dce110_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dce110_resource_pool *pool, struct dce110_resource_pool *pool,
...@@ -1492,7 +1492,7 @@ static bool construct( ...@@ -1492,7 +1492,7 @@ static bool construct(
return true; return true;
res_create_fail: res_create_fail:
destruct(pool); dce110_resource_destruct(pool);
return false; return false;
} }
...@@ -1507,7 +1507,7 @@ struct resource_pool *dce110_create_resource_pool( ...@@ -1507,7 +1507,7 @@ struct resource_pool *dce110_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(num_virtual_links, dc, pool, asic_id)) if (dce110_resource_construct(num_virtual_links, dc, pool, asic_id))
return &pool->base; return &pool->base;
kfree(pool); kfree(pool);
......
...@@ -744,7 +744,7 @@ void dce112_clock_source_destroy(struct clock_source **clk_src) ...@@ -744,7 +744,7 @@ void dce112_clock_source_destroy(struct clock_source **clk_src)
*clk_src = NULL; *clk_src = NULL;
} }
static void destruct(struct dce110_resource_pool *pool) static void dce112_resource_destruct(struct dce110_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -1013,7 +1013,7 @@ static void dce112_destroy_resource_pool(struct resource_pool **pool) ...@@ -1013,7 +1013,7 @@ static void dce112_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool); struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool);
destruct(dce110_pool); dce112_resource_destruct(dce110_pool);
kfree(dce110_pool); kfree(dce110_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -1186,7 +1186,7 @@ const struct resource_caps *dce112_resource_cap( ...@@ -1186,7 +1186,7 @@ const struct resource_caps *dce112_resource_cap(
return &polaris_10_resource_cap; return &polaris_10_resource_cap;
} }
static bool construct( static bool dce112_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dce110_resource_pool *pool) struct dce110_resource_pool *pool)
...@@ -1372,7 +1372,7 @@ static bool construct( ...@@ -1372,7 +1372,7 @@ static bool construct(
return true; return true;
res_create_fail: res_create_fail:
destruct(pool); dce112_resource_destruct(pool);
return false; return false;
} }
...@@ -1386,7 +1386,7 @@ struct resource_pool *dce112_create_resource_pool( ...@@ -1386,7 +1386,7 @@ struct resource_pool *dce112_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(num_virtual_links, dc, pool)) if (dce112_resource_construct(num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
kfree(pool); kfree(pool);
......
...@@ -587,7 +587,7 @@ static void dce120_transform_destroy(struct transform **xfm) ...@@ -587,7 +587,7 @@ static void dce120_transform_destroy(struct transform **xfm)
*xfm = NULL; *xfm = NULL;
} }
static void destruct(struct dce110_resource_pool *pool) static void dce120_resource_destruct(struct dce110_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -872,7 +872,7 @@ static void dce120_destroy_resource_pool(struct resource_pool **pool) ...@@ -872,7 +872,7 @@ static void dce120_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool); struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool);
destruct(dce110_pool); dce120_resource_destruct(dce110_pool);
kfree(dce110_pool); kfree(dce110_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -1024,7 +1024,7 @@ static uint32_t read_pipe_fuses(struct dc_context *ctx) ...@@ -1024,7 +1024,7 @@ static uint32_t read_pipe_fuses(struct dc_context *ctx)
return value; return value;
} }
static bool construct( static bool dce120_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dce110_resource_pool *pool) struct dce110_resource_pool *pool)
...@@ -1237,7 +1237,7 @@ static bool construct( ...@@ -1237,7 +1237,7 @@ static bool construct(
clk_src_create_fail: clk_src_create_fail:
res_create_fail: res_create_fail:
destruct(pool); dce120_resource_destruct(pool);
return false; return false;
} }
...@@ -1252,7 +1252,7 @@ struct resource_pool *dce120_create_resource_pool( ...@@ -1252,7 +1252,7 @@ struct resource_pool *dce120_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(num_virtual_links, dc, pool)) if (dce120_resource_construct(num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
kfree(pool); kfree(pool);
......
...@@ -773,7 +773,7 @@ static struct input_pixel_processor *dce80_ipp_create( ...@@ -773,7 +773,7 @@ static struct input_pixel_processor *dce80_ipp_create(
return &ipp->base; return &ipp->base;
} }
static void destruct(struct dce110_resource_pool *pool) static void dce80_resource_destruct(struct dce110_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -901,7 +901,7 @@ static void dce80_destroy_resource_pool(struct resource_pool **pool) ...@@ -901,7 +901,7 @@ static void dce80_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool); struct dce110_resource_pool *dce110_pool = TO_DCE110_RES_POOL(*pool);
destruct(dce110_pool); dce80_resource_destruct(dce110_pool);
kfree(dce110_pool); kfree(dce110_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -1093,7 +1093,7 @@ static bool dce80_construct( ...@@ -1093,7 +1093,7 @@ static bool dce80_construct(
return true; return true;
res_create_fail: res_create_fail:
destruct(pool); dce80_resource_destruct(pool);
return false; return false;
} }
...@@ -1290,7 +1290,7 @@ static bool dce81_construct( ...@@ -1290,7 +1290,7 @@ static bool dce81_construct(
return true; return true;
res_create_fail: res_create_fail:
destruct(pool); dce80_resource_destruct(pool);
return false; return false;
} }
...@@ -1483,7 +1483,7 @@ static bool dce83_construct( ...@@ -1483,7 +1483,7 @@ static bool dce83_construct(
return true; return true;
res_create_fail: res_create_fail:
destruct(pool); dce80_resource_destruct(pool);
return false; return false;
} }
......
...@@ -919,7 +919,7 @@ static struct pp_smu_funcs *dcn10_pp_smu_create(struct dc_context *ctx) ...@@ -919,7 +919,7 @@ static struct pp_smu_funcs *dcn10_pp_smu_create(struct dc_context *ctx)
return pp_smu; return pp_smu;
} }
static void destruct(struct dcn10_resource_pool *pool) static void dcn10_resource_destruct(struct dcn10_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -1166,7 +1166,7 @@ static void dcn10_destroy_resource_pool(struct resource_pool **pool) ...@@ -1166,7 +1166,7 @@ static void dcn10_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dcn10_resource_pool *dcn10_pool = TO_DCN10_RES_POOL(*pool); struct dcn10_resource_pool *dcn10_pool = TO_DCN10_RES_POOL(*pool);
destruct(dcn10_pool); dcn10_resource_destruct(dcn10_pool);
kfree(dcn10_pool); kfree(dcn10_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -1305,7 +1305,7 @@ static uint32_t read_pipe_fuses(struct dc_context *ctx) ...@@ -1305,7 +1305,7 @@ static uint32_t read_pipe_fuses(struct dc_context *ctx)
return value; return value;
} }
static bool construct( static bool dcn10_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dcn10_resource_pool *pool) struct dcn10_resource_pool *pool)
...@@ -1592,7 +1592,7 @@ static bool construct( ...@@ -1592,7 +1592,7 @@ static bool construct(
fail: fail:
destruct(pool); dcn10_resource_destruct(pool);
return false; return false;
} }
...@@ -1607,7 +1607,7 @@ struct resource_pool *dcn10_create_resource_pool( ...@@ -1607,7 +1607,7 @@ struct resource_pool *dcn10_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(init_data->num_virtual_links, dc, pool)) if (dcn10_resource_construct(init_data->num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
kfree(pool); kfree(pool);
......
...@@ -1226,7 +1226,7 @@ void dcn20_dsc_destroy(struct display_stream_compressor **dsc) ...@@ -1226,7 +1226,7 @@ void dcn20_dsc_destroy(struct display_stream_compressor **dsc)
} }
static void destruct(struct dcn20_resource_pool *pool) static void dcn20_resource_destruct(struct dcn20_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -2886,7 +2886,7 @@ static void dcn20_destroy_resource_pool(struct resource_pool **pool) ...@@ -2886,7 +2886,7 @@ static void dcn20_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dcn20_resource_pool *dcn20_pool = TO_DCN20_RES_POOL(*pool); struct dcn20_resource_pool *dcn20_pool = TO_DCN20_RES_POOL(*pool);
destruct(dcn20_pool); dcn20_resource_destruct(dcn20_pool);
kfree(dcn20_pool); kfree(dcn20_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -3342,7 +3342,7 @@ static bool init_soc_bounding_box(struct dc *dc, ...@@ -3342,7 +3342,7 @@ static bool init_soc_bounding_box(struct dc *dc,
return true; return true;
} }
static bool construct( static bool dcn20_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dcn20_resource_pool *pool) struct dcn20_resource_pool *pool)
...@@ -3659,7 +3659,7 @@ static bool construct( ...@@ -3659,7 +3659,7 @@ static bool construct(
create_fail: create_fail:
destruct(pool); dcn20_resource_destruct(pool);
return false; return false;
} }
...@@ -3674,7 +3674,7 @@ struct resource_pool *dcn20_create_resource_pool( ...@@ -3674,7 +3674,7 @@ struct resource_pool *dcn20_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(init_data->num_virtual_links, dc, pool)) if (dcn20_resource_construct(init_data->num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
......
...@@ -844,7 +844,7 @@ enum dcn20_clk_src_array_id { ...@@ -844,7 +844,7 @@ enum dcn20_clk_src_array_id {
DCN20_CLK_SRC_TOTAL_DCN21 DCN20_CLK_SRC_TOTAL_DCN21
}; };
static void destruct(struct dcn21_resource_pool *pool) static void dcn21_resource_destruct(struct dcn21_resource_pool *pool)
{ {
unsigned int i; unsigned int i;
...@@ -1146,7 +1146,7 @@ static void dcn21_destroy_resource_pool(struct resource_pool **pool) ...@@ -1146,7 +1146,7 @@ static void dcn21_destroy_resource_pool(struct resource_pool **pool)
{ {
struct dcn21_resource_pool *dcn21_pool = TO_DCN21_RES_POOL(*pool); struct dcn21_resource_pool *dcn21_pool = TO_DCN21_RES_POOL(*pool);
destruct(dcn21_pool); dcn21_resource_destruct(dcn21_pool);
kfree(dcn21_pool); kfree(dcn21_pool);
*pool = NULL; *pool = NULL;
} }
...@@ -1624,7 +1624,7 @@ static struct resource_funcs dcn21_res_pool_funcs = { ...@@ -1624,7 +1624,7 @@ static struct resource_funcs dcn21_res_pool_funcs = {
.update_bw_bounding_box = update_bw_bounding_box .update_bw_bounding_box = update_bw_bounding_box
}; };
static bool construct( static bool dcn21_resource_construct(
uint8_t num_virtual_links, uint8_t num_virtual_links,
struct dc *dc, struct dc *dc,
struct dcn21_resource_pool *pool) struct dcn21_resource_pool *pool)
...@@ -1876,7 +1876,7 @@ static bool construct( ...@@ -1876,7 +1876,7 @@ static bool construct(
create_fail: create_fail:
destruct(pool); dcn21_resource_destruct(pool);
return false; return false;
} }
...@@ -1891,7 +1891,7 @@ struct resource_pool *dcn21_create_resource_pool( ...@@ -1891,7 +1891,7 @@ struct resource_pool *dcn21_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(init_data->num_virtual_links, dc, pool)) if (dcn21_resource_construct(init_data->num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
......
...@@ -48,18 +48,18 @@ ...@@ -48,18 +48,18 @@
struct gpio; struct gpio;
static void destruct( static void dal_hw_ddc_destruct(
struct hw_ddc *pin) struct hw_ddc *pin)
{ {
dal_hw_gpio_destruct(&pin->base); dal_hw_gpio_destruct(&pin->base);
} }
static void destroy( static void dal_hw_ddc_destroy(
struct hw_gpio_pin **ptr) struct hw_gpio_pin **ptr)
{ {
struct hw_ddc *pin = HW_DDC_FROM_BASE(*ptr); struct hw_ddc *pin = HW_DDC_FROM_BASE(*ptr);
destruct(pin); dal_hw_ddc_destruct(pin);
kfree(pin); kfree(pin);
...@@ -207,7 +207,7 @@ static enum gpio_result set_config( ...@@ -207,7 +207,7 @@ static enum gpio_result set_config(
} }
static const struct hw_gpio_pin_funcs funcs = { static const struct hw_gpio_pin_funcs funcs = {
.destroy = destroy, .destroy = dal_hw_ddc_destroy,
.open = dal_hw_gpio_open, .open = dal_hw_gpio_open,
.get_value = dal_hw_gpio_get_value, .get_value = dal_hw_gpio_get_value,
.set_value = dal_hw_gpio_set_value, .set_value = dal_hw_gpio_set_value,
...@@ -216,7 +216,7 @@ static const struct hw_gpio_pin_funcs funcs = { ...@@ -216,7 +216,7 @@ static const struct hw_gpio_pin_funcs funcs = {
.close = dal_hw_gpio_close, .close = dal_hw_gpio_close,
}; };
static void construct( static void dal_hw_ddc_construct(
struct hw_ddc *ddc, struct hw_ddc *ddc,
enum gpio_id id, enum gpio_id id,
uint32_t en, uint32_t en,
...@@ -243,7 +243,7 @@ void dal_hw_ddc_init( ...@@ -243,7 +243,7 @@ void dal_hw_ddc_init(
return; return;
} }
construct(*hw_ddc, id, en, ctx); dal_hw_ddc_construct(*hw_ddc, id, en, ctx);
} }
struct hw_gpio_pin *dal_hw_ddc_get_pin(struct gpio *gpio) struct hw_gpio_pin *dal_hw_ddc_get_pin(struct gpio *gpio)
......
...@@ -46,22 +46,13 @@ ...@@ -46,22 +46,13 @@
struct gpio; struct gpio;
static void dal_hw_generic_construct(
struct hw_generic *pin,
enum gpio_id id,
uint32_t en,
struct dc_context *ctx)
{
dal_hw_gpio_construct(&pin->base, id, en, ctx);
}
static void dal_hw_generic_destruct( static void dal_hw_generic_destruct(
struct hw_generic *pin) struct hw_generic *pin)
{ {
dal_hw_gpio_destruct(&pin->base); dal_hw_gpio_destruct(&pin->base);
} }
static void destroy( static void dal_hw_generic_destroy(
struct hw_gpio_pin **ptr) struct hw_gpio_pin **ptr)
{ {
struct hw_generic *generic = HW_GENERIC_FROM_BASE(*ptr); struct hw_generic *generic = HW_GENERIC_FROM_BASE(*ptr);
...@@ -90,7 +81,7 @@ static enum gpio_result set_config( ...@@ -90,7 +81,7 @@ static enum gpio_result set_config(
} }
static const struct hw_gpio_pin_funcs funcs = { static const struct hw_gpio_pin_funcs funcs = {
.destroy = destroy, .destroy = dal_hw_generic_destroy,
.open = dal_hw_gpio_open, .open = dal_hw_gpio_open,
.get_value = dal_hw_gpio_get_value, .get_value = dal_hw_gpio_get_value,
.set_value = dal_hw_gpio_set_value, .set_value = dal_hw_gpio_set_value,
...@@ -99,14 +90,14 @@ static const struct hw_gpio_pin_funcs funcs = { ...@@ -99,14 +90,14 @@ static const struct hw_gpio_pin_funcs funcs = {
.close = dal_hw_gpio_close, .close = dal_hw_gpio_close,
}; };
static void construct( static void dal_hw_generic_construct(
struct hw_generic *generic, struct hw_generic *pin,
enum gpio_id id, enum gpio_id id,
uint32_t en, uint32_t en,
struct dc_context *ctx) struct dc_context *ctx)
{ {
dal_hw_generic_construct(generic, id, en, ctx); dal_hw_gpio_construct(&pin->base, id, en, ctx);
generic->base.base.funcs = &funcs; pin->base.base.funcs = &funcs;
} }
void dal_hw_generic_init( void dal_hw_generic_init(
...@@ -126,7 +117,7 @@ void dal_hw_generic_init( ...@@ -126,7 +117,7 @@ void dal_hw_generic_init(
return; return;
} }
construct(*hw_generic, id, en, ctx); dal_hw_generic_construct(*hw_generic, id, en, ctx);
} }
......
...@@ -46,34 +46,18 @@ ...@@ -46,34 +46,18 @@
struct gpio; struct gpio;
static void dal_hw_hpd_construct(
struct hw_hpd *pin,
enum gpio_id id,
uint32_t en,
struct dc_context *ctx)
{
dal_hw_gpio_construct(&pin->base, id, en, ctx);
}
static void dal_hw_hpd_destruct( static void dal_hw_hpd_destruct(
struct hw_hpd *pin) struct hw_hpd *pin)
{ {
dal_hw_gpio_destruct(&pin->base); dal_hw_gpio_destruct(&pin->base);
} }
static void dal_hw_hpd_destroy(
static void destruct(
struct hw_hpd *hpd)
{
dal_hw_hpd_destruct(hpd);
}
static void destroy(
struct hw_gpio_pin **ptr) struct hw_gpio_pin **ptr)
{ {
struct hw_hpd *hpd = HW_HPD_FROM_BASE(*ptr); struct hw_hpd *hpd = HW_HPD_FROM_BASE(*ptr);
destruct(hpd); dal_hw_hpd_destruct(hpd);
kfree(hpd); kfree(hpd);
...@@ -120,7 +104,7 @@ static enum gpio_result set_config( ...@@ -120,7 +104,7 @@ static enum gpio_result set_config(
} }
static const struct hw_gpio_pin_funcs funcs = { static const struct hw_gpio_pin_funcs funcs = {
.destroy = destroy, .destroy = dal_hw_hpd_destroy,
.open = dal_hw_gpio_open, .open = dal_hw_gpio_open,
.get_value = get_value, .get_value = get_value,
.set_value = dal_hw_gpio_set_value, .set_value = dal_hw_gpio_set_value,
...@@ -129,14 +113,14 @@ static const struct hw_gpio_pin_funcs funcs = { ...@@ -129,14 +113,14 @@ static const struct hw_gpio_pin_funcs funcs = {
.close = dal_hw_gpio_close, .close = dal_hw_gpio_close,
}; };
static void construct( static void dal_hw_hpd_construct(
struct hw_hpd *hpd, struct hw_hpd *pin,
enum gpio_id id, enum gpio_id id,
uint32_t en, uint32_t en,
struct dc_context *ctx) struct dc_context *ctx)
{ {
dal_hw_hpd_construct(hpd, id, en, ctx); dal_hw_gpio_construct(&pin->base, id, en, ctx);
hpd->base.base.funcs = &funcs; pin->base.base.funcs = &funcs;
} }
void dal_hw_hpd_init( void dal_hw_hpd_init(
...@@ -156,7 +140,7 @@ void dal_hw_hpd_init( ...@@ -156,7 +140,7 @@ void dal_hw_hpd_init(
return; return;
} }
construct(*hw_hpd, id, en, ctx); dal_hw_hpd_construct(*hw_hpd, id, en, ctx);
} }
struct hw_gpio_pin *dal_hw_hpd_get_pin(struct gpio *gpio) struct hw_gpio_pin *dal_hw_hpd_get_pin(struct gpio *gpio)
......
...@@ -403,7 +403,7 @@ static const struct irq_service_funcs irq_service_funcs_dce110 = { ...@@ -403,7 +403,7 @@ static const struct irq_service_funcs irq_service_funcs_dce110 = {
.to_dal_irq_source = to_dal_irq_source_dce110 .to_dal_irq_source = to_dal_irq_source_dce110
}; };
static void construct(struct irq_service *irq_service, static void dce110_irq_construct(struct irq_service *irq_service,
struct irq_service_init_data *init_data) struct irq_service_init_data *init_data)
{ {
dal_irq_service_construct(irq_service, init_data); dal_irq_service_construct(irq_service, init_data);
...@@ -421,6 +421,6 @@ dal_irq_service_dce110_create(struct irq_service_init_data *init_data) ...@@ -421,6 +421,6 @@ dal_irq_service_dce110_create(struct irq_service_init_data *init_data)
if (!irq_service) if (!irq_service)
return NULL; return NULL;
construct(irq_service, init_data); dce110_irq_construct(irq_service, init_data);
return irq_service; return irq_service;
} }
...@@ -273,7 +273,7 @@ static const struct irq_service_funcs irq_service_funcs_dce120 = { ...@@ -273,7 +273,7 @@ static const struct irq_service_funcs irq_service_funcs_dce120 = {
.to_dal_irq_source = to_dal_irq_source_dce110 .to_dal_irq_source = to_dal_irq_source_dce110
}; };
static void construct( static void dce120_irq_construct(
struct irq_service *irq_service, struct irq_service *irq_service,
struct irq_service_init_data *init_data) struct irq_service_init_data *init_data)
{ {
...@@ -292,6 +292,6 @@ struct irq_service *dal_irq_service_dce120_create( ...@@ -292,6 +292,6 @@ struct irq_service *dal_irq_service_dce120_create(
if (!irq_service) if (!irq_service)
return NULL; return NULL;
construct(irq_service, init_data); dce120_irq_construct(irq_service, init_data);
return irq_service; return irq_service;
} }
...@@ -283,7 +283,7 @@ static const struct irq_service_funcs irq_service_funcs_dce80 = { ...@@ -283,7 +283,7 @@ static const struct irq_service_funcs irq_service_funcs_dce80 = {
.to_dal_irq_source = to_dal_irq_source_dce110 .to_dal_irq_source = to_dal_irq_source_dce110
}; };
static void construct( static void dce80_irq_construct(
struct irq_service *irq_service, struct irq_service *irq_service,
struct irq_service_init_data *init_data) struct irq_service_init_data *init_data)
{ {
...@@ -302,7 +302,7 @@ struct irq_service *dal_irq_service_dce80_create( ...@@ -302,7 +302,7 @@ struct irq_service *dal_irq_service_dce80_create(
if (!irq_service) if (!irq_service)
return NULL; return NULL;
construct(irq_service, init_data); dce80_irq_construct(irq_service, init_data);
return irq_service; return irq_service;
} }
......
...@@ -355,7 +355,7 @@ static const struct irq_service_funcs irq_service_funcs_dcn10 = { ...@@ -355,7 +355,7 @@ static const struct irq_service_funcs irq_service_funcs_dcn10 = {
.to_dal_irq_source = to_dal_irq_source_dcn10 .to_dal_irq_source = to_dal_irq_source_dcn10
}; };
static void construct( static void dcn10_irq_construct(
struct irq_service *irq_service, struct irq_service *irq_service,
struct irq_service_init_data *init_data) struct irq_service_init_data *init_data)
{ {
...@@ -374,6 +374,6 @@ struct irq_service *dal_irq_service_dcn10_create( ...@@ -374,6 +374,6 @@ struct irq_service *dal_irq_service_dcn10_create(
if (!irq_service) if (!irq_service)
return NULL; return NULL;
construct(irq_service, init_data); dcn10_irq_construct(irq_service, init_data);
return irq_service; return irq_service;
} }
...@@ -359,7 +359,7 @@ static const struct irq_service_funcs irq_service_funcs_dcn20 = { ...@@ -359,7 +359,7 @@ static const struct irq_service_funcs irq_service_funcs_dcn20 = {
.to_dal_irq_source = to_dal_irq_source_dcn20 .to_dal_irq_source = to_dal_irq_source_dcn20
}; };
static void construct( static void dcn20_irq_construct(
struct irq_service *irq_service, struct irq_service *irq_service,
struct irq_service_init_data *init_data) struct irq_service_init_data *init_data)
{ {
...@@ -378,6 +378,6 @@ struct irq_service *dal_irq_service_dcn20_create( ...@@ -378,6 +378,6 @@ struct irq_service *dal_irq_service_dcn20_create(
if (!irq_service) if (!irq_service)
return NULL; return NULL;
construct(irq_service, init_data); dcn20_irq_construct(irq_service, init_data);
return irq_service; return irq_service;
} }
...@@ -350,7 +350,7 @@ static const struct irq_service_funcs irq_service_funcs_dcn21 = { ...@@ -350,7 +350,7 @@ static const struct irq_service_funcs irq_service_funcs_dcn21 = {
.to_dal_irq_source = to_dal_irq_source_dcn21 .to_dal_irq_source = to_dal_irq_source_dcn21
}; };
static void construct( static void dcn21_irq_construct(
struct irq_service *irq_service, struct irq_service *irq_service,
struct irq_service_init_data *init_data) struct irq_service_init_data *init_data)
{ {
...@@ -369,6 +369,6 @@ struct irq_service *dal_irq_service_dcn21_create( ...@@ -369,6 +369,6 @@ struct irq_service *dal_irq_service_dcn21_create(
if (!irq_service) if (!irq_service)
return NULL; return NULL;
construct(irq_service, init_data); dcn21_irq_construct(irq_service, init_data);
return irq_service; return irq_service;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment