drm/amd/display: implement dc_init_callbacks to assign callback pointers after dc_create
authorWenjing Liu <Wenjing.Liu@amd.com>
Tue, 13 Nov 2018 23:21:53 +0000 (18:21 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 14 Jan 2019 20:04:33 +0000 (15:04 -0500)
[why]
Some components depend on dc to constuct
but need to assign callback functions to dc.

[how]
Instead of assigning dc callback functions in dc_create,
decouple the callback init to a standlone function after dc_create. This
is currently a no-op.

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h

index 5fd52094d459efb3cbf97f12c068ff9d2d5d0b35..e12612be118dd458fd7154169adb7e08a4e2ef99 100644 (file)
@@ -840,6 +840,11 @@ alloc_fail:
        return NULL;
 }
 
+void dc_init_callbacks(struct dc *dc,
+               const struct dc_callback_init *init_params)
+{
+}
+
 void dc_destroy(struct dc **dc)
 {
        destruct(*dc);
index 9a1e8f6eb244efb4c46df41370e4837dc28f95db..580f752920d18f579ef5c0d981c35e344e73e9dc 100644 (file)
@@ -339,8 +339,13 @@ struct dc_init_data {
        uint32_t log_mask;
 };
 
-struct dc *dc_create(const struct dc_init_data *init_params);
+struct dc_callback_init {
+       uint8_t reserved;
+};
 
+struct dc *dc_create(const struct dc_init_data *init_params);
+void dc_init_callbacks(struct dc *dc,
+               const struct dc_callback_init *init_params);
 void dc_destroy(struct dc **dc);
 
 /*******************************************************************************