Commit 89c4f84b authored by Eryk Brol's avatar Eryk Brol Committed by Alex Deucher

drm/amd/display: Restructure DCN10 hubbub

[Why]
Change DCN10 hubbub to use hubbub as a base and allow all future DCN
hubbubs to do the same instead of using DCN10_hubbub. This increases
readability and doesn't require future hubbubs to inherit anything
other than the base hubbub struct.

[How]
Create separate DCN10_hubbub struct which uses the hubbub struct as
a base.
Signed-off-by: default avatarEryk Brol <eryk.brol@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c69dffab
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#include "core_types.h" #include "core_types.h"
#include "dchubbub.h" #include "dchubbub.h"
#define TO_DCN10_HUBBUB(hubbub)\
container_of(hubbub, struct dcn10_hubbub, base)
#define HUBHUB_REG_LIST_DCN()\ #define HUBHUB_REG_LIST_DCN()\
SR(DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A),\ SR(DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A),\
SR(DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_A),\ SR(DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_A),\
...@@ -165,10 +168,8 @@ struct dcn_hubbub_mask { ...@@ -165,10 +168,8 @@ struct dcn_hubbub_mask {
struct dc; struct dc;
struct dcn10_hubbub {
struct hubbub { struct hubbub base;
const struct hubbub_funcs *funcs;
struct dc_context *ctx;
const struct dcn_hubbub_registers *regs; const struct dcn_hubbub_registers *regs;
const struct dcn_hubbub_shift *shifts; const struct dcn_hubbub_shift *shifts;
const struct dcn_hubbub_mask *masks; const struct dcn_hubbub_mask *masks;
......
...@@ -678,18 +678,18 @@ static struct mpc *dcn10_mpc_create(struct dc_context *ctx) ...@@ -678,18 +678,18 @@ static struct mpc *dcn10_mpc_create(struct dc_context *ctx)
static struct hubbub *dcn10_hubbub_create(struct dc_context *ctx) static struct hubbub *dcn10_hubbub_create(struct dc_context *ctx)
{ {
struct hubbub *hubbub = kzalloc(sizeof(struct hubbub), struct dcn10_hubbub *dcn10_hubbub = kzalloc(sizeof(struct dcn10_hubbub),
GFP_KERNEL); GFP_KERNEL);
if (!hubbub) if (!dcn10_hubbub)
return NULL; return NULL;
hubbub1_construct(hubbub, ctx, hubbub1_construct(&dcn10_hubbub->base, ctx,
&hubbub_reg, &hubbub_reg,
&hubbub_shift, &hubbub_shift,
&hubbub_mask); &hubbub_mask);
return hubbub; return &dcn10_hubbub->base;
} }
static struct timing_generator *dcn10_timing_generator_create( static struct timing_generator *dcn10_timing_generator_create(
......
...@@ -75,5 +75,9 @@ struct hubbub_funcs { ...@@ -75,5 +75,9 @@ struct hubbub_funcs {
struct dcn_hubbub_wm *wm); struct dcn_hubbub_wm *wm);
}; };
struct hubbub {
const struct hubbub_funcs *funcs;
struct dc_context *ctx;
};
#endif #endif
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