diff options
author | Tony Cheng <tony.cheng@amd.com> | 2017-04-22 14:17:51 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:06:41 -0400 |
commit | a2b8659db9b435853cb0dc78d225a492e7ee69d0 (patch) | |
tree | 90cbccc70e1be2712f2c2cf75a31f85ee236e45f /drivers/gpu/drm/amd/display/dc/inc/resource.h | |
parent | 72ada5f76939ed00c07c584be7691a29d3c2c3da (diff) |
drm/amd/display: decouple resource_pool from resource_context
to avoid null access in case res_ctx is used to access res_pool before it's fully constructed
also make it clear which function has dependency on resource_pool
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/inc/resource.h')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/resource.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/inc/resource.h b/drivers/gpu/drm/amd/display/dc/inc/resource.h index b1987cab9751..89d34bed131b 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/resource.h +++ b/drivers/gpu/drm/amd/display/dc/inc/resource.h | |||
@@ -92,10 +92,12 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx); | |||
92 | 92 | ||
93 | void resource_unreference_clock_source( | 93 | void resource_unreference_clock_source( |
94 | struct resource_context *res_ctx, | 94 | struct resource_context *res_ctx, |
95 | const struct resource_pool *pool, | ||
95 | struct clock_source **clock_source); | 96 | struct clock_source **clock_source); |
96 | 97 | ||
97 | void resource_reference_clock_source( | 98 | void resource_reference_clock_source( |
98 | struct resource_context *res_ctx, | 99 | struct resource_context *res_ctx, |
100 | const struct resource_pool *pool, | ||
99 | struct clock_source *clock_source); | 101 | struct clock_source *clock_source); |
100 | 102 | ||
101 | bool resource_are_streams_timing_synchronizable( | 103 | bool resource_are_streams_timing_synchronizable( |
@@ -107,7 +109,8 @@ struct clock_source *resource_find_used_clk_src_for_sharing( | |||
107 | struct pipe_ctx *pipe_ctx); | 109 | struct pipe_ctx *pipe_ctx); |
108 | 110 | ||
109 | struct clock_source *dc_resource_find_first_free_pll( | 111 | struct clock_source *dc_resource_find_first_free_pll( |
110 | struct resource_context *res_ctx); | 112 | struct resource_context *res_ctx, |
113 | const struct resource_pool *pool); | ||
111 | 114 | ||
112 | struct pipe_ctx *resource_get_head_pipe_for_stream( | 115 | struct pipe_ctx *resource_get_head_pipe_for_stream( |
113 | struct resource_context *res_ctx, | 116 | struct resource_context *res_ctx, |
@@ -117,9 +120,12 @@ bool resource_attach_surfaces_to_context( | |||
117 | const struct dc_surface *const *surfaces, | 120 | const struct dc_surface *const *surfaces, |
118 | int surface_count, | 121 | int surface_count, |
119 | const struct dc_stream *dc_stream, | 122 | const struct dc_stream *dc_stream, |
120 | struct validate_context *context); | 123 | struct validate_context *context, |
124 | const struct resource_pool *pool); | ||
121 | 125 | ||
122 | struct pipe_ctx *find_idle_secondary_pipe(struct resource_context *res_ctx); | 126 | struct pipe_ctx *find_idle_secondary_pipe( |
127 | struct resource_context *res_ctx, | ||
128 | const struct resource_pool *pool); | ||
123 | 129 | ||
124 | bool resource_is_stream_unchanged( | 130 | bool resource_is_stream_unchanged( |
125 | const struct validate_context *old_context, const struct core_stream *stream); | 131 | const struct validate_context *old_context, const struct core_stream *stream); |
@@ -131,7 +137,8 @@ bool resource_validate_attach_surfaces( | |||
131 | const struct dc_validation_set set[], | 137 | const struct dc_validation_set set[], |
132 | int set_count, | 138 | int set_count, |
133 | const struct validate_context *old_context, | 139 | const struct validate_context *old_context, |
134 | struct validate_context *context); | 140 | struct validate_context *context, |
141 | const struct resource_pool *pool); | ||
135 | 142 | ||
136 | void validate_guaranteed_copy_streams( | 143 | void validate_guaranteed_copy_streams( |
137 | struct validate_context *context, | 144 | struct validate_context *context, |