diff options
author | Harry Wentland <harry.wentland@amd.com> | 2017-07-24 13:55:26 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:15:36 -0400 |
commit | 89899039356a645c1cebe5a454d3577aa1f42bf2 (patch) | |
tree | a399022da122d6480137b73ead8b9bdc118d84dc | |
parent | d0778ebfd58f5650de17531296ee5ecdde39ba68 (diff) | |
download | linux-stable-89899039356a645c1cebe5a454d3577aa1f42bf2.tar.gz linux-stable-89899039356a645c1cebe5a454d3577aa1f42bf2.tar.bz2 linux-stable-89899039356a645c1cebe5a454d3577aa1f42bf2.zip |
drm/amd/display: Roll sink struct into core_sink
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 43 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/core_types.h | 3 |
2 files changed, 18 insertions, 28 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c index 7f0ba7267682..1f7985ad5dba 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c @@ -28,30 +28,18 @@ #include "core_types.h" /******************************************************************************* - * Private definitions - ******************************************************************************/ - -struct sink { - struct core_sink protected; - int ref_count; -}; - -#define DC_SINK_TO_SINK(dc_sink) \ - container_of(dc_sink, struct sink, protected.public) - -/******************************************************************************* * Private functions ******************************************************************************/ -static void destruct(struct sink *sink) +static void destruct(struct core_sink *sink) { - if (sink->protected.public.dc_container_id) { - dm_free(sink->protected.public.dc_container_id); - sink->protected.public.dc_container_id = NULL; + if (sink->public.dc_container_id) { + dm_free(sink->public.dc_container_id); + sink->public.dc_container_id = NULL; } } -static bool construct(struct sink *sink, const struct dc_sink_init_data *init_params) +static bool construct(struct core_sink *sink, const struct dc_sink_init_data *init_params) { struct dc_link *link = init_params->link; @@ -59,13 +47,12 @@ static bool construct(struct sink *sink, const struct dc_sink_init_data *init_pa if (!link) return false; - sink->protected.public.sink_signal = init_params->sink_signal; - sink->protected.link = link; - sink->protected.ctx = link->ctx; - sink->protected.public.dongle_max_pix_clk = init_params->dongle_max_pix_clk; - sink->protected.public.converter_disable_audio = - init_params->converter_disable_audio; - sink->protected.public.dc_container_id = NULL; + sink->public.sink_signal = init_params->sink_signal; + sink->link = link; + sink->ctx = link->ctx; + sink->public.dongle_max_pix_clk = init_params->dongle_max_pix_clk; + sink->public.converter_disable_audio = init_params->converter_disable_audio; + sink->public.dc_container_id = NULL; return true; } @@ -76,7 +63,7 @@ static bool construct(struct sink *sink, const struct dc_sink_init_data *init_pa void dc_sink_retain(const struct dc_sink *dc_sink) { - struct sink *sink = DC_SINK_TO_SINK(dc_sink); + struct core_sink *sink = DC_SINK_TO_CORE(dc_sink); ASSERT(sink->ref_count > 0); ++sink->ref_count; @@ -84,7 +71,7 @@ void dc_sink_retain(const struct dc_sink *dc_sink) void dc_sink_release(const struct dc_sink *dc_sink) { - struct sink *sink = DC_SINK_TO_SINK(dc_sink); + struct core_sink *sink = DC_SINK_TO_CORE(dc_sink); ASSERT(sink->ref_count > 0); --sink->ref_count; @@ -97,7 +84,7 @@ void dc_sink_release(const struct dc_sink *dc_sink) struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params) { - struct sink *sink = dm_alloc(sizeof(*sink)); + struct core_sink *sink = dm_alloc(sizeof(*sink)); if (NULL == sink) goto alloc_fail; @@ -107,7 +94,7 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params) ++sink->ref_count; - return &sink->protected.public; + return &sink->public; construct_fail: dm_free(sink); diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h index 6cdfeeba0faf..eed31a827a90 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h +++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h @@ -94,6 +94,9 @@ struct core_sink { /* not used for now */ struct dc_link *link; struct dc_context *ctx; + + /* private to dc_sink.c */ + int ref_count; }; /************ link *****************/ |