Commit 1877ccf6 authored by David Francis's avatar David Francis Committed by Alex Deucher

drm/amd/display: Change from aux_engine to dce_aux

[Why]
The aux_engine struct is needlessly complex and
is defined multiple times.  It contains function pointers
that each have only one version and are called only from
inside dce_aux.

[How]
Replace aux_engine with a new struct called dce_aux.
Remove all function pointers and call functions directly.
Remove unused functions
Signed-off-by: default avatarDavid Francis <David.Francis@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent eae5ffa9
......@@ -75,8 +75,20 @@ enum { /* This is the timeout as defined in DP 1.2a,
*/
SW_AUX_TIMEOUT_PERIOD_MULTIPLIER = 4
};
struct dce_aux {
uint32_t inst;
struct ddc *ddc;
struct dc_context *ctx;
/* following values are expressed in milliseconds */
uint32_t delay;
uint32_t max_defer_write_retry;
bool acquire_reset;
};
struct aux_engine_dce110 {
struct aux_engine base;
struct dce_aux base;
const struct dce110_aux_registers *regs;
struct {
uint32_t aux_control;
......@@ -96,17 +108,17 @@ struct aux_engine_dce110_init_data {
const struct dce110_aux_registers *regs;
};
struct aux_engine *dce110_aux_engine_construct(
struct dce_aux *dce110_aux_engine_construct(
struct aux_engine_dce110 *aux_engine110,
struct dc_context *ctx,
uint32_t inst,
uint32_t timeout_period,
const struct dce110_aux_registers *regs);
void dce110_engine_destroy(struct aux_engine **engine);
void dce110_engine_destroy(struct dce_aux **engine);
bool dce110_aux_engine_acquire(
struct aux_engine *aux_engine,
struct dce_aux *aux_engine,
struct ddc *ddc);
int dce_aux_transfer(struct ddc_service *ddc,
......
......@@ -587,7 +587,7 @@ struct output_pixel_processor *dce100_opp_create(
return &opp->base;
}
struct aux_engine *dce100_aux_engine_create(
struct dce_aux *dce100_aux_engine_create(
struct dc_context *ctx,
uint32_t inst)
{
......
......@@ -606,7 +606,7 @@ static struct output_pixel_processor *dce110_opp_create(
return &opp->base;
}
struct aux_engine *dce110_aux_engine_create(
struct dce_aux *dce110_aux_engine_create(
struct dc_context *ctx,
uint32_t inst)
{
......
......@@ -607,7 +607,7 @@ struct output_pixel_processor *dce112_opp_create(
return &opp->base;
}
struct aux_engine *dce112_aux_engine_create(
struct dce_aux *dce112_aux_engine_create(
struct dc_context *ctx,
uint32_t inst)
{
......
......@@ -391,7 +391,7 @@ struct output_pixel_processor *dce120_opp_create(
ctx, inst, &opp_regs[inst], &opp_shift, &opp_mask);
return &opp->base;
}
struct aux_engine *dce120_aux_engine_create(
struct dce_aux *dce120_aux_engine_create(
struct dc_context *ctx,
uint32_t inst)
{
......
......@@ -467,7 +467,7 @@ static struct output_pixel_processor *dce80_opp_create(
return &opp->base;
}
struct aux_engine *dce80_aux_engine_create(
struct dce_aux *dce80_aux_engine_create(
struct dc_context *ctx,
uint32_t inst)
{
......
......@@ -609,7 +609,7 @@ static struct output_pixel_processor *dcn10_opp_create(
return &opp->base;
}
struct aux_engine *dcn10_aux_engine_create(
struct dce_aux *dcn10_aux_engine_create(
struct dc_context *ctx,
uint32_t inst)
{
......@@ -911,7 +911,7 @@ static void destruct(struct dcn10_resource_pool *pool)
for (i = 0; i < pool->base.res_cap->num_ddc; i++) {
if (pool->base.engines[i] != NULL)
pool->base.engines[i]->funcs->destroy_engine(&pool->base.engines[i]);
dce110_engine_destroy(&pool->base.engines[i]);
if (pool->base.hw_i2cs[i] != NULL) {
kfree(pool->base.hw_i2cs[i]);
pool->base.hw_i2cs[i] = NULL;
......
......@@ -146,7 +146,7 @@ struct resource_pool {
struct mpc *mpc;
struct pp_smu_funcs_rv *pp_smu;
struct pp_smu_display_requirement_rv pp_smu_req;
struct aux_engine *engines[MAX_PIPES];
struct dce_aux *engines[MAX_PIPES];
struct dce_i2c_hw *hw_i2cs[MAX_PIPES];
struct dce_i2c_sw *sw_i2cs[MAX_PIPES];
bool i2c_hw_buffer_in_use;
......
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